Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

2024-01-11: Fuzion January Update

In an attempt to solve last month's Advent of Code challenge using Fuzion, a number of improvements of the standard library to improve usability and fix performance issues have been made.

Here is what happened in detail:

  • General
  • Fuzion language
    • When redefining an inherited feature, it is now enforced that the visibility is not restricted (#2233).

    • Syntax sugar for access to tuple elements now permits using t.0/t.1/... instead of t.values.0/t.values.1/...: One can now use

      t := (3,4)
      say (t.0 + t.1)
              

      instead of

      t := (3,4)
      say (t.values.0 + t.values.1)
              

      (#2392).

  • base library
    • io.buffered.read_string now may return io.end_of_file (#2227).

    • ctrie has been moved to the lock_free module (#2238).

    • The monoids all, any, and parity have been added to bool.type (#2287).

    • Many useful features have been made public:

      • ranges like codepoint.ascii #2289,
      • bool.as_option #2309,
      • io.buffered.read_bytes#2332,
      • function composition features like atop, flip, etc. defined in composition#2342,
      • (has_interval.infix ..).upper#2384,
      • String.trim#2374,
      • length and others in java.Array#2395.
    • option now inherits from Sequence (#2291).

    • time.durations.as_string has a fixed width now such that nice looking timing tables are easier to create (#2330).

    • A stack data type using local mutation is available now (#2351).

    • map and flat_map are now features of Sequence that produce a new Sequence. Specific variants for array or list that produce an array or a list have been renamed as map_to_array and map_to_list, etc., resp. (#2317).

    • count and drop were redefined for array backed sequences to achieve O(1) performance (#2337).

    • reverse, map_pairs, fold1, and foldf were added to Sequence (#2341).

    • Unused features were removed from effects.fz (#2352).

    • For debugging of functions, a feature log was added which is like say, but instead of returning unit, it returns its argument (#2297).

    • Output of list.as_string has been improved for empty entries (#2314).

    • Performance improvements for io.stdin and io.buffered.reader (#2343).

    • Pipe operators |>, ||>, |||>, etc. have been added (#2355), so you can now do things like

      (3,4) ||> (+) |> say
              

      which will first destructure the tuple into 3 and 4, then apply infix + to add these and pass the result as an argument to say.

  • Front end
    • this.type can now be used inside of the corresponding type feature (#2296).

    • Support for partial application with type parameters has been implemented (#2355). This was required, e.g., for the pipe operator to work with partial application as in

      "Hello" |> say.
              

    • Error output for this-types now uses xyz.this instead of xyz.this.type to match the current syntax (#2356).

    • Fixed type inference for numeric literals wrapped in a lazy value (#2363).

    • Fixed false detection of ambiguous code due to partial applications (#2298).

    • Improved type inference for function argument types (#2316).

    • Mark result clazz of intrinsic constructor as instantiated, this paves part of the way for fzjava integration with the JVM backend (#2394).

  • Middle end
    • Reduce recursion depth of CFG and DFA to improve performance and avoid stack overflows (#2338).

    • Fixed null-pointer exceptions and check-condition failures (#2357).

  • C back end
    • Enable -fno-omit-frame-pointer by default to enhance debugging (#2373).

Cheers,

--The Fuzion Team.