Skip to content

0.6.0

Latest

Choose a tag to compare

@giann giann released this 01 Nov 12:05

This release brings a lot of useful tools to write buzz code (LSP, formatter and
DAP support) along with Windows support.

Note

This release builds with zig 0.17.0. We will only use tagged version
of zig from now on.

Added

  • Windows support (#74)
  • First working version of a LSP thanks to
    lsp-kit
    (#16)
  • First working version of the debugger that implements the
    Debugger Adapter Protocol
    thanks to buzz-language/dap-kit
    (#88)
  • Code formatter (buzz format)
    (#96)
  • Package manager (#85)
    • Package manifests with manifest.buzz and the new buzz:manifest std lib
      definitions
    • Package scaffolding with buzz init
    • Dependency fetching with buzz fetch, supporting git repositories, archives
      and local directories
    • manifest.lock.buzz lock files with resolved refs and dependency content
      hashes
  • match statement/expression for value matching with type-specific condition
    semantics (#80)
  • Enum name can be omitted if it can be inferred
    (final list: [Locale] = [ .fr, .it, .en ])
    (#360)
  • Object initialization name can be omitted if it can be inferred
    (final payload: Payload = .{ data "..." };)
    (#373)
  • When function call as one anonymous object literal argument, the parentheses
    can be omitted (callMe(.{ data = "..." }) becomes
    callMe .{ data = "..." }) (#372)
  • File polling API: File.getPoller, FilePoller (see example
    https://github.com/buzz-language/buzz/blob/main/tests/manual/007-fd-poller.buzz)
  • Shortcut operators: +=, -=, *=, etc.
    (#78)
  • rg.contains
  • map.hasKey
  • REPL highlights input as it's being written and format it once submitted
  • Added
    C header file
    for the buzz API (#309)
  • as! operator to force a cast and raise a runtime error when it fails

Changed

  • buzz binary now uses subcommands for tools and direct paths for execution
    • buzz <script.buzz> runs a standalone script
    • buzz -t <script.buzz> becomes buzz test <script.buzz>
    • buzz -f <script.buzz> becomes buzz format <script.buzz>
    • buzz <directory> runs src/main.buzz from a buzz package directory
    • buzz init and buzz fetch manage package scaffolding and dependencies
    • buzz will start the REPL
  • Extern libraries now must expose only one function which will be called by the
    compiler to lookup the functions of the library
  • int are now i48 instead of i32
    (#306). If you're wondering why,
    it's because all buzz values live in a NaN boxed f64 and the maximum bits
    available for an integer in there is 48. However, C ABI does not understand
    i48 so we're still stuck with i32 in FFI for now.
  • main signature can omit args argument
  • Maximum number of enum cases is now 16 777 215 instead of 255
  • pattern.matchAgainst returns now a list of
    obj{ start: int, end: int, capture: str } and matchAllAgainst a list of
    those lists
  • Tuples no longer require free form identifier to access their properties:
    tuple.@"0" can now be tuple.0
  • as? now warns when the cast target is already optional, and as! warns when
    used with an optional target
  • Removed map.next

Imports

  • Import don't rely on searchers any more, instead the import path provides a
    deterministic way of finding the imported script
    • buzz:<name> will look for a buzz's standard library <name>
    • pkg:<name>/path/to/<script.buzz> will look for the script under
      vendors/<name>/src/path/to/<script.buzz>
  • Selective import erases the imported namespace:
    import print from "buzz:std"; ... print("hello world");
  • Common part of imported namespace gets erased: if imported file as namespace
    a\b\c and importing script has namespace a\b, only c\ remains

Internal

  • JIT compiler works in a separate thread
  • Better JIT thresholds based of functions/hotspots complexity scores
  • The standard librairies are now statically loaded which gives a small speed
    boost
  • Build option -Dshow_perf now shows detailed rundown of the time spent in
    each component of buzz