Skip to content

Instantly share code, notes, and snippets.

View sunny-g's full-sized avatar

Sunny Gonnabathula sunny-g

View GitHub Profile
@sunny-g
sunny-g / ulam.hoon
Created September 15, 2024 17:09 — forked from belisarius222/ulam.hoon
ulam -- self-describing hoon data structures
=>
|%
+$ ulam
$~ [%coin *coin]
:: leaves
::
$% [%coin =coin] :: atom, noun, or compound coin
[%path =pith] :: hoon path syntax
[%page =mark noun=*] :: %foo|bar, bar is coin blob
::
@sunny-g
sunny-g / tt.hs
Created August 10, 2024 00:05 — forked from VictorTaelin/tt.hs
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
@sunny-g
sunny-g / todays_refactor_kind2_sonnet.md
Created August 7, 2024 15:57 — forked from VictorTaelin/todays_refactor_kind2_sonnet.md
Today's Kind2 refactor by Sonnet 3.5 - 1 hour of work

good morning! I'd like to ask your help factoring some Kind2 files. it is a proof lang like the CoC, very minimal. I just want to change the style of global definitions. please cat the from_to.txt file I just wrote

Good morning! I'd be happy to help you with factoring your Kind2 files. Let's start by looking at the contents of the from_to.txt file you've written.

'''sh
cat from_to.txt
'''
# OLD STYLE:
@sunny-g
sunny-g / dps_sup_nodes.md
Created August 7, 2024 15:53 — forked from VictorTaelin/dps_sup_nodes.md
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

@sunny-g
sunny-g / fast_dps_add_carry.md
Created August 7, 2024 15:53 — forked from VictorTaelin/fast_dps_add_carry.md
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.

// Copy-paste into your console (or minify and save as a bookmarklet) to see any DOM in an almost-sorta-working 3D stack of DOM elements.
// The front faces are colored for debugging, if this gist can be fixed, they can return to their normal styling.
(function () {
const MAX_ROTATION = 180;
const DEPTH_INCREMENT = 25;
const PERSPECTIVE = 1000;
const SIDE_FACE_CLASS = 'side-face';
const MAX_DOM_DEPTH = getMaxDepth(document.body);
// Calculate color based on depth, ensuring lighter colors for deeper elements
@sunny-g
sunny-g / readme.md
Created December 15, 2023 21:47 — forked from firexcy/readme.md
DIY a Rewind.ai

This Gist provides a solution to periodically capture screenshots of your Mac, and create therefrom a searchable PDF archive so that you can always get an answer to the “what, when, and where” questions about your usages.

To use these scripts:

  1. Download the shell script rewind, then:
    1. put it under ~/bin (or other fixed path you prefer);
    2. execute
@sunny-g
sunny-g / hvm.rs
Created June 22, 2023 20:16 — forked from VictorTaelin/hvm.rs
Self-Contained HVM as a single Rust file with no FreeList
#![allow(clippy::identity_op)]
#![allow(dead_code)]
#![allow(non_snake_case)]
use std::collections::{hash_map, HashMap};
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use rand::prelude::*;
use std::time::Instant;
@sunny-g
sunny-g / notes.md
Created June 7, 2023 15:25 — forked from binji/notes.md
Compiling LLVM/Clang for Wasm notes
  • How to Cross Compile LLVM: https://llvm.org/docs/HowToCrossCompileLLVM.html
  • Building LLVM with CMake: https://llvm.org/docs/CMake.html
  • Hints from wasi-sdk Makefile: https://github.com/CraneStation/wasi-sdk/blob/master/Makefile
  • Try compiling natively (needed for llvm-tblgen and clang-tblgen)
    • cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;WebAssembly" -DLLVM_ENABLE_PROJECTS="lld;clang" ../llvm
  • Try building LLVM with WASI:
  • cmake -G Ninja -DCMAKE_AR=”/usr/local/google/home/binji/dev/llvm-project/build/bin/llvm-ar” -DCMAKE_RANLIB=”/usr/local/google/home/binji/dev/llvm-project/build/bin/llvm-ranlib” -DCMAKE_C_COMPILER="/usr/local/google/home/binji/dev/wasi-sdk-5.0/opt/wasi-sdk/bin/clang" -DCMAKE_CXX_COMPILER="/usr/local/google/home/binji/dev/wasi-sdk-5.0/opt/wasi-sdk/bin/clang++" -DCMAKE_CROSSCOMPILING=True -DCMAKE_INSTALL_PREFIX=/usr/local/google/home/binji/dev/wasi-clang -DLLVM_TABLEGEN=/usr/local/google/home/binji/dev/llvm-project/build/bin/llvm-tblgen -DCLANG_TABLEGEN=/
Verifying my Blockstack ID is secured with the address 17b4KwXNs98zb6Y13G4cKQApaxKjDB6JLL https://explorer.blockstack.org/address/17b4KwXNs98zb6Y13G4cKQApaxKjDB6JLL