Compiler & VM finished

Today, I’ve written the bytecode-based virtual machine that runs the scripts within NGEDIT. It didn’t take more than 6-8 hours. Complete with the access mechanisms to built-in functions, casting of values for inter-type operations, function calls, etc. It doesn’t amount to much more than 1,000 lines of code.

It always strikes me as weird that the kind of things that seem “complex” are often done in quite little time, while other parts which seem easier take so much more. The Undo system, selecting/copying/pasting etc… have taken much less time to develop than things such as the custom menus, tab bar, preferences dialogs, etc, which are supposedly much simpler. No surprise we’re so bad at forecasting development times. I almost dare predict that printing support will take double the time than syntax highlighting will.

I find that my productivity is much lower when I have to be talking to the Windows API, than when I’m writing self-contained code. Does the same happen to you?

My next goal is vi/vim emulation using the internal NGS scripting language, I’ll report how it fares.

Leave a Reply