When comparing Opa vs Earl Grey, the Slant community recommends Earl Grey for most people. In the question“What are the best languages that compile to JavaScript? ” Earl Grey is ranked 29th while Opa is ranked 30th. The most important reason people chose Earl Grey is:
Earl Grey's macro system allows for creating powerful control structures that look just like builtin ones. EG also supports macro libraries which allows developers to provide their macros/DSLs for others to use.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Type Inferred
Opa uses type inference to decide what code runs on the client or the server, so you can organize code how you like, but still be sure that it runs where it needs to.
Pro Familiar Javascript Syntax
Opa's syntax is very similar to JavaScript, making it an easy choice for developers who are used to developing in JavaScript.
Pro Client and Server in the same language
Pro Powerful hygienic macros
Earl Grey's macro system allows for creating powerful control structures that look just like builtin ones. EG also supports macro libraries which allows developers to provide their macros/DSLs for others to use.
Pro Pattern matching
Pattern matching is an incredibly powerful tool that, once you've tried, you cannot live without. This is not your average hacked-together pattern matching but a complete and integral feature to the language.
Pro ECMAScript 6 Asynchrony
Earl Grey provides Promises based on ECMAScript version 6 and as many NPM libraries already implement. Earl Grey also provides a promisify
function that converts old-fashioned callback-style asynchrony to promises.
Pro Fully compatible with Node.js ecosystem
Anything available on NPM can be used just as easily with Earl Grey. In fact, everything else can be used too! Earl Grey has interfaces to Browserify, Webpack, and even experimental support for SystemJS. Earl Grey can even be used to generate npm packages that any node-compatible language can use!
Cons
Con Not popular
Opa is not as popular as other languages which compile to JavaScript. Making it harder to find learning resources or even answers if you get stuck somewhere.
Con Not true static typing
EG gives you the tools to implement your own type-checking inside of argument lists and elsewhere but there's no analysis done at compile-time like other compile-to-js languages.
Con Unfamiliar syntax
While the language shares a lot of DNA with Python, there are still many new (and interesting) features/sugar that may take some time to get used to.