Index

Brew your own coffee...script

A simple transcompiler in Ruby

Txus (@txustice) - Twitter, GitHub

CoffeeScript

CoffeeScript

JavaScript

Transcompiling: how it works

Roll our own... RubyScript!

AST representation of a simple program

AST nodes and the Visitor pattern

Visiting our AST

Yeah it works!

but...

Improving our Visitor

TA-DA!!! RubyScript improved!

RubyScript

JavaScript

That's all folks!

Get RubyScript while it's still hot!

~400 LOC
$ curl http://bit.ly/AsoU9w > rubyscript
$ chmod +x rubyscript
$ ./rubyscript my_file.rb > my_file.js

Go check out the code here:

https://gist.github.com/2017173
By Txus (@txustice) - Twitter, GitHub
Use spacebar or the arrow keys to navigate
See all slides