If memory serves me right, Cory Spencer wrote: > most example languages implement a complete compiler (ie lexxer -> parser > -> optimizer -> code emitter), which seems to be somewhat of a > duplication of labour.
Some are in C, others in pasm and yet others in Perl ... how do do you re-use libraries in that case ? ... > Has or is anyone worked on a framework a la gcc gcc is not my ideal pick because it has an RTL bridge in between ... But I get the idea ... > which would only require that new languages have a lexxer/parser written > that coerced data into a standardized AST which could be passed off to other > compilation stages? (Similarly, other end targets (such as Java bytecode > or native code would only require the implementation of a new code > emission module.) I have been working on just such a compiler collection , which generates .NET IL & JVM from C# ... The next target is obviously Parrot and we plan at acheiving this by adding a new PMCodegen to the compiler backend. It uses a custom AST management tool (TreeCC) which should speed up development of ASTs. The system combines visitors and inhertiance to simplify compiler dev. Anyway treecc is there if you want to simplify AST management ... though I should say it's a bit different from OO or procedural programming ,it's aspect oriented... takes some getting used to. Take a look at the DotGNU portable.net's CSCC for examples, if you want to ... (and no, -mparrot will not work, though -mjvm might...) Gopal -- The difference between insanity and genius is measured by success