This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git remote -vv | |
origin [email protected]:dhil/wasm-stack-switching.git (fetch) | |
origin [email protected]:dhil/wasm-stack-switching.git (push) | |
spec [email protected]:WebAssembly/spec.git (fetch) | |
spec [email protected]:WebAssembly/spec.git (push) | |
upstream [email protected]:WebAssembly/stack-switching.git (fetch) | |
upstream [email protected]:WebAssembly/stack-switching.git (push) | |
$ git diff spec/wasm-3.0 | |
diff --git a/README.md b/README.md | |
index cbc17b46..fde9c1c7 100644 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module $co2 | |
(type $task (func (result i32))) ;; type alias task = [] -> [] | |
(type $ct (cont $task)) ;; type alias ct = $task | |
(tag $pause (export "pause")) ;; pause : [] -> [] | |
(tag $cancel (export "cancel")) ;; cancel : [] -> [] | |
;; run : [(ref $task) (ref $task)] -> [] | |
;; implements a 'seesaw' (c.f. Ganz et al. (ICFP@99)) | |
(func $run (export "seesaw") (param $up (ref $ct)) (param $down (ref $ct)) (result i32) | |
(local $result i32) | |
;; run $up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# A thin wrapper around wasmtime's CLI to easily run WasmFX programs. | |
# | |
DEBUG_BIN=~/projects/wasmfx/wasmtime/target/debug/wasmtime | |
RELEASE_BIN=~/projects/wasmfx/wasmtime/target/release/wasmtime | |
WASMTIME=$DEBUG_BIN | |
WFLAGS="exceptions,function-references,typed-continuations" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Typing the Y combinator in Rust. | |
// $ rustc y.rs -o y | |
// $ .y | |
// 720 | |
// Succ(Succ(Succ(Succ(Succ(Succ(Zero)))))) | |
use std::fmt; | |
trait Apply<A, B> { | |
fn apply(&self, f: &dyn Apply<A, B>, x: A) -> B; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jshint globalstrict: true */ | |
/* jshint esversion:6 */ | |
'use strict'; | |
/* First-order continuation module */ | |
const _$K = (function() { | |
return Object.freeze({ | |
'kind': 'Default_Continuation', | |
'apply': function(k, arg) { | |
return k(arg); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TOGGLE=/tmp/.saturate-toggle | |
if [ ! -e $TOGGLE ]; then | |
touch $TOGGLE | |
nvidia-settings -a DigitalVibrance=1000 | |
else | |
rm $TOGGLE | |
nvidia-settings -a DigitalVibrance=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: runlinks [debug] [application.links] | |
LINKSHOME="$HOME/projects/links/my-links" | |
CONFIG="$LINKSHOME/handlers.config" | |
LINKSPATH="$LINKSHOME/examples:$LINKSHOME/examples/games:$LINKSHOME/examples/handlers:$LINKSHOME/examples/dictionary" | |
PROG=$1 | |
DEBUG="" | |
if [[ $1 = "debug" ]]; then | |
DEBUG="-d" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Acknowledgement: this idea is adapted from Raphaël Rigo (https://twitter.com/_trou_/status/1313951783182651393?s=20). | |
if [[ -z "${1+x}" || -z "${2+x}" || -z "${3+x}" ]]; then | |
echo "usage: $(basename $0) <source-file> <text> <output-file>" | |
exit 0 | |
fi | |
convert -density 150 -fill "rgba(255,0,0,0.25)" -gravity Center -pointsize 80 -draw "rotate -45 text 0,0 \"$2\"" "$1" "$3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Links types refactoring. | |
Initial draft. 2020-04-16. | |
*) | |
module StringMap = Map.Make(struct type t = string let compare = String.compare end) | |
type 'a point = unit | |
module Kind = struct | |
type primary = Type | Presence | Row | |
type secondary = Session | Effect | |
type t = primary * secondary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Typing the Y combinator in C#. | |
// $ mcs y.cs | |
// $ mono y.exe | |
// 720 | |
// Succ(Succ(Succ(Succ(Succ(Succ(Zero)))))) | |
using System; | |
class YCombinator { |
NewerOlder