Skip to content

Instantly share code, notes, and snippets.

View yazaldefilimone's full-sized avatar
🍋
lemonc -o main.ln

Yazalde Filimone yazaldefilimone

🍋
lemonc -o main.ln
View GitHub Profile
@yazaldefilimone
yazaldefilimone / pr.md
Created October 16, 2024 13:10 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

ast.exe: ast.c
gcc -Werror -Wswitch -Wimplicit-fallthrough ast.c -o ast.exe
clean:
rm -f *.o *.exe *.s a.out
test.s: ast.exe
./ast.exe > test.s
impl<V: Value> core::str::FromStr for NonNormalizingDec<V> {
type Err = &'static str;
#[inline(never)]
#[rustfmt::skip]
fn from_str(s: &str) -> Result<Self, Self::Err> {
/// Converts an ASCII decimal digit to an int.
///
/// In release builds, no range checks are performed and passing a
/// non-digit character will result is undefined (yet safe) behavior.
@yazaldefilimone
yazaldefilimone / cc.md
Created April 27, 2024 23:55 — forked from noghartt/cc.md
Resources to learn more about Computer Science and related stuffs
@yazaldefilimone
yazaldefilimone / UntypedLambda.agda
Created March 10, 2024 19:54 — forked from gallais/UntypedLambda.agda
Interpreting the untyped lambda calculus in Agda
{-# OPTIONS --copatterns #-}
module UntypedLambda where
open import Size
open import Function
mutual
data Delay (A : Set) (i : Size) : Set where
@yazaldefilimone
yazaldefilimone / phoas.md
Created March 10, 2024 19:28 — forked from VictorTaelin/phoas.md
PHOAS in JS / HVM
@yazaldefilimone
yazaldefilimone / simple_fast_functional_sieve.md
Created February 20, 2024 15:02 — forked from VictorTaelin/simple_fast_functional_sieve.md
Can a simple functional sieve be fast? Optimizing Tromp's algorithm on HVM.

Can a simple functional sieve be fast? Optimizing Tromp's algorithm on HVM.

Today, John Tromp - creator of the Binary λ-Calculus, and one of the smartest functional wizards alive - ported his famous prime number generator (first published 12 years ago!) to HVM:

@yazaldefilimone
yazaldefilimone / sat.md
Created February 20, 2024 15:02 — forked from VictorTaelin/sat.md
Simple SAT Solver via superpositions

Solving SAT via interaction net superpositions

I've recently been amazed, if not mind-blown, by how a very simple, "one-line" SAT solver on Interaction Nets can outperform brute-force by orders of magnitude by exploiting "superposed booleans" and optimal evaluation of λ-expressions. In this brief note, I'll provide some background for you to understand how this works, and then I'll present a simple code you can run in your own computer to observe and replicate this effect. Note this is a new observation, so I know little about how this algorithm behaves asymptotically, but I find it quite

@yazaldefilimone
yazaldefilimone / itt-coc.ts
Created February 15, 2024 22:41 — forked from VictorTaelin/itt-coc.ts
ITT-Flavored Calculus of Constructions Type Checker
// A nano dependent type-checker featuring inductive types via self encodings.
// All computation rules are justified by interaction combinator semantics,
// resulting in major simplifications and improvements over old Kind-Core.
// Specifically, computable annotations (ANNs) and their counterpart (ANN
// binders) and a new self encoding based on equality (rather than dependent
// motives) greatly reduce code size. A more complete file, including
// superpositions (for optimal unification) is available on the
// Interaction-Type-Theory repository.
// Credits also to Franchu and T6 for insights.