Skip to content

Instantly share code, notes, and snippets.

View VictorTaelin's full-sized avatar

Victor Taelin VictorTaelin

View GitHub Profile
=== docs/HVM.md ===
# HVM
HVM is a fast C implementation of the Interaction Calculus.
It is a pure functional runtime like Haskell's GHC, with some peculiarities:
- Variables are affine, meaning they can only occur, at most, once.
- To copy values, linear dups are used, where 2 vars refer to the same value.
- Accessing a dup triggers an incremental, layer-by-layer copy of the value.
- Lambdas can also be cloned incrementally by linear dups.
//Write a complete λ-Calculus evaluator in TypeScript. Use {$:"Lam",...} etc. to
//emulate ADTs. Use switch for pattern-matching. Implement wnf, wnf_app, snf,
//show, parse, main, and more. Use HOAS (NO SUBST()). Field names must have
//exactly 3 letters. Test it on 2^2 (church-encoded). Print the result.
type Term =
| { tag: 'Var', idx: number }
| { tag: 'Abs', body: (v: any) => any }
| { tag: 'App', left: any, right: any };
### 256-Diverse-Games-Prompts
Remake Pac-Man: navigate a yellow circle through a dot-filled maze, eat all pellets to clear levels, avoid four ghosts with unique AI (chase/ambush/flank/wander), grab power pellets to eat blue ghosts, fruit bonuses, increasing speed, score counter, three lives, side tunnels wrap around
Remake Space Invaders: rows of aliens march sideways and descend, accelerating as fewer remain, player moves a cannon left/right firing upward, aliens shoot randomly, four destructible shields erode per hit, UFO crosses top for bonus, clear all aliens to advance, three lives, score
Remake Frogger: a frog crosses multi-lane roads dodging cars then hops onto logs, turtles, and gators crossing a river, reach five home bays before time runs out, hazards include submerging turtles and snakes, bonus flies in bays, progressive difficulty, five lives, high score
Remake Q*bert: hop on a pyramid of cubes changing their color on landing to match a target, avoid Coily the snake, Ugg/Wrongway on cube sides, an
@VictorTaelin
VictorTaelin / par_tree_sum.c
Created April 13, 2026 22:14
par_tree_sum.bend compiled to C
//# Tree sum: allocates a complete binary tree with U32 leaves 0,1,2,...
//# then sums all values in parallel. Tests heap-heavy parallel workloads.
//
//type Tree() {
// leaf{U32}
// node{Tree, Tree}
//}
//
//def build(d: U32, x: U32) -> Tree:
// match d:
#!/usr/bin/env python3
import json
import os
import sys
import time
import urllib.error
import urllib.request
~/.claude/skills/codex/SKILL.md
```
---
name: codex
description: Drives OpenAI's Codex CLI as a specialist executor in a driver/specialist loop. Use when user asks to "talk to codex", "ask codex", "codex review", "have codex look at this", or wants deep analysis/implementation delegated. Also use proactively for code review and architecture validation.
context: fork
allowed-tools:
- Bash(codex *)
- Bash(cat /tmp/claude/codex-*)
@VictorTaelin
VictorTaelin / foo.ts
Last active March 4, 2026 00:18
quick work
// LamBit.ts
// =========
// A minimal linear functional language with binary pattern matching.
//
// Func ::=
// | Mat ::= "λ" "{" "0" ":" Func ";" "1" ":" Func ";" "}"
// | Lam ::= "λ" Name "." Func
// | Ret ::= Term
//
// Term ::=
export const Nat = null;
export const List = null;
export const Char = null;
export const String = null;
export function $steps(n, acc) {
while (true) {
if (((n >>> 0) === (1 >>> 0)) ? 1 : 0) {
return acc;
}
@VictorTaelin
VictorTaelin / gist:4efe81318ce1576a0f01fd5ebd39e33f
Created February 18, 2026 20:42
test suite for pattern match elaboration into affine case-trees (λ-matches)
λn.
match n:
case #Z:
A
case #S{a}:
B(a)
//λ{#Z:A;#S:λa.B(a)}
λn.
match n:
@VictorTaelin
VictorTaelin / microgpt.py
Created February 12, 2026 00:58 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp