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

2024-03-07: Fuzion March Update

Fuzion has made it into gentoo Linux! Also, exciting stuff happened to Fuzion itself, including support for calling to Java from the JVM backend as well as the possibility to omit .type. when calling type features. Here all the details:

  • General
    • The recording of the FUZION talk at FOSDEM is online!

    • The Fuzion GitHub repository is open for external contributors, we added a Contributor License Agreement and documentation for new contributors (#2500, #2502, #2505, #2514, #2538, #2545).

    • We have switched to using JDK 21 ( #2504).

    • Fuzion has been integrated as a development language into gentoo linux!

  • Documentation
  • Build infrastructure
    • Added a base-only target to the Makefile for faster build-test cycles (#2501).

  • Fuzion language
    • The .type. can now be omitted in calls to type features (#2631).

  • base library
    • Intrinsics and effects that allow directory listing have been implemented ( #1688, #2635).

    • Add infix :: to list, which allows creating a list from a given starting element and a partial function that gets applied on each iteration ( #2516).

      This permits code like

      ints := 0 :: +1
              

      to create a list of all integers starting at 0 and calculating the next element by adding one using the partial function +1.

    • Change Sequence.infix | to be an alias for map, the new alias for for_each is Sequence.infix ! now ( #2517).

    • Handling of infinite sequences has been made more convenient since the number of entries shown by as_string is limited for non-finite sequences ( #2528).

      You can now safely do things like

          say (1.. | x->x**2)
              

      which used to crash, but now results in

          [1, 4, 9, 16, 25, 36, 49, 64, 81, 100, …]
              
    • Add feature String.is_ascii ( #2531).

    • Set.add was implemented due to errors with the abstract version (#2533).

    • When producing a string from a sequence, separate the elements with instead of just a , ( #2548).

    • Facilities to launch processes have been added ( #2575).

    • Visibility of Type is now module:public, because nothing should inherit from or call Type ( #2581).

    • bench now uses the time.nano effect ( #2606).

    • String: add features for center, left, and right padding of strings ( #2609).

    • Some fixes for unsafe intrinsics ( #2521, #2594, #2627).

    • Refactoring of interval ( #2551, #2560, #2608).

  • Front End
    • Improve type inference for tagged union types ( #2582).

          # infers that all the numbers to be of type option f64
          a := [0.3, option 3.142, nil, 42]
      
          # infers that all the numbers to be of type option f64
          if b then 42  else option 3.14
              
    • Improve type inference type parameters ( #2585).

          # type parameters for `zip` can now be inferred in this case:
          prods :=  ([1,2,3].zip 0.. a,b->a*b)
              
    • Remove string comparisons in the code ( #2616, #2617).

    • Replace Could not find called feature messages by more specific errors in case the feature could be found but is invisible or the argument count does not match ( #2622).

    • Suppress declarationsInLazy error if it is a subsequent error, due to frequent false-positives ( #2628).

    • Fix source range of parsed lambdas ( #2646).

  • JVM back end
    • The fzjava interface known from the interpreter that allows calling into Java code is now supported by the JVM backend as well ( #2487).

    • Support for the stackmap table attribute was added ( #2499, #2556). This allowed switching to class files for JDK version 21.

    • Improvements to tail recursive call optimization (however, this does still not work in many cases) ( #2543).

    • The -jar and -classes backends now create a run script that allows one to easily run the jar file or the classes (#2547).

    • For the -jar and -classes backends, fix the result of envir.args ( #2549).

    • The -jar and -classes backends now support an optional argument -o=<outputName> to specify the name of the generated output ( #2567).

  • C back end
    • Separated include/fz.h into platform-specific files, refactored (#2553, #2573, #2601).

    • Replace __atomic compiler-specific built-ins by C11 standard atomics ( #2563).

    • Not longer emits duplicate casts in generated code ( #2592).

    • The generated C source files are not deleted unless -XkeepGeneratedCode is set ( #2605).

  • fz tool
    • Run simple examples given on the command line using the -e <code> or -execute <code> argument (#2618). So it is now possible to do

          fz -e 'say "Hello, world!"'
              

      to run a one-liner.

    • In the case of a contract failure (pre/post-condition or check) due to a bug in the fz tool, the failed expression will now be shown ( #2619).

    • Running fz without any arguments now shows the general help instead of the default backend help ( #2648).

    • Experimentation with calling the Fuzion compiler via fzjava from the JVM backend have started ( #2536).

Cheers,

--The Fuzion Team.