v1.16.0
This version is a general code cleanup such that it relies less on obscure hacks unless those tricks provide genuine performance benefits. It should make the code base easier to follow for new contributors.
The minimum Rust compiler version is raised to 1.66.0
.
Potentially-breaking changes
- Limit functions (e.g.
max_operations
,max_array_size
etc.) as well asEngine::ensure_data_size_within_limits
are no longer exported underunchecked
. This should be the correct behavior instead of returningNone
or zero. - The type
OptimizationLevel
is no longer exported underno_optimize
. Originally it was mapped to()
underno_optimize
. - O/S features such as file access and time are no longer disabled when using
wasm32-wasi
(or any WASM target other thanwasm32-unknown
).
Bug fixes
- Fixes a panic when using
this
as the first parameter in a namespace-qualified function call. - Comparing two different data types (e.g. a custom type and a standard type) now correctly defaults to
false
(except for!=
which defaults totrue
). max
andmin
for integers, strings and characters were missing from the standard library. They are now added.
Dependencies
- Minimal version numbers for dependencies are now specified in
Cargo.toml
to avoid breaking changes in future versions. bitflags
is bumped to version 2.syn
inrhai_codegen
is bumped to version 2.hashbrown
(used inno-std
builds) is bumped to version 0.14.
Deprecated API's
ParseErrorType::MalformedCallExpr
andParseErrorType::MalformedInExpr
are deprecated and will be removed in the next major version.Module::get_custom_type
is deprecated in favor ofModule::get_custom_type_display_by_name
and other new methods.
New features
- New
exit
function that terminates script evaluation regardless of where it is called, even inside deeply-nested function calls. - Added
Engine::max_variables
andEngine::set_max_variables
to limit the maximum number of variables allowed within a scope at any time. This is to guard against defining a huge number of variables containing large data just beyond individual data size limits. Whenmax_variables
is exceeded a new error,ErrorTooManyVariables
, is returned. - Added
zip
function for arrays. - Added
on_print
andon_debug
definitions forTypeBuilder
. - Doc-comments are now included in custom type definitions within plugin modules. They can be accessed via
Module::get_custom_type_raw
. These doc-comments for custom types are also exported in JSON viaEngine::gen_fn_metadata_to_json
.
Enhancements
once_cell
is used instd
environments instead of the home-brewSusLock
which is removed.- Originally, unit tests use the
?
operator liberally to simplify code. However, this causes the loss of proper line numbers when a test fails, making it difficult to identify the exact location of the failure. This is now fixed by changing tounwrap()
. - Many inlined collections are turned back into
Vec
because they are not transient and do not appear to improve performance. UsingVec
seems to be yield better performance as it probably enables more compiler optimizations. - General code clean-up to remove optimizations tricks that are not obviously beneficial in favor of clearer code.