package tiny_languages

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

tiny_languages

Languages as text, parsed and run, written from scratch for teaching: one library per language, each interface with its grammar, a worked example and its references. None of them knows the Elm Playground: what a program can touch outside itself is a host, a record of functions its caller gives (a sheet's cells, a page's elements). They stand on tiny_libs.

Each is a library of its own, named tiny_languages.<name> outside this repository, for example in a dune file:

(executable
 (name main)
 (libraries tiny_languages.scheme tiny_languages.lang_html))

The libraries are unwrapped: their modules are used by their own names, Scheme_eval, Html_tree.

The spreadsheet's formulas

tiny_languages.formula: arithmetic over numbers and cells, SUM and its kin over ranges; recursive descent, the parser to know first.

BASIC

tiny_languages.basic: Tiny BASIC, Integer BASIC and Applesoft; a program run as a Talk conversation.

The Lisps

s-expressions, the syntax they share (tiny_languages.sexpr), a small Emacs Lisp (tiny_languages.lisp), a small Scheme and HtDP's Beginning Student, run by a CESK machine, with its stepper (tiny_languages.scheme):

Pascal

tiny_languages.pascal: compiled in one pass to P-code and run on a P-machine, with its debugger.

HyperTalk

tiny_languages.hypertalk: HyperCard's language, the cards the host's.

Smalltalk-80

tiny_languages.smalltalk: from the Blue Book, compiled to its bytecodes and run by its interpreter over an object table, its kernel classes in Smalltalk bootstrapped from their text.

Scratch and Snap!

tiny_languages.scratch: the blocks as one table of specs, their text, a project run as green threads.

PostScript

tiny_languages.postscript: a page described as a program; the letters are the host's.

The web: JavaScript, HTML, CSS

A small JavaScript (tiny_languages.javascript), HTML read (tiny_languages.lang_html), what a page's elements look like, the cascade and computed styles (tiny_languages.lang_css):

JSON and jsonnet

tiny_languages.lang_json (over JavaScript's lexer) and tiny_languages.lang_jsonnet, for configuration files:

Code read, not run

OCaml (tiny_languages.lang_ocaml), C (tiny_languages.lang_c) and assembly (tiny_languages.lang_asm), read for a code visualizer, their tokens coloured by Highlight_code's categories: