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

2024-04-11: Fuzion April Update

Last month brought massive improvements in the internal plumbing of the Fuzion implementation. Important improvements include automatic unwrapping for, eg., mutable or atomic values, removal of the stateful base library feature Stream in favor of stateless list, increased accuracy of data flow analysis for effects, and Java interface support for the C backend.

  • General
  • Documentation
    • Minor fixes in the reference manual (#2741).

    • Added MacOS section to readme (#2783).

  • Build infrastructure
    • Reduced level of parallelism of test runs (#2632)

    • Added test-class dfa for tests not requiring backend (#2690)

    • Fixed MacOS build problem related to libjvm.dylib (#2727)

    • Added makefile target to fix Java imports (#2823)

  • Fuzion language
    • Support for automatic unwrapping of values (#2644). This enables using values of types like mutate.new or atomic directly without explicit unwrapping using v.get.

    • Functions and constructors declared using { } now also require the is keyword or an arrow => (#2655, #2657, #2658, #2774).

    • Allow then to be placed at minimum indentation (#2656). This permits code as follows:

            if a=b
            then
              say "equal"
            else
              say "not equal"
              
  • base library
    • A new feature auto_unwrap can be used to enable automatic unwrapping for arbitrary features (#2644).

    • Added features array2.transpose and array2.type.create2 (#2663).

    • Renamed id(T) as identity(T) (#2705). This enables partial application for id(T,x) to do things like l.filter id on a Sequence bool, which was not possible before since the reference to id was ambiguous.

    • Added precondition for array.slice (#2736).

    • Increased buffer size in file.read to 4K (#2737).

    • Removed feature Stream since it require mutable state (#2769). Instead, list should be used to iterate a Sequence.

    • Minor implementation improvements (#2739, #2757, #2772, #2776, #2784, #2793, #2818, #2819).

  • Front End
  • Fuzion Intermediate Representation
    • Improved quality of dumped intermediate code (#2692, #2706).

      Here is an example output:

               > ./build/bin/fz -XdumpFUIR -e "for a := 1, a+1 while a < 10 else say a" | tail -n 30
              Code for #loop0(outer universe#0, a i32) unit
              l3:	0: Current
              	1: Call #loop0.a(outer #loop0) i32
              	2: Const of type i32 00 00 00 04 0a 00 00 00
              	3: Call infix < i32(outer universe#0, a i32, b i32) bool
              	4: Match 0=>l1 1=>l2
              l1:	0: Current
              	1: Call #loop0.a(outer #loop0) i32
              	2: Const of type i32 00 00 00 04 01 00 00 00
              	3: Call i32.infix +(outer i32, other i32) i32
              	4: Current
              	5: Assign to #loop0.a
              	6: Current
              	7: Call #loop0.a(outer #loop0) i32
              	8: Call #loop0(outer universe#0, a i32) unit
              	9: Current
              	10: Assign to #loop0.#exprResult0
              	goto l3_4
              l2:	0: Current
              	1: Call #loop0.a(outer #loop0) i32
              	2: Box i32 => ref i32
              	3: Call say(outer universe#0, s Any) unit
              	4: Current
              	5: Assign to #loop0.#exprResult0
              	goto l3_4
              l3_4:
              	7: Current
              	8: Call #loop0.#exprResult0(outer #loop0) unit
              	9: Current
              	10: Assign to #loop0.#result
              
    • Added support for a site, i.e., a code position in a class (#2752).

    • Minor implementation improvements (#2447, #2610, #2651, #2659, #2660, #2666, #2669, #2672, #2674, #2688, #2723, #2815, #2820)

  • Data Flow Analysis
    • Tailcall handling improved for JVM backend (#2697).

    • Fixed handling of unreachable code following void result that caused errors in backends (#2698).

    • Improved error produced in case of missing effect installation before effect use (#2732).

    • Increased analysis accuracy by distinguishing calls by their call site (#2753, #2755) and by comparing effect values (#2763).

    • Improved error produced for uninitialized fields (#2754).

    • Code cleanup (#2696, #2707, #2710, #2713, #2718, #2764) and fixes (#2750, #2766, #2810).

  • Effect backend
    • Use data flow analysis instead of control flow analysis for -effects analysis (#2720).

  • JVM back end
    • Support for exceptions in Java interface (#2667).

    • For -jar backend: Add missing classes needed to handle errors such as StackOverfowError (#2716).

    • Removed dependency on interpreter backend (#2686).

    • Disable tail recursion optimization within precondition (#2693).

    • Fixed epilog code gen for special cases (#2747).

    • Fixed match with case fields in the universe (#2762).

    • Add source file and line number attributes to created byte code (#2801, #2802).

    • Increased robustness of intrinsics in case of an thrown Java Error (#2804).

  • C back end
  • interpreter back end
    • Added new interpreter backend based on the Fuzion intermediate representation and AbstractInterpreter (#2724, #2770, #2796, #2797, #2803).

    • Increased robustness of intrinsics in case of an thrown Java Error (#2804).

    • Code fixes (#2726).

  • util
    • Better debug output on contract failure in Fuzion's Java code (#2619).

    • Better handling of source ranges in errors massages (#2678).

    • Minor implementation improvements (#2699, #2733, #2751)

  • FZ tool
    • Minor implementation improvements (#2671)

  • Tests
  • Overall Code

Cheers,

--The Fuzion Team.