I worked last years with python language. And when I tried to switch to node.js and create both backed and frontend on JavaScript only - I found that JS lacks some cool features from other part of the World.
In this project I implement compiler from Nice.js syntax to plain JavaScript (now on python, but in near future - on JS). I believe that you are using Underscore.js to simplify your coding life. I also use it, and in resulting code you will see _()
syntax.
Resulting code is readable like your original code on Nice.js. We transform only short forms of code to full form of plain JS.
And the greatest part of this project that you can use classes like in other OOP languages.
You can find syntax description in folder tests.
This is part of them:
- classes -
class MyClass extends BaseClass {...}
- conditions -
if (10 not in list)
orif (a == b or c and d)
- loops -
for (x, y in obj)
and[year for year in years if year <= 30]
- etc
Thank you for interest to this project. It's fun. And it's helpful. I am trying to change our development life to implement our amazing ideas faster and easier.
Feel free to contact me, add new propositions in comments to files or by creating issues. It will be happy to review your pull requests and discuss with you.