Tag: js

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.

A Closer Look at Generators Without Promises

June 7, 2013
In my last post, I studied how combining promises and generators provides a nice solution for callback hell. Here I look at a few solutions for simply using generators, without promises at all, in node to write nice async code.

A Study on Solving Callbacks with JavaScript Generators

June 5, 2013
Callback hell is a real problem in node.js. Since generators have landed in V8, I take a look at how we can write code with them, leveraging promises to handle the details. This technique vastly improves code with asynchronous workflows.

My JSConf 2013 Diary

May 29, 2013
While at JSConf 2013 I'm taking notes for each talk and taking pictures so that I don't miss anything. Check this out if you are interested in what's going on at JSConf.

Compiling LLJS to asm.js

March 25, 2013
Mozilla recently announced asm.js, a specification of a restricted subset of javascript that can be ridiculously optimized. It's difficult to write by hand, so I ported a language called LLJS to compile to it, unlocking high performance in browsers with a C-like language.

Reflections on My Game Off Experience

December 10, 2012
After an intense few weeks building a multiplayer first person shooter on the web, I take a look at what I achieved and what I did wrong.

Making Web Games #5: Authoritative Server

November 26, 2012
Now that I have a multiplayer server working for my WebGL FPS, I improve it to become an "authoritative server". It runs client-side prediction and interpolation to keep gameplay smooth but reject any cheating.

Making Web Games #4: Multiplayer Networking

November 23, 2012
First person shooters aren't very fun unless you can play with other people. In this article I show how I implemented a basic multiplayer server for my game.

Making Web Games #3: 3d Engine

November 15, 2012

Why sweet.js Matters

October 26, 2012