Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Releases: ArkScript-lang/Ark

ArkScript v4.3.3

01 Mar 11:29
Immutable release. Only release title and notes can be modified.
946d9b0

Choose a tag to compare

Changed

  • runtime type checking errors are on stderr instead of stdout
  • runtime exceptions are on stderr instead of stdout

ArkScript v4.3.2

28 Feb 17:33
Immutable release. Only release title and notes can be modified.
763d663

Choose a tag to compare

Changed

  • VM error outputs are on stderr instead of stdout

ArkScript v4.3.1

28 Feb 16:32
Immutable release. Only release title and notes can be modified.
v4.3.1

Choose a tag to compare

Added

  • new TAIL_CALL_SELF instruction 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

26 Feb 16:56
Immutable release. Only release title and notes can be modified.
v4.3.0
3654654

Choose a tag to compare

Breaking change

  • in macros, len, empty?, head, tail, @ have been renamed to $len, $empty?, $head, $tail and $at. Those versions only work inside macros too, inside of having a weird dichotomy where they sometimes got applied and sometimes not

Added

  • apply function: (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__slice builtin, 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-cache cli option to disable the creation of the bytecode cache folder __arkscript__
  • in the CLI, file can 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

04 Feb 19:05
Immutable release. Only release title and notes can be modified.
v4.2.0
9cb43e0

Choose a tag to compare

Breaking changes

  • assert is no longer an instruction but a builtin
  • when comparing values of different types using <, >, <=, >= and =, the result will always be false (it used to rely on the type index)

Added

  • added BREAKPOINT instruction
  • breakpoints can be placed using (breakpoint) and (breakpoint condition)
  • added a debugger that can be triggered on error or on breakpoint by passing -fdebugger to the CLI (see the docs for the debugger)
  • diagnostics can now be generated when using State.doString, using Diagnostics::generateWithCode (as the original code must be passed to the diagnostics generator)
  • empty? can now take a dict, and returns true if it has no key/value pairs
  • len can now work on dictionaries, counting the number of keys

Changed

  • changed the runpath of arkscript to look for libArkReactor under its (arkscript's) directory, {arkscript}/bin, {arkscript}/lib, and {arkscript}/../lib
  • and and or require 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 returns false, as not checks if the dict is empty

ArkScript v4.1.2

09 Jan 14:10
Immutable release. Only release title and notes can be modified.
v4.1.2
7550bb1

Choose a tag to compare

Added

  • the repl prints the output of the last expression it ran
  • new super instructions: MUL_BY, MUL_BY_INDEX, MUL_SET_VAL that 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_SYMBOL instruction that avoids creating a reference

Fixed

  • the REPL doesn't color import in two colors (red for imp__t and 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 0 every time

Changed

  • quotes are added around strings in type errors
  • disassemble can show a file bytecode
  • empty? now accepts nil and returns true for this value
  • the REPL adds (repl:history) and (repl:save filename) as builtins
  • the REPL attempts to load a file from ARKSCRIPT_REPL_STARTUP environment 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

13 Dec 13:51
Immutable release. Only release title and notes can be modified.
v4.1.1
27b9585

Choose a tag to compare

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 had then and else nodes or a single multi nodes then node

Changed

  • long function calls are split on multiple lines

ArkScript v4.1.0

12 Dec 19:25
v4.1.0
2c4cba7

Choose a tag to compare

Breaking changes

  • Function arguments are now immutable by default and an argument attribute mut must be added: (fun (a b c) (set b 5)) -> (fun (a (mut b) c) (set b 5))

Deprecated

  • dict:contains, use dict:contains?
  • math:even, use math:even?
  • math:odd, use math:odd?

Added

  • new builtin disassemble to print the bytecode of a function
  • new builtin io:readFileLines to read lines from a file as a list of strings

Changed

  • the formatter properly formats dictionaries (key-value pairs on their own line, always)
  • renamed dict:contains to dict:contains? so that all functions returning booleans have ? suffix ; added temporary alias dict:contains
  • renamed math:even to math:even?, and math:odd to math:odd?
  • string:removeAt can work with negative indexes

ArkScript v4.0.0

12 Sep 16:47
v4.0.0
823d9d0

Choose a tag to compare

Changes for you, as a user

  • macros are defined using (macro name value) and (macro name (foo bar ...args) body) instead of !{name value} and !{name (foo bar ...args) body}
  • quote keyword got removed. You can emulate it with a macro: (macro quote (value) (fun () value)) (it wasn't really a Lisp quote in the first place...)
  • while loops have their own scope
  • imports changed a lot: from (import "path/to/file.ark") to java like imports (the root is deduced from the main script emplacement): (import path.to.file :foo :bar)
  • you can format your code using the cli: arkscript -f myfile.ark
  • new dict datatype: https://arkscript-lang.dev/docs/std/dict/

For more information, check the language documentation!

Technical changelog

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 defined
  • 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 the 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 produce a value)
  • introduced Ark::internal::Pass to describe compiler passes: they all output an AST (parser, import solver, macro processor, and optimizer for now)
  • add -f(no-)importsolver, -f(no-)macroprocessor and -f(no-)optimizer to toggle on and off those compiler passes
  • added resolving empty? as a macro when possible
  • added short-circuiting to and and or implementation
  • added --check to the formatter as an option: returns 0 if the code is correctly formatted, 1 otherwise
  • the name & scope resolution pass now checks for mutability errors
  • compile-time checks for mutability errors with append!, concat! and pop!
  • new MAKE_CLOSURE <page addr> instruction, generated in place of a LOAD_CONST when a closure is made
  • added -fdump-ir to 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 and and or
  • basic dead code elimination in the AST optimizer
  • new operator @@ to get elements in list of lists / list of strings
  • new builtin random, returning a random number between INT_MIN and INT_MAX, or in a custom range
  • $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_JUMP 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
  • instruction source location; two new bytecode tables were added: one for filenames, another for (page pointer, instruction pointer, file id, line), allowing the VM to display better error messages when the source is available
  • show source location when a runtime error is thrown in the VM
  • LT_CONST_JUMP_IF_FALSE and LT_SYM_JUMP_IF_FALSE to compare a symbol to a const and a symbol to a symbol (respectively), then jump to an address if false (useful for while loops that check a simple (< x n) condition)
  • LT_CONST_JUMP_IF_TRUE, counterpart of LT_CONST_JUMP_IF_FALSE
  • GT_CONST_JUMP_IF_TRUE, counterpart of LT_CONST_JUMP_IF_TRUE
  • GT_CONST_JUMP_IF_FALSE, counterpart of LT_CONST_JUMP_IF_FALSE
  • GT_SYM_JUMP_IF_FALSE, counterpart of LT_SYM_JUMP_IF_FALSE
  • CALL_SYMBOL super instruction to load and call a symbol in a single instruction
  • GET_FIELD_FROM_SYMBOL and GET_FIELD_FROM_SYMBOL_INDEX super instructions to get a field from a closure and push it to the stack
  • EQ_CONST_JUMP_IF_TRUE and EQ_SYM_INDEX_JUMP_IF_TRUE to compare a symbol to a const and a symbol to a symbol (respectively), then jump to an address if true (useful for conditions that check a simple (= x n) condition)
  • NEQ_CONST_JUMP_IF_TRUE as a super instruction counterpart to EQ_CONST_JUMP_IF_TRUE
  • NEQ_SYM_JUMP_IF_FALSE, counterpart of LT_SYM_JUMP_IF_FALSE for inequality
  • AT_SYM_SYM and AT_SYM_INDEX_SYM_INDEX super instructions, to get an element from a list in a single instruction, avoiding 2 push and 2 pop
  • CHECK_TYPE_OF and CHECK_TYPE_OF_BY_INDEX super instructions, to check the type of variable against a constant in a single instruction
  • INCREMENT_STORE and DECREMENT_STORE super instructions, to update a value in place when incrementing/decrementing it by a set amount
  • APPEND_IN_PLACE_SYM and APPEND_IN_PLACE_SYM_INDEX super instructions
  • PUSH_RETURN_ADDRESS instruction now replaces the VM auto push of IP/PP
  • remove the stack swapping by pushing arguments in the reverse order by which they are loaded
  • wasm export: we can now run ArkScript code on the web!
  • GET_CURRENT_PAGE_ADDRESS instruction to push the current page address to the stack
  • CALL_CURRENT_PAGE super instruction, calling the current page with a given number of arguments (avoid loading a page address on the stack, then popping it to perform the call)
  • new data type Dict, which can be created with (dict "key" "value" ...), and manipulated with dict:get, dict:add, dict:contains, dict:remove, dict:keys and dict:size
  • added program name under `builtin__sys:programName
  • STORE_LEN super instruction, to load a symbol by index and store its length (if it's a string or list) in a new variable
  • AT_SYM_INDEX_CONST super instruction, to load a value from a container using a constant as the index
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 expect 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 (macro name value) / (macro 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 non-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 (macro 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 a...
Read more

ArkScript v4.0.0-18

20 Aug 14:31
4c54cf4

Choose a tag to compare

ArkScript v4.0.0-18 Pre-release
Pre-release

Added

  • added program name under builtin__sys:programName

Changed

  • execution contexts can be reused for async calls if they are not active, to avoid constantly requesting memory and creating (heavy) contexts
    • if there is more than 5 contexts, the 6th one will be destroyed once it completes
  • execution contexts are now marked as free to be reused (or deleted) once a value has been computed, without waiting for a call to await
  • captures are not renamed anymore by the NameResolutionPass (which used to fully qualify captured names when possible, which isn't desirable: when you capture &foo, you expect to be able to use .foo not .module:foo)
  • when loading a module, its mappings are loaded in the current scope instead of the global scope
  • argument order in the CLI changed: the file to run (and its optional script arguments) are now last, to be more consistent with all the other existing tooling (Python, Docker...)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.