On 04/05/2009 16:26, Noel Grandin wrote:
Once you get into code generation, the world is your oyster :-)
That's the road taken by JavaFX: to generate Java code out of their language.
But it definitely makes deployment a little harder (one extra build step), and code generation is not trivial.
Indeed. Processing "language" (http://Processing.org) took this road, using Antlr (a modified Java grammar): they take a simple "script" and add a class declaration, a main() method, handle properly imports, adds F at the end of literal decimal values, replace occurrences of 'color' "keyword" by 'int', etc. This makes it much easier to write small programs for newbies, while remaining fully compatible with Java. But the drawback is that the author never had the time to update to Java 1.5 syntax (a quite different grammar file, available but yet to modify) so we don't have access to typed collections, for each loops and such...
A pre-processor is cool, but is quite some work to make it work and to maintain... And too much might be badly perceived by users (some people love JavaFX language syntax, others hate it! -- I am in between, some features are cool, others are irritating).
-- Philippe Lhoste -- (near) Paris -- France -- http://Phi.Lho.free.fr -- -- -- -- -- -- -- -- -- -- -- -- -- --
