3 ms·
can you create your own programming language with python?
by notastartup 12y ago
can you create your own programming language with python?
- aye 12y agoSure! You could use a parser generator like Yapps [0] to write a parser for your own programming language. [0]: http://mbreen.com/yapps2.html http://mbreen.com/yapps2.html
- pjmlp 12y agoAny Turing complete language can be used for writing compilers/interpreters, it is just harder in some than other. Python is actually pretty neat for doing it and you even have tools like PyPy (with RPython) to write a JIT for the language if you wish.
- sklogic 12y agoYou don't even need a Turing-complete language for writing compilers, see CompCert for example.
- pjmlp 12y agoI need to dive into it. Do you mean it because of the formal logic being used?
- sklogic 12y agoThis is because compilation can be represented as a finite sequence of applying simple rewrite rules. You don't need a true Turing-complete language to do so, because you don't have any indeterminate loops in such process. Any simple total language (like Coq) is more than enough.