A collection of illustrative examples in close to 100 programming languages, including every code snippet used in the book Programming Language Explorations.
Nearly every program in this repo can be run at Replit. Many (especially the smaller single-file scripts) can also be run at TIO or OneCompiler. Many languages feature their own ”official” online playgrounds, notably Rust, Go, TypeScript, and Haskell.
You are welcome to clone this repository and run the examples locally on your own machine. See the specific README files within the language sub folders for instructions running the examples this way. You'll generally have to first download and install a language implementation for your particular operating system and architecture; such information is generally available online, but the individual language READMEs will often have pointers.
Each of the examples here have been tested on a machine running macOS using the
language versions in the table below. The tests are executed via the test.sh
script in each language folder. Modify the test script or install a suitable
Unix-like virtual machine if you desire to run the test scripts yourself.