Skip to main content.

Tuesday, July 12, 2011

A funny thing about the orgainc VM is that it has several way to do things:
* You can push a PStep to the code stack. -- that's the most direct way.
* You can push a PCode, which is a list (in reverse order) of PSteps to be evaluated by the VM in "one step".
* You can push a Statement, which is a special PStep (with a little of self-awareness).
* You can push a SynTree, or a derived class, which is a list of statements to be executed in the given order.
* Finally, you can "call a function", which is generally performed in a single step. If the function is a Falcon source function, then the VM pushes a new call frame in the call stack, adds the syntree which embodies the function code to the code stack and starts executing that.
* Or, if you really want to go fancy, you can add your own call stack frame and push psteps, pcodes, statements or syntrees that will be interpreded as executed in a new function.

Sunday, July 10, 2011

After a bit of experiment and talk with ppl on the channel, we have approved the idea to introduce a typed prototype programming in Falcon. While blessed dictionaries (or a kind of object we could introduce in this version) are a "random" collection of data and behavior, prototypes a-la-falcon shall be classes whose structure is mutable in runtime. The difference with respect to classes is that prototypes can be altered, and the difference with respect to typeless objects (i.e. blessed dictionaries) is that the structure of data and behavior is shared across all the instances of a prototype.