v1.26.0
Version 1.26.0
Added 3
- Add the experimental Rhai Grain bytecode compiler and VM, gated behind the `grain` feature flag, for fast evaluation of scripts
- The `serde` and `metadata` features can now be used in `no-std` builds
- Allow `no-std` builds for WASM
Changed 1
- `BloomFilterU64` takes the size of its bit array as a `const` generic parameter instead of being hard-coded to 256 slots (32 bytes) signature changed · inferred, marked in the notes below
Fixed 6
- Fix a serious optimizer bug that erroneously removed statements involving variable access which should be considered side effects
- Fix function pointers called in method-call style with curried arguments, which were passed to native Rust functions in the wrong order
- Fix `switch` statement failing to try ranges when all exact-match conditions fail
- Fix `switch` statement failing to match shared values
- Fix optimizer failing to optimize closures
- Fix `Engine::compact_script` generating invalid compacted scripts due to missing spaces between ambiguous operators
1 change to check, marked in the notes below
From Rhai
This is a significant release.
The major change in this version is the addition of the experimental Rhai Grain bytecodes VM for faster evaluation of scripts under resource constraints.
This is experimental and gated under the grain feature flag.
Rhai Grain VM
- Add the experimental Rhai Grain bytecodes compiler and VM (requires the
grainfeature) for fast evaluation of scripts (thanks@ImTheSquid#1109).
Bugs found in the process
Since the Rhai Grain VM must run a script exactly the same as the standard AST interpreter, a number of bugs have been uncovered that are now fixed.
- Fixes a very serious bug in optimizer that erroneously removes statements involving variable access which should be considered side effects (
#1126). - Fixes a serious bug with function pointers being called in method-call style with curried arguments; the arguments were passed to a native Rust function in the wrong order. (
#1139). - Fixes bug in
switchstatement that fails to try ranges when all conditions of exact matches fail (#1117). - Fixes bug in
switchstatement that fails to match shared values (#1123). - Fixes bug in optimizer that fails to optimize closures (
#1114).
Bug fixes
- Fixes bug in
Engine::compact_scriptthat generates invalid compacted scripts due to missing spaces between ambiguous operators (thanks@yuvalrakavy#1106).