
Hi, Am Freitag, den 19.07.2013, 11:19 +0200 schrieb John Blackbox:
The question about generating the code was only to have a "debugging tool" - to see if the generated AST is good - I wanted to generate the Haskell code only to check if its correct, but normally I would not do it, because it makes no sense to generate AST -> code -> AST (by GHC) again etc :)
it does make sense: ASCII (or today, Unicode text) is a much easier and more stable interface than some ADT of a library. There is a good reason why GHC generates llvm files and calls clang on them, instead of generating the LLVM AST with some libllvm. Same for all the pre-processors (happy, alex) – they all go through the serialized form. It will be easier to plug components together, to inspect the intermediate Haskell code or even modify it. Of course if you need features not available via the command line, using the API might be required. But for your own sake I suggest you avoid it if possible. Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0x4743206C Debian Developer: nomeata@debian.org