I've been making some progress with Roy in the past few weeks. The
first big thing is support for modules.
Compiling a .roy file on the command-line will generate a .roym file
which contains exported type information:
numberToBinaryString: Function(Number, String)
Roy will then load those types in an `import` and use them for type
checking. If you use the Roy compiler in the browser, it will generate
an Immediately-Invoked Function Expression (IIFE) and some global var
statements. If you use the Roy compiler with node.js it will generate
CommonJS 1.0 `require` and `export` calls.
One interesting point is that you can manually write the .roym
descriptor and provide JavaScript implementations in a .js file:
exports.numberToBinaryString = function(x) {
return x.toString(2);
};
This will hopefully help with interoperability while I work on a good
standard library.
The second thing I'm getting excited about is Play 2.0 integration. If
you have a Play 2.0 app, you can just depend on the `Ray` plugin to
automatically compile .roy files to .js:
https://github.com/pufuwozu/ray
Let me know what you think.
- Brian McKenna
Hm, so right now if I want to precompile modules for browser, I'll
need to use browser for that?
--
Alexander
I'm definitely planning to make it a compile flag so you'll be able to
do it from node.js - I'll make that happen soon.