pufuwozu/roy — Issue #119: use contracts.coffee parser
Author: gregwebs
Created: 2012-02-24 15:16:10+00:00
State: open

I have ran into a lot of issues with the roughness of the parser. In addition, coffeescript has a lot of features (multi-line strings, string interpolation, ...) that Roy could get for free.

I think Roy would be on a lot better footing if it started with the coffeescript compiler and worked its way backwards. I would be fine with using coffeescript syntax actually. I would only protest if Roy switched from layout-based to brackets or used the full 'function' keyword. Roy isn't about copying Haskell syntax, it is about types!

Adopting coffeescript syntax would provide a lot of benefits. I am already writing in coffeescript, so transitioning my code to Roy would be a minimal amount of work. If I decided to abandon Roy, that would also require less work. Supporting abandoning is important for uptake. I was able to use coffeescript because I was able to claim that if we don't like it, we can just use the generated javascript.

I am trying out contracts.coffee now: http://disnetdev.com/contracts.coffee/

This project uses coffeescript syntax but also adds type annotations (they aren't actually types though, they are turned into contracts). It is being kept up to date, and seems like a perfect base for Roy.