Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (38 sloc) 1.63 KB

Welcome to the café

We feature the most exquisite compilers to brew your JavaScript just the way you like it. There is much work to be done but a few recipes are ready for you to try and help improve. No refunds if you grow a third arm!


Clone the repository with git.


Here's an example of callbacks from the examples directory:

  sys = require("sys"),
  cafe = require("../lib/cafe"),
  compiler = new cafe.js.Compiler();

compiler.on("parse:FunctionDecl", function () {

  // rewrite the function name
  this.children[0].name = 'zomg';

var source = "function foo (bar) { return this; }";

var ast = compiler.parse(source);


Run with node:

node ./examples/function-decl.js

The script is parsed in AST form, which you can modify, and then converted back to JavaScript. I'm not sure what kind of API cafe will have, really, but this seemed like something cool and easy to show. There are more tricks possible.


There's also an Objective-J to JavaScript compiler. It doesn't contain the Objective-J runtime or anything, but could help catch syntactic errors. It probably needs an official once over from 280North to make sure it's correct, but when it is it should be better at catching syntax errors than the official Objective-J parser.

harmony.js (soon)

I plan to have a Simple Modules to JavaScript and CommonJS module compilation and other syntactic goodies.

(your js here).js

Whatever, let's go wild and add stuff.

To be continued...