Skip to content

Instantly share code, notes, and snippets.

@VictorTaelin
VictorTaelin / hard_ai_debugging_prompt.txt
Last active March 1, 2025 23:03
Hard AI Debugging Prompt / SupTT Codebase
This is a debugging challenge.
Read the document below, and identify the bug.
---
# The Interaction Calculus
The Interaction Calculus (IC) is term rewriting system inspired by the Lambda
Calculus (λC), but with some major differences:
1. Vars are affine: they can only occur up to one time.
@VictorTaelin
VictorTaelin / dps_sup_nodes.md
Last active April 20, 2025 14:33
Accelerating Discrete Program Search with SUP Nodes

Fast Discrete Program Search 2

I am investigating how to use Bend (a parallel language) to accelerate Symbolic AI; in special, Discrete Program Search. Basically, think of it as an alternative to LLMs, GPTs, NNs, that is also capable of generating code, but by entirely different means. This kind of approach was never scaled with mass compute before - it wasn't possible! - but Bend changes this. So, my idea was to do it, and see where it goes.

Now, while I was implementing some candidate algorithms on Bend, I realized that, rather than mass parallelism, I could use an entirely different mechanism to speed things up: SUP Nodes. Basically, it is a feature that Bend inherited from its underlying model ("Interaction Combinators") that, in simple terms, allows us to combine multiple functions into a single superposed one, and apply them all to an argument "at the same time". In short, it allows us to call N functions at a fraction of the expected cost. Or, in simple terms: why parallelize when we can share?

A

@hirrolot
hirrolot / a-preface.md
Last active April 24, 2025 05:34
A complete implementation of the positive supercompiler from "A Roadmap to Metacomputation by Supercompilation" by Gluck & Sorensen

This is the predecessor of Mazeppa.

Supercompilation is a deep program transformation technique due to V. F. Turchin, a prominent computer scientist, cybernetician, physicist, and Soviet dissident. He described the concept as follows [^supercompiler-concept]:

A supercompiler is a program transformer of a certain type. The usual way of thinking about program transformation is in terms of some set of rules which preserve the functional meaning of the program, and a step-by-step application of these rules to the initial program. ... The concept of a supercompiler is a product of cybernetic thinking. A program is seen as a machine. To make sense of it, one must observe its operation. So a supercompiler does not transform the program by steps; it controls and observes (SUPERvises) the running of the machine that is represented by th

@badamczewski
badamczewski / Morph.cs
Created December 1, 2020 14:11
Text Morphing in WPF
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;
namespace WPFAnimations
@jhewlett
jhewlett / new-fsharp-kata.sh
Created April 8, 2019 03:39
Template for F# Coding Exercies (simple class library and test project)
mkdir Kata
cd Kata
dotnet new sln
mkdir App
cd App
dotnet new classlib -lang F#
@jdh30
jdh30 / MicroKanren.fs
Created February 18, 2017 15:26
MicroKanren ported from Scheme to F#
type Term =
| Var of int
| Pair of Term * Term
| Int of int
let (|Find|_|) s k = Map.tryFind k s
let rec walk (s: Map<_,_>) = function
| Var(Find s t) -> walk s t
| t -> t
@jwosty
jwosty / StateBuilder.fsx
Created March 24, 2016 23:44
F# state monad / computation expression builder, and example usage
open System
open System.IO
type State<'s, 'a> = State of ('s -> ('a * 's))
module State =
let inline run state x = let (State(f)) = x in f state
let get = State(fun s -> s, s)
let put newState = State(fun _ -> (), newState)
let map f s = State(fun (state: 's) ->
@riyadparvez
riyadparvez / StreamTokenizer.cs
Last active February 6, 2024 07:40
C# port of java's StreamTokenizer class. Everything kept same except some renaming for following C# naming convention. And it also implements IEnumerable for foreach support
/**
* The <code>StreamTokenizer</code> class takes an input stream and
* parses it into "tokens", allowing the tokens to be
* Read one at a time. The parsing process is controlled by a table
* and a number of flags that can be set to various states. The
* stream tokenizer can recognize identifiers, numbers, quoted
* strings, and various comment styles.
* <p>
* Each byte Read from the input stream is regarded as a character
* in the range <code>'&#92;u0000'</code> through <code>'&#92;u00FF'</code>.
open System
type Cont<'T> =
abstract Call<'R> : ('T -> 'R) * (exn -> 'R) -> 'R
let protect f x cont econt =
let res = try Choice1Of2 (f x) with err -> Choice2Of2 err
match res with
| Choice1Of2 v -> cont v
| Choice2Of2 v -> econt v