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
-
There will be a talk on Fuzion's JVM backend at FOSDEM on 3rd of February: The Challenges of Running the Fuzion Language Natively on the OpenJDK. We are looking forward to see you there!
-
- 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 oft.values.0
/t.values.1
/...: One can now uset := (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 returnio.end_of_file
(#2227). -
ctrie
has been moved to thelock_free
module (#2238). -
The monoids
all
,any
, andparity
have been added tobool.type
(#2287). -
Many useful features have been made public:
-
option
now inherits fromSequence
(#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
andflat_map
are now features ofSequence
that produce a new Sequence. Specific variants forarray
orlist
that produce anarray
or alist
have been renamed asmap_to_array
andmap_to_list
, etc., resp. (#2317). -
count
anddrop
were redefined for array backed sequences to achieve O(1) performance (#2337). -
reverse
,map_pairs
,fold1
, andfoldf
were added toSequence
(#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 returningunit
, it returns its argument (#2297). -
Output of
list.as_string
has been improved for empty entries (#2314). -
Performance improvements for
io.stdin
andio.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
and4
, then applyinfix +
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 usesxyz.this
instead ofxyz.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
- C back end
-
Enable
-fno-omit-frame-pointer
by default to enhance debugging (#2373).
-
Cheers,
--The Fuzion Team.