Skip to content

Instantly share code, notes, and snippets.

View munificent's full-sized avatar

Bob Nystrom munificent

View GitHub Profile
@munificent
munificent / Sieve.mag
Created June 14, 2011 17:06 — forked from dscleaver/Sieve.mag
Implementation of the Sieve of Eratosthenes in Magpie
import async
def spawnGenerator(channel is Channel)
run with for i = count(from: 2, by: 1) do channel send(i)
end
def spawnFilter(in is Channel, prime is Int)
val out = Channel new(1)
run with
while true do
@munificent
munificent / 2 - Plan 9
Created July 20, 2011 04:13
UNIX V5, OpenBSD, Plan 9, FreeBSD, and GNU coreutils implementations of echo.c
#include <u.h>
#include <libc.h>
void
main(int argc, char *argv[])
{
int noNewline;
int arg, length;
char *output, *p;
@munificent
munificent / HelloDartTest.dart
Created November 22, 2011 06:05
Dart Compilation
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Simple test program invoked with an option to eagerly
// compile all code that is loaded in the isolate.
// Compiled using frog, the in-progress self-hosted compiler:
// dart/frog$ ./frogsh --out=hello.js --compile-only samples/hello.dart
class HelloDartTest {
static testMain() {