20 Oct 2004 elanthis   » (Journeyer)

Scriptix2 Work

I've picked up on the Scriptix2 work some more. The compiler is now actually generating bytecode, although I have no interpreter to check correctness. And interpreter is of course the next step.

The second Big Thing I need after that is the function binding logic. Right now it's only binding functions based on name, which of course isn't going to work for function overloading, which is a *huge* piece of the Scriptix2 puzzle.

See, while there will be user types, these will just be opaque types. There are no "methods" only functions. This simplifies the syntax. So instead of obj->method(), you'd always have method(object). We need overloading for sure, of course, since namespacing all the functions would result in a very complex API. get_name(obj) is so much nicer than object_type_get_name(obj).

A feature I then plan on adding is runtime-selection of functions. Normally they will be bound at compile time resulting in superb interpreted performance. (Far better than most script languages which are highly dynamic; such as Scriptix1.) Run-time binding will allow for virtual functions. However, our virtual functions will be far more powerful than the C++/Java/C# virtual methods. See, instead of just declaring a whole function as virtual, we define individual arguments as virtual. The result is that a function can have multiple virtual arguments. So not only can the behavior vary by the type of the object being worked on, but it can vary based on the types of the arguments passed to that function. This is, iirc, called multi-dispatch in other languages that have a similar feature.

[#] Comments

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!