Sergi shows an easy way to extend the syntax of JavaScript without having to create a new language. Using sweet.js macros created by Mozilla's Tim Disney, we can extend our favorite language without making big sacrifices, we can add a few small features to our favorite language or we can create entire DSLs that help with the problem at hand, all in an easy way.
30. Use cases
Try proposed syntax before it makes into the language
Create Micro-DSLs for your scenario
Use ideas from other languages
Make the new <your-silly-name-here>Script
Implement basic types
You get the idea
31. Start using it now
Node.js
> npm install sweet.js
> sjs -o output.js test_macros.sjs
> node output.js
Browser
https://github.com/iammerrick/require-sweet