github sharkdp/numbat v1.13.0

latest releases: v1.23.0, v1.22.0, v1.21.0...
22 months ago

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

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

Units

New Contributors

Full Changelog: v1.12.0...v1.13.0

Don't miss a new numbat release

NewReleases is sending notifications on new releases.