Skip to content

Instantly share code, notes, and snippets.

View SeniorMars's full-sized avatar
💭
Math is hard, but I want to get better at it.

SeniorMars SeniorMars

💭
Math is hard, but I want to get better at it.
View GitHub Profile
@CMCDragonkai
CMCDragonkai / higher_kinded_types_in_rust_and_haskell.md
Last active June 26, 2024 23:03
Rust/Haskell: Higher-Kinded Types (HKT)

Rust/Haskell: Higher-Kinded Types (HKT)

A higher kinded type is a concept that reifies a type constructor as an actual type.

A type constructor can be thought of in these analogies:

  • like a function in the type universe
  • as a type with a "hole" in it
@hediet
hediet / main.md
Last active March 11, 2024 15:05
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@Aerijo
Aerijo / tree_sitter_guide.md
Last active July 3, 2024 22:35
Guide to writing your first Tree-sitter grammar

Guide to your first Tree-sitter grammar

NOTE: The Tree-sitter API and documentation has changed and improved since this guide was created. I can't guarantee this is up to date.

About

Tree-sitter is the new way Atom is providing language recognition features, such as syntax highlighting, code folding, autocomplete, and more. In contrast to TextMate grammars, which work by regex matching, Tree-sitter will generate an entire syntax tree. But more on that can be found in it's own docs.

Here, we look at making one from scratch.

@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@lambdabetaeta
lambdabetaeta / lambda-macros.sty
Last active April 10, 2024 15:46
Lambda calculus/PL LaTeX macros
%% Basic Lambda Calculus macros
%% Alex Kavvos, 2021-2023
\ProvidesPackage{lambda-macros}[2024/04/10 lambda-macros]
%% Load in your own work by putting in the same folder as your file and invoking
%%
%% \usepackage{lambda-macros}
%%
@alonsosilvaallende
alonsosilvaallende / LLM_generating_random_numbers.ipynb
Created July 14, 2023 20:20
LLM_generating_random_numbers.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.