Skip to content

0.6.4

Choose a tag to compare

@xTrayambak xTrayambak released this 18 May 15:26
· 388 commits to master since this release

Bali 0.6.4 is out with ~50 commits in total. It's been 4 months since the last release, haha.
This update mostly focuses on stabilizing the engine and making it more stable and ready for embedding into other programs.

The most notable addition is the implementation of try-catch clauses.

Optimizations

  • The execute phase is marked as a computed-goto now.
  • The valuespace is now a proper sequence/vector.
  • Removed the concept of "local" values. This reduces a lot of value-fetching overhead.
  • Removed several unused opcodes:
  • SCAPL (set cap to list)
  • MARKHOMO (mark list as homogenous)
  • POPL (pop list)
  • POPLPFX (pop list prefix)

Bug Fixes

  • Fixed a regression in ToPrimitive()
  • String constructor no longer creates boxed string as internal representation, uses lower-level atom instead
  • Fixed a crash during codegen for decrement operations
  • Fixed a crash in the Nim-JavaScript native interface when registering native types
  • The parser now ensures that a function body ends with a curly bracket
  • INVK only increments the program counter when invoking a native function
  • computeTypeof() in Nim (and typeof in JavaScript) now handles callables (BytecodeCallable and NativeCallable are mapped to function)
  • Reassignments now handle expressions
  • The tokenizer no longer considers a plus-sign succeeded by whitespace as invalid
  • Math operations now use generic operations instead of int-only opcodes that misbehaved upon seeing a floating number. This means that arithmetic between floats and ints finally works!

Additions

  • Implemented try-catch clauses.
  • The VM can now recover from errors properly, if needed
  • Added new Error type. This is not used yet.
  • The bytecode emitter allocates some memory in advance now.
  • The VM has much better debugging support for control flow (-d:baliLogVmDbg) and operation-execute debugging (-d:baliLogExecDbg).
  • The parser can now parse compound assignments. There is a full "test suite" for this at tests/data/comp-asgn-001.js

That's about it for now. :^)