koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.16k stars 153 forks source link

console effect doesn't allow for error handling #320

Open pcrockett opened 1 year ago

pcrockett commented 1 year ago

One way I like to try out new languages is to get my hello world app to throw errors. The easiest way to do that (on Linux) is to redirect console output to a device that has no free space:

./hello > /dev/full

(Inspired by Bugs in Hello World)

At this point I usually begin to figure out how to handle the I/O error and return a nonzero exit code. Unfortunately println() has a console effect rather than an io effect, so it doesn't look like there's a good way to handle this error. I don't see any other interfaces to write to stdout either.

Some questions: