2008/7/1 tim Rowledge tim@rowledge.org:
On 30-Jun-08, at 8:27 PM, Igor Stasenko wrote:
err... a primitive names, will add about same or even more space (in fact it will make VM and image both little bigger ). So its unlikely that new VM will have less memory footprint, but more likely that it would be simplified a bit comparing to old ways how it works with primitives.
Well, about 200 methods would get an extra literal (to put the name in) and about 200 symbols would be interned (for the names), so yes it would cost a little image space there. The VM size would be affected by what the C compiler did; sometimes simplifying code a little makes for a significant size change as CSE etc comes into play.
You forgot , that primitive names are appear in VM as literals too. Just to be able to lookup for a primitive function by its name instead of index. But forget it.. Size is really not an issue, if we can focus on making VM more clean without obsolete stuff. The worst thing is image compatibility: you can't run images which using numbered primitives anymore. Or again, you would need to keep an index->name translation table for backward compatibility :)
The plugins are obviously different in structure to plain functions in an executable - no idea whether they are consistently bigger or smaller. Probably depends a bit on the OS? Of course, your image may well not use all the ex-numbered prims and thus may not load some of the new plugins. If the VM is properly (in my opinion) built to have all plugins external then the actual working size might be a fair bit smaller.
Why external? If you declare a primitive like:
<primitive: 'foo' module: ''>
it will look for a primitive in VM itself. No need in putting things in standalone plugin. There are many primitives which assume that they are in VM code, and also many others that assume that they built as internal only. There will be a lot of C discrepancy if you try to compile some plugins/primitives either as standalone plugin or external plugin :)
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim A)bort, R)etry, I)gnore, V)alium?