Skip to content

Releases: PlutoLang/Pluto

0.8.2

28 Feb 15:41
Compare
Choose a tag to compare
  • Added variable scoping warnings to switch statements to highlight code that will break in 0.9.0
  • Improved some error messages
  • Fixed base32 & base64 functions not being binary-safe
  • Removed compile-time concat optimization that was introduced in 0.8.0 because it could produce incorrect results

0.8.1

05 Jan 10:52
Compare
Choose a tag to compare
  • Added a specialized error message for local class = etc
  • 'exportvar' now prefixes function bytecode with 'load'
  • Improved code generation for switch blocks
  • Improved "possibly unwanted function call" warning
  • Fixed dumpvar & exportvar not handling recursion of sub-tables
  • Fixed assert.equal & assert.nequal ignoring extra fields in value2
  • Fixed 'until' possibly using a variable from wrong scope due to 'continue'
  • Fixed var-shadow warning for named vararg being raised on the wrong line

For integrators:

  • Added PLUTO_MEMORY_LIMIT
  • Added PLUTO_NO_DEBUGLIB
  • Added PLUTO_NO_COROLIB

For a more comprehensive overview of the changes, take a look at the commit log.

0.8.0

20 Dec 23:45
Compare
Choose a tag to compare
  • Added switch expressions
  • Added shorthand fallthrough syntax for switch statement & expression, e.g. case 1, 2: ...
  • Added try...catch statement
  • Added spaceship operator (<=>)
  • Added safe navigation for method calls: nilable_inst?:method(), inst:nilable_method?(), nilable_inst?:nilable_method?()
  • Added optional 'const' keyword as shorthand for local ... <const> [= ...], enabled with pluto_use const.
  • Added pluto_use "VERSION+"
  • Tables now have a metatable by default ({ __index = _G.table }).
  • Added '!' as an alias for 'not'
  • Added 'private' modifier for class fields
  • Improved 'class' and 'extends' to support indexed names
  • Improved 'instanceof' to be usable with more complex expressions
  • export now works in all scopes, not just the main body
  • Updated in operator on tables to check values instead of keys
  • \{ is now a valid escape sequence (for interpolated strings)
  • Fixed to-be-closed variables not working in switch cases
  • Fixed 'new' not working as expected if it was disabled by the environment and re-enabled by 'pluto_use'
  • Fixed 'enum class' not incrementing enumerator values
  • Fixed not being able to use expressions such as increment in enum without parentheses

Warnings:

  • Added warning for local attributes used without '<' ... '>'
  • Now propagating types for global variables so when their value is assigned to something, mismatches can be detected.
  • Added optional global-shadow warning which is like var-shadow but for globals that are especially vulnerable to obscure shadowing bugs (to prevent excessive annoyance).
    • These globals include: arg,string, and table. Integrators can change this via PLUTO_COMMON_GLOBAL_NAMES
    • Global shadow warnings do not apply to localization optimization (i.e, local table = table)
  • var-shadow has been improved to check more enclosing scopes
  • Improved unreachable-code
  • Fixed var-shadow warning for locals used in switch cases despite break
  • Added optional non-portable-code, non-portable-bytecode, and non-portable-name warning types
  • Warnings can now be promoted to errors, e.g. @pluto_warnings error-all

Standard library:

  • Soup is now always linked in, obsoleting _PSOUP
  • Added assertion library (see here for more preliminary detail)
  • Added url library (encode & decode)
  • Added exception class
  • Added vector3 class
  • Added dumpvar & exportvar
  • Added string.truncate
  • Added string.replace — a slightly faster, but mostly more straightforward alternative to gsub.
    • Most notably, not burdened by MAX_CAPTURES
  • Added string.formatint (supports any BigInt impl that can offer the user a string representation)
    • Also supports any grouping & any separator without concerning locale.
  • Added table.filter
  • Added table.map
  • Added table.reverse
  • Added table.reorder
  • Added io.currentdir
  • Added io.part
  • Added io.writetime
  • Added math.isnan
  • Added compareversions
  • Added wcall
  • Added math.atan2 as an alias for math.atan
  • Added json.null
  • io.absolute now has an optional argument to request a canonicalized absolute path
  • Updated string.rfind to accept Lua patterns
  • Renamed io.copyto to io.copy
  • Renamed base64.url_encode & base64.url_decode to base64.urlencode & base64.urldecode
  • Deprecated string.find_first_of & string.find_first_not_of in favor of string.find
  • Deprecated string.find_last_of & string.find_last_not_of in favor of string.rfind
  • Deprecated string.lfind in favor of string.find
  • Deprecated crypto.hexdigest in favor of string.format
  • Modified require
    • Prioritizes local files now to ensure compatibility. Added require("pluto:libname") to explicitly request pluto libraries if ever needed (normal still works for pluto libraries, we just check for local files first).
  • Removed base58

For integrators:

  • Added PLUTO_NO_FILESYSTEM - disables all filesystem access (for sandboxing).
  • Added PLUTO_WARN_NON_PORTABLE_CODE
  • Added PLUTO_WARN_NON_PORTABLE_BYTECODE
  • Added PLUTO_WARN_NON_PORTABLE_NAME
  • Added PLUTO_NO_BINARIES - disables all dll/so/c module loading (for sandboxing)
  • Added luaG_addsrcinfo

Far more information can be found at our documentation: https://pluto-lang.org/

0.7.4

09 Nov 10:13
Compare
Choose a tag to compare
  • Fixed unexpected behavior when using a ternary expression inside of an interpolated string
  • Fixed table.contains returning 0 instead of the actual key for non-integer key types
  • Fixed REPL not recognizing multi-line statements
  • Fixed Pluto-injected code corrupting bytecode

For integrators:

  • Added PLUTO_LOADCLIB_HOOK

0.7.3

16 Sep 09:02
Compare
Choose a tag to compare
  • Updated error semantics of os.remove & os.rename to match Lua's again (return false instead of raising error), Pluto's 'io' versions of these functions remain unchanged
  • Fixed extends not copying over metamethods
  • Fixed "memory allocation error: block too big" when parsing --[[]]
  • Fixed allowing function calls to primitives, causing ambiguities with exprstat after assignment
  • Fixed string.upper & string.lower delimiting on '\0'
  • Some other improvements and bugfixes

0.7.2

27 Aug 01:34
Compare
Choose a tag to compare
  • String interpolation now allows nested strings
  • Improved "unreachable code" warning
  • Improved some error messages
  • Fixed string interpolation not working with string call syntax
  • Fixed rare issues with 'new', 'extends' and 'instanceof' operators

0.7.1

20 Jul 09:38
Compare
Choose a tag to compare
  • Fixed string interpolation not working with single-quoted strings after 0.7.0
  • Fixed os.sleep disregarding execution time limit
  • Fixed scripts being able to go past execution time limit with coroutines

0.7.0

18 Jul 21:19
Compare
Choose a tag to compare
  • Added table destructuring (local '{' NAME [= FIELD][, ...] '}' '=' TABLE)
  • Added array destructuring (local '[' NAME[, ...] ']' '=' TABLE)
  • Added pluto_use <* | version | token> [= false] to toggle non-compatible keywords
  • Added pluto_use let [= false] to toggle 'let' alias for 'local'
  • Added ++ statement
    • Also supports ++t.prop
  • Added constructor promotion
  • Added compile-time conditionals
  • Improved class expression & statement
    • Now supports property declaration without value
    • Now supports type hints (currently without warnings)
    • Now supports access modifiers (currently without warnings or errors)
    • Can now optionally use 'begin' before body
  • Improved string interpolation to support any expression, not just variable names
  • Improved type hints to support alternatives, e.g. string|int
  • Named arguments may now be used in conjunction with positional arguments
  • Improved 'new' expression to support direct member access into the table it created, e.g. print(new Human("John").name)
  • 'new' may now also be used as a statement
  • Fixed loading of precompiled code from files with non-Latin path on Windows
  • Fixed behavior of 'in' expression when used on a temporary table

Out-of-the-box Compatibility:

  • 'parent' may now be overwritten via local or parameter name
  • All reserved identifiers can now be used with shorthand table syntax and goto

Standard library:

  • Added coroutine.xresume

For integrators:

  • Added PLUTO_USE_LET

More detailed documentation can be found here.

0.6.3

25 May 01:27
Compare
Choose a tag to compare
  • Defaults arguments now produce Lua-compatible bytecode
  • Fixed default arguments not working for methods
  • Fixed named arguments, etc. not working for upvalue functions
  • Fixed 'in' expression for when right-hand operand is nested table
  • Fixed 'in' expression being too greedy in consuming righthand operand

For integrators:

  • Added PLUTO_LUA_LINKABLE

0.6.2

03 May 07:57
Compare
Choose a tag to compare
  • Optional Parentheses now works for table types and with chained "suffix expressions"
  • Fixed new overwriting user-defined __index
  • Fixed infinite recursion with multi-level parent calls
  • Fixed some other small issues

Performance:

  • Optimized lua_insert, lua_remove, & lua_replace (Optimization by @gottfriedleibniz)
  • Optimized luaO_ceillog2 (Inspired by @gottfriedleibniz)
  • Enabled Lua's jump table for clang build as well
  • Fixed a VM performance regression introduced by Pluto