I implemented a quick-and-dirty IRC bot for Egel, a C++ application which allows for online evaluation. That gave me the opportunity to work on a somewhat neat manner of incorporating the Egel runtime in a C++ application.
It works but not to my satisfaction. I need to change and support two things: 1) Evaluation now works in a cumbersome manner with callbacks which need to go. 2) I need to think about a scheme to call Egel routines from the evaluator. I am not sure what I want here but some tighter integration seems in order.
I also found a not so nice bug in bytecode generation. Well, that's a show stopper. I am not worried since I trust the evaluation scheme I got but annoyed that a bug like that can pop up that late during development. I need to either test a lot or idiot proof it, and it turns out I am not idiotic enough to write down really strange programs which bring all bugs to the surface.
Then there is OO. I think I'll need syntactic sugar for an extend relation. That's not too hard but some work.
Well. I don't feel like doing much. I registered an account at readthedocs and started thinking a bit about performance. On a small test example, determine the length of a list of a million numbers, the interpreter runs in seventeen seconds whereas the Glasgow Haskell interpreter runs in around a second. 17x slower.
The hotspot is, of course, the bytecode interpreter.
There are a number of things I can do to gain some performance:
Change the register storage from a container to an array.
Fix the amount of copying. (The 'clone' method.)
Expand the bytecode a bit since it's minimal but not fast.
Use multiple inheritance to remove an indirection from arrays of objects.
Write my own reference counting object.
I changed a few lines of code and implemented the first two steps. Performance increased from seventeen to ten seconds on the example.