Skip to content

Instantly share code, notes, and snippets.

View kriskowal's full-sized avatar

Kris Kowal kriskowal

View GitHub Profile

Modules Harmony Simplification Effort

Disclaimer: This text is exclusively focused on the existing capabilities of the language, and does not weight into additional capabilities like wasm, or virtual modules, or compartments. Those can be discussed later on.

MVP to create a module graph

The bare minimum mechanism to create a module graph that matches ESM requires few main pieces:

  1. A portable (serializable) structure that represents the source text of the module. ModuleSource must be portable across processes and across realms.
  2. A realm based Module that closes over a ModuleSource.
@kriskowal
kriskowal / kni-markdown-style.md
Last active December 12, 2018 01:54 — forked from snowyu/kni-markdown-style.md
The new style markdown KNI

Starting with @snowyu’s proposal I infer some design principles:

  1. This language is designed to be easy to render using existing Markdown, YAML, and syntax highlighters.
  2. The language should break out to TypeScript that is evaluated in the scope of a global object that represents all of the play state.
  3. The Markdown script is a Markdown subset that uses inline backtick expressions to break out to an annotation language that carry semantics.
  4. The annotation language embeds the TypeScript grammar for evaluating expressions.

My iteration on this design adds some detail:

  1. We use a Markdown variant that forbids arbitrary HTML, adds semantics to list item notation, and uses backticks for annotations.
@kriskowal
kriskowal / Authors of GG CLA.md
Last active October 4, 2018 17:49 — forked from CLAassistant/SAP_CLA
Authors of GG Contributor License Agreement

Authors of GG Individual Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by Authors of GG (“Authors”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Authors in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please

@kriskowal
kriskowal / index.js
Last active January 7, 2016 22:55 — forked from brianleroux/index.js
callback-with-promise
const fs = require('fs')
function readPackage(callback) {
return fs.readFile('./package.json').nodeify(callback);
}
module.exports.readPackage = readPackage
var DIR = '/tmp/test',
FILE_PATTERN = /test/,
fs = require('q-io/fs');
fs.list(DIR)
.then(function (files) {
var matched = files.filter(function (item) {
return item.match(FILE_PATTERN);
});
if (matched.length !== 1) {

HORSES AND PONIES and WAGONS n CARTS:

By Deb White, Seattle, [NWRinger]

Can horses swim the Brandywine?

The Fellowship of the Ring, 112 the question of whether or not horses can cross the Brandywine River comes up at Buckleberry Ferry. We know that at least 1 hobbit pony can ride the ferry, as Merry takes his across on it when he searches for Frodo who is late to arrive; but there doesn’t seem to be an ability for them, either ponies or horses, to swim it at this point, they must go up to the Bridge or down to Sarn Ford, as Merry’s response to Frodo is: “Can horses cross the river?”

“They can go twenty miles north to Brandywine Bridge - or they might swim,” answered Merry, “Though I never heard of any horse swimming the Brandywine.”

@kriskowal
kriskowal / README.md
Created August 23, 2012 02:29 — forked from aaronj1335/README.md
bootstrapping mr
We couldn’t find that file to show.
@kriskowal
kriskowal / huffman.py
Created July 24, 2012 16:32 — forked from ryanwitt/huffman.py
silly huffman coding example
__all__ = (
'build',
'endode',
'decode',
)
phrase = 'A man a plan a canal Panama'.lower()
def build(phrase):
"""
@kriskowal
kriskowal / streams.js
Created April 9, 2012 18:06 — forked from domenic/streams.js
Streams are painful
var IO = require("q-io");
function exists(id) {
var deferred = Q.defer();
var request = knoxClient.get(id);
request.on("error", deferred.reject);
request.on("response", function (response) {
if (response.statusCode === 200)
deferred.resolve(IO.Reader(response));
} else {
@kriskowal
kriskowal / streams.js
Created March 19, 2012 20:02 — forked from domenic/streams.js
Streams are painful
function promiseResponse(request) {
var deferred = Q.defer();
request.on("error", deferred.reject);
request.on("response", deferred.resolve);
return deferred.promise
// if you must:
.fin(function () {
request.removeListener("error", deferred.reject);
request.removeListener("response", deferred.resolve);
});