More on the Fuzion language, more examples, idioms, a tutorial, design background can be found at flang.dev
…8/8.

Show thread

For library features, the effects must be explicit. In our example, if we would want to place it in a library, we must hence add `! io.out` after the type signature to document the use of this effect, otherwise building that library module would result in an error:
…7/8…

Show thread

The effects that are required by a feature can be determined by static analysis. Analysing our example for effects (by selecting `Effects!`) results in `io.out`:
…6/8…

Show thread

Fuzion uses effects, which means that `say` does not just print the string, but it uses the `io.out` effect from the current environment. The default `io.out` prints that string to `stdout`, but we could replace it by an effect that does something else.
…5/8…

Show thread

The code of `finish` performs a call to `say`, which prints a given string and returns a value of type `unit`, which in Fuzion has a similar role like `void` in Java or C, but it is a proper first-class type. So the inferred result type of `finish` is `unit` as well.
…4/8…

Show thread

To call this feature, it is sufficient to write the name followed by an argument of type `String`, here we call `finish "schöne Welt!"`:
…3/8…

Show thread

The feature declared here is called `finish`. It has one argument `name` of type `String`. The arrow `=>` says that this feature is a function and the result type is inferred automatically from the code.
…2/8…

Show thread

Part three of a small series explaining Fuzion using idioms from programming-idioms.org/.
Fuzion idiom #3, Create a procedure:
A procedure in Fuzion is a feature with effects.
A small 🧵1/8…

More on the Fuzion language, more examples, idioms, a tutorial, design background can be found at flang.dev
…3/3.

Show thread

Alternatively, Fuzion defines the `infix *` operator for Strings to repeat a String, so the following code creates the same output. `yak` performs a print without adding a new line character.
…2/3…

Show thread

Part two of a small series explaining Fuzion using idioms from programming-idioms.org/.
Fuzion idiom #2, Print `Hello` 10 times:
The simplest way to do this is using something that looks like a loop, even though Fuzion does not have loops!
Loops in Fuzion are just syntactic sugar. Internally, loops are converted to recursive functions. This simplifies the intermediate code which simplifies tools working on the code such as static analysis tools that reason about the code.
You might worry about the performance, but this is solved by the back-ends that support tail recursion and convert this code back into an efficient inline loop.
`1..10` defines a Sequence, while `x in 1..10` is, again, syntax sugar to iterate over that sequence. When the actual elements are not needed, as in this example, `_` can be used to discard the value.
A small 🧵1/3…

The Fuzion May news have been published. Mostly polishing and bug fixing was done during the last month, while larger changes under the hood are on the way.
All the details:
flang.dev/news/news_026

The Fuzion April news have been published. An exciting new feature is much nicer support for lazy evaluated arguments enabling very compact Haskell-style lazy lists.

All the details:
flang.dev/news/news_025

Fuzion March news have been published: A lot of work going into support for local mutability within otherwise provably pure code.

All the details: flang.dev/news/news_024

Fuzion February news have been published: In addition to many improvements in the base lib and tools (fz, fzdoc, fzjava) Fuzion got syntax to document effects in feature signatures and support for type features with type parameters.

All the details: flang.dev/news/news_023

Fuzion today reached the milestone of 1000s PRs/issues! That project is growing up!

github.com/tokiwa-software/fuz

Fuzion January news have just been published: Last month's language improvements include support for covariant type changes and improvements for type parameters, also lots of work on the base library. Also two Fuzion talks at !

All the details: flang.dev/news/news_022

Merry Christmas to everyone with a Fuzion generated Christmas tree!
🧵1/2

More on the Fuzion language, more examples, idioms, a tutorial, design background can be found at flang.dev
…5/5.

Show thread
Show older
types.pl

A Mastodon instance for programming language theorists and mathematicians. Or just anyone who wants to hang out.