For several releases now, the runtime representation of Nickel expressions has been completely reworked behind the scenes for improved performance. Nickel 1.15 is the first version to migrate to the new representation. Our microbenchmarks show run time improvements since 1.14 on every single benchmark, ranging from 10% to 65%. On a large real-world configuration that was supplied to us by a user, run-time decreased by 35% and peak memory usage decreased by 50%. Most of these performance improvements were implemented in #2302. As always, the impact on your specific codebase may vary.
This release is also the first to provide a public API for Nickel as a library. Some intrepid users were already embedding the nickel-lang-core crate, and this remains the only way to access certain internal features. However, we hope that most users will find it easier to use the nickel-lang crate (published at initial version 2.0.0, repurposed from the former all-in-one Nickel crate), which is simpler, better documented, and more stable. We also now have a public C API: the header file is available as a release artifact, as are pre-built libraries for various architectures. Finally, a go-lang API is available at https://github.com/nickel-lang/go-nickel.
Breaking changes
- Add a YamlDocuments export format by @jneem in #2445
This change adds a new supported format'YamlDocumentstostd.serializeandstd.deserialize. While standard calls toserializeordeserializeshould not be impacted even in statically typed code, this can be a breaking change if you copied the stdlib's format enum type in an annotation, for example:my_serialize : [| 'Json, 'Yaml, 'Toml, 'Text |] -> [...]. In this case, you must update such enum types. Run any evaluation or typehecking command on your codebase and simply let the typechecking errors guide you.
LSP
- NLS completions can now see through the built-in any_of, all_of and Sequence contracts by @jneem in #2391
- NLS can now report errors in YAML files by @jneem in #2383
- Better error messages for incomplete records, thanks to typechecking changes by @L0r3m1p5um in #2439
Tooling
- New public rust and C apis by @jneem in #2378 and #2360
- Add locations to json by @jneem in #2382 and #2388
- Add note to error when arrays are merged piecewise in a record by @L0r3m1p5um in #2420
- Better error message for undefined record field by @jneem in #2427
- Allow the input format of stdin to be specified in the CLI by @L0r3m1p5um in #2435
- Adds a convert command by @jneem in #2437
Performance
- [RFC007] Migrate to the new compact value representation by @yannham in #2302
- [RFC007] Reduce
Termsize, chapter: functions by @yannham in #2409 - [RFC007] Reduce
Termsize, chapter:letby @yannham in #2410 - [RFC007] Reduce
Termsize, chapter: recursive records (revival) by @yannham in #2413 - [RFC007] Reduce
Termsize, chapter:Op1,Op2&OpNby @yannham in #2414 - [RFC007] Reduce
Termsize, chapter:Sealedby @yannham in #2415 - [RFC007] Reduce
Termsize, chapter:Annotatedby @yannham in #2416 - Fix large error types in
coreby @yannham in #2417 - [RFC007] Reduce
Termsize, chapter: errors by @yannham in #2421 - perf: reduce memory consumption of the stack by @yannham in #2442
- perf: optimize term and metadata representation by @yannham in #2451
- Pattern compilation improvements by @jneem in #2443 and #2453
- perf: store thunk data directly in value blocks by @yannham in #2455
- perf: rework ref counting to look like std::rc::Rc by @yannham in #2456
- perf: remove useless reserve by @yannham in #2457
- perf: optimize the label representation by @yannham in #2448
- perf: buffer output by @jneem in #2466
Stdlib
- Add base64 encoding and decoding functions to stdlib by @L0r3m1p5um in #2444
Full Changelog: 1.14.0...1.15.0