Skip to content

Instantly share code, notes, and snippets.

@no-defun-allowed
no-defun-allowed / dbyol.org
Last active March 27, 2025 22:57
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

@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/]
>-->->->>>>>(>>>>>>>>>)+++++[>++++++<-]>+[>+>+++<<-]>+[
[<]<++[<++]--<[>>[-->]>..<<<]>>[[-->]>>--.++.<<]<<<<<<<+[
[--->++++++<[+++>--------->>[->>>]->>>]+<<<+]
>[<->>>[->>>]++++++++++.[-]<<+>+++[-]]<
]>>>->>
]
@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 / 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-------->>>]+[-<<<]>>>[>>,----------[>]<]<<[
<<<[
>--[<->>+>-<<-]<[[>>>]+>-[+>>+>-]+[<<<]<-]>++>[<+>-]
@haxscramper
haxscramper / languages-and-vms.md
Last active July 2, 2024 03:38
languages-and-vms
@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) {
@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
@acutmore
acutmore / README.md
Last active February 27, 2025 19:55
Emulating a 4-Bit Virtual Machine in (TypeScript\JavaScript) (just Types no Script)

A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.

Syntax emits zero JavaScript.

type RESULT = VM<
  [
    ["push", N_1],         // 1
    ["push", False],       // 2
 ["peek", _], // 3

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@hornc
hornc / APLBAONWSJAS.py
Last active October 14, 2021 17:00
A ridiculous interpreter for the joke esoteric programming language APLBAONWSJAS https://esolangs.org/wiki/APLBAONWSJAS
#!/usr/bin/env python3
import re
import subprocess
"""
This is a ridiculous interpreter for the joke esoteric programming language APLBAONWSJAS
see https://esolangs.org/wiki/APLBAONWSJAS for details.
!!!WARNING!!! this takes user input and runs it without checking as system commands,
this could have unintended consequences, and what you type could make changes to your