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