Skip to content

Releases: PlutoLang/Pluto

0.6.1

12 Apr 01:18
Compare
Choose a tag to compare
  • Improved suggestions (for when using plutoc with the language server)
  • Optimized switch statement code generation (now omits cases leading to default case)
  • Fixed producing syntax error when 'case' or 'default' is used outside of switch
  • Fixed using 'export' outside of global scope not producing an error
  • Fixed some confusing error messages
  • Pulled in the latest Lua changes so some Lua bugs are now fixed

0.6.0

06 Apr 18:34
Compare
Choose a tag to compare
  • Added <constexpr> attribute to force locals to be compile-time constants
  • Added $expr syntax for compile-time evaluation of select functions
  • Added export [NAME=VALUE | function | class] syntax
  • Added named arguments (name=value in funcargs)
  • Added named varargs (...NAME), automatically puts the varargs into a table with the given name
  • A subset of Soup is now vendored with Pluto so standard library features that rely on it should now be more viable
  • Removed deprecated "pluto_case" and "pluto_default" keywords
  • Removed when statement

Enums:

  • Added ENUM.ENUMERATOR syntax for named enums
    • Added ENUM CLASS NAME ... syntax to force usage of this syntax
  • Added enum reflection for named enums (:names(), :values(), :kvmap(), :vkmap())

Object-oriented programming:

  • Added new TABLE(...) syntax (creates new table, sets TABLE as its metatable + __index, calls :__construct(...) if exists)
  • Added 'class' statement & expression (similar to table but without need for ',' or ';' after properties and functions)
    • 'class' and 'local class' statements also support extends NAME which sets __parent property and metatable with __index
    • Added static function NAME for use within table constructor/class definition (equal to NAME = function)
  • Added 'parent' expression
    • parent.PROP -> self.__parent.PROP
    • parent:METHOD(...) -> self.__parent.METHOD(self, ...)
  • Added TABLE instanceof METATABLE operator

Type hints:

  • Added 'int' & 'float' type hints (more restrictive than 'number')
  • Added 'void' type hint for function return type

Standard library:

  • Added utonumber, utostring, & string.uformat
  • Added instanceof(TABLE, METATABLE)

For integrators upgrading to Pluto 0.6.0:

  • Consider defining PLUTO_COMPATIBLE_NEW, PLUTO_COMPATIBLE_CLASS, PLUTO_COMPATIBLE_PARENT & PLUTO_COMPATIBLE_EXPORT so 'new', 'class', 'parent' & 'export' will not be reserved keywords just yet, instead 'pluto_new', 'pluto_class', 'pluto_parent' & 'pluto_export' can be used.

More detailed documentation can be found here.

0.5.4

04 Apr 19:56
Compare
Choose a tag to compare
  • Default arguments now support tables
  • Pluto now supports building with C ABI so you can replace Lua's shared library with Pluto's without needing to change the program
  • Fixed return before case or default causing a syntax error
  • Fixed access violation on lua_close with strings as default parameters

0.5.3

01 Mar 11:32
Compare
Choose a tag to compare
  • Default arguments now support compile-time constant variables, unary -, and pseudo-unary +
  • Re-added os.remove & os.rename because they originated in Lua and should not have been removed
  • Fixed some instances of errors not providing a code snippet and reporting the wrong line
  • Fixed enumerators being limited to 32-bit values
  • Fixed warning disable/enable being global-only
  • Removed if-goto optimisation due to various edge cases where goto is not executed

0.5.2

16 Feb 22:43
4015371
Compare
Choose a tag to compare
  • Enum statement: Now supports compile-time constant variables when setting value
  • Fixed require, dofile, etc. not taking UTF-8 encoded paths on Windows
  • Fixed pluto & plutoc not being able to execute files with foreign names on Windows

0.5.1

10 Feb 19:15
Compare
Choose a tag to compare
  • Enum Statement: Now supports unary - and pseudo-unary + when setting value
  • Replaced locals limit with registers limit so you can have more compile-time constants
  • Fixed Pluto's IO functions not taking UTF-8 encoded paths
  • Fixed UB when emitting unfinished string error, possibly resulting in an access violation

0.5.0

23 Jan 06:13
c986fb6
Compare
Choose a tag to compare
  • Added "for ITERABLE as VALUE" loop
  • Added $-strings (string interpolation)
  • Added prefix ++ operator
  • Added support for binary number literals.
  • Added C-style enums
  • Added _PSOUP global
  • Updated package.path to look for .pluto files in working directory by default
  • Deprecated "pluto_case" and "pluto_default" (now "case" and "default", respectively)
  • Removed what was deprecated in 0.4.0 (sleep -> os.sleep, os.remove -> io.remove, os.rename -> io.rename)
  • Added execution time limit (optional, must be enabled in luaconf.h)
  • Added content moderation

Standard Library:

  • Added io.makedirs

Standard Library (Soup):

  • Added base64
  • Added base58
  • Added base32
  • Added json

0.4.5

16 Dec 01:06
Compare
Choose a tag to compare
  • Improved wording of some warning & error messages
  • Fixed excessive "duplicate local declaration" warnings
  • Cherry-picked some Lua commits, so the following Lua bugs are now fixed:
    • 'break' may not properly close variable in a 'for' loop
    • error message in 'table.remove'
    • 'utf8.codes' accepts spurious continuation bytes
    • Negation in constant folding of '>>' may overflow
    • stack overflow with nesting of coroutine.close

0.4.4

11 Nov 19:53
Compare
Choose a tag to compare
  • Added math.rand as an alias for math.random
  • Changed unknown type hint to be warning instead of error
  • Reverted table.insert optimation due to unexpected behavior
  • Some minor tweaks

0.4.3

22 Oct 21:32
Compare
Choose a tag to compare
  • Improved most error messages, and vastly improved the internal code for them.
  • These reserved tokens can be used as identifiers outside of their functional context: default, case
  • Optimized the performance of table.insert. Roughly 3x faster, but still slightly slower than t[#t + 1]
  • Pluto can now be built using Sun.