package tiny_languages
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=7c636383d146d30ac6f2fa234a6253c8
sha512=c79f3823c5f8f57e5038eb640d487c61168b84aa07c61999d6622ef9fd0c890e2b03b4c6a7cdbbe9352a49e25dda00ac7bb14693cee8e3d7beeed251351a2af0
doc/index.html
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):
SexprSexpr_readLispLisp_readLisp_evalLisp_preludeSchemeScheme_imageScheme_syntaxScheme_primsScheme_preludeScheme_evalScheme_step
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.
St_lexerSt_astSt_parseSt_chunkSt_memorySt_classSt_bytecodeSt_compileSt_interpSt_primitivesSt_kernelSt_bootSt_debugSt_imageSt_bitblt
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):
Js_lexerJs_astJs_parseJs_valueJs_evalJs_builtinsJs_regexpCharsetEntitiesHtml_lexerDomDtdHtml_treeLine_modeFormsLooksCss_syntaxSelectorsCssCss_valuesCascadeComputedUa_sheet
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: