Skip to content

Instantly share code, notes, and snippets.

View VictorTaelin's full-sized avatar

Victor Taelin VictorTaelin

View GitHub Profile
@VictorTaelin
VictorTaelin / hvm4_pretty_printer_prompts.md
Created December 18, 2025 22:15
Opus 4.5 vs Codex 5.2 - complete HVM4's pretty printer

https://x.com/VictorTaelin/status/2001777678765129832

Opus 4.5 - chat log

 * ▐▛███▜▌ *   Claude Code v2.0.72
* ▝▜█████▛▘ *  Opus 4.5 · Claude Max
 *  ▘▘ ▝▝  *   ~/vic/dev/hvm4-claude

> # Task 1: print unscoped lambdas and floating dups with matching names
@VictorTaelin
VictorTaelin / fully_linear_sort.hs
Last active December 10, 2025 14:14
fully linear sort, no with-clauses, no mutual recursion
module Main where
data Nat = Z | S Nat deriving Eq
data Nats = N | C Nat Nats deriving Eq
data Bit = T | F deriving Eq
-- Sort
-- ----
tmap :: (Nat -> Nat) -> (Nat -> Nat) -> (Nat, Nat) -> (Nat, Nat)
commit 4ffb261f8a43be0c5891e0725f1ea709147eeb7e
Author: VictorTaelin <[email protected]>
Date: Sun Dec 7 11:53:52 2025 -0300
Make commas and semicolons optional in parser
- Superposition: &L{A,B} or &L{A B}
- Fork params: &Lλx,y,z{...} or &Lλx y z{...}
- Fork branches: semicolons now optional between and after branches
- Constructor args: #Foo{a,b} or #Foo{a b}
@VictorTaelin
VictorTaelin / hvm4.txt
Created December 7, 2025 16:13
HM4 commit history
commit 4ffb261f8a43be0c5891e0725f1ea709147eeb7e
Author: VictorTaelin <[email protected]>
Date: Sun Dec 7 11:53:52 2025 -0300
Make commas and semicolons optional in parser
- Superposition: &L{A,B} or &L{A B}
- Fork params: &Lλx,y,z{...} or &Lλx y z{...}
- Fork branches: semicolons now optional between and after branches
- Constructor args: #Foo{a,b} or #Foo{a b}
Let $a<b<c$ be distinct natural numbers. Must every block of $c$ consecutive natural numbers contain three distinct numbers whose product is a multiple of $abc$? Do not use search or tools.
gemini 3 deep think:
Yes, the statement is true.
Let $a<b<c$ be distinct natural numbers. Let $S$ be a block of $c$ consecutive natural numbers. We want to show that there exist three distinct numbers $x, y, z \in S$ such that $abc$ divides $xyz$.
We proceed by induction on $c$.
@VictorTaelin
VictorTaelin / gameboy.txt
Created November 18, 2025 19:02
gameboy retro mon catcher game prompt
Implement a retro web game inspired by Pokémon Red.
Include a demo playground map, with:
- a shop that you can enter and exit
- a small grass area that you can step into and encounter monsters
- an NPC that you can talk to
LAYOUT AND GRAPHICS:
The screen resolution must be natively 160x144, scaled up 4x for rendering, with
@VictorTaelin
VictorTaelin / prompt_debug_wnf_spos_hvm4_supgen.txt
Created November 18, 2025 18:26
Prompt: debug WNF_SPOS issue on HVM4 / SupGen
=== 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.
@VictorTaelin
VictorTaelin / tuple_rotl.txt
Created November 18, 2025 18:21
λ-calculus tuple rotl problem
Implement a λ-Term named `rotL` that, when applied to a function F, a Church Nat
N, and a Church N-Tuple, returns the same Church N-Tuple, but with elements
shifted left. In other words, create a generic 'rotL<N,F,t>' function for
N-tuples. Example:
- (rotL λf.λx.(f (f x)) λt.(t 1 2)) == λt.(t 2 1)
- (rotL λf.λx.(f (f (f x))) λt.(t 1 2 3)) == λt.(t 2 3 1)
Your final answer must be a λ-Term that implements `rotL` correctly, as follows:
@rotL = term_here
NOTE: Don't omit parenthesis. Each application requires them. Example:
module Main where
import Unsafe.Coerce (unsafeCoerce)
data Term
= App Term Term
| Var String
| Ct0
| Ct1 Term
| Ct2 Term Term
@VictorTaelin
VictorTaelin / optimize_interaction_calculus_to_c_prompt.txt
Last active November 7, 2025 21:38
optimize interaction calculus from Haskell to pure C
{-# LANGUAGE MultilineStrings #-}
import Data.IORef
import Debug.Trace
import System.IO.Unsafe
import Text.ParserCombinators.ReadP
import qualified Data.Map as M
type Lab = String
type Name = String