Skip to content

Instantly share code, notes, and snippets.

View axelbdt's full-sized avatar

Axel Baudot axelbdt

View GitHub Profile
@VictorTaelin
VictorTaelin / solving_the_mystery.md
Last active November 17, 2024 14:32
Solving the mystery behind Abstract Algorithm’s magical optimizations

Note: This is an old post from back when I was trying to make sense of why inets are so fast for evaluating some λ-terms. It has some silly bits, I learned a lot since and could probably write a better article today, but I think this can still be insightful for these getting started, so I'll leave it here.

Yesterday, I reported the bizarre observation that certain functions can behave as if they had negative complexity. If you haven’t checked that article yet, it isn’t necessary, but you should, as it may blow your mind. In short, the λ-term f(bits) = copy(comp(inc,n,bits)), when given to optimal λ-calculus evaluator, is asymptotically faster than g(bits) = comp(inc,n,bits); i.e.,copy (a O(1) operation for a fixed size) behaves as if it had a O(1/n) complexity, causing the program to run faster by doing more things (!?).

That’s not the only bizarre complexity result I had when

@VictorTaelin
VictorTaelin / optimal_evaluation_in_1_or_10_or_10_years.md
Last active March 10, 2025 07:54
Optimal Evaluation in 1 Minute or 10 Minutes or 10 Years

Optimal Evaluation in 1 Minute (or 10 Minutes) (or 10 Years)

Short Version (1 minute)

A prerequisite to intelligence is the ability to find a program that explains a pattern. Programs are functions. To test a candidate program, we need to implement a "function evaluator". The problem is: all modern programming languages are sub-optimal "function evaluators", which, in the context of search, leads to massive slowdowns. To implement an optimal interpreter, we need to: 1. postpone the execution of expressions, to avoid wasted work, 2. cache the result of postponed expressions, to avoid duplicated work, 3. incrementally copy cached structures, to ensure 1 and 2 don't interfere. Haskell almost achieves this, but falls short on 3, because it is unable to incrementally copy lambdas. To solve this, we introduce the concept of a "superposition", which allows multiple versions of a term to exist simultaneously. This ensures that no work is ever wasted or duplicated, allowing us to optimally interpret (or com

@VictorTaelin
VictorTaelin / dps_sup_nodes.md
Last active January 23, 2025 20:12
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

@VictorTaelin
VictorTaelin / fast_dps_add_carry.md
Last active November 17, 2024 14:30
Fast Discrete Program Search with HVM Superpositions (SUP nodes) - finding ADD-CARRY

HOC's Fast Discrete Program Search (DPS)

HOC will soon (EOY?) launch an API for our DPS solution. The interface will be simple:

  • You give us a set of examples (input/output pairs)

  • We'll give you a (Python?) function that models it

And that's it. It will be an universal function finder.

@VictorTaelin
VictorTaelin / hoc_historical_overview.md
Last active February 9, 2025 09:35
Higher Order Company: Complete Historical Overview - WIP

Higher-Order Company: Complete Historical Overview

This document is a complete historical overview of the Higher Order Company. If you want to learn anything about our background, a good way to do so is to feed this Gist into an AI (like Sonnet-3.5) and ask it any question!

My Search for a Perfect Language

It all started around 2015. I was an ambitious 21-year-old CS student who, somehow, had been programming for the last 10 years, and I had a clear goal:

I want to become the greatest programmer alive

@VictorTaelin
VictorTaelin / towards_an_optimal_computer.md
Last active March 9, 2025 23:20
Higher-Order Company: Towards an Optimal Computer

Higher-Order Company: Towards an Optimal Computer

What is the true nature of computation?

A hundred years ago, humanity answered that very question, twice. In 1936, Alan invented the Turing Machine, which, highly inspired by the mechanical trend of the 20th century, distillated the common components of early computers into a single universal machine that, despite its simplicity, was capable of performing every computation conceivable. From simple numerical calculations to entire

@andymatuschak
andymatuschak / States-v3.md
Last active February 20, 2025 22:22
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

@edliaw
edliaw / custom_xkb.desktop
Last active April 23, 2024 18:32
Custom keyboard layout for GNOME
[Desktop Entry]
Name=Keyboard Layout
Type=Application
Exec=sh -c "sleep 10 && [ -f \\$HOME/.Xkeymap ] && xkbcomp \\$HOME/.Xkeymap \\$DISPLAY 2> /dev/null"
Terminal=false
NoDisplay=true
X-GNOME-Autostart-enabled=true