Skip to main content.

Wednesday, July 16, 2008

I spent the day in trying to put the templates back in the Falcon::List class. For sure, it would have been more elegant, but there are problems in the interfaces (as the class is often returned and used across modules) and undeniable code bloat, so I think that I will just revert and forget about it, at least for now. At spots, I am tempted to re-make everything from scratch in C, but I try to resist ;-)

However, the work wasn't wasted; While I was working and searching for docs, I found an article that was talking about the limitations of C++ templates with respect of the Lisp, ERlang and ML metacompilers (macro compilers). Thinking a bit about it, I found a way to provide meta-compilation, that is, to script the Falcon compiler in Falcon. However, to be able to to this, I must bring a bit forward the flexible modules and provide them the ability to 1) associate code segments with single functions (now each module has just a big code area which contains all the bytecode defined in the module), and 2) the ability to create discardable code that can be executed on the fly. With the new Flexy Modules it should be just a matter of redefining a bit the interfaces.

Then, the compiler must be provided with the ability to send code compiled on the fly to a flexy module and it must be given a private VM that is used to link the scripts driving the compiler, and whose output is captured and fed to the lexer.

Nicely enough, this model allows also for a full interactive environment (but I would use another VM, the one held by the falcon command line, to run the single lines entered in dynamic mode); since the interactive mode is 1) simpler to make and debug and 2) more catchy for newby users, I think I will start from that.

I'd like to have someone taking care of this detail, as the QT project is now a priority...


No comments yet

Add Comment

This item is closed, it's not possible to add new comments to it or to vote on it