Skip to content

ArkScript v4.0.0-13

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 12 Apr 17:52
· 269 commits to dev since this release
dfb6038

Added

  • $as-is to paste a node inside a maro without evaluating it further ; useful to stop recursive evaluation of nodes inside function macros
  • LOAD_SYMBOL_BY_INDEX instruction, loading a local from the current scope by an index (0 being the last element added to the scope)
  • STORE_FROM_INDEX and SET_VAL_FROM_INDEX instructions for parity with the super instructions not using load by index
  • INCREMENT_BY_INDEX and DECREMENT_BY_INDEX instructions for parity with the super instructions not using load by index
  • STORE_TAIL_BY_INDEX, STORE_HEAD_BY_INDEX, SET_VAL_TAIL_BY_INDEX, SET_VAL_HEAD_BY_INDEX super instructions added for parity with the super instructions not using load by index
  • RESET_SCOPE instruction emitted at the end of a while loop to reset a scope so that we can create multiple variables and use LOAD_SYMBOL_BY_INDEX

Changed

  • -bcr option can be given a source file, it will then be compiled before its bytecode is shown
  • magic numbers for tables start in bytecode files have been changed from 0x01, 0x02, 0x03 to 0xA1, 0xA2, 0xA3 (symbols, values, code) to make them stand out in hex editors
  • magic numbers for value types in bytecode files have been changed from 0x01, 0x02, 0x03 to 0xF1, 0xF2, 0xF3 (number, string, function)
  • numbers in the values table in bytecode files are no longer stringified but their IEEE754 representation is now encoded on 12 bytes (4 for the exponent, 8 for the mantissa)
  • changed how scopes are stored inside the VM to enhance performances. All scope data are now contiguous!
  • when possible, accessing variables from the current scope is compiled to a new instruction LOAD_SYMBOL_BY_INDEX, to avoid the sometimes expansive lookup by id
    • this works inside normal scopes (introduced by while loops) and functions scopes, but not for closures