Skip to content
vic

sweet-js/sweet-core

Sweeten your JavaScript.

sweet-js/sweet-core.json
{
"createdAt": "2012-08-01T19:26:02Z",
"defaultBranch": "master",
"description": "Sweeten your JavaScript.",
"fullName": "sweet-js/sweet-core",
"homepage": "https://www.sweetjs.org",
"language": "JavaScript",
"name": "sweet-core",
"pushedAt": "2017-10-26T12:24:08Z",
"stargazersCount": 4572,
"topics": [
"javascript",
"macros",
"parser"
],
"updatedAt": "2025-11-26T19:34:36Z",
"url": "https://github.com/sweet-js/sweet-core"
}

Build Status

Join the chat at https://gitter.im/mozilla/sweet.js

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 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!

Install the command line app with npm:

Terminal window
$ npm install -g @sweet-js/cli

Write your sweet code:

syntax hi = function (ctx) {
return #`console.log('hello, world!')`;
}
hi

And compile:

Terminal window
$ sjs my_sweet_code.js
console.log('hello, world!')