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_sizeetc.) as well asEngine::ensure_data_size_within_limitsare no longer exported underunchecked. This should be the correct behavior instead of returningNoneor zero. - The type
OptimizationLevelis 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
thisas 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). maxandminfor 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.tomlto avoid breaking changes in future versions. bitflagsis bumped to version 2.syninrhai_codegenis bumped to version 2.hashbrown(used inno-stdbuilds) is bumped to version 0.14.
Deprecated API's
ParseErrorType::MalformedCallExprandParseErrorType::MalformedInExprare deprecated and will be removed in the next major version.Module::get_custom_typeis deprecated in favor ofModule::get_custom_type_display_by_nameand other new methods.
New features
- New
exitfunction that terminates script evaluation regardless of where it is called, even inside deeply-nested function calls. - Added
Engine::max_variablesandEngine::set_max_variablesto 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_variablesis exceeded a new error,ErrorTooManyVariables, is returned. - Added
zipfunction for arrays. - Added
on_printandon_debugdefinitions 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_cellis used instdenvironments instead of the home-brewSusLockwhich 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
Vecbecause they are not transient and do not appear to improve performance. UsingVecseems 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.