User loginNavigation |
A stratified implementation of a LISP-to-CIL compilerHi all! I built an interpreter for a language that is similar to lisp and scheme (https://github.com/bryanedds/aml/wiki). I am thinking about writing a .NET compiler for it, however I think I am missing some fundamental background knowledge. I think I can see how it might be smart to write an itermediate 'machine' that indirectly generates IL code rather than manually translating each special form to IL code directly. So instead of going from AST analysis straight to IL, I would go from interpreter to 'hand-wavy-virtual-machine' to IL. This stratification seems like a good idea, as it may ease optimization logic by reasoning about semantics at a lower level, but I don't know where to start. Is there a typical stratification technique for building compilers for lambda calculus-based languages? It seems like it would look like an intepreter that passes symbolic primitive that are understood by a 'machine' that produces .NET code. Perhaps the SECD machine (http://en.wikipedia.org/wiki/SECD_machine) was something like this? I think Haskell's G-Machine might also be similar? Am I off-base here? PS - I'm still a language design newbie, so please keep any answers simple for me :) By bryanedds at 2012-08-27 13:00 | LtU Forum | previous forum topic | next forum topic | other blogs | 6429 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
23 weeks 2 hours ago
23 weeks 2 hours ago
45 weeks 1 day ago
49 weeks 3 days ago
51 weeks 10 hours ago
51 weeks 10 hours ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago