Skip to content

Wisp v0.50.0 "Sunrise"

Latest

Choose a tag to compare

@Gui97p Gui97p released this 26 Nov 17:58
· 3 commits to main since this release

The standard library has been almost entirely rebuilt, and the language gained what it needed to be pleasant to use. This is the first version that is ready to hand to other people.

Language

  • defer that propagates an error (defer file.close()!), and for x in v! over a next() that can fail.
  • yield :label to leave a block with a value, so break is only for loops.
  • switch type with several types in one arm (case *A, *B v), and checked interface conversion ((?*T)(x)).
  • Inline formatting inside the string, "{total:08.2f}", with the spec after a colon.
  • Imports per file, dynamic interfaces with #dynamic, a reworked C interop (#symbol, #fails), and errors with messages built at run time.

Standard library

  • fmt: just print, println, fprint and fprintln, writing to any io.Writer, with Display for your own types.
  • io: Reader, Writer, buffered versions, Scanner, discard, limitReader and teeWriter.
  • conv: exact parseFloat, writing to any Writer, and text in any base. Constructors take the allocator first.
  • os: a single File API, the same on Linux and Windows.
  • strings and seq: strings.Builder, strings.split and seq.Vec.
  • New: time with Duration and Stopwatch, and rand with range(1..=6), shuffle and seeded generators.

Tooling

  • wisp test prints one line per test, status module name, without extra punctuation.
  • The language server no longer shows wrong colors after a syntax error, and no longer reports unknown types when you open standard library files.