1
1
mirror of https://github.com/tweag/nickel.git synced 2024-08-16 23:20:38 +03:00
nickel/RELEASES.md
Yann Hamdaoui 6015c8c0cb
Backport 1.4 release to master (#1755)
* Only update relevant deps in Cargo.lock

The release script needs to update Cargo.lock after having updated
Cargo.toml with the new version of various Nickel crates.

Indeed, we are running some checks via Nix, and Nix builds are sandboxed
without network access. This requires the Nix build to use `cargo
--frozen --offline`, which in turns require the Cargo.lock file to be
up-to-date or it will fail.

The previous version of the release script would do a simple `cargo
update`, which has the default of updating all dependencies. This commit
changes that to only udpate dependencies which we might have bumped.

* Add pause to commit release notes in release script

* Fix release script for LSP

The release script was missing a part: the removal of `lsp-harness` (a
local, unpublished util crates) from the nickel-lang-lsp package priori
to publication to crates.io.

Passing by, other small improvements and fixes are included as well.

* [release.sh] update to 1.4.0

* Specify 'do not commit' when updating release notes

* release guide: add missing step for lsp-harness removal
2024-01-11 09:15:16 +00:00

27 KiB

Version 1.4

Nickel 1.4 is a maintenance release, at the exception of a breaking change (see below).

Breaking changes

  • The curried dot operator added in Nickel 1.3 was implemented the wrong way: the arguments were flipped, meaning that (.) foo bar was bar."%{foo}" instead of the expected foo."%{bar}". While the initial flipped implementation seems more useful for piping operations using the reverse application operator |>, it's inconsistent with all other curried operators, where (<operator>) is always defined as fun x y => x <operator> y. To ensure consistency, and because the initial behavior was an oversight and not a conscious design decision, we decided to change the definition of (.) to match the other curried operator by flipping its arguments.

    To fill the gap, Nickel 1.4 introduces std.record.get with the same definition as the (.) introduced in Nickel 1.3. To migrate from 1.3 to 1.4, you can either flip the arguments of the curried dot as a function (.) whenever possible, or you can just replace it with the new std.record.get.

    (implemented by @yannham in https://github.com/tweag/nickel/pull/1752)

Tooling

Core language

Fixes

Version 1.3

Version 1.3 includes several new optimizations following reports of long evaluation time for medium-sized codebase. The command-line interface (CLI) has been reworked to be more user-friendly, at the cost of breaking changes: see below. Finally, the LSP has seen continuous improvement as well.

Breaking changes

  • @vkleen improved the CLI UX in numerous ways in https://github.com/tweag/nickel/pull/1632
    • The file argument is now argument positional. That is, instead of running nickel export -f config.ncl, now use nickel export config.ncl instead.
    • Every command which can take a file argument can now take several of them. The program parsed from the files are then merged before applying the action. For example, the new nickel export config1.ncl config2.ncl config3.ncl is the equivalent of the previous: nickel export <<< '(import "config1.ncl") & (import "config2.ncl") & (import "config3.ncl")'
    • Evaluation is now an explicit subcommand, instead of being the default action. Instead of running nickel -f config.ncl to evaluate a file, use nickel eval config.ncl instead.
  • Not a breaking change per se, because the customize mode is experimental, but @yannham introduced a new syntax for customize mode in https://github.com/tweag/nickel/pull/1709. Instead of dynamically generating a CLI where arguments are field paths, the new customize mode CLI directly take assignments written in a Nickel-like syntax as positional arguments. For example, in 1.2, the command nickel eval -f confing.ncl -- \ --input.field1 '"Value"' --input.flag false \ --override output.bar 0 now becomes nickel eval config.ncl -- \ 'input.field1="Value"' input.flag=false \ --override output.bar=0

Fixes

Tooling

Optimizations

Documentation

New Contributors

Version 1.2

Version 1.2 comes with several improvements on the LSP and other components of the Nickel tooling. The new customize mode of the CLI makes it possible to dynamically turn a configuration into a command-line interface, which you can interact with.

Several related long-standing issues and limitations when typechecking polymorphic functions are also finally fixed.

Core language

Fixes

Tooling

Stdlib

Documentation

Version 1.1

This version mostly includes bugfixes and stdlib improvement since 1.0.

IMPORTANT: The main crate nickel-lang has been split between nickel-lang-cli (the binary) and nickel-lang-core (the library). If you're using cargo to install Nickel, please uninstall the previous crate by running cargo uninstall nickel-lang, and from now one use cargo install nickel-lang-cli to install 1.1 and do further updates.

Stdlib

Tooling

Fixes

Version 1.0

This is the 1.0 release! The syntax and the semantics of the core language have been stabilized and shouldn't evolve as much in the future.

  • The core semantics of the language have been reworked and stabilized, in particular (but not limited to) merging, types and contracts with the implementation of RFC005
  • The stdlib has been augmented with many new functions
  • Parts of the syntax and some builtin symobls (types, stdlib functions, and so on) have been improved and made consistent
  • New features for the LSP, and in particular code completion

Breaking changes

  • Various functions from the stdlib have been renamed for better discoverability, and the stdlib got a lot of new additions. Please refer to the documentation of the stdlib.
  • String functions are now unicode-aware, and operate on the Unicode grapheme cluster abstraction instead of the character abstraction (string.length, string.is_match, etc.)
  • The switch keyword has been replaced by match, and can now be used as a standalone function (doesn't need to be applied right away)
  • The Num and Str builtin types have been renamed to Number and String by @yannham in https://github.com/tweag/nickel/pull/1164
  • The num and str stdlib modules have been renamed to number and string
  • The builtin.typeof function now returns 'Number, 'String, 'Function instead of respectively 'Num, 'Str, and 'Fun
  • The builtin.is_num, builtin.is_str and builtin.to_str functions have been renamed to is_number, is_string and to_string
  • The string.to_num and string.from_num functions have been renamed to to_number and from_number
  • All the stdlib modules array, string, record, etc. have been put under a std namespace. They must now be accessed as std.array, std.string and so on.
  • RFC005 was implemented, which changes the semantics of contract annotations and merging. See the RFC content for more details. Most notably, metadata annotation (default values, optional, documentation, etc.) can only appear next to a record field. Contract and type annotations can still appear anywhere. Documentation can still appear on let-bindings.
  • Use static dictionary types for record.fields and record.values by @matthew-healy in https://github.com/tweag/nickel/pull/1024
  • Make type annotations to not propagate through merging by @yannham in https://github.com/tweag/nickel/pull/1271
  • Change to dictionary contracts and introduction of a separate dictionary contract (in addition to dictionary type):
  • Stdlib string.Stringingable -> string.Stringable by @vkleen in https://github.com/tweag/nickel/pull/1180
  • Fix the type of array.elem by @yannham in https://github.com/tweag/nickel/pull/1223
  • Change the enum tag start delimiter from backtick to single-quote by @vkleen in https://github.com/tweag/nickel/pull/1279
  • import is now a statement, import "foo.ncl" arg1 arg2 requires parenthesis now: (import "foo.ncl") arg1 arg2, see https://github.com/tweag/nickel/pull/1293

Language features

Stdlib

Tooling

Fixes

Version 0.3.1 (2022-12-15)

Fixes

Version 0.3 (2022-12-07)

Fixes

Language features

Stdlib

Tooling

Performances

Version 0.2 (2022-07-29)

Breaking changes

  • Using a contract as part of a static type annotation will in most cases fail with an appropriate error message. This is a temporary limitation in order to fix previously unsound behavior in the typechecker. This restriction will likely be lifted in the upcoming 0.3.x release. For more details, see issues #701 and #724

Fixes

  • Fix unnecessarily restricted record contract for record.update
  • Fix wrong interpretation of long interpolation-like sequences %..%{ in strings
  • Fix panic when evaluating a switch in specific cases
  • Fix fields without definition being assigned to null, instead of just being marked as undefined

Language features

  • Merging null values together gives null, and merging empty lists together gives an empty list, instead of failing with error: non mergeable terms
  • Add recursive let-bindings (let rec)
  • Add type wildcards. Use _ in place of a type to let the typechecker fill the gap. Example: let foo : _ = array.all ((==) 2) [1,2,3]
  • Add builtin.to_str and string.from to convert generic values to a string
  • Re-introduce an official syntax for enum types

Tooling

  • Add the nickel pprint-ast command to pretty print a parsed program (mostly debugging purpose)
  • Add the nickel doc command to produce markdown documentation from the in-code doc metadata

Documentation

  • Fix various typos and remove use of deprecated syntax in the user manual

Version 0.1 (2022-03-10)

First release! The main focus has been the design of the Nickel language itself.

Language features

  • Gradual type system with row types, polymorphism and type inference
  • Contract system for data validation
  • Merge system for recursive records that supports one level of overriding
  • Metadata annotations (default values, documentation, etc.)
  • Unified syntax for terms, types and contracts (RFC002)
  • Record destructuring

Tooling

  • The main binary supports the following subcommands:

    • nickel query to show metadata and documentation of library functions, the field of a configuration, etc.
    • nickel export to serialize to JSON, YAML, or TOML
    • nickel repl to launch an REPL
    • nickel typecheck to do typechecking without evaluating
  • An LSP-server is included

Documentation

  • User manual sections on syntax, correctness (types and contracts), and merging
  • The standard library has been documented in-code (use nickel query/:query to retrieve it)

Known limitations

  • The roadmap for overriding and the merge system (RFC001) has not been implemented fully yet.

  • Performance has not been prioritized.

  • Due to the use of reference counting as a memory management strategy, mutually recursive record fields are currently leaking memory. This shouldn't be an issue in a standard workflow.

  • Standard library APIs and language features are subject to change. There is no backward compatibility guarantees for this version. In general, this release is meant for experimenting and getting user feedback, but isn't intended to be used in production.