On this page:
A Worst Interpreter

A Worst Interpreter

You are reading an interpreter for The Worst Programming Language.

It’s written in Typed Racket, but any language will work if you’d like to follow along. As you read on, you will encounter documentation and source code for the core procedures, built-in library functions, and command-line interface of a working Worst interpreter, in roughly that order. A single source file holds this text, the interpreter itself, and a handful of tests.

Reading this interpreter should hopefully give you a good understanding of how it works, and currently serves as the best source of documentation for Worst. If you’d rather just run it and have a poke around, check it out.

This is a work in progress; in particular, it needs more built-in functions and more tests. If there are any necessary builtins missing, or you see any other problems, please feel free to file an issue!

    1 Introduction

    2 Data structures

    3 Core operations

      3.1 Resolving functions

      3.2 Calling functions

      3.3 Figuring out what’s next

      3.4 Traversing the context stack

    4 The End

      4.1 Tests

    5 Builtins

      5.1 Quote

      5.2 Uplevel

      5.3 Intermission: Utilities

      5.4 Execution

      5.5 Conditional execution

      5.6 Looping

    6 Exceptions

    7 More builtins

      7.1 Type predicates

      7.2 General operations

      7.3 Interpreter

      7.4 Context

      7.5 Debugging utilities

      7.6 Definitions and builtins

      7.7 Lists

      7.8 Strings and symbols

      7.9 Booleans

      7.10 Numbers

      7.11 Environment

      7.12 Ports

      7.13 Places

      7.14 Subprocesses

      7.15 Filesystem

      7.16 Hash tables

      7.17 Vectors

      7.18 Byte vectors

    8 Reading code

    9 The entry point

    10 Invocation

    11 Program overview

    12 License