Releases: ArkScript-lang/Ark
Releases · ArkScript-lang/Ark
ArkScript v4.5.0-1
Immutable
release. Only release title and notes can be modified.
Breaking changes
- removed
list:permutationsWithReplacement(deprecated in 4.4.0) list:permutationsnow produces real permutations and not combinations (deprecated in 4.4.0)
Added
- added new macro
$gensym, to generate a unique symbol identifier to use in macros append,concat, andpopcan be used as values- new
ptrcommand for the debugger, printing the VM pointers (ip, pp, sp) - compile time arity check when performing a tail call
string:utf8lento compute the number of codepoints in a string
Changed
- all paths inside
ifshould return a value, when used as an expression. If anelsebranch is missing,nilwill be returned - new compile time error when trying to use
append!,concat!,pop!,@=and@@=as values - arguments in tail calls are loaded by value and not by reference
string:ordchecks that it get only 1 utf8 character
ArkScript v4.4.1
Immutable
release. Only release title and notes can be modified.
Breaking changes
- in function calls, the function to call is now always evaluated first
- in function calls, the arguments are now evaluated from left to right
Added
- the bytecode reader can print the argument of a
PUSH_RETURN_ADDRESSinstruction as a hex number - new super instruction
CALL_SYMBOL_BY_INDEXto optimise aLOAD_FAST_BY_INDEXfollowed by aCALL
Changed
- instruction counter in the bytecode reader are displayed in hex, and count each instruction instead of each byte
let/mut/setpush a copy of their value when used as expression (instead of an internal reference)
Removed
- removed a nearly never emitted
GET_CURRENT_PAGE_ADDRinstruction, since it's now always optimised withCALLinto aCALL_CURRENT_PAGEinstruction - removed
list:size,dict:size,dict:contains,math:evenandmath:oddsince they were deprecated since ArkScript 4.2.0
ArkScript v4.4.0
Immutable
release. Only release title and notes can be modified.
Deprecations
list:permutationsis deprecated in favor oflist:combinationslist:permutationsWithReplacementis deprecated in favor oflist:combinationsWithReplacement
Added
- new debugger commands:
stack <n>andlocals <n>to print the values on the stack and in the current locals scope - custom format specifiers for lists:
:nto remove surrounding brackets,:c/:ncto use,as a separator instead of,:l/:nlto use\nas a separator,:?sto format as an escaped quoted string,:sto format as a quoted string
formatcan use format specifiers for integers:b,#b,B,#B,c,d,o,x,#x,X, and#Xif the argument is an integer- display a warning to
stderrwhen using a deprecated function/value (checks for@deprecatedinside the attached comment of functions / values)
Changed
pop!can return the removed value@=and@@=return the inserted valueappend!andconcat!return the modified listlet,mutandsetcan return the assigned value- fix formatter: when the condition of a
whileloop is on multiple lines, add the right amount of indentation before it
ArkScript v4.3.3
Immutable
release. Only release title and notes can be modified.
Changed
- runtime type checking errors are on stderr instead of stdout
- runtime exceptions are on stderr instead of stdout
ArkScript v4.3.2
Immutable
release. Only release title and notes can be modified.
Changed
- VM error outputs are on stderr instead of stdout
ArkScript v4.3.1
Immutable
release. Only release title and notes can be modified.
Added
- new
TAIL_CALL_SELFinstruction to take care of tail calls in functions: jumps to address 0 in the current page, and reset the scope
Changed
- error outputs are on stderr instead of stdout
ArkScript v4.3.0
Immutable
release. Only release title and notes can be modified.
Breaking change
- in macros,
len,empty?,head,tail,@have been renamed to$len,$empty?,$head,$tailand$at. Those versions only work inside macros too, inside of having a weird dichotomy where they sometimes got applied and sometimes not
Added
applyfunction:(apply func [args...]), to call a function with a set of arguments stored in a list. Works with functions, closures and builtins+,-,*,/and many other operators can now be passed around, like builtins. This now works:(list:reduce [1 2 3] +), where before we would get a compile time error about a "freestanding operator '+'"builtin__slicebuiltin, for strings and lists:(builtin__slice data start end [step=1]); this is an experimentation and may be removed in future versions- arguments of builtin macros are properly type-checked and will now raise runtime errors if the type is incorrect
-fno-cachecli option to disable the creation of the bytecode cache folder__arkscript__- in the CLI,
filecan be-to read code from stdin
Changed
- when using the cli flag
-fdump-ir, the IR is dumped in the cache folder
ArkScript v4.2.0
Immutable
release. Only release title and notes can be modified.
Breaking changes
assertis no longer an instruction but a builtin- when comparing values of different types using
<,>,<=,>=and=, the result will always befalse(it used to rely on the type index)
Added
- added
BREAKPOINTinstruction - breakpoints can be placed using
(breakpoint)and(breakpoint condition) - added a debugger that can be triggered on error or on breakpoint by passing
-fdebuggerto the CLI (see the docs for the debugger) - diagnostics can now be generated when using
State.doString, usingDiagnostics::generateWithCode(as the original code must be passed to the diagnostics generator) empty?can now take a dict, and returnstrueif it has no key/value pairslencan now work on dictionaries, counting the number of keys
Changed
- changed the runpath of
arkscriptto look forlibArkReactorunder its (arkscript's) directory, {arkscript}/bin, {arkscript}/lib, and {arkscript}/../lib andandorrequire valid expressions, so(or 1 (mut x 3))is no longer valid code, as(mut x 3)doesn't return a value(not (dict "a" 2))now returnsfalse, asnotchecks if the dict is empty
ArkScript v4.1.2
Immutable
release. Only release title and notes can be modified.
Added
- the repl prints the output of the last expression it ran
- new super instructions:
MUL_BY,MUL_BY_INDEX,MUL_SET_VALthat can do multiplications (and optional storing in vars) in place - new super instruction:
FUSED_MATH, which can fuse 2 to 3 math operations in one go (ADD, SUB, MUL, DIV) - new
LOAD_SYMBOLinstruction that avoids creating a reference
Fixed
- the REPL doesn't color
importin two colors (red forimp__tand blue for___or_), it keeps the first color that matched (red for import here) - page numbers are correctly counted when using the bytecode reader with '--only-names', instead of displaying
0every time
Changed
- quotes are added around strings in type errors
disassemblecan show a file bytecodeempty?now acceptsniland returnstruefor this value- the REPL adds
(repl:history)and(repl:save filename)as builtins - the REPL attempts to load a file from
ARKSCRIPT_REPL_STARTUPenvironment variable, to preload code - rename LOAD_SYMBOL and LOAD_SYMBOL_BY_INDEX to LOAD_FAST and LOAD_FAST_BY_INDEX to emphasize they load refs
ArkScript v4.1.1
Immutable
release. Only release title and notes can be modified.
Fixed
- the formatter was breaking functions' arguments list containing argument attributes on multiple lines for no reason
- the formatter was formatting begin nodes inside conditions badly, putting the
{on the same line as the condition, making it hard to know if the condition hadthenandelsenodes or a single multi nodesthennode
Changed
- long function calls are split on multiple lines