
Hi, Am Dienstag, den 20.11.2012, 06:54 -0500 schrieb citb@lavabit.com:
I know nothing about compilers and interpreters. I checked several books, but none of them explained why we have to translate a high-level language into a small (core) language. Is it impossible (very hard) to directly translate high-level language into machine code?
I would expect that even if you were to implement a compiler for full Haskell itself, you would end up generating a core language. E.g, where clauses can be implemented using let. So after you have implemented let you are likely to not copy the code but rather transform your where clause into a let clause. And alas, you suddenly have introduced a core language (Haskell without where clauses). This way you will end up with a very reduced subset of Haskell. Then you might also notice that some features are similar to implement and you can merge the code if you add some feature to your language, making it a bit more expressive. Then your core language will be more than just a subset of Haskell. As you can see, you will have a hard time preventing yourself from introducing a core language. Greetings, Joachim -- Joachim Breitner e-Mail: mail@joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nomeata@joachim-breitner.de