tsoding / porth

It's like Forth but in Python
629 stars 50 forks source link

WIP: Translator to rust #122

Open mjdr opened 2 years ago

mjdr commented 2 years ago

Translate porth to rust. That allow for more optimal assembly generation. And it's fun. Wrote in same style as compiler and simulator, so its can be ported to porth (theoretically)

TODO

zrthxn commented 2 years ago

Correct me if I'm wrong but doesn't this sort of go against the language being self-hosted? If the python compiler generates Rust and then rustc generates assembly... doesn't this make the language not self-hosted?

mjdr commented 2 years ago

no, right now (python) -> asm -> (nasm) -> binary my translator (python) -> rust -> (rustc) -> binary after self hosted (porth) -> asm -> (nasm) -> binary (porth) -> rust -> (rustc) -> binary

mjdr commented 2 years ago

And it's not simulator, but source code generator