Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sweet-js/sweet-core
Sweeten your JavaScript.
https://github.com/sweet-js/sweet-core
javascript macros parser
Last synced: about 1 month ago
JSON representation
Sweeten your JavaScript.
- Host: GitHub
- URL: https://github.com/sweet-js/sweet-core
- Owner: sweet-js
- License: bsd-2-clause
- Created: 2012-08-01T19:26:02.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-10-26T12:24:08.000Z (about 7 years ago)
- Last Synced: 2024-04-15T00:13:36.556Z (7 months ago)
- Topics: javascript, macros, parser
- Language: JavaScript
- Homepage: https://www.sweetjs.org
- Size: 23.6 MB
- Stars: 4,580
- Watchers: 131
- Forks: 206
- Open Issues: 66
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.BSD
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/sweet-js/sweet.js.svg)](https://travis-ci.org/sweet-js/sweet.js)
[![Join the chat at https://gitter.im/mozilla/sweet.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mozilla/sweet.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Hygienic Macros for JavaScript!
Macros allow *you* to build the language of your dreams. Sweeten JavaScript by defining new syntax for your code.
Currently, Sweet should be considered experimental and under heavy development ([re-development](https://medium.com/@disnet/announcing-sweet-js-1-0-e7f4f3e15594#.fo9kyqu48) more like). As such, the API will be undergoing a bit of churn until probably the end of the year. So, probably best not to try Sweet in production systems just yet. If you're interested in helping out though we'd love to have you!
# Getting started
Install the command line app with npm:
```sh
$ npm install -g @sweet-js/cli
```Write your sweet code:
```js
syntax hi = function (ctx) {
return #`console.log('hello, world!')`;
}
hi
```And compile:
```sh
$ sjs my_sweet_code.js
console.log('hello, world!')
```# Learning More
* Read the [tutorial](http://sweetjs.org/doc/1.0/tutorial.html).
* Read the [reference documentation](http://sweetjs.org/doc/1.0/reference.html).
* Play with the [editor](http://sweetjs.org/browser/editor.html).
* Discuss on [Google Groups](https://groups.google.com/forum/#!forum/sweetjs).
* Hang out on IRC: #sweet.js at irc.mozilla.org and on [Gitter](https://gitter.im/sweet-js/sweet.js).