misc: some activity again...
- well, after a great many months I have gone and done some new stuff
for pdscript, and am now considering possibly renaming it to "BGB-
Script", err, sort of after myself...
not much has gone on with actually changing the language (imo, it
is "good enough" allready).
what I have done is more like misc stuff:
some bug fixes;
a little bit of optimizing;
creation of some actual frontends/tools;
addition of an external object format;
a better disassembler (eg: does some processing, inserts labels,
takes not of opcode arguments and inlines literals with the
tools I have thus far:
bsi, interpreter (takes scripts or objects, has an argument to
suppress giving a repl);
bscc, compiles scripts into objects;
bscg, compiles scripts/objects into c code;
bsdisasm, disassembles objects into bytecode assembly dumps.
I have yet to write an assembler, but I am not so sure one is needed
the c code generator is now "not quite" as stupid.
eg, if there is no possible environment capture for a function
(closures, continuations, ...) then it doesn't bother setting up an
interpreter visible scope for lexical variables, instead it will
create c variables and use the function args array directly.
I am also considering the idea of having the cg tool generate an init
stub in one of the generated source files.
in this way, the cg tool could be called with an option telling which
file is the entry point, and it could generate an appropriate "main"
and similar (vs having to link against an object).
completes in about 2.7 seconds and consumes about 160 bytes of heap
space, is this anywhere near a "sane" number?...
my guess is those 160 bytes are probably going to a few upper level
numbers (my fixnum range is a little small) and probably some
additional allocation of bindings or similar...
according to the profiler, the most time is going into the main
interpreter loop (the large switch for dispatching instructions)
followed most closely by the function for fetching type names (yeah,
at present strings are the primary means of identifying types...).