From d991e1986cd25d7040adb864f5abe93079c25430 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 25 Sep 2026 21:27:50 +0700 Subject: [PATCH 1/3] Flat lets and one-argument and/or in the .fln printer are queued --- TODO.org | 4 ++++ test/syntax/algorithms.fln | 15 +++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/TODO.org b/TODO.org index dc07b62f..35c7ec6a 100644 --- a/TODO.org +++ b/TODO.org @@ -300,6 +300,10 @@ on its own. Decided 2026-09-25: a match over a dyn takes keyword arms, meaning (= d :k); = and != compare bools, and a match over a bool takes true/false arms, exhaustive without _. +** NEXT The .fln printer writes a flat let where the scope does not matter +Decided 2026-09-25: a let whose name no later statement of its block mentions prints +flat, not as a nested block; a one-argument and/or prints as its argument. + ** WAIT ML-style patterns Held 2026-09-25 as a future direction, like the JS backend: nested destructuring, guards, or-patterns, literals at any depth, exhaustiveness over the nesting. diff --git a/test/syntax/algorithms.fln b/test/syntax/algorithms.fln index eaaa4d7a..90b0262b 100644 --- a/test/syntax/algorithms.fln +++ b/test/syntax/algorithms.fln @@ -27,19 +27,18 @@ fn selection-sort(coll: [$t]) -> () where ordered?($t) fn insertion-sort(coll: [$t]) -> () where ordered?($t) let i = 1 let length = length(coll) - while and(i < length) + while i < length let j = i - while j > 0 - and coll[j] < coll[dec(j)] - let temp = coll[j] - coll[j] = coll[dec(j)] - coll[dec(j)] = temp - --(j) + while j > 0 and coll[j] < coll[dec(j)] + let temp = coll[j] + coll[j] = coll[dec(j)] + coll[dec(j)] = temp + --(j) ++(i) fn main() -> i32 = 0 -comment(): +comment: insertion-sort([\I \N \S \E \R \T \I \O \N \S \O \R \T]) insertion-sort(slice([6 2 4 9 1 9 4 5], 0, 8)) let str = bytes("INSERTIONSORT") From 94134da25ad417b9deef9f66ff725bd3f1de08c9 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 25 Sep 2026 21:32:46 +0700 Subject: [PATCH 2/3] Dyn containers print without a space after the bracket, queued --- TODO.org | 3 +++ test/syntax/algorithms.fln | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/TODO.org b/TODO.org index 35c7ec6a..39f9bf6b 100644 --- a/TODO.org +++ b/TODO.org @@ -304,6 +304,9 @@ compare bools, and a match over a bool takes true/false arms, exhaustive without Decided 2026-09-25: a let whose name no later statement of its block mentions prints flat, not as a nested block; a one-argument and/or prints as its argument. +** NEXT A dyn vector prints as [1 2 3], a map as {:a 1} +Decided 2026-09-25: no space after the opening bracket, in every renderer. + ** WAIT ML-style patterns Held 2026-09-25 as a future direction, like the JS backend: nested destructuring, guards, or-patterns, literals at any depth, exhaustiveness over the nesting. diff --git a/test/syntax/algorithms.fln b/test/syntax/algorithms.fln index 90b0262b..1f267d09 100644 --- a/test/syntax/algorithms.fln +++ b/test/syntax/algorithms.fln @@ -36,6 +36,18 @@ fn insertion-sort(coll: [$t]) -> () where ordered?($t) --(j) ++(i) +fn insertion-sort-dyn(coll) + let i = 1 + let length = length(coll) + while i < length + let j = i + while j > 0 and coll[j] < coll[dec(j)] + let temp = coll[j] + coll[j] = coll[dec(j)] + coll[dec(j)] = temp + --(j) + ++(i) + fn main() -> i32 = 0 comment: From 7bc04cc434868dea2184620b2dcc713198448c73 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 25 Sep 2026 21:43:21 +0700 Subject: [PATCH 3/3] Flan is dyn unless annotated --- TODO.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TODO.org b/TODO.org index 39f9bf6b..f2888865 100644 --- a/TODO.org +++ b/TODO.org @@ -11,6 +11,11 @@ rejected without a record is an idea that gets re-proposed. * Language surface +** NEXT Dyn unless annotated +Decided 2026-09-25: in both syntaxes an unannotated value is dyn — [6 2 4 9] is a dyn +vector, 1 a dyn integer — and a typed value needs an annotation. Rules and migration +wait on a design pass. + ** DONE Dynamic-first, and the dyn half of the language CLOSED: [2026-09-20] An unannotated parameter or return is =dyn=: a NaN-boxed value over a mark-sweep