Part three of a small series explaining Fuzion using idioms from https://www.programming-idioms.org/.
Fuzion idiom #3, Create a procedure:
A procedure in Fuzion is a feature with effects.
A small 🧵1/8…
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.
More on the Fuzion language, more examples, idioms, a tutorial, design background can be found at https://flang.dev
A Mastodon instance for programming language theorists and mathematicians. Or just anyone who wants to hang out.
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.