Releases: PlutoLang/Pluto
Releases · PlutoLang/Pluto
0.6.1
- 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
- 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
- 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 toNAME = function
)
- 'class' and 'local class' statements also support
- 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
- 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
beforecase
ordefault
causing a syntax error - Fixed access violation on lua_close with strings as default parameters
0.5.3
- 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
0.5.1
- 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
- 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
- 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
0.4.3
- 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 thant[#t + 1]
- Pluto can now be built using Sun.