– Typee Introduction –
Typee is a new generic Object Oriented Programming language. It is currently under development, our aim being to implement a Proof of Concept (or PoC) on automated translation of an unambiguous and well formed programming language into at least another unambigous and well formed programming language. This leads to the concept of DOGM or DOGMa : Do Once Get Many.
The syntax of Typee is derived from other OOP languages such as C++, Java and Python.
It should be a very good support for computering science and programming classes, since it then open doors for the easy learning of Java, C++, C#, Python, etc.!
Typee language characteristics
We list here only the main characteristics of Typee.
- Object Oriented Programming;
- typed variables and objects;
- classical scalar types;
- Templated on functions, methods and operators (as with templates in C++ and generics in Java; but with bonuses on operators);
- auto typing in specific cases (as with auto in C++ and as is by default in Python);
- for and if comprehensions (as in Python);
- built-in containers for objects (as in Python: list, set, dict; but plus array);
- classical instructions plus bonuses (e.g. otherwise associated with for, while or switch statements);
- classical exception handling;
- classical operators plus a few bonuses (e.g. 0-shifting as built in Java);
- few undefined operators available for users specific definitions;
- unnamed functions (as in Java or Python lambdas);
- an embed instruction for the embedding of native code in Python, C++ or Java for instance;
- and few other goodies you will enjoy to use.
While navigating in Typee GitHub repository you will find numerous documentation on Typee grammar specification, the Typee translator software architecture or the whole software documentation (as generated in HTML by an open source application, PyYadc which stands for Python Yet another documentation compiler).
Finally, Typee source code is Open Source with very the permissive MIT license. Any modification, add or the like you would provide or develop by your own is allowed for free, as well as it is free of charge for commercial uses.
Typee: neither compiled nor interpreted but translated
Traditionnal OOP languages are either compiled (e.g. C++) or interpreted (e.g. Python). They even may be first compiled into an intermediate code which is then interpreted (e.g. Java and its Bytecode interpreted by a Java Virtual Machine that has to be implemented on each of the different targeted devices).
Typee is neither compiled nor interpreted. It is rather translated into other OOP languages, such as Python which chronologically is the first addressed OOP language from this list: Python, C++, C# and Java. During the translation, type infering and checking is done on the whole parts of the source code.
While this may seem to be valuable for untyped languages such as Python, it should appear to be not really useful for other typed languages, of course.
Yes, but wait…
Typee: one code for many implementations – the DOGM (or DOGMa) concept
Here is the core usefulness of Typee: once a program has been written in Typee, it can then easily be translated into any other available OOP language. At first, this will be a translator to Python. But as soon as other translators will be available, e.g. for C++ or Java, the same code will be available for translation in these languages also.
As long as related libraries are added to the package (for instance graphical ones or GPU parallel programming ones) and are programmed in Typee with dedicated code (i.e. native embedded code) for the targeted OOP language, it should be easy to program applications for Windows, Linux, iOS or Android for instance with a single code programmed in Typee.
This is the DOGM (or DOGMa) concept: Do Once Get Many.
Here we are!
Typee design
Typee has been designed as would have been any compiler. Our bedside book for a long has been “Engineering a Compiler, 2nd Edition” from Keith D.Cooper & Linda Torczon, Elsevier, 2012, and we encourage the reader to read it.
We have choosen this book because it was newer than the famous Dragoon book “Compilers, principles, techniques, & tools, 2nd ed.” from Alfred V. Aho, Monica S. Lam, Ravi Ethi and Jeffrey D. Ullman, Pearson-Addison Wesley, 2007 – while this Dragoon book had been used to specify the Python interpretor CPython.
Typee PoC is under development
Please be aware that this project is under construction and that currently NO running version is available. Documentation, directories tree on GitHub repository as well as this Web site content are highly subject to change, actually on a daily or at least on a weekly basis.
It might be that, finally, Typee language will be developed in… Typee. Imagine then that the translator would be available for any kind of Operating System and translated in the programming language of your choice to get the best performances on your device!