Skip to content

Instantly share code, notes, and snippets.

View mikesol's full-sized avatar
🎯
Focusing

Mike Solomon mikesol

🎯
Focusing
View GitHub Profile
@mikesol
mikesol / ctor-enforcement-spike.ts
Created February 22, 2026 19:15
Spike: ExtractKinds + StrictPlugin for ctor-kind consistency enforcement
/**
* Spike: enforce ctor-kind consistency at the Plugin type level.
*
* ExtractKinds<T> recursively walks a type tree and collects all CExpr
* kind strings — through functions, builder chains, nested objects,
* closure returns, and callback parameter types.
*
* StrictPlugin uses this to reject plugins where ctors produce CExpr
* nodes with kinds not declared in the `kinds` map.
*
@mikesol
mikesol / spike-ur-bridge.ts
Last active February 18, 2026 20:38
Issue 190: Codex ur-spike 0
import { fromTypedAdj, type Desc, type Expr, type NodeEntry, type RuntimeNode } from "./spike-ur-core";
export interface DagBridge {
expr: Expr<unknown, Desc<unknown, string, Record<string, NodeEntry<string, string[], unknown>>, string, true>>;
}
function nextIdRuntime(s: string): string {
const chars = s.split("");
for (let i = chars.length - 1; i >= 0; i--) {
if (chars[i] !== "z") {
@mikesol
mikesol / spike-bidir-gc.ts
Last active February 18, 2026 18:54
Expr<O, R> spike: content-addressed DAG with type-safe AST rewrites (issue #190)
// ============================================================
// Spike: Bidirectional graph + type-level gc via parent chains
// ============================================================
//
// Hypothesis: storing reverse adj (child → parents) enables gc
// without forward graph traversal. Each orphan check walks UP
// the parent chain to root — bounded by tree DEPTH, not node COUNT.
// ============================================================
// ============================================================
@mikesol
mikesol / spike.ts
Last active February 17, 2026 06:40
Spike: end-to-end phantom kind propagation (validates #233)
/**
* Spike: end-to-end phantom kind propagation with branded Interpreter.
* Validates the approach described in #233 on a small scale.
*
* Run: npx tsc --noEmit (uses tsconfig.json)
*/
// ============================================================
// Typed node interfaces
// ============================================================
@mikesol
mikesol / async-spike.ts
Last active February 16, 2026 10:55
Spike: typed, stack-safe, single-concept foldAST for mvfm (issue #189)
// =============================================================
// ASYNC SPIKE: typed async generators + trampoline +
// WeakMap memoization + taint tracking
// =============================================================
// --- Foundation types ----------------------------------------
interface Expr<T> {
readonly kind: string;
readonly __T?: T;
@mikesol
mikesol / jam.txt
Created December 7, 2021 15:44
07-12-2021
<
[psr:3 bd [notes:2,hh*2] [notes:3,chin*4]]
[bd bd [notes:4,hh*2] [notes:5,chin*4]]
[psr:3 bd [notes:6,hh*2] [notes:7,chin*4]]
[bd bd [notes:8,hh*2] [notes:9,chin*4]]
[[psr:3 psr:3] bd [notes:2,hh*2] [notes:3,chin*4]]
[bd bd [notes:8,hh*2] [notes:9,chin*4]]
[psr:3 bd [notes:9,hh*2] [notes:8,chin*4]]
[bd bd [notes:10,hh*2] [notes:6,chin*4]]
[psr:3 bd [notes:9,hh*2] [notes:7,chin*4]]
@mikesol
mikesol / Main.purs
Last active October 25, 2021 13:30
m i n i m a l
module Main where
import Prelude
import Effect (Effect)
import WAGS.Lib.Learn (play)
import WAGS.Lib.Tidal (AFuture, tdl)
import Prelude
import Data.Array ((..))
@mikesol
mikesol / Main.purs
Last active October 25, 2021 13:25
Tablas and lighters
module Main where
import Prelude
import Effect (Effect)
import WAGS.Lib.Learn (play)
import WAGS.Lib.Tidal (AFuture, tdl)
import Data.Lens (_Just, set, traversed)
import Data.Profunctor (lcmap)
import WAGS.Math (calcSlope)
@mikesol
mikesol / Main.purs
Last active October 26, 2021 14:03
LoFi
module Main where
import Prelude
import Data.Lens (_Just, set, traversed)
import Data.Newtype (unwrap)
import Data.Profunctor (lcmap)
import Effect (Effect)
import Math ((%))
import WAGS.Create.Optionals (highpass, pan)
@mikesol
mikesol / Main.purs
Created October 13, 2021 06:50
Avoiding unsafe
module Main where
import Prelude
import Data.Maybe (Maybe, maybe)
import Data.Traversable (traverse)
import Debug (spy)
import Effect (Effect)
import Effect.Exception (throw)
import Web.DOM.Element (getAttribute, toNode)