Rethinking the Symta's Runtime Apparently I was doing pointer tagging thing incorrectly the whole time.
I did stole the fixnum idea from Lisp/Haskell.
But that was pretty much all.
For example, I had the closure storing it's size inside the object on heap.
That incurred performance penalty even for the functions having no closure.
Yet it is useful to have fixnums with custom types.
So the right thing is allocating a type tag range for functions.
After all, a program can't have more than a million functions.
Now we can either have it point to the area of memory with functions.
Or to a pointer vector. Without any heap overhead.
Generally, most tagged pointers, like entities, don't need a heap object.
I.e. most of my functions are not closures.
With entities I just temporarily bring them to existence as a specific type.
Which then gets dropped after the processing is done.
Going through a heap object creation is super inefficient.
The difference between 6 FPS and 60 FPS
TLDR: preparing runtime for transitioning to ECS.
Current Mood:
contemplative