notes on forth
___ __ __
/ _/__ ____/ /_/ /
/ _/ _ \/ __/ __/ _ \
/_/ \___/_/ \__/_//_/
# 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.
HTML felix plesoianu
Forth is a programming environment for CREATING application oriented
languages.
HTML thinking forth by leo brodie, p. 24
With the huge RAM of modern computers, an operating system is no longer
necessary.
HTML 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
HTML 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:
- the heap: all the words and their data
- the association of tokens with their code
HTML 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
HTML beginner's guide
# THINK FORTH AS THE FUTURE
- tiny, ubiquitous computers
- solar power
- heavily constrained VMs
- more elegant programs
- concatenative programming
- combinators
HTML talk by dave gauer
# ALTERNATIVES TO VON NEUMANN LANGUAGES
TEXT functional programming languages
# IMPLEMENTATIONS
HTML 14f
HTML colorforth
HTML foth
HTML psi-forth
HTML nasmjf
HTML sectorforth (8 primitives)
HTML OneFileForth
## COLOR FORTH VARIANTS
HTML retro forth
HTML r3
HTML colorforth-pbr
HTML colorforth 2019
HTML ripen
## FORTH IN RUST
HTML rtforth
HTML forth-in-rust
HTML fifth
## FORTH IN JS
HTML hhwebforth
RESERV eForth
## ON RISC-V PLATFORM
HTML noForth
HTML for microcontrollers
HTML muforth cross-compiler
HTML lbforth self hosting metacompiled
HTML port of jonesforth
HTML another port of jonesforth
HTML derzforth bare-metal
HTML riscyforth assembler
## 64 BITS
HTML sixtyforth
# COMPILERS
HTML build a compiler
HTML 4tH
HTML kim harris notes
# VM
HTML c4
# OS
HTML duskOS
# CONCATENATIVE SHELL
HTML cosh
# RISC-V REFERENCES
HTML assembly programmer's manual
HTML specs
____________________________________________________________________________
Gophered by Gophernicus/3.0.1 on Ubuntu/22.04 x86_64