* Version bump: 1.0.0 -> 1.1.0 * Add release notes for 1.1 * Bump version - part 2, reset to 0.1 for new crates * Add missing README to nickel-lang-cli * Update Cargo.lock, make nickel-wasm-repl's version consistent * Update releasing instructions for new crate layout * Fix typo in RELEASES.md * Update Cargo.lock
15 KiB
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
- Encode more pre-conditions of stdlib functions as additional contracts, replacing dynamic type errors with nice contract errors by @yannham in https://github.com/tweag/nickel/pull/1358
- ArraySliceFun incorrectly excluded the length of the array as the end index by @vkleen in https://github.com/tweag/nickel/pull/1396
Tooling
- Improve the pretty printing of terms in the CLI and within error messages by @vkleen in https://github.com/tweag/nickel/pull/1262
- Fix LSP panic when importing JSON by @yannham in https://github.com/tweag/nickel/pull/1382
- Fix LSP hanging under certain conditions involving external imports by @yannham in https://github.com/tweag/nickel/pull/1390
- Better error message when contract makes certain rows illegal by @Radvendii in https://github.com/tweag/nickel/pull/1323
- Fix function params hovering in the LSP by @yannham in https://github.com/tweag/nickel/pull/1395
- Fix LSP infinite loop on hovering on external imports by @yannham in https://github.com/tweag/nickel/pull/1397
Fixes
- Fixes incorrect variable names in type mismatch errors by @vkleen in https://github.com/tweag/nickel/pull/1313
- Improve error messages for polymorphic tail parametricity violations by @matthew-healy in https://github.com/tweag/nickel/pull/1320
- Fix panic on duplicated top-level idents in record destructuring by @matthew-healy in https://github.com/tweag/nickel/pull/1324
- Prevent panic when parsing record type with field path by @matthew-healy in https://github.com/tweag/nickel/pull/1325
- Give a better error message when trying to query a non-record by @jneem in https://github.com/tweag/nickel/pull/1326
- Fix error position by @jneem in https://github.com/tweag/nickel/pull/1333
- Fix panic when interpolating fields in a record type by @jneem in https://github.com/tweag/nickel/pull/1332
- Fix type annotations not generating contracts by @yannham in https://github.com/tweag/nickel/pull/1379
- Fix typechecker looping by adding missing check for unifying equal type vars by @yannham in https://github.com/tweag/nickel/pull/1400
- Fix panic on function contract failure (position of arrow functions not set) by @yannham in https://github.com/tweag/nickel/pull/1407
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 bymatch
, and can now be used as a standalone function (doesn't need to be applied right away) - The
Num
andStr
builtin types have been renamed toNumber
andString
by @yannham in https://github.com/tweag/nickel/pull/1164 - The
num
andstr
stdlib modules have been renamed tonumber
andstring
- The
builtin.typeof
function now returns'Number
,'String
,'Function
instead of respectively'Num
,'Str
, and'Fun
- The
builtin.is_num
,builtin.is_str
andbuiltin.to_str
functions have been renamed tois_number
,is_string
andto_string
- The
string.to_num
andstring.from_num
functions have been renamed toto_number
andfrom_number
- All the stdlib modules
array
,string
,record
, etc. have been put under astd
namespace. They must now be accessed asstd.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
andrecord.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):
- Fix dictionary contract semantics by @vkleen in https://github.com/tweag/nickel/pull/1141
- Introduce dictionary contracts by @yannham in https://github.com/tweag/nickel/pull/1272
- 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
- Symbolic strings by @matthew-healy in https://github.com/tweag/nickel/pull/994
- [RFC005] Lazy propagation by @yannham in https://github.com/tweag/nickel/pull/1086
- Non-exported record fields by @vkleen in https://github.com/tweag/nickel/pull/1132
- Enrich label custom reporting data by @yannham in https://github.com/tweag/nickel/pull/1152
- Use type annotations in record patterns during typechecking by @matthew-healy in https://github.com/tweag/nickel/pull/1176
- Use arbitrary precision rationals as the underlying representation of numbers by @yannham in https://github.com/tweag/nickel/pull/1182
- Allow equal arrays to be merged in order to make merge idempotent by @yannham in https://github.com/tweag/nickel/pull/1229
- Use deterministic hashtables, making runtime errors and typechecking error deterministic by @yannham in https://github.com/tweag/nickel/pull/1235
Stdlib
- Add a %trace% primop (and
std.trace
function) by @vkleen in https://github.com/tweag/nickel/pull/1055 - Add
std.contract.Equal
contract to the stdlib by @yannham in https://github.com/tweag/nickel/pull/1203
Tooling
- Display meta information when providing completion in https://github.com/tweag/nickel/pull/966
- LSP completion for import terms by @ebresafegaga in https://github.com/tweag/nickel/pull/993
- Fix LSP server not giving completion when a non-contract meta-information is present in a declaration by @ebresafegaga in https://github.com/tweag/nickel/pull/991
- Fix LSP not giving completion when an identifier is prefixed by a delimiting character by @ebresafegaga in https://github.com/tweag/nickel/pull/1043
- Improve the "goto definition" feature of the LSP by making it work across multiple files by @ebresafegaga in https://github.com/tweag/nickel/pull/1029
- Add --color option to the CLI by @matthew-healy in https://github.com/tweag/nickel/pull/1033
- Make the "find references" feature of the LSP work across multiple files by @ebresafegaga in https://github.com/tweag/nickel/pull/1037
- Add support for LSP completion using the surrounding context by @ebresafegaga (context completion) in https://github.com/tweag/nickel/pull/1057
- Support completion for field names inside recursive records. by @ebresafegaga in https://github.com/tweag/nickel/pull/1088
- Improve contract violation error reporting by @ebresafegaga in https://github.com/tweag/nickel/pull/1139
- Add a JSON documentation export option by @vkleen in https://github.com/tweag/nickel/pull/1209
- Add support for formatting capabilities to the LSP by @ebresafegaga in https://github.com/tweag/nickel/pull/1216
Fixes
- Do not panic on type path mismatch by @yannham in https://github.com/tweag/nickel/pull/1028
- Fix multiline string interpolation when preceded by a
"
character by @matthew-healy in https://github.com/tweag/nickel/pull/1023 - Improve the performance of
std.array.fold_left
andstd.array.fold_right
by @vkleen in https://github.com/tweag/nickel/pull/1075 - Correctly type identifiers introduced in destructuring patterns by @matthew-healy in https://github.com/tweag/nickel/pull/1099
- Always include fields with a value in
record.fields
by @vkleen in https://github.com/tweag/nickel/pull/1225 - Make partially applied boolean operators work by @vkleen in https://github.com/tweag/nickel/pull/1282
Version 0.3.1 (2022-12-15)
Fixes
- Fix blame error when calling
string.find
by @euank in https://github.com/tweag/nickel/pull/988
Version 0.3 (2022-12-07)
Fixes
- Fix polymorphic contracts unduly changing semantics by @ebresafegaga in https://github.com/tweag/nickel/pull/802
- Fix typechecking and unification in presence of flat types (aka opaque types, aka contracts) by @yannham in https://github.com/tweag/nickel/pull/766
- Fix polarity for polymorphic contract failure by @ebresafegaga in https://github.com/tweag/nickel/pull/831
- Fix panic when a row mismatch occurs while unifying row tails by @matthew-healy in https://github.com/tweag/nickel/pull/847
- Fix type to term conversion causing unbound type variables errors by @francois-caddet in https://github.com/tweag/nickel/pull/854
- Fix bad lexing of enum tags by @matthew-healy in https://github.com/tweag/nickel/pull/874
- Fix multiple recursive overriding by @yannham in https://github.com/tweag/nickel/pull/940
Language features
- Optional fields by @yannham in https://github.com/tweag/nickel/pull/815
- Numeral merge priorities by @yannham in https://github.com/tweag/nickel/pull/829
- Recursive merge priorities (or push-priorities, or leafy priorities) by @yannham in https://github.com/tweag/nickel/pull/845
- Change
switch
tomatch
and make it a proper function by @yannham in https://github.com/tweag/nickel/pull/970
Stdlib
- Statically type
string.join
by @matthew-healy in https://github.com/tweag/nickel/pull/946
Tooling
- Add record completion in the LSP by @ebresafegaga in
- Add completion for Nickel's stdlib in the LSP by @ebresafegaga in https://github.com/tweag/nickel/pull/918
Performances
- Lazy array contracts by @fuzzypixelz in https://github.com/tweag/nickel/pull/809
- Array slices by @fuzzypixelz in https://github.com/tweag/nickel/pull/776
- String interning for identifiers by @Acaccia in https://github.com/tweag/nickel/pull/835
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
andstring.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-codedoc
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 TOMLnickel repl
to launch an REPLnickel 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.