2026-11-16: Fuzion November Update
Highlights of last month are compile-time reflection with new features that support inspecting
arbitrary choice types and more extensive use of type parameters to allow
specialization, e.g., for Sequence.map to remove function argument passing and
dynamic binding overhead.
- Fuzion language
-
free types are always inferred from actual arguments (#8069)
This means that you can now influence if a type parameter may be given explicitly as in
add(N type : numeric, a, b N) N => a + bwhich can be called with or without the type parameterpi := add f64 3 0.14 # using explicit type parameter seven := add _ 3 4 # using inferred type parameter ten := add 4 6 # also using inferred type parameterwhile using a free typeadd(a, b N : numeric) N => a + bis always inferred, i.e., must not be given:pi := add 3 0.14 # inferred f64 seven := add 3 4 # inferred i64 ten := add 4 6 # inferred i64This makes the number of required actual arguments more obvious and avoids the need to specify_type parameters if some type parameters can be inferred.
-
- Base library
-
New library features
-
choicenow supports compile-time reflection viachoice.ordinal,choice.apply, andchoice.combine: fix #5793 (#7765, #7943, #7953, #8040)This made it possible to implement a generic
choice.as_stringand to makechoiceorderableandhashable.The code to implement
choice.as_stringusingapplyis magically simple:public redef as_string String => apply (_,v -> $v)It works as follows:applyis an intrinsic that expects aTyped_Functionas an argument and calls that function with the type and value stored in the choice. For, e.g,choice red green blue, the compiler creates anapplyfunction as followspublic apply(R type : Any, F type : Typed_Function R, f F ) R => match choice.this v0 red => f.call red v0 v1 green => f.call green v1 v2 blue => f.call blue v2Effectively,applyprovides a genericmatch.To make
choiceorderable, we needed a generic implementation oftype.lteqfor anychoice.this. This is done as follows:public redef type.lteq(a, b choice.this) bool => a.combine b (i64.lteq a.ordinal b.ordinal) T,va,vb-> if T : property.orderable then T.lteq va vb else compile_time_panicThis usescombinewhich also receives aTyped_Functionthat is called from compiler generated code iff bothchoices have the same ordinal number. So we can use that to compile-time type check if the element type isorderableand use that type'slteqimplementation. Otherwise,combinewill return its second argument, which is the result of comparing both choice'soridinalvalues usingi64.lteq. -
Sequence.mapis now specialized for its function argument. This is possible since it no longer takes a referencef Function R Targument, but uses a free type parameterf F : Functgion R T(#8075).The result is that, e.g,
[1,2,3].map +3will automatically get specialized for the given operation, i.e., we have[1,2,3].map_add3without a function argument and without dynamic binding overhead. New APIs for thread and process time: add
time.Thread_Timeandtime.Process_Time(#7979, #8017)f64/float/data_size: addf64.as_u128and remove NYI hack inunits.data_size.scale_approx(#7753)
-
-
Changed library features
change
internal_array.lengthtype toi64(#7998)fix
f32.fits_in_i64accepting2^63(#7967)fix intrinsic definitions:
cnd_timedwait/cnd_init(#7995)fix snapshot bug in ctrie (#8066)
make
typed_zippera lambda-target (#7977)move string cut result to universe (#8087)
processes do not remove process from processes on successful wait (#7970)
run finallies of default effects in reverse order (#8091)
Replace
switch.okbyswitch.postfix ??or similar (#7722)
-
Removed library features
-
- Other library modules
- Parser
- Front end
Add call to
resolveDeclarationsbefore callingconstrainton type parameter (#8095)cache
AbstractCase.tags, found this while profiling (#8022)clarify error for value argument given as type (#8016)
do not expose
Expr.visitto other packages (#8056)fix
ParsedCall.splitOffTypeArgsto ignore free type args (#8074)cleanup: Move
Function.NO_CALLStoAbstractCall(#7948)make
Expr.unwraptolerant if type of expression is unknown, fix #8086 (#8089)fix comments on module hash sizes (#8111)
allow
choicewith redundant types, only forbidmatchif ambiguous (#7935)Call, handle case when target of target is erroneous. (#7984)
cleanup: Implement more scalable
compareTofor different Features (#7923)cleanup in reporting of duplicate argument names (#8062)
remove type par caching (#8030)
rename
AbstractType.isUnitType(#7969)test removing
rebaseTypeForCotype(#8053)Type inference from actual type parameters, fix #7791 (#8006)
fix
IndexOutOfBoundsExceptionafter errors found during type inference fix #8084 (#8085)
- Monomorphization/DFA
Call.compareToWhy, list all differences (#7917)consider two
nullenvs to be same (#7916)on verbose=4 list 25 most used values/calls (#7918)
refine
newValueConst, add precondition toCallGroup(#7966)refine
setFieldprecondition (#7957)remove dead code (#8107)
remove
UNKNOWN_JAVA_REF(#7960)remove unused
_clazzesThatRequireEffect(#8032)remove unused
Value.UNDEFINED(#7956)set correct clazz for SysArray (#7958)
set
_preEffectValuesto null (#8023)use only one instance if clazz at site is not siteSensitive (#7934)
- Middle end
cfg: remove dead code (#8109)
add
FuirFeatureabstraction ofLibraryFeatureand future FUIR generated features (#7950)ignore dead ends during tail call detection (#8060)
TailCall: update comments referring to call site (#8057)
cache
Clazz.feature()(#8068)-
error on self recursive types (#7987, #8020)
Code like this
test(T type) => i is test i test i64would produce an endless chain of typestest (test ... (test (test i64).i)... .i).iand crash the compiler. This now results in a propper error. find redefinition without lookup by name (#7959)
change
toStackIRto eval potential side effects of dumpedInlineArray(#8093)do not add type parameter calls to stack (#8055)
XdumpFUIR: always serializeFuir (#7940)
- Backends
-
C backend
-
JVM backend
-
Interpreter backend
-
- Windows
- Tests
add additional test from issue #7791 to corresponding regression test (#8072)
add test
dump_fuir(#7963)avoid copied code from module tokiwa where possible (#7996)
fix test recording (#8121)
comment out now working case in
inference_choice_generics(#8116)fix compile.mk for examples containing code in universe (#8019)
update interpreter recordings (#7997)
skip
blocking_mutate_timeoutfor now (#7989)
- Language Server
- Build Infrastructure
make
simple_example.fzhonor skip files in Fuzion repo (#8051)make
simple_example.fzthread-safe by naming tmp files after tests (#8007)only keep filename in expected error, remove (relative) paths (#7988)
simplify path and line number replacement in
simple_example.fz(#8009)support setting debug level via comment in test (#8052)
- Documentation
- Fuzion Webserver
add
not_executableoption (#485)Blocklists, Feeds: use
concur.atomic_mutate(#487)Blocklists, Feeds: use put instead of update (#488)
connection_handler: cleanup code (#501)
fix benchmark compilation (#491)
Jenkins: include default recipients in failure emails (#492)
minor cleanup: pass on read error when reading form data (#497)
README: adjust to current reality (#490)
reduce visibility of event_msg (#502)
session_document: support boolean attributes, improve attribute parsing (#499)
src/Session: ensure user authentication consistency by blocking mutate (#486)
src/Session: use
blocking_mutatefor history (#489)src/user: fix stringification of time when moving deleted users (#493)
src/user: move deleted users into subdirectory of users (#495)
src/user: send email after successfully deleting an account (#496)
Cheers,
--The Fuzion Team.