Releases: tweag/nickel
v1.14.0
Version 1.14 (2025-10-02)
Nickel 1.14 has no core language changes. It adds position information to
YAML documents, so that if some imported YAML breaks a contract then Nickel
can blame the correct location in the YAML file. Nickel's LSP has had some
bugfixes (thanks to @L0r3m1p5um), fixing a crash and avoiding stale data.
LSP
- Implement textDocument/didClose method for LSP by @L0r3m1p5um in #2323
- Pass sources from World into background eval by @L0r3m1p5um in #2338
- Avoid copying file contents in LSP eval by @L0r3m1p5um in #2347
- Fix crash in NLS when creating typechecking diagnostics by @L0r3m1p5um in #2357
- Fix performance of UsageLookup by @jneem in #2339
Tooling
- Allow index packages to live in subdirectories of the repo by @jneem in #2315
- Convert to saphyr for positions in yaml by @jneem in #2332
- Initial public api rfc by @jneem in #2337
- Clean up Ident conversions to reduce accidental allocations by @jneem in #2341
- Declare MSRV as 1.85 by @brandonweeks in #2364
- Narrow serde_with features by @brandonweeks in #2366
- Bump malachite to version 0.6 by @brandonweeks in #2367
- Bump toml to version 0.9 and toml_edit to version 0.23 by @brandonweeks in #2368
- Plumb custom_transform into EntryState to minimize traversal by @twitchyliquid64 in #2346
- Restore the static nix release jobs by @jneem in #2373
Documentation
New Contributors
- @brandonweeks made their first contribution in #2364
- @twitchyliquid64 made their first contribution in #2346
Full Changelog: 1.13.0...1.14.0
v1.13.0
LSP
- Fix cache miss when pulling source file by a relative path by @L0r3m1p5um in #2276
- Publish diagnostics for parsing errors in imported files by @L0r3m1p5um in #2299
Tooling
- Wrap App arguments in atoms by @jneem in #2287
- Print more information for git errors by @jneem in #2283
- [RFC007] Improve the runtime value representation (not yet used by the interpreter) by @yannham in #2282, #2288, #2290, #2297, #2303
- Add format --check by @bthmc in #2309
- [nix-experimental] Provide the proper base path to Nix with
%eval_nix%by @yannham in #2314
Documentation
- Fix formatting of doc/manual/package-management.md by @yannham in #2274
- Fix missing package field in package manual example by @yannham in #2275
- Update examples to use latest Nickel idioms by @yannham in #2289
New Contributors
Full Changelog: 1.12.2...1.13.0
1.12.2
1.12.1
[EDIT: this release is strictly identical to 1.12.0; the pkg fix is actually not included. We keep it to avoid messing with package managers relying on release events, but you should use 1.12.2 instead for the pkg fix]
Fix the generated package-enabled binary artifacts (with -pkg). They didn't include the package management experimental feature as initially advertised in 1.12.0 due to an error in the build workflow.
1.12.0
Version 1.12 (2025-06-04)
Nickel 1.12 includes the long-awaited addition of field punning, in the form of include expressions, which makes it easy to re-use a variable as a record field without running into infinite recursion errors or clumsy renamings. If foo is a symbol in the environment (e.g. a variable defined earlier or a function parameter), one can now write { include foo } instead of having to write let foo_ = foo in { foo = foo_ } to put it in a field with the same name. See the syntax section of the manual for more details.
The Nickel CLI now accepts any supported configuration format as file input, making the nickel binary a possible merge engine for JSON, YAML or TOML configurations. for example, nickel export conf1.json conf2.toml --format YAML --output result.yaml will merge a JSON configuration and a TOML configuration into a YAML one using Nickel's merge semantics. Together with the just added --apply-contract argument, it's also possible to use Nickel as a non-invasive validator for existing configurations without needing to convert them to Nickel first. For example, nickel eval config.json --apply-contract schema.ncl will validate config.json against the Nickel contract schema.ncl.
Core language
- [Feat] Field punning (include expressions) by @yannham in #2241
- [Feat] Support annotations on included expressions by @yannham in #2252
LSP
- Add context to error opening trace file in nls by @L0r3m1p5um in #2244
- Update behavior of debugLog flag in VSCode extension by @L0r3m1p5um in #2257
- Filter out LSP diagnostics for labels with no message by @jneem in #2263
Tooling
- Improved error message when subtyping an inhomogeneous record as a dict by @jneem in #2234
- Only output up to 10 warnings by @jneem in #2239
- Negation error messages by @jneem in #2242
- [Feat] Add
--apply-contractargument to the CLI by @yannham in #2266 - [Feat] Determine the format automatically for input files on the CLI by @yannham in #2267
Fixes
- Don't quote enum tag keywords by @jneem in #2232
- Remove the unused merge keyword by @jneem in #2243
- Bigger stack on windows by @jneem in #2260
New Contributors
- @L0r3m1p5um made their first contribution in #2244
Full Changelog: 1.11.0...1.12.0
1.11.0
Nickel 1.11 includes a new experimental package manager. It is integrated directly in the normal Nickel binary, but is not enabled by default: you either need to use a package-enabled pre-built binary (ending with -pkg) or build Nickel from source with the feature package-experimental. Please refer to the new package management chapter of the manual for more details.
Nickel 1.11 also includes a number of additions to the stdlib, improvements in tooling (environment variable passing), the stdlib, the contract system, and string interpolation (many cases don't need the explicit std.to_string anymore). See the detailed changelog below for more details.
The large refactoring splitting up the internal representation into two intermediate representations, started a few minor versions ago and paving the ground for a more efficient interpreter, has been completed. Users should not see much difference, although it already leads to better information in the LSP.
Breaking changes
-
The typechecking of chains of imports has been modified due to the migration to a new internal intermediate representation. Before, when importing file A in a statically typed block, if the imported file was itself a single import of B, and B contained, say, the number
2, then the typechecker would follow the chain and infer the typeNumberfor the initial import of A. Now, the typechecker only looks at the apparent type of A but doesn't follow imports chains further. If the import expression in A doesn't have a type annotation, as inimport "B.ncl", its type will be inferred to beDyninstead.If this breaks your code, the solution is to add missing type annotations to the intermediate imports, here
import "B.ncl" : Number.
Core language
- Allow custom contracts to customize the label by @jneem in #2176
- Automatically convert interpolated values to string by @yannham in #2195
Documentation
Stdlib
- Adds a Matches contract to std.string by @jneem in #2172
- Adds a FieldsMatch contract for validating record fields against a regex by @jneem in #2174
- Add std.cast by @jneem in #2184
LSP
- Bump the VSCode extension to 0.4 by @yannham in #2162
- Support pull diagnostics and use them for testing by @jneem in #2166
- ADT and package management improvements in nls by @jneem in #2217
Tooling
- Add support for environment variables sigil
@envon the command line by @yannham in #2201 - Experimental package manager:
Fixes
1.10.0
Nickel 1.10 includes various bug fixes and quality of life improvements. Nickel now comes with more prebuilt binary packages (adding Windows and arm-based MacOS), is now built with LTO (Link-Time Optimization), and comes with official python bindings to be published on PyPI together with this release.
Under the hood, a lot of work has been devoted to internal refactorings in order to prepare the implementation of a bytecode compiler and virtual machine (RFC007). Those changes shouldn't have any noticeable effects currently for users.
Breaking changes
-
Record freezing (#2113, #2131). To fix an unsound and unexpected behavior appearing when first altering a record with dictionary operations (
std.record.remove,std.record.insertorstd.record.update- see #1877) and then overriding it, the aforementioned stdlib operations now freeze the returned record, which removes the possibility of performing further recursive overriding.Typically, the record returned by one of those operations is a static dictionary instead of a record with recursive dependencies. While you can still override specific fields through merging, the information about internal dependencies is lost and their reverse dependencies won't be updated automatically.
Documentation
- Mention any_of as alternative to enum by @yannham in #2119
- Link to the CLI chapter in the manual intro by @yannham in #2144
Stdlib
- Add the package std module by @jneem in #2104
- Fix empty capture groups in regexes by @jneem in #2109
- Add
filter_map,dedupand some variants to the stdlib by @yannham in #2120
LSP
Tooling
- Add support for packages to nickel-lang-core by @jneem in #2094
- Add support warnings by @jneem in #2086
- Fixed
Debugimpl ofEvalOrDeserErrorprinting entire source of files by @rben01 in #2118 - Do deep eval for doctests by @jneem in #2110
- pass thru feature
nix-experimentalby @KiaraGrouwstra in #2132 - Add github action for packaging and publishing python packages to PyPI (#1592) by @vlcek in #2126
- Include a release artifact for nls by @jneem in #2139
- Update rustyline to 15.0 by @neuschaefer in #2142
- Add LTO to static builds by @jneem in #2147
- Add import_paths parameter to Python bindings by @yannham in #2157
New Contributors
- @rben01 made their first contribution in #2098
- @KiaraGrouwstra made their first contribution in #2132
- @vlcek made their first contribution in #2126
- @neuschaefer made their first contribution in #2142
Full Changelog: 1.9.1...1.10.0
1.9.1
1.9.0
Nickel 1.9 includes various bug fixes and quality of life improvements.
Noteworthy additions are:
- let-blocks: declaring several variables at once instead of chaining
let ... in ... - explicit import: the ability to specify explicitly the format of an imported
file (it was based on the file extension implicitly and would default
to Nickel), e.g. asimport "foo.txt" as 'Jsonorimport "bar.ncl" as 'Text. - the addition of a
nickel testcommand that can extract snippets from the
in-code documentation (the| docmetadata) together with their expected
result and run them. The feature is detailed in a new CLI chapter of the user
manual.
Two important future evolutions have been designed and discussed through RFCs:
package management and a performant bytecode virtual machine. Those features
aren't implemented yet, but the initial designs have been agreed upon.
Breaking changes
- Formatting: the formatting of let bindings has been fixed and improved. To
avoid a large, irrelevant diff on your next commits, we advise formatting your
whole codebase first after upgrading to 1.9 in a separate commit.
Core language
- Let blocks by @jneem (#2010,
#2031,
#2051) - Fix unsound record contract deduplication by @yannham in #2042
- Explicit import format:
import "sample.html" as 'Textby @vi
(#2036,
#2070) - Thunks for resolved imports (detect import infinite loops and avoid work duplication) by @jneem in #2052
- Use a persistent vector to represent arrays instead of an
Rc<[..]>by @jneem in #2057
Documentation
- Add a manual chapter for the cli. by @jneem in #2065
- [RFC006] Package management by @jneem in #1983
- [RFC007] Bytecode interpreter by @yannham in #2045
LSP
- Remove the option for an external formatter in nls by @jneem in #2064
- Fix completions in incomplete field name position. by @jneem in #2069
- Bound the length of nls completions by @jneem in #2073
Tooling
- Add
--formatargument tonickel querycommand by @suimong in #2015 - Adds a
nickel testsubcommand for testing examples in docs. by @jneem in #2020 - Detect infinite recursions in
nickel docby @yannham in #2055 - Strict typechecking mode by @jneem in #2077
- Switch to toml-edit for spanned deserialization fixing TOML deserialization bug by @jneem in #2074
- Make serde-wasm-bindgen optional in core by @akavel in #2089
- Move 'clap' crate dependency behind feature flag in core by @akavel in #2090
New Contributors
- @vi made their first contribution in #2036
- @epompeii made their first contribution in #2087
- @akavel made their first contribution in #2089
Full Changelog: 1.8.1...1.9.0
1.8.1
This releases includes a fix to a bug discovered by @alialabbas, which has been introduced in 1.3.0 with the contract deduplication optimization.
The contract deduplication optimization would eliminate some contracts unduly, because the optimizer wrongly deemed them equivalent to another contract already applied to the same value. This could result in some record contracts being potentially silently ignored in specific conditions, letting wrong values slip through.
See #2041 for more details.