Upload
simon-belak
View
214
Download
2
Embed Size (px)
Citation preview
Transpiling to JS: have your cake and eat it too
source code compiler JS
bootstrap +
selfhosted
compile to JS(no runtime)
CLJS at a glance• Dialect of Clojure (code mostly interoperable,
different libraries on different runtimes)
• Functional, dynamic, immutable
• Bootstrapped + self hosted, impeccable JS interoperability
• Uses Google Closure as core library & complier
What makes it special
• Emphasis on concurrency and state management
• Unparalleled data manipulation
• Homoiconicity & macros (code = data)
System paradigmLanguage paradigm
infoq.com/presentations/Mixin-based-Inheritance realworldclojure.com/the-system-paradigm
The system paradigm
1. Nibble at the problem from different directions
2. Compose partial solutions into the final solution
Elm at a glance
• Statically typed & strict: no null, undefined or runtime exceptions
• Functional & pure
• Compiles to JS, limited interoperation with JS (via Ports)
What makes it special• Front-end building language
• Optimized for simplicity, friendliness. Fantastic error messages.
• Package system enforces semantic versioning
• Reactive by design (Model-Update-View architecture)
The program is a pure function that's being evaluated in a loop over the inputs. Impureness is pushed to the runtime where it can be controlled (via Mailboxes).
Initial state: [“”] [ "" ] -> [ "Hello" ] -------> [ "" ] -> [ "Hello" ] -> [ "Hello World" ] ------->
PureScript: a clean modern Haskell?
• Compiles to JS, no runtime, can interoperate with JS
• Statically typed, powerful type system
• Functional & pure