Repository navigation
Releases
MiniScript 2.0.0
MiniScript 2 is a complete rewrite of MiniScript 1, focused on performance. See What's New in MiniScript 2 for the details, but here are the highlights:
- Up to 45X faster
- Better error handling
- Frozen lists and maps
- Computed lists
- Mark-and-sweep garbage collection, even in C++
This is the biggest update to MiniScript since its first release in 2017. Today's release includes command-line builds for Windows, Mac, and Linux, as well as a C# version for any platform that has .NET. It also includes an updated MiniScript Manual, a new Command-Line MiniScript document, a library of generally helpful utility modules, and some example programs (including a Tetris game you can play right in your terminal!).
If you're embedding MiniScript in your own programs, the underpinnings and interfaces have changed a bit. Upgrading is not too difficult, but should be approached with patience. C/C++ users should see the C++ Host App Update Guide; a similar guide for C# is coming soon. You are also encouraged to join the Discord server and reach out for assistance.
Download the latest package for your platform at the Releases page.
MiniScript 2.0 FC7
Final candidate 7 of MiniScript 2.0. Changes since FC6:
- Fixed a small typo in the NewInMS2 doc.
- Fixed a tricky bug where an unused
selfargument could leak into the next call. - Fixed nested
importbug on the web, or any time an import module calledyieldorwait. - Updated lib modules with the latest & greatest improvements from Soda and raylib-miniscript.
MiniScript 2.0 FC6
Final candidate 6 of MiniScript 2.0. Changes since FC5:
- Fixed an issue with MS_EXE_DIR and MS_SCRIPT_DIR, resulting in the
libfolder not being found for imports. - Changed
shellArgsto include the script path asshellArgs[0], matching command-line MiniScript 1.x. - Added CommandLine documentation (in .md and .pdf formats).
- Cleaned up the examples folder.
- Changed release format to a zip file containing executable, docs, and examples.
MiniScript 2.0 FC5
Final candidate 5 of MiniScript 2.0. Changes since FC4:
- The REPL no longer exits when you press Control-C; instead this only interrupts any running script or partial input.
- Garbage collection now happens periodically even in a tight loop without
waitoryield. - String replication (e.g.
s * n) now operates in linear time rather than quadratic. - Assembler now properly handles non-ASCII string literals. (The assembler is an undocumented feature and may be removed in the future.)
key.availableon POSIX platforms now returnsfalsewhen stdin is closed.- Calls to intrinsic functions have been optimized (avoiding some unnecessary string creation/destruction).
inputnow flushes output to stdout to ensure the prompt appears before your input.- The release assets now include an updated MiniScript Manual PDF.
MiniScript 2.0 FC4
Final candidate 4 of MiniScript 2.0. Changes since FC3:
- REPL no longer exits upon a blank input.
- The lexer now treats U+200B (zero-width space) and U+FEFF (byte-order mark) as whitespace, rather than causing a compiler error.
- Reworked
execto avoid running out of handles (resulting in a segfault after 64execcalls).
MiniScript 2.0 FC3
Final candidate 3 of MiniScript 2.0. Changes since FC2:
- Further fix for issue #16 (the fix for which was incomplete in FC2).
- Improved performance in tight loops.
- Changed the format of a
funcRefwhen converted to string; now shows function name and parameters, similar to MS1. - Added a
-icommand-line option to drop into interactive mode after running a script (also like MS1). - Fixed the
yieldintrinsic in command-line apps, which was causing a hang in recent builds.
MiniScript 2.0 FC2
Final candidate 2 of MiniScript 2.0. Changes since FC1:
- Fixed major performance regression (
yielding on every store into a map). - Binaries are now named
miniscriptrather thanminiscript2. - Fixed issue where a function's locals could leak into a calling frame's stack.
- Math-assignment operators like
+=now evaluate the LHS expression only once. - Fixed a handful of edge cases, particularly with regard to handling of errors.
MiniScript 2.0 FC1
Final candidate 1 of MiniScript 2.0.
MiniScript 2.0 Preview 9
Preview build 9 of MiniScript 2.0. Changes since preview 8:
Language & semantics
newnow requires a map;__isacycles are rejected.- Fixed inconsistencies in how
@affects indexing. - Fixed off-by-one error in
rangeunder certain conditions (issue #14). - Fixed
NaN == NaNcomparison. - Fixed parsing of method calls where the first argument starts with parentheses, e.g.
m.f (arg1), arg2. - Map inserts now store a frozen copy of a list or map key.
- String indexing is now by Unicode code point in both C# and C++, with surrogate pairs handled identically.
infoon a function reference now reports the source code location where it was defined.
Performance
- String indexing is now O(1) instead of O(N) in the common case.
- GC policy collects more aggressively after heavy allocation, plus new facilities for collecting at appropriate
times automatically. - Removed unused opcodes (this is more of a clean-up task than performance.)
Fixes
- Fixed iteration over
localsin the C++ version. - Fixed string interning in C++, and C++ string processing where a
char(0)is involved. - Fixed two register scoping issues.
- Fixed invoking an intrinsic function through a
funcRef, and an intrinsic-clearing issue. - Fixed failure to mark the intrinsics map as a GC root.
- Class short names are now cleared before the invalidation callback.
Build & embedding
MiniScript 2.0 Preview 8
Preview build 8 of MiniScript 2.0.