Elm
Elm is a delightful language for reliable web applications. It is a purely functional language that compiles to JavaScript.
LiveCodes compiles Elm in the browser using @live-codes/elm-wasm, a WebAssembly build of the Elm compiler.
Basic Demo
See below for more examples.
Usage
Write Elm code in the script editor. The module must expose main (e.g.
module Main exposing (main)), as required by the Elm compiler.
The code is compiled to JavaScript, then the compiled program is initialized in the result page
by a Elm.<ModuleName>.init({ node }) call into a div appended to the page body.
If you wish to use a specific DOM element use "livecodes-app" as the element id.
This works for the common program types (Browser.sandbox, Browser.element, Browser.document and Browser.application).
Imports of modules from Elm packages are detected automatically. Packages the compiler ships with
(a set of elm/* packages, provided as precompiled artifacts) are enabled without downloading
anything; any other package is downloaded from jsDelivr and installed into the compiler's virtual
file system.
The generated JavaScript can be inspected in the Compiled code tool pane.
Language Info
Name
elm
Aliases / Extensions
elm
Editor
script
Compiler
@live-codes/elm-wasm, a WebAssembly build of the Elm compiler.
Version
Elm 0.19.1 (@live-codes/elm-wasm 0.2.1)
Code Formatting
Not supported.
Limitations
- The first run downloads the compiler (~10.6 MB
ulm.wasm) in addition to the Elm package data. - Elm source is compiled as a single module. Other modules are provided by installed packages, which are resolved at compile time (jsDelivr by default).
Starter Template
https://livecodes.io/?template=elm