Skip to content

Fixed imports, exec, and library improvements

Compare
Choose a tag to compare
@thesephist thesephist released this 20 Dec 00:06
· 84 commits to master since this release

This release contains an accumulation of bugfixes to the standard library and some interpreter improvements since the last release. There is one breaking change, which concerns the newly introduced feature of de-duplicated imports added to load('module').

Features

  • exec(command, []args, stdin, outputCallback) is a new builtin function that allows Ink programs to spawn child processes in the operating system and is the primary method of communicating with other software for Ink programs. Access to this API is gated behind the --no-exec and PermissionsConfig.Exec flags.
  • Imports loaded with the load() builtin are now de-duplicated, so only one copy of the imported file is created in one running Context, on first import, which saves memory and allows for multiple files to import the same single single instance of a value.
  • Ink is now available as a Go package, at github.com/thesephist/ink/pkg/ink as package ink.
  • Ink is now continuously tested with Travis CI on master branch and all pull requests.

Fixes

  • Improvements and bugfixes to std and str standard library functions. In particular, more documentation is added and std.writeFile fixes a bug related to truncating files on save.
  • Ink used to crash when there was an error evaluating the left side of an assignment, or when there were certain syntax errors in composite literals. Both of these now result in an Ink runtime error instead.