BMax Virtual Machine?

Miscellaneous Forums/General Discussion/BMax Virtual Machine?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

How does the new BVM differ from the old one?


Except for a few exceptions, the features in BVM 1 are found identical in BVM 2.

The differences lie in a series of additions:

* a script debugger featuring the usual step in, step over (etc), runtime breakpoints, a call stack view, a variables view and a debug log.
* a more straight forward way to import other scripts.
* a better repository handling (the handling of the way scripts, modules and command sets are located on the hard drive)
* a more straight forward way of calling a script's function. In BVM 1, while calling host app functions from the scripts required no special effort on your part (you just had to declare the function in your command set), doing the reverse required a bit more grunt work. That wasn'such a big issue as the host app usually has to call a very limited amount of script functions, but I felt unhappy with it. So now the host app can call a script function in just a single normal function call. No manual poppings or pushings.
* a documentation system ala JavaDoc. In case you're brave enough to document your scripts (depending on the amount of code you write in scripts, that can very soon be vital), you can generate a documentation form your scripts and read it in your favorite web browser.
* constants in command sets, ability to include sub-command sets.
* optional "dynamic" contexts: allow to map contexts using different command sets, and in particular allows a script to import another module that uses a different command set.
* Most important, extensions to the BlitzBasic language (which still forms the core of the script language).
- reflection: look up at runtime which types are loaded, instanciate them and/or edit object fields. Primary use: write an integrated editor that can manage just any type your scripts declare.
- function pointers
- OOP: brings up inheritance and overriding.
- an option to slightly change the syntax to better suit most programmers expactations: most notably, '\' becomes '.'
- serialization: read/write your objects to disk easily.
- annotations: attach meta-data to modules, types and fields. This data can be read via reflection.
This can be very handy by example to pass pass information to your integrated editor (telling him to edit an integer field with a color picket by example).
- properties: use getters and setters as if you were manipulating a simple field:
obj.SetColor(obj.getColor() / 2) becomes obj.color = obj.color / 2
Simple, and makes code cleaner.
- Public/Protected/Friendly/Private keywords, to limit access to type members.

I also added arrays in types, though you might prefer to just use the provided TList type (provided by a

"core.bbm" module that you're likely to want to import in just any script).

For EachIn is also there.

I'm certainly forgetting a thing or 2.

Now that you're excited (at least I hope so :) ) I'll just temper a bit by saying that there is still work to do and important issues to solve. But at least it has laready become very useable.