JAMES LONG

Tag: macros

Compiling JSX with Sweet.js using Readtables

July 2, 2014
<a href="http://facebook.github.io/react/docs/jsx-in-depth.html">JSX</a> is a Facebook project that embeds an XML-like language in JavaScript, and is typically used with <a href="http://facebook.github.io/react/">React</a>. Many people love it and find it highly useful. Unfortunately it requires its own compiler and doesn't mix with other language extensions. I have implemented a <a href="https://github.com/jlongster/jsx-reader">JSX "compiler"</a> with <a href="http://sweetjs.org/">sweet.js</a> macros, so you can use it alongside any other language extensions implemented as macros.

Sweet.js Tutorial #2: Recursive Macros and Custom Pattern Classes

March 12, 2014
This tutorial explores how to write more complex sweet.js macros. There are several use cases which require more control over pattern matching, and recursive macros and pattern classes allow this and let you build abstractions when writing macros.

Writing Your First Sweet.js Macro

February 6, 2014
This is the first entry in a series about writing JavaScript macros with <a href="http://sweetjs.org/">sweet.js</a>. You will learn how to write your first macro, basics of pattern matching, and how to run the sweet.js compiler and use sourcemaps for debugging.

Stop Writing JavaScript Compilers! Make Macros Instead

January 7, 2014
JavaScript is everywhere, but that's a double-edged sword. It's hard for everyone involved to agree on how the language should move forward, let alone implement changes in all implementations. Some people write compilers to implement extensions, but that's bad. sweet.js is a new project that implements macros for JavaScript, and it's much better way to implement language extensions.

Why sweet.js Matters

October 26, 2012