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

2023-04-04: Fuzion April Update

Hi,

Here is this month's update:

  • Fuzion language
    • Introduced syntax sugar for lazy evaluation. The Lazy feature approach from the design page has been selected for this (#1197).

      As an example, the infix : operator now takes a lazy argument and can be used to create a lazy list of integers as follows:

      
      ints(i i32) => i : ints i+1  # head i, tail lazy recursion starting at i+1
      
      say ((ints 1).take 10)       # will print  `[1,2,3,4,5,6,7,8,9,10]`
                

    • The code for handling of outer types has been rewritten entirely to fix various bugs (#229 and #1180). Essentially, a type of an outer feature o is o.this.type, which is a placeholder for o or any heir of o. Within o, an inner feature fi with a inner result type ti will have the effective resulting type o.this.type.ti, which become o.ti when the other instance is o. However, for a heir p that inherits from o, the result type of a call p.fi automatically becomes p.ti:

      
      o is
        ti is
      
        fi ti is            # result type is o.this.type.ti
          ti
      
      p : o is
      
      say (type_of o.fi)    # will print `o.ti`
      say (type_of p.fi)    # will print `p.ti`
                

      This requires a bit of care since within o, types like ti are incompatible to o.ti.

    • The parser has been improved to avoid a bug where an infix : was erroneously detected as the syntax for inheritance (#1226).
    • Multi-line strings are now supported, they are documented in the tutorial for string constants (#1267).

      
        s := """
          <!DOCTYPE html>
          <html>
              <head>
                  <title>Fuzion</title>
              </head>
              <body>
                  <p>A multi-line string constant!</p>
              </body>
          </html>"""
                

    • A parser bug was fixed that made it possible to have an indented if statement following an else (in an if or loop statement) (#1297).
  • base library
    • New features Mutable_Linked_List and mutable_tree_map which implement a linked list and AVL trees using the mutate effect (#1148, #1177).
    • The has_equality feature has been renamed as equatable. Features prefixed with has_ will in the future designate predicate features. The name equatable is inspired by Swift (#1199).
    • With built-in support for Lazy arguments, features such as list_of_none_lazy and option.lazyGet have been removed in favor f making the main versions of theses features lazy by default (#1240, #1241).
    • A Unary function type has been introduced. This allows easy function composition. Lambdas which take exactly one argument will now be detected by Fuzion as functions of type Unary by default (#1224).
    • Internal changes have been made in preparation of making array sliceable (#1178).
    • Monoid now uses the type's underlying equality relation rather than depending on one specified by the Monoid.infix == feature.
    • the work on networking support is still ongoing (#1223).
  • fz tool
    • Compilation time was quadratic in the code size of one feature. In particular, inline arrays could easily trigger very long compilation time. This has been reduced to linear time for most cases (#1291).
    • The formatting of code in error messages and other fz output has been adjusted to improve readability (#1191).
    • If a feature is called with the wrong number of arguments, a solution will be proposed now (#1195).

Cheers,

--The Fuzion Team.

last changed: 2024-06-28