Skip to content

Instantly share code, notes, and snippets.

View Yoric's full-sized avatar

David Teller Yoric

View GitHub Profile
@Yoric
Yoric / migration.md
Last active July 13, 2018 23:22 — forked from jonco3/migration.md
Migrating from JSM to ES6 modules

This document shows a possible migration path from Cu.import() to ES modules for the code of Firefox.

Objectives

Use standard JavaScript, to simplify the use of third-party tools (e.g. static analysis, code rewriting, smart IDEs) and onboarding of new developers.

Requirements

  1. Preserve current JSM semantics where multiple imports of a single module from different globals results in a single module instance that lives in a separate global to the importer.
  2. Add-ons and Thunderbird should not be affected by the migration.
@Yoric
Yoric / categories.md
Created November 10, 2011 15:33 — forked from nikomatsakis/categories.md
"Categories", "object extensions", or just "objects without classes"

Categories

Goals

This proposal is a bridge Haskell's type classes and class-based OOP. It also addresses a pet theme of mine, which is the ability to add methods to classes and define groups of related methods together.

The core unit of organization is called a category, and it is a bundle of statically dispatched methods based on a shared receiver type (a