July 18, 2019 Β· Originally published at Future of Coding
Lamdu is a Haskell-inspired projectional editor. It features live-evaluated subexpression annotations, localized type errors, and a focus on a fluid editing experience. It is an open-source project, actively developed since 2011.
The following video creates a series of simple mathematical expressions in Lamdu.
It demonstrates:
*2 to apply to an argument and not the result of the functionThe following video builds a simple HTTP server in Lamdu.
It demonstrates:
httpOk200The following explores and modifies a large Lamdu project, a conference website server.
It demonstrates:
(empty) expressionIt's extremely rare to see live-evaluated subexpression annotations, particularly in languages with a textual representation. Some non-visual languages put the results of whole lines off to the side, but Lamdu is one of the first to publish a working implementation of underlined evaluation of all intermediate subexpressions. This goes a long way towards making functional programming understandable for beginners.
Unlike many projectional editors, Lamdu is navigable without every touching the mouse. Everything (and I mean everything) can be done via keyboard. It features a context-aware shortcut help menu to help you learn their hotkeys. However despite their attention-to-detail, I still found it quite difficult to use as you can see me fumbling in the above videos. Crafting a fluid projectional editor is still an unsolved problem but they have made significant strides.
As demonstrated in the above videos, internally variables have IDβs, so changing their names is a superficial change. This means no merge conflicts on renaming, formatting, stylistic differences, or moving code. There are no files, folders or line numbers to worry about.
Lamdu's function features named parameters, like keyword arguments in Python. They add clarity compared to their equivalents in Haskell, but also add clutter.
Their type errors take advantage of information unavailable to traditional textual languages, such as the order in which you type an expression. This allows it to infers your intent. For example, if you type βHelloβ first it guesses that the type error is with the 5:
But if you added the 5 first, it would now see an error with your "Hello"