Skip to content

Instantly share code, notes, and snippets.

@Guevara-chan
Guevara-chan / rl_converter.coffee
Last active July 4, 2024 11:32
RayLib h2nim autoconverter
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #
# RayLib h2nim autoconverter v0.05
# Developed in 2*20 by Guevara-chan
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #
[fs, rl, http] = [require('fs'), require('readline'), require('https')] if process?
#.{ [Procedures]
sanity = (name, undes = /\*/g) ->
name = name.replace(undes, '')
if name in ['type', 'end', 'from', 'div', 'ptr'] then name + 'x' else name
@cellularmitosis
cellularmitosis / HashTable.c
Last active July 29, 2021 18:53
Hash table in C, part 5: better hashing
#include "HashTable.h"
#include <stdio.h> // fprintf
#include <stdlib.h> // exit
#include <string.h> // memset
#include <stdint.h> // uint8_t
#include <stdbool.h> // true
#include <assert.h> // assert
void* dmalloc(size_t size) {
@haxscramper
haxscramper / languages-and-vms.md
Last active July 2, 2024 03:38
languages-and-vms
@danielcristofani
danielcristofani / life.b
Last active March 6, 2024 01:21
Game of Life program.
[life.b -- John Horton Conway's Game of Life
(c) 2021 Daniel B. Cristofani
http://brainfuck.org/]
>>>->+>+++++>(++++++++++)[[>>>+<<<-]>+++++>+>>+[<<+>>>>>+<<<-]<-]>>>>[
[>>>+>+<<<<-]+++>>+[<+>>>+>+<<<-]>>[>[[>>>+<<<-]<]<<++>+>>>>>>-]<-
]+++>+>[[-]<+<[>+++++++++++++++++<-]<+]>>[
[+++++++++brainfuck.org-------->>>]+[-<<<]>>>[>>,----------[>]<]<<[
<<<[
>--[<->>+>-<<-]<[[>>>]+>-[+>>+>-]+[<<<]<-]>++>[<+>-]
@danielcristofani
danielcristofani / quine.ook
Created April 2, 2021 09:53
Quine in Ook! (core part taken directly from Erik Bosman's 410-byte brainfuck quine)
Ook! Ook! Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook
@danielcristofani
danielcristofani / siercarpet.b
Created April 20, 2021 06:05
Sierpinski Carpet program
[siercarpet.b -- Sierpinski Carpet
(c) 2021 Daniel B. Cristofani
http://brainfuck.org/]
>-->->->>>>>(>>>>>>>>>)+++++[>++++++<-]>+[>+>+++<<-]>+[
[<]<++[<++]--<[>>[-->]>..<<<]>>[[-->]>>--.++.<<]<<<<<<<+[
[--->++++++<[+++>--------->>[->>>]->>>]+<<<+]
>[<->>>[->>>]++++++++++.[-]<<+>+++[-]]<
]>>>->>
]
@no-defun-allowed
no-defun-allowed / dbyol.org
Last active August 24, 2025 16:40
Don't Build Your Own Lisp

Don’t Build Your Own Lisp

I feel somewhat pressed to give a negative review of this book. This comes from someone who has worked on various Lisp implementations, and written some amount of C, but that isn’t an excuse to be overly harsh. This book, however, does not provide many nice things to say, and plenty of un-nice things. My apologies in advance.

First off: God help you if you are going to write your first interpreter in C of all things. No one I know thinks it’s a good idea to start

@p4bl0-
p4bl0- / 00_readme.md
Last active January 2, 2025 09:03
A complete compiler for a simple language (in less than 150 LoC)

This project is a tiny compiler for a very simple language consisting of boolean expression.

The language has two constants: 1 for true and 0 for false, and 4 logic gates: ! (not), & (and), | (or), and ^ (xor).

It can also use parentheses to manage priorities.

Here is its grammar in BNF format:

expr ::= "0" | "1"

@mgritter
mgritter / Factorial.fst
Last active November 10, 2021 18:01
An F* program for computing factorial sums
module Factorial
open FStar.Mul // Give us * for multiplication instead of pairs
open FStar.IO
open FStar.Printf
let rec factorial (n:nat) : nat =
if n = 0 then 1
else n * factorial (n-1)
aahed
aalii
aapas
aargh
aarti
abaca
abaci
aback
abacs
abaft