SMOLNET PORTAL home about changes
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.
(URL) felix plesoianu (https://felix.plesoianu.ro) text/html
Forth is a programming environment for CREATING application oriented
languages.
(URL) thinking forth by leo brodie, p. 24 (https://www.forth.com) application/pdf
With the huge RAM of modern computers, an operating system is no longer
necessary.
(URL) chuck moore (https://colorforth.github.io) text/html
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
(URL) OS/Forth (http://www.forth.org) text/html
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 /~moreno/forth/ - the heap: all the words and their data tilde.team 70
- the association of tokens with their code /~moreno/forth/ - the association of tokens with their code tilde.team 70
(URL) bootstrap yourself into conviviality by writing your own Forth (https://raw.githubusercontent.com)
# 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 image/gif
(URL) beginner's guide (https://galileo.phys.virginia.edu) text/html
# THINK FORTH AS THE FUTURE
- tiny, ubiquitous computers
- solar power
- heavily constrained VMs
- more elegant programs
- concatenative programming
- combinators
(URL) talk by dave gauer (https://ratfactor.com) text/html
# ALTERNATIVES TO VON NEUMANN LANGUAGES
(FILE) functional programming languages text/plain
# IMPLEMENTATIONS
(URL) 14f (https://14f.ichi.city) text/html
(URL) colorforth (https://colorforth.github.io) text/html
(URL) foth (https://github.com)
(URL) psi-forth (https://git.sr.ht)
(URL) nasmjf (https://ratfactor.com)
(URL) sectorforth (8 primitives) (https://github.com)
(URL) OneFileForth (https://github.com)
## COLOR FORTH VARIANTS
(URL) retro forth (https://www.retroforth.org)
(URL) r3 (https://github.com)
(URL) colorforth-pbr (https://github.com)
(URL) colorforth 2019 (https://github.com)
(URL) ripen (https://felix.plesoianu.ro) text/html
## FORTH IN RUST
(URL) rtforth (https://github.com)
(URL) forth-in-rust (https://github.com)
(URL) fifth (https://git.sr.ht)
## FORTH IN JS
(URL) hhwebforth (https://github.com)
(UNKN) eForth application/pdf
## ON RISC-V PLATFORM
(URL) noForth (https://home.hccnet.nl) text/html
(URL) for microcontrollers (https://github.com)
(URL) muforth cross-compiler (https://muforth.nimblemachines.com)
(URL) lbforth self hosting metacompiled (https://github.com)
(URL) port of jonesforth (https://github.com)
(URL) another port of jonesforth (https://github.com)
(URL) derzforth bare-metal (https://github.com)
(URL) riscyforth assembler (https://github.com)
## 64 BITS
(URL) sixtyforth (https://gitlab.com)
# COMPILERS
(URL) build a compiler (http://home.iae.nl) text/html
(URL) 4tH (https://thebeez.home.xs4all.nl) text/html
(URL) kim harris notes (http://www.forth.org) application/pdf
# VM
(URL) c4 (https://github.com)
# OS
(URL) duskOS (https://sr.ht)
# CONCATENATIVE SHELL
(URL) cosh (https://github.com)
# RISC-V REFERENCES
(URL) assembly programmer's manual (https://github.com)
(URL) specs (https://riscv.org)
____________________________________________________________________________
Gophered by Gophernicus/3.0.1 on Ubuntu/22.04 x86_64
Response: application/gopher-menu
Original URLgopher://tilde.team/1/~moreno/forth
Content-Typeapplication/gopher-menu; charset=utf-8