| |
|
Dan
| Hi guys,
I'm still around. Work's been busy, and I've been studying parser design theory whenever I think of my project. At the moment, I've got approximately 50% of the work done.
The engine is under 'the new BSD License'.
The object framework, properties/methods/attributes, and inheritance works. It is class-less, and very lean, with 8 byte overhead for objects, and 20 byte overhead for each property. It is written as an 2-d array of property structs.
The interpreter internally uses Global_eval to handle source text after calling a Global_init() to set up a copy of the Object framework. This allows us to run multiple script environments in one process; but could be forsaken by using the static data instead of copying in cases where memory size is crucial. The program initialization amounts to a memcpy() followed by setting about a dozen pointers and then it's done.
I figured out that with some trickery I can make the arguments object a mask to the x86 stack.
The lexer works, all the text and error messages are done, it is roughly 10-20% faster than DMDScript when I test it on my folder of scripts. I'd imagine if I hand coded the jump gate I could probably squeeze another 15% out.
The program so far doesn't use a parser, and all of the methods and operators are empty husks. I vaguely remember that most ECMAScript engines use some sort of tokenization/bytecode. My lexer has been creating Values, some of which are char[]'s pointing to a TEXT_something, some are numbers, some are dup'd from the source.
What I need to know is what to do with program flow, flow control, scope, and opcodes. Then I can finish my parser and get that all written up pretty. Once that's done, I'll release the source, and it'll be a simple matter of populating methods.
At this point, I'm not hugely motivated to finish this. It's a hobby project, so it might take a while. When I _am_ done though, I'll be doing ECMA-conformance testing on the script; I know the program is definitely different than ECMA spec in C. If it passes ECMAScript conformance, then I'll publish it and try to get it moved to Mozilla and KJS, as well as developing an optional platform independent ASP 3.0 interface.
|