Skip to content

Instantly share code, notes, and snippets.

View VictorTaelin's full-sized avatar

Victor Taelin VictorTaelin

View GitHub Profile
@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
@VictorTaelin
VictorTaelin / optimize_interaction_calculus_prompt.txt
Created November 7, 2025 11:17
challenge: optimize a reference interaction calculus implementation
{-# 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
TIMELINE DE EVENTOS:
000000000011111
012345678901234
____d_D____d_D____________________________________________________________________ A
\ \ / /
\ \/ /
_______\/\/_______________________________________________________________________ Server
\ \
\ \
@VictorTaelin
VictorTaelin / enum_bin_tree.hvm
Created September 16, 2025 19:55
enumerating binary trees with 1 label
// Enumerating Binary Trees with 1 label
// -------------------------------------
data Tree { #L #N{a b} }
// Recursive: requires label forking
@sp0(x) = (+ 0 (* x 2))
@sp1(x) = (+ 1 (* x 2))
@VictorTaelin
VictorTaelin / kaelim.fmc
Created August 31, 2025 17:05
Kaelin - Formality Core - Elementary Affine Type THeory
// https://github.com/MaisaMilena/kaelin/blob/db1eff57aaca6d0936e1a9210da0855c5d17d45a/formality/stdlib/kaelin.fmc
// ## Kaelin
//
// A simple, blockhain-enabled MOBA implemented in Formality-Core.
//
// Kaelin aims to capture some of the spirit of a MOBA, inluding map awareness,
// micro and macro strategies, resource control, team-fights, skillshots and so
// on, while aiming blockchain-compatible by being very lightweight (the entire
// game state has only 8192 bits) and based on ~20 second turns. This allows it
@VictorTaelin
VictorTaelin / hvm_new_spec
Created August 26, 2025 21:29
HVM new spec
# ./HVM.hs #
# HVM
HVM is functional language and prover based on 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 thunks are used, where 2 vars refer to the same value.
- Accessing a thunk triggers an incremental, layer-by-layer copy of the value.