ESSENTIAL
JAVASCRIPT
ELIXIRSCRIPT
@rastopyr_ua
André Maginot
what is elixirscript?
source-to-source compiler
elixir -> javascript
success stories
• clojurescript
• closure compiler
• coffeescript
• typescript
• babel
How it happens
• pass code to elixir compiler
• compile(and get error messages)
• load modules(and expand macros)
transform ast
• convert to elixir ast
• transforms to Javascript AST
• transforms to Javascript CODE
show what you can
• most special forms
• modules
• functions
• pattern matching
• public macros
• protocols
• structs
• sigils
• bitstring
Primitive Mapping
elixir javascript
List Array
Map Object
Atom Symbol
Binary String
Integer,Float Number
Bitstring ErlangTypes.Bitstring
Tuple ErlangTypes.Tuple
PID ErlangTypes.PID
Reference ErlangTypes.Reference
limitations
• No OTP
• Buggy Processes
• Not all special forms
• No private macros
• incomplete standard library
• babel
JS interop
• spec compatible
• es6
• es5(legacy support)
JS interop
• web API
• window
• document
• html5
JS.<javascript operator name>
JS interop
build tools
• webpack
• brunch
Not optimized build
DEMO TIME
Future*
• not production ready yet
• not enough documentation
• increase support of standard library
• dependency resolution(oh god!)
• add support of source maps(really?)
• stable processes
*але е одне але
WebAssembly
Elixir Javascript
Binary format
CONCLUSIONS
• Very interesting for research
• Not ready for production
QUESTIONS?
Senin Roman

Essential ElixirScript - Roman Senin