• The little-endian web?

    Here’s the deal: typed arrays are not fully portable. On most browsers, this code will print 1:

    var a1 = new Uint32Array([1]);
    var a2 = new Uint8Array(a1.buffer);

    Read on →

  • Homoiconicity isn’t the point

    I’ve never really understood what “homoiconic” is supposed to mean. People often say something like “the syntax uses one of the language’s basic data structures.” That’s a category error: syntax is not a data structure, it’s just a representation of data as text. Or you hear “the syntax of the language is the same as the syntax of its data structures.” But S-expressions don’t “belong” to Lisp; there’s no reason why Perl or Haskell or JavaScript couldn’t have S-expression libraries. And every parser generates a data structure, so if you have a Python parser in Python, then is Python homoiconic? Is JavaScript?

    Read on →

  • Synchronous module loading in ES6

    One of the great features of ES6 modules is the direct style module loading syntax:

    import map from "underscore.js";
    ... map(a, f) ...

    This makes it as frictionless as possible to grow or refactor your code into multiple modules, and to pull third-party modules into an existing codebase. It also makes a common module format that can be shared between the browser and JS servers like Node.

    Read on →