2025-01-16: Fuzion January Update
December was a busy month. This month, we're a bit earlier with our latest changes:
- General
-
December was Advent-of-Code time, you find Fuzion solution to all 25 puzzles! Working on these puzzles resulted in positive input for Fuzion, a total of 55 issues where opened, about half of them for API improvements and half for compiler improvements like bugs or enhanced error messages.
There will be a presentation on Fuzion at FOSDEM:
Effects Everywhere: Error Handling and Design-By-Contract in Fuzion by Fridtjof Siebert on Sunday 12h30 in room H.1308 in the Declarative and Minimalistic Computing devroom. Hope we meet there, or you join online!
-
- Base library
-
New features
add
Sequence.count(f T->bool)(#4382) so one can writesay "{persons.count (p -> p.age < 18)} kids"instead of
say "{persons.filter (p -> p.age < 18) .count} kids"net: add
ip_addressfeature (#4417)fuzion/java: pass Pointers to
call_*instead of Java_Object (#4431)rename
Sequence.concat_sequencesasSequence.concat(#4450)mutate: array: convenience feature for initialization (#4467)
add
set []toMutable_Mapas alias foradd(#4498)Add
Sequence.as_*tuple[s], fix #4501 (#4502)say ([1,2,3,4,5,6].as_3tuples.map t->t.0+t.2)which will convert the sequence into
[(1,2,3),(4,5,6)]and then sum the first and last tuple elements to produce[4,10].To avoid quadratic performance, added
foldr*tolistandSequence, usefoldrinString.type.join(#4532)Add new mechanism for function memoization (#4543)
say you have a function fib that performs poorly because it lacks memoization:
fib(n) => if n <= 1 then 1 else fib n-1 + fib n-2you can now memoize this as follows
fib(n) i32 : memoize => keep n _-> if n <= 1 then 1 else fib n-1 + fib n-2
-
Changed features
Sequence.sortnow requires elements to be (totally)orderable(#4347)Sequenceis now the preferred result type, even for features that internally create alist(#4383, #4391)mutate: array2: value initialization consistent with
mutate.array(#4466)Remove mutate parameter from
io.stdin, add convenience features (#4485)don't return line for final newline in
io.buffered.read_lines(#4496)change
Const_Stringtoconst_string(#4521)cleanup, move
alloc,getel,setelto type features. (#4523)io: flush buffers on everysay/yaketc. (#4511)fuzion java: simplify result type of
array_to_java_object0(#4520)correct result type of
fzE_file_close(#4527)rename
logfeature asio.log(#4476)use pipes operator in some places (#4530)
-
- Parser
- Front End
replace
$MODULEin error message with name of fum file, e.g.,{base.fum}/Sequence.fz(#4499)- bug fixes
-
fix nested tuples (#4407), allowing code like
x := tuple 1 (tuple 2 3) say x.values.1 say x.1.values.1Note that
x.1.1currently does not work yet (#2913) robustness of
setActualResultTypein case of errors (#4333)fix type parameter constraints in pre/post features (#4406)
fix field access for tuples, e.g.,
x.1, if type is a type parameters with tuple as constraint (#4409)Fix confusing error created in case of wrong number of type parameters in a call (return null for
asTypeof partialargs) (#4448)Fix crash during argument type inference from actual args (fix result type once inferred) (#4453)
fix unjustified errors reported on calls performed in parentheses (do not propagate for partial if operator call in parentheses). (#4482)
addDeclaredOrInherited: relax pre-condition on errors (#4373)fix name clash of type features in different modules (#4381)
allow initial value in if/else (#4388)
-
- cleanup
AbstractType.isRefchange result type toYesNo(#4300)removed code duplication in
AbstractFeature.typeCallandAbstractCall.typeCall(#4314)rename
isFunctionType/isAnyFunctionType(#4361)optimize recording of used fields (#4411)
replace
isFunctionTypeExcludingLazybyisFunctionType(#4442)refine
isAssignableFromchecks (#4452)merge
Call.ERRORandExpr.ERROR_VALUE(#4385)
- Middle End
DFA: fix type of valueset of original of
TaggedValue(#4470)DFA: override
accessedClazz(#4517)move some abstract from GeneratingFUIR to FUIR (#4437)
move abstract methods from GenFUIR to FUIR (#4441)
cleanup, move methods from GenFUIR to FUIR (#4493)
do not add code when lookup done (#4438)
remove
declarationPos(#4519)effects: fix a require-condition in DFA.java (#4397)
ir: programmatically calc
CLAZZ_END,SITE_BASE, etc. (#4432)abstract interpreter:
assignStaticonly for values that have data (#4477)
- All back ends
replace
fuzion.java.Java_Object/Arraywithfuzion.sys.Pointer(#4340)
- JVM back end
- C back end
- Interpreter back end
- Native
- fz command
set
-Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8(#4392)
- Docs
- Build Infrastructure
fix building fuzion runtime (#4339)
add build target for java docs (#4356)
run_tests_jar, fix for spaces in directory (#4363)
remove python3 dependency (#4366)
fix target debug_api_docs not working on first run (#4371)
lint/javadoc: include syntax and html checks (#4464)
add .DELETE_ON_ERROR (#4497)
- Tests
Cheers,
--The Fuzion Team.