Tiny Programs

Rosetta code for implementations

Learning a new language can be hard. Developers go to "Hello World" but this is so trivial a program so as to be almost useless.

This project is a collection of tiny programs that may help you learn a language. It is similar to Rosetta Code except that all programs here will be implementations and not library calls.

Implementations are opinionated and simple, but not necessarily idiomatic. Tests are in place for all implementations but they are not necessarily 100% bug-free or (in the case of SHA-256) secure. Basically, don't use any code here for anything other than to as a learning resource.


A generic, balanced binary search tree.

See https://www.cs.umd.edu/class/fall2019/cmsc420-0201/Lects/lect06-aa.pdf for details.


An implementation of the Brainfuck programming language.

See https://en.wikipedia.org/wiki/Brainfuck for details.


An implementation of SHA-256 acting on a one-time input (rather than streaming input). This project demonstrates a unique programming style: heavy bitwise operations on fixed-size chunks of data.

Do not consider these implementations secure. See FIPS 180-2 for details.


A UUIDv4 generator.

See https://www.rfc-editor.org/rfc/rfc4122 for details.