[go: nahoru, domu]

Skip to content

Instantly share code, notes, and snippets.

View VictorTaelin's full-sized avatar

Victor Taelin VictorTaelin

View GitHub Profile
@VictorTaelin
VictorTaelin / ic_hoas_bug_complete_log.hvm1
Created September 3, 2024 11:43
IC HOAS BUG - COMPLETE LOG
<0>(HVM_MAIN_CALL)
----------------
<0>(HVM_MAIN_CALL)
----------------
<0>(Main)
----------------
<0>(Main)
----------------
<0>(Quote (APP (C2a) (C2b)) 0)
----------------
(Switch 0 z s) = z
(Switch n z s) = (s (- n 1))
// (λx(bod) arg)
// ------------- APP-LAM
// x <- arg
// bod
(APP (Lam bod) arg) =
(bod arg)
@VictorTaelin
VictorTaelin / optimal_evaluation_in_1_or_10_or_10_years.md
Last active September 4, 2024 11:04
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 / conversation_2024-08-28T19-40-20-814Z.md
Last active September 7, 2024 06:05
conversation_2024-08-28T19-40-20-814Z.txt

Refactoring Kind's switch with ChatSH

(This is a readable version of my ChatSH session. For the full log, click here.)

Taelin: Hello. We're going to refactor an aspect of the implementation of the Kind language. Are you ready? Start by doing 'ls', then 'cat kind-lang.cabal' to get familiar with the repo.

ChatSH: Certainly! I'm ready to help you refactor an aspect of the Kind language implementation. Let's start by examining the repository structure and the contents of the Cabal file.

ls &amp;&amp; echo "---" &amp;&amp; cat kind-lang.cabal
@VictorTaelin
VictorTaelin / sonnet_code_example.txt
Last active August 26, 2024 12:27
real world example / using Sonnet to code
SYSTEM:
You're a code completion assistant.
PROMPT:
-- Files for context:
-- Kind-Lang parser in Rust:
--
use crate::{*};
@VictorTaelin
VictorTaelin / example_prompt.txt
Created August 12, 2024 04:07
converting tt.hs to tt.hvm1
// tt.hs:
import Control.Monad (forM_)
import Data.Char (chr, ord)
import Debug.Trace
import Prelude hiding (LT, GT, EQ)
import System.Environment (getArgs)
import System.Exit (exitFailure)
import Text.Parsec ((<|>))
import qualified Data.Map.Strict as M
@VictorTaelin
VictorTaelin / tt.hs
Created August 9, 2024 22:46
yet another...
import Control.Monad (forM_)
import Data.Char (chr, ord)
import Debug.Trace
import Prelude hiding (LT, GT, EQ)
import System.Environment (getArgs)
import System.Exit (exitFailure)
import Text.Parsec ((<|>))
import qualified Data.Map.Strict as M
import qualified Text.Parsec as P
@VictorTaelin
VictorTaelin / dps_sup_nodes.md
Last active September 4, 2024 10:22
Accelerating Discrete Program Search with SUP Nodes

Accelerating Discrete Program Search

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 sha

@VictorTaelin
VictorTaelin / fast_dps_add_carry.md
Last active August 31, 2024 04:02
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 September 2, 2024 19:34
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