Releases: ArkScript-lang/Ark
Releases · ArkScript-lang/Ark
ArkScript v4.0.0-11
Added
- new operator
@@to get elements in list of lists / list of strings
Changed
- loops have their own scope: variables created inside a loop won't leak outside it
ArkScript v4.0.0-10
Added
- the name & scope resolution pass now checks for mutability errors
- compile time checks for mutability errors with
append!,concat!andpop! - new
MAKE_CLOSURE <page addr>instruction, generated in place of aLOAD_CONSTwhen a closure is made - added
-fdump-irto dump the IR entities to a file named{file}.ark.ir - added 11 super instructions and their implementation to the VM
- support for the glob import syntax and symbol import syntax
- modify list and return a copy
(string:setAt string index char)(bound checked) - added in place list mutation:
(@= list|string index new_value),(@@= list|list<string> index1 index2 new_value|char)(bound checked) - compile time argument count check for
andandor - basic dead code elimination in the AST optimizer
Changed
- the
Ark::VMclass is nowfinal - the
STOREinstruction has been renamedSET_VAL - the
STOREinstruction is emitted in place of theLETandMUTinstructions, without any mutability checking now io:writeFileno longer takes a mode and has been split intoio:writeFileandio:appendToFile- instructions are now positioned like this:
inst byte1 byte2 byte3- byte1 is 0 if the instruction takes a single argument on 16 bits, split on byte2 and byte3
- if the instruction takes two arguments, they each have 12 bits ; the second one is on byte1 and upper half of byte2, the first on lower half of byte2 and then byte3
- ast-to-json dump now supports macros
- the parser can detect ill-formed macros (that are seen as function macros while being value macros)
- adding a
CALL_BUILTIN <builtin> <arg count>super instruction - fixed formatting of comments after the last symbol in an import node
- renamed
str:xyzbuiltins tostring:xyzfor uniformity with the standard library string:findtakes an optional third argument, startIndex (where to start the lookup from, default 0list:setAtcan work with negative indexes, and is now bound checked- re-enabled the AST optimizer, only used for the main
arkscriptexecutable (not enabled when embedding arkscript, so that one can grab variables from the VM)
Removed
- removed
LETandMUTinstructions in favor of a single newSTOREinstruction - removed
SAVE_ENVinstruction
ArkScript v4.0.0-9
Changed
- formatted ArkScript examples
- better variable formatting in the ArkScript code formatter
ArkScript v4.0.0-8
Added
- introduced
Ark::internal::Passto describe compiler passes: they all output an AST (parser, import solver, macro processor, and optimizer for now) - add
-f(no-)importsolver,-f(no-)macroprocessorand-f(no-)optimizerto toggle on and off those compiler passes - added resolving
empty?as a macro when possible - added short-circuiting to
andandorimplementation - added
--checkto the formatter as an option: returns 0 if the code is correctly formatted, 1 otherwise
Changed
- added a max macro evaluation depth
- introduced
internal::listInstructionswith the different instructions, to be used by the compiler and name resolution pass - checking for forbidden variable/constant name in the name & scope resolution pass, to give errors to the user before compiling some weird code
- repl completion and colors are now generated automatically from the builtins, keywords & operators
- fixed formating of comments inside function declarations
- renamed the macros
symcatandargcountto$symcatand$argcountfor uniformity
Removed
- removed
termcolordependency to rely onfmtfor coloring outputs - removed
andandorinstructions in favor of a better implementation to support short-circuiting
ArkScript v4.0.0-rc7
Added
$pasteto paste a node inside a maro without evaluating it further ; useful to stop recursive evaluation of nodes inside function macros
ArkScript v4.0.0-rc6
Added
- 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,appendand friends to only push valid nodes (that produces a value)
Changed
- fixed a bug in the compiler where one could pass a non symbol to
let,mutorset, resulting in a compiler crash - fixed a bug in the macro processor where one could pass an unknown symbol to
argcountand 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/setnodes - 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
whilenodes - 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
funnodes - fixed a bug when generating
let,mutorsetnodes 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 useless
\0escape in strings
ArkScript v4.0.0-rc5
Added
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
Changed
void Value::toString(std::ostream&, VM&)now becomesstd::string Value::toString(VM&)- removed
Node::operator<<to replace it withNode::debugPrint
Removed
- removed
VM::getUserPointerandVM::setUserPointer - removed
ARK_PROFILER_COUNTdefine
ArkScript v4.0.0-rc4
Added
- 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
Changed
- 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 --versionandarkscript --helpnow output ArkScript version with the commit hash
ArkScript v4.0.0-0.3
Added
$reprmacro to get a string representation of a given node- added boost-ext/ut to write unit tests in C++
Changed
- 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)
ArkScript v4.0.0-0.2
Added
- added the padding/instruction/argumentation values when displaying instructions in the bytecode reader