___ __ __ / _/__ ____/ /_/ / / _/ _ \/ __/ __/ _ \ /_/ \___/_/ \__/_//_/ # BASIC PRINCIPLES - keep it simple: make programs which can fit in 4K words of core - do not speculate: do not put code in your program that MIGHT be used - do it yourself # INPUT information that controls a program - not moving data between media (copying) - not reading data (displaying) # VARIABLES - declare them before everyting else - make them global # WORDS - use nouns for variables, verbs for functions, adjectives for ... states? - make words mnemonic - keep them short # QUOTES The point of Forth is making software open and transparent to its users, by providing a scripting engine with a minimum of effort. (HTM) felix plesoianu Forth is a programming environment for CREATING application oriented languages. (HTM) thinking forth by leo brodie, p. 24 With the huge RAM of modern computers, an operating system is no longer necessary. (HTM) chuck moore If the operating system can open, close, read, write, buffer, sort or index a file, why should such code be in a program? Why a need to update the screen coordinates in the program control file when the operating system can as it has the information first and interfaces to the storage system. So we are back to the BASIS OF FORTH: - don't duplicate code - leverage what you have already created - refactor (HTM) OS/Forth what is forth? - trivial syntax (whitespace-separated tokens) - trivial compiler (words are simply sequenced) - 2 stacks: allows words to consume and generate arguments - everything is executable - reverse polish notation (RPN) - tokens are simply executed left-to-right - dictionary has 2 meanings: (HTM) bootstrap yourself into conviviality by writing your own Forth # NOTES - an application language is a problem oriented language - a problem oriented language should be able to express any problem encountered - 4k of 16 bits (2 bytes) words - Extensible via colon words, code words, and new data types # INTERPRETER/COMPILER OF A FORTH SYSTEM (GIF) flow chart (HTM) beginner's guide # THINK FORTH AS THE FUTURE - tiny, ubiquitous computers - solar power - heavily constrained VMs - more elegant programs - concatenative programming - combinators (HTM) talk by dave gauer # ALTERNATIVES TO VON NEUMANN LANGUAGES (TXT) functional programming languages # IMPLEMENTATIONS (HTM) 14f (HTM) colorforth (HTM) foth (HTM) psi-forth (HTM) nasmjf (HTM) sectorforth (8 primitives) (HTM) OneFileForth ## COLOR FORTH VARIANTS (HTM) retro forth (HTM) r3 (HTM) colorforth-pbr (HTM) colorforth 2019 (HTM) ripen ## FORTH IN RUST (HTM) rtforth (HTM) forth-in-rust (HTM) fifth ## FORTH IN JS (HTM) hhwebforth (???) eForth ## ON RISC-V PLATFORM (HTM) noForth (HTM) for microcontrollers (HTM) muforth cross-compiler (HTM) lbforth self hosting metacompiled (HTM) port of jonesforth (HTM) another port of jonesforth (HTM) derzforth bare-metal (HTM) riscyforth assembler ## 64 BITS (HTM) sixtyforth # COMPILERS (HTM) build a compiler (HTM) 4tH (HTM) kim harris notes # VM (HTM) c4 # OS (HTM) duskOS # CONCATENATIVE SHELL (HTM) cosh # RISC-V REFERENCES (HTM) assembly programmer's manual (HTM) specs ____________________________________________________________________________ Gophered by Gophernicus/3.0.1 on Ubuntu/22.04 x86_64