2023-04-04: Fuzion April Update
Here is this month's update:
- Fuzion language
Introduced syntax sugar for lazy evaluation. The
Lazyfeature 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.this.type, which is a placeholder for
oor any heir of
o, an inner feature
fiwith a inner result type
tiwill have the effective resulting type
o.this.type.ti, which become
o.tiwhen the other instance is
o. However, for a heir
pthat inherits from
o, the result type of a call
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
tiare incompatible to
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
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
ifstatement following an
else(in an if or loop statement) (#1297).
- base library
mutable_tree_mapwhich implement a linked list and AVL trees using the
mutateeffect (#1148, #1177).
has_equalityfeature has been renamed as
equatable. Features prefixed with
has_will in the future designate predicate features. The name
equatableis inspired by Swift (#1199).
With built-in support for
Lazyarguments, features such as
option.lazyGethave been removed in favor f making the main versions of theses features lazy by default (#1240, #1241).
Unaryfunction 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
Unaryby default (#1224).
Internal changes have been made in preparation of making
Monoidnow uses the type's underlying equality relation rather than depending on one specified by the
- the work on networking support is still ongoing (#1223).
- New features
- 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).
--The Fuzion Team.