Hacker News new | ask | show | jobs
by foota 2873 days ago
I'm not sure the statement "It's possible to write a compiler from any Turing-complete language to any other Turing-complete language" is really accurate, other than in a strict cs sense. If you have a language that only allows printing to the screen as output and reading from the keyboard as input then you can't write anything that requires low level hardware access in it.
1 comments

Thats more a symptom of the environmemt/compiler, but not the language itself. Theres no reason printing to the screen would stop you from printing binary, and feeding that into your processor as normal. Theres also no reason why the language can't have another implementation that does allow more standard outputs.

Language-wise, theres nothing stopping you from parsing java, and producing equivalent semantics. There's nothing stopping you from producing equivalent jvm bytecode.

The interesting part of racket/perl6/this project is that this compilation step is being done without having to parsing "another language", by using macros. Parsing is still done ofc, but it could also be said that you're really just parsing the rust language, which happens to look like java, and producing rust code. The macro system itself is operating as the compiler, and since macros are "rust", then whats the difference?