v1.13.0
Overview
This is probably the largest release since the initial version of Numbat. The type checker has been rewritten completely and we now have full type inference in Numbat. You can read more about it here and in #443. This new type system also made it possible to add lists to the language. You can read more here and here. Another major feature is the possibility to add local variables in function definitions (by @irevoire). You can read more in #519 and #201.
One example to sum up the features in this new release is the following function:
fn breaking_distance(v) = v t_reaction + v² / 2 µ g0
where t_reaction = 1 s # driver reaction time
and µ = 0.7 # coefficient of friction
If you enter this function in the Numbat interpreter (try here), the new type inference engine will fill in all types:
fn breaking_distance(v: Velocity) -> Length = v × t_reaction + (v² / (2 µ × g0))
where t_reaction: Time = 1 second
and µ: Scalar = 0.7
Features
- Full type inference, list datatype by @sharkdp in #443
- Multiline functions: local variables by @irevoire in #519
- Make the reverse function call more useful by @irevoire in #518
- Calendar arithmetic for DateTimes by @sharkdp in #517
- Add simple numerical methods for root finding and differentiation by @sharkdp in #451
- Add coloring config argument by @T1mVo in #458
- More statistics, list and string functions by @sharkdp in #468
- Add sort_by_key by @sharkdp in #482
- Support string escape sequences by @sharkdp in #484
- Implement 'gcd' and 'lcm' by @sharkdp in #487
- Add source spans for assertion error messages by @sharkdp in #489
- Add a 'run' link to all examples in the documenation by @Bzero in #492
- Add ord(…) function by @sharkdp in #498
- Add trunc(…) function by @sharkdp in #499
- Add special symbols for arcmin, arcsec by @sharkdp in #500
- Add mixed-unit conversion functions by @sharkdp in #501
- Add support for Unicode subscript-number input by @sharkdp in #502
- Add julian_date conversions by @sharkdp in #508
Changes
- Change postfix apply operator from
//
to|>
by @sharkdp in #520 - Change quadratic_equation to return a list of solutions by @sharkdp in #450
- Better error message for empty string interpolations by @sharkdp in #474
Bugfixes
- fix: layout shifting after terminal loads by @hamirmahal in #446
- Fix 465 by @sharkdp in #473
- root_newton: Add max. iterations to prevent infinite loop by @sharkdp in #475
- Newlines before closing ']' should be allowed in list expressions by @maksimowiczm in #480
- Allow closing parens and newlines by @irevoire in #513
Misc
- Major speed-ups in the list implementation @irevoire in #515
- Show quotes for pretty-printed strings by @triallax in #440
- New example: How many photons are received per bit transmitted from Voyager 1? by @sharkdp in #453
- HasField constraints by @sharkdp in #461
- Make local timezone support optional by @eminence in #460
- Typo fix docs number notation by @mgenser in #472
- Refactor FFI module by @sharkdp in #476
- Fix clippy suggestions by @sharkdp in #477
- Faster lists by @sharkdp in #478
- Update dependencies by @sharkdp in #486
- Major documentation update by @sharkdp in #526
- Replace chrono with jiff by @sharkdp in #511
- refactor: remove redundant reference and closure by @hamirmahal in #444
- Add Repology packaging status badge to installation section of book by @triallax in #439
- Restructure test examples by @sharkdp in #488
- Readable types by @sharkdp in #493
- info: Print readable function signatures by @sharkdp in #497
- Auto-generated reference documentations (functions) by @sharkdp in #469
Units
- Add new heat energy units by @MugheesQasim in #495
New Contributors
- @T1mVo made their first contribution in #458
- @mgenser made their first contribution in #472
- @maksimowiczm made their first contribution in #480
- @MugheesQasim made their first contribution in #495
Full Changelog: v1.12.0...v1.13.0