Hacking on the Terminal with Scala Native
Happy new year! If you're the Christmas type, I hope you had a good one as well. Our Christmas was very traditional: we had no heating or hot water as our boiler died on Christmas Eve. We also lost power, and hence the Internet, for a few hours. As you can imagine it was a very trying time. Actually, we were fine, it a little bit cold. The weather wasn't too bad, and we were able to get the boiler fixed fairly quickly. It definitely made for a memorable Christmas, however.
I took a break from the book for a few months but I'm back at it now. As a result of working on the book I've released a new library for terminal interaction: Terminus. Terminus supports the JVM, Scala Native, and Javascript. I've never used Scala Native before, and I haven't done much with the terminal, so working on Terminus has been quite interesting to me. I've been impressed with Scala Native. It compiles as quickly as normal Scala code (unlike Graal Native, which was very slow last time I used it). The resulting executables start in milliseconds and are a few megabytes in size.
You might be wondering what Terminus has to do with tagless final. I wanted a case study of a codata interpreter, which is a precursor to tagless final. The usual example of an arithmetic interpreter doesn't much relate to practice, and it can make the concepts feel ungrounded. Working with the terminal is simple enough that I can build useful programs in a page of code, and its also a problem domain with real world applications. The plan is to extend it to a TUI to demonstrate tagless final.
As always, big thanks for my sponsors! I'd also like to give a shout-out to the people who have been opening issues and PRs on the book. I was not able to deal with them for a little while, but I think I've addressed all the recent ones since getting back to the book. These are definitely helping to make the book better.
That's all for now. Happy hacking!
Noel