Get the latest tech news

Functional semantics in imperative clothing


There's an old joke about programming with pure functions: “Eventually you have to do some effects. Otherwise you're just heating up the CPU.” I've always wanted the purely functional Roc programming language to be delightful for I/O-heavy use cases.

Earlier I said that this style of Roc code "desugars to a big pile of 100% statically type-checked pure functions." In fact, one of the main motivations for representing effects as values like this is so that future Roc platforms can do all this "traversing the data structure" work behind the scenes to quietly give you excellent async I/O performance that's potentially even tailored to a particular domain (e.g. web servers, CLIs, games), while your application code gets to look as straightforward as it would in any imperative language: If you're intrigued by this "functional semantics in imperative clothing" idea and want to give Roc a try for yourself, the tutorial is the easiest way to get up and running.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of imperative clothing

imperative clothing

Photo of richard feldman

richard feldman

Photo of functional semantics

functional semantics