2025-10-09: Fuzion October Update
Significant progress has been made in the fzweb web-server during last month. Dependencies on the original Java-based web-server code will soon be fully eliminated and last missing features will be added.
On the Fuzion language side, we saw significant improvements of the handling of open types and lambdas. This lays a basis for processing variable argument lists.
- Fuzion language
-
Add support to infer partial and lambda from type parameter constraint (#5994)
This permits better code specialization: Using a function type directly as in
test(f i32->i32) => say "{type_of f} {f.call 42}" test x->x+1 test (-) test (3*)will pass the actual functions as values boxed into a reference of type
Function i32 i32to heap-allocated instances and use dynamic binding forf.call, adding unnecessary overheads.Now, we can use a type parameter
Fwith constraint: i32->i32like thistest(f F : i32->i32) => say "$F {f.call 42}" test x->x+1 test (-) test (3*)and let the compiler specialize the code of
testfor all actual lambdas passed, i.e., for the internal features created forx->x+1,(-), and(3*). Since the actual values for these features are unit types, the code will get compiled into something like thistest1 => say "{λ1.type} {λ1.call 42}" test2 => say "{λ2.type} {λ2.call 42}" test3 => say "{λ3.type} {λ3.call 42}" λ1 : Function i32 i32 is public redef call(a i32) i32 => a+1 λ2 : Function i32 i32 is public redef call(a i32) i32 => -a λ3 : Function i32 i32 is public redef call(a i32) i32 => 3*a test1 test2 test3which uses no references, no dynamic binding, no heap allocation, just code specialized for the actual lambdas (except for the
Strings passed tosay). -
It is now possible to use free types as open type parameters (#6022)
This permits variadic functions to be declared using
f(a A...) =>instead of the somewhat clumsyf(A type ..., a A...) => -
Call open type parameter (#5813)
This permits code like the following
f(A type ...) => a : container.type_applicator unit is public redef apply(T type, e unit) unit => say T A.type_foldf unit a f i32 (option (Sequence String)) voidto iterate over the provided types and produce this output:
Type of 'i32' Type of 'option (Sequence String)' Type of 'void' -
Allow open type parameter arguments even if they are not the last argument, fix #5895 (#5925)
This permits open type parameters from an outer feature to be used as types at any place in the arguments list, e.g.,
f(A type ...) is g(n i32, a A..., b f64) => say "$n $a $b" (f bool (option String)) .g 42 true "hi" 3.14
-
- Base library
-
New library features
time.durationis nowproperty.hashable(#5837)add
compile_time_panicto statically cause an error in code that should be unreachable (#5851)add
frequency.as_string(#5887)Add
Typed_Sequence.variadic, minor cleanup (#5897)add
Any.dynamic_applyandTyped_Functionthat extracting the type and value from a referenced of typeAny(#5896)add
os.mmap_offset_multiple(#5890)add
stat.meta_data.as_string(#5930)add
trit.is_yes,is_no,is_unknownetc. (#5942)add
Sequence.as_ordered_mapandSequence.as_hash_mapto create a map from the values in aSequence(#5888)add effect
Buffer_Sizefor central configuration of buffer size (#5958)add (infix) set operators
∆(symmetric difference),⊆(is subset of),⊇(is superset of),∋and∌(contains and contains not) (#5960)Add variants of
String .trim/trim_start/trim_endwith custom conditions on what to codepoints or utf8-bytes to trim (#5986)process(es) implement
as_string(#5997)add
switch.fold(#5999)
-
Changed library features
Added redef
Typed_Sequence.finitesinceTyped_Sequenceis always known to be finite (#5827)fix type parameter constraint in
Clock.run_periodic(#5859)change visbilities of handles(2)/bitset (#5860)
process.waitadd timeout parameter (#5862)relax preconditions for
ordered_map/hash_mapto avoid counting for debug level below 2 (#5898)make
tupleinheritproperty.hashableusingtyped_foldfon open typevaluesfield (#5882)improve
hash_map's collision handling for poor hash functions (#5886)os: add upper bound for
polling_timewhen waiting on process (#5907)fix
Sequence.findperformance problem due to too many calls toSequence.countan non-array-backedSequences (#5934)fix
abstract_array.dropfor negativen, implementabstract_array.take(#5933)fix
Sequence.is_valid_indexthat false returnedtruefor the first invalid index (#5932)replace some fixed constants in io and network APIs by
page_size/max_path_length(#5953)fix slice of slice by redefining slice in
array_slice(#5956)implement
array_sliceas anabstract_array(#5951)remove double buffering from buffered reader (#5957)
extend
Sequence.split_atto permit a predicate on the element type as an argument instead of the index (#5972)Sequence,
find/replacenow first make sure the underlyingSequenceis array backed for better performance (#5983)rename
Sequence.averageasSequence.mean(#6017)rename
as_codepointsascodepoints(#5991)improve comment in
bitset(#5869)Sequence.take/dropdocument behavior for negative argument (#5931)expanding_array, fix comment (#5959)
update to Unicode 17 (#5992)
-
- Shared Library (native features)
include: fix incoherence between
fz.handshared.c(#5911)
- Modules
- Parser
fix #1022, confusing indentation related error (#5831)
- Front end
cleanup in
AbstractType.applyTypeParsLocally(#5814)fix require condition failure for non-loaded features (#5833)
fix inheriting from feature with open type parameters (#5838)
fix check-condition: IncompleteType.java:47 (#5847)
fix check condition failure in man_or_boy2 (#5855)
fix soundness issue in
constraintAssignableFrom(#5786)Fix check condition failure when comparing tuples (#5871)
fix
AbstractFeature.toStringwhen very early in front-end (#5917)fix result type propagation to loops (#5904) (#5918)
fix using open type parameters in inherited feature (#5944)
fix open type parameters inherited from type parameter constraints (#5962)
fix null pointer exception (#6003)
- Monomorphization/DFA
- JVM back end
- C back end
do not destroy JVM in each thread, fix #5912 (#5913)
- Interpreter back end
fix an issue where
exit 0caused a require condition failure in the interpreter (#5824) (#5839)
- Tools
fz
fix confusing missing module file error (#5865)
timer: split dfa into dfa1 and dfa2 (#5876)
Show failing pre/post/check condition even if it comes from generated code (#5877)
improve terminal detection (#5881)
dfa: verbosity level 2, add info on how many iterations DFA took (#6015)
don't silently ignore if
universe.fzwas not found (#5832)add hint on how to start profiler not at app start (#5921)
fzjava
-
Allow passing
nilwhen java string is expected (#6008)In code generated by
fzjava, arguments that are aStringon the Java side now take anoption Stringon the Fuzion side.nilwill be passed as anullin Java.This means it is now possible to do
Java.java.lang.System.out.println nil
-
- Documentation
- Tests
tests: re-add show slowest tests in test run (#5836)
run_tests: cleanup remove use of timeout (#5875)
run_tests: don't panic on test timeout (#5889)
fix and rerecord test
mod_http_message(#5920)strip line numbers from jvm stack traces (#5926)
check_simple_example: use
os.cwdto replace with CURDIR (#5939)run_tests: emit histogram of test times (#6016)
run_tests: change design of output (#6006)
run_tests: histogram, add argument
max_recorded(#6019)
- Windows
- Build Tooling
automatically deploy git version of api docs to fuzion-lang.dev (#5852)
Makefile: compile
run_tests.fzin a separate target (#5863)Makefile: fix error caused by missing directory
build/include/(#5873)makefile:
build/bin/run_testsadd dep on$(FZ_SRC)/bin/run_tests.fz(#5879)
Cheers,
--The Fuzion Team.