This is the first talk from the second Elm Remote Meetup,
Elm Stuff by Luke
I hope you enjoy it. If you do, the best thing you can do to help make sure we
can do these going forward in perpetuity is to subscribe to DailyDrip or tell a
friend about us that might be interested. :heart:
Elm stuff. Elm for things. For hardware!
Elm’s conceptual representation of a user interface is simple and lovely – and
very different from the browser’s DOM API used internally by Elm to display our
programs to the user. Elm and elm-lang/html hide the low-level complexities of
the DOM API from users by using it as a protocol rather than directly as an API.
The HTML renderer places a broker between us and the actual DOM API that asks
our program for information about our view and provides it with messages from
the outside world. As this broker interacts with our program it also feeds
updates to the DOM and listens for events to send back. It turns out that this
is a very generic way of understanding a UI system.
If we can cut off the part of elm-lang/html that chooses to write and listen
specifically to the DOM and instead plug in our own renderers then the
possibilities for what can be accomplished by Elm become limitless. If we accept
that to Elm, the DOM is a protocol we can start to explore other protocols like
MIDI, DMX512, and Firmata. In this talk I will explain what properties of Elm’s
conceptual model make this possible and how we can take advantage of them to run
Elm for goals other than browser UIs. Most importantly, I’ll show an Elm
application I wrote to run in a music performance device over the MIDI protocol.
After seeing this talk and demo it is my hope that we can form a community
around using Elm for things from music hardware to IoT applications by rendering
to and accepting messages from all manner of devices. Join me in the #hardware
channel of the Elm Slack for continued discussion after the talk as well!
Here are the slides, embedded for your pleasure.