Skip to content

ArkScript v4.0.0-rc6

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 08 Jul 20:19
4b8adbd

Added

  • more tests for the io builtins
  • added lines and code coloration in the error context
  • new dependency: fmtlib
  • added the padding/instruction/argumentation values when displaying instructions in the bytecode reader
  • $repr macro to get a string representation of a given node
  • added boost-ext/ut to write unit tests in C++
  • basic ArkScript code formatter, available through the CLI: arkscript -f|--format
  • comments are now tracked in the AST and attached to the nearest node below them
  • VM::forceReloadPlugins, to be used by the REPL to force reload the plugins and be sure that their symbols are all define
  • added help, save (save history to disk), history (print history), reset (reset vm and code) commands to the REPL
  • REPL can now show when a code block isn't terminated (prompt changes from > to :)
  • more controls available inside the REPL
  • fuzzing step in the CI
  • better error reporting on unknown import
  • check on number of arguments passed to type
  • warning when the formatter deletes comment(s) by mistake
  • check on arguments passed to list, concat, append and friends to only push valid nodes (that produces a value)

Changed

  • instructions are on 4 bytes: 1 byte for the instruction, 1 byte of padding, 2 bytes for an immediate argument
  • enhanced the bytecode reader and its command line interface
  • added the padding/instruction/argumentation values when displaying instructions in the bytecode reader
  • fixed underline bug in the error context
  • the str:format functions now expects strings following this syntax: https://fmt.dev/latest/syntax.html
  • more documentation about the compiler implementation
  • more documentation about the virtual machine
  • closures can be now be compared field per field: (= closure1 closure2) will work only if they have the same fields (name) and if the values match
  • macros are now defined like ($ name value) / ($ name (args args args) body) / ($if cond then else)
  • upgraded from C++17 to C++20
  • new parser, new syntax for imports: (import package.sub.file)
  • allow nodes to be empty when dumping the AST to JSON
  • macros can be declared inside a begin block within a cond macro and used in the scope surrounding the cond macro
  • arkscript --version and arkscript --help now output ArkScript version with the commit hash
  • void Value::toString(std::ostream&, VM&) now becomes std::string Value::toString(VM&)
  • removed Node::operator<< to replace it with Node::debugPrint
  • fixed a bug in the compiler where one could pass a non symbol to let, mut or set, resulting in a compiler crash
  • fixed a bug in the macro processor where one could pass an unknown symbol to argcount and crash the processor
  • fixed a bug in the compiler where one could pass something other than a list to (fun) as the argument block, resulting in a crash
  • fixed a bug in the compiler generating not callable functions
  • fixed a bug in the macro processor generating invalid let / mut / set nodes
  • fixed a bug in the macro processor allowing out of bounds access with ($ test (@ [1 2 3] -5))
  • fixed a bug in the vm which wrongfully allowed self concat in place: (concat! lst lst)
  • fixed a bug in the compiler where one could "use" operators without calling them: (print nil?)
  • fixed a bug in the compiler allowing the use of operators without any argument: (+)
  • fixed a bug in the vm during error reporting when a non-function was used as a function
  • refactored code inside the bytecode reader to promote code reuse
  • fixed a bug in the compiler generating invalid while nodes
  • fixed a bug when passing the wrong number of arguments to a function inside an async call was crashing the VM because the function couldn't be named
  • fixed a bug in the compiler generating invalid fun nodes
  • fixed a bug when generating let, mut or set nodes inside macros with an invalid node type
  • fixed a bug when reading invalid UTF8 codepoints in the parser caused out of bounds reads
  • fixed a bug with recursive macro, exhausting the stack space due to recursive evaluation
  • futures can be awaited again, they will return nil on all the tries
  • checking for reused argument name in macros during parsing
  • enhanced comment after node handling in macros
  • adding a hard limit on package names length (255 characters, to comply with posix limits)
  • disallow passing invalid nodes as arguments to functions and operators
  • checking for unevaluated spread inside macros
  • checking for invalid symbols when defining a function through a macro
  • added a max macro unification depth

Removed

  • removed unused NodeType::Closure
  • removing the custom string, replacing it with std::string (the format engine of the custom string had a lot of memory leaks)
  • Utils::digPlaces and Utils::decPlaces got removed as they were no longer needed
  • removed deprecated code (list:removeAt, ark executable now replaced by arkscript)
  • removed VM::getUserPointer and VM::setUserPointer
  • removed ARK_PROFILER_COUNT define
  • removed useless \0 escape in strings