There has been a lot of talk of late (and in the past) about new language features, be it, once keywords, DSLs or AOP. I'd like to throw in my 2 pence in for I see all these ideas as part of a larger one...
If there was an official opportunity to enhance the fcode, either at compile or runtime, then all these little features could be libraries of their own. Leaving it up to the developer as to whether they include them, enhance them or write their own.
I myself would like to see the Fantom core left relatively clutter free, and have all these little asides as optional dependencies.
There are two places where this new code could be executed:
DSLs go someway towards this but I feel its current implementation is a little clumsy.
Run Time
Alternatively, there could be a means to transform classes at Runtime. The Tapestry web framework does this allowing the component classes to be annotation driven. Their Plastic framework manipulates the Java bytecode to allow users to inspect classes and add methods, fields and advice where they see fit.
This way a lot of new features and ideas could plugged into Fantom as developers see fit - leaving the core Fantom focused on, well, more core stuff.
mikeMon 27 Aug 2012
I like both of these ideas, even though they are a can of worms :-). AOP in particular can create horrible problems, but that doesn't mean I don't like the idea of load-time fcode manipulation....
Post a patch Slimer! It shouldn't be that hard to provide callbacks from inside the compiler at load time. I'm sure Brian will hate this idea :-). But it would be an interesting project and you could maintain as a floating patch on top of the repo.
SlimerDude Mon 20 Aug 2012
There has been a lot of talk of late (and in the past) about new language features, be it,
once
keywords,DSLs
orAOP
. I'd like to throw in my 2 pence in for I see all these ideas as part of a larger one...If there was an official opportunity to enhance the fcode, either at compile or runtime, then all these little features could be libraries of their own. Leaving it up to the developer as to whether they include them, enhance them or write their own.
I myself would like to see the Fantom core left relatively clutter free, and have all these little asides as optional dependencies.
There are two places where this new code could be executed:
Build / Compiler Time
This would be akin to JSR 269 Pluggable Annotation Processing API available since Java6 (see Project Lombok for good examples). There would be a build time hook to allow you to inspect Facets and enhance the code.
DSLs go someway towards this but I feel its current implementation is a little clumsy.
Run Time
Alternatively, there could be a means to transform classes at Runtime. The Tapestry web framework does this allowing the component classes to be annotation driven. Their
Plastic
framework manipulates the Java bytecode to allow users to inspect classes and add methods, fields and advice where they see fit.This way a lot of new features and ideas could plugged into Fantom as developers see fit - leaving the core Fantom focused on, well, more core stuff.
mike Mon 27 Aug 2012
I like both of these ideas, even though they are a can of worms :-). AOP in particular can create horrible problems, but that doesn't mean I don't like the idea of load-time fcode manipulation....
Post a patch Slimer! It shouldn't be that hard to provide callbacks from inside the compiler at load time. I'm sure Brian will hate this idea :-). But it would be an interesting project and you could maintain as a floating patch on top of the repo.