frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Moving Forth: a series on writing Forth kernels

https://www.bradrodriguez.com/papers/index.html
71•todsacerdoti•1y ago

Comments

benji-york•1y ago
Some trivia for those who might not be aware: the tile of the series is a reference to the beloved 1981 book "Starting FORTH" which you can now read online at https://www.forth.com/wp-content/uploads/2018/01/Starting-FO...

Do yourself a favor and read a few chapters.

sitkack•1y ago
I would also recommend "R. G. Loeliger Threaded Interpretive Languages Their Design And Implementation" between these two books the whole beauty of Forth and their implementation should just click.

Forth isn't one of those languages that you _use_. You extend the language from the inside, so you need to know how your Forth is implemented. I'd say it is the only language where users of the language could all recreate the language.

Verdex•1y ago
Also recommending Thinking Forth by Leo Brodie. The book feels like it was written in the 2010s but the original publish date was mid 80s.
RetroTechie•1y ago
Recently released under a CC license:

https://thinking-forth.sourceforge.net

anthk•1y ago
Now I'd love the same with Starting Forth set to ANS Forth standards, and not just in web form. Yes, I know how to use wget --mirror and such, but I'm used to MuPDF and the editor terminal switching back and forth. No pun intended.
anthk•1y ago
That's more for ANS Forth. PForth for instance has a block editor, but is not documented ( edit-blockfile file -- ).

I would love a Starting Forth book on PDF form but updated, as the web does.

zck•1y ago
Writing a Forth myself, I find it somewhat frustrating that I have relatively different design restrictions than these guides. I don't need to be incredibly low-power, so I'm using C, not assembly. I'm not a great C coder, and I've never done assembly, so I find it hard (but not impossible) to learn from assembly. Also, because it's not assembly, I can't just JUMP to code the same way assembly can.

It's also frustrating trying to understand some of the lowest-level information. For example, a few systems have a very fundamental `w` variable -- but what is is used for? You can't search for it. Or just using registers and having to remember that %esi is the program counter (aka instruction pointer).

I keep wanting to make a series of diagrams to really understand Forth's program flow. It makes sense in concept, but when I go to program it, there are a lot of nuances I keep missing.

crq-yml•1y ago
It took me a few tries(over a few years) to properly approach the task of writing a Forth, and when I approached it, I made my Forth in Lua, and all I really did was implement the wordlist in FORTH-83 as the spec indicated, and rewrite every time my model assumptions were off. No diving into assembly listings. Eventually I hit the metaprogramming words and those were where I grasped the ways in which the parser and evaluator overlap in a modal way - that aspect is the beating heart of a bootstrappable Forth system and once you have it, the rest is relatively trivial to build when starting from a high level environment.

The thing is, pretty much every modern high level language tends to feel a bit clumsy as a Forth because the emphasis of the execution model is different - under everything with an Algol-like runtime, there's a structured hierarchy of function calls with named parameters describing subprograms. Those are provisions of the compiler that automate a ton of bookkeeping and shape the direction of the code.

It's easier to see what's going on when starting from the metaphor of a line-number BASIC (as on most 8-bit micros) where program execution is still spatial in nature and there usually aren't function calls and sometimes not even structured loops, so GOTO and global temporaries are used heavily instead. That style of coding maps well to assembly, and the Forth interpreter adds just a bit of glue logic over it.

When I try to understand new systems, now, I will look for the SEE word and use that to tear things down word by word. But I still usually don't need to go down to the assembly(although some systems like GForth do print out an assembly listing if asked about their core wordset).

anthk•1y ago
This is fun too

      https://github.com/howerj/subleq/
but you might need to edit subleq.fth and create a new image with some of the constants named opt.* settings set to 1 (enabled) in order to enable do...loop support and such. After you enabled them, try ./sublec ./sublrec.dec < ./sublec.fth > new.dec, wait a lot, and then run ./subleq sublec.dec .

In order to save lots of time, clone the muxleq repo https://github.com/howerj/muxleq , edit muxleq.fth as always, and then run ./muxleq ./muxlec.dec < muxlec.fth > new.dec, and ./muxlec ./new.dec to run the new DEC EForth image.

Is not especially fast but it's a ready to run Forth and the Subleq machine can be compiled even under Windows XP and up with Min-C or any bundled C compiled on GNU/Linux BSD, from cproc to tcc, gcc or clang. If some of your code runs fast under Muxleq+EForth, it will fly under PForth and GForth.

https://minc.commandlinerevolution.nl/english/home.html

The speeds I get under an n270 atom with Muxleq are almost like a Forth machine under a boosted up 8 bit machine, kinda like an 8MHZ z80 with a native Forth, or a very low end M68k machine.

anthk•1y ago
Well I made a typo in the former comment; in order to run the NEW subleq.fth image, as you might guessed it's './subleq ./new.dec' .

I post this because I can't edit my comment any more.

zck•1y ago
I understand implementing words as you think they should be. However, you need the core first, and that's where I'm working right now. I'm trying to get the central loop, dictionary, and threading model functional.

Which brings up another complication -- the threading model. There are multiple, of course. But sometimes I want to figure out, for example, what the `w` variable does. Is it different between indirect threading and subroutine threading? Maybe!

Three Ways to Get Paid (2018)

https://jasonzweig.com/three-ways-to-get-paid/
121•nate•1h ago•70 comments

A walking tour of surveillance infrastructure in Seattle

https://coveillance.org/a-walking-tour-of-surveillance-infrastructure-in-seattle/
261•eustoria•5h ago•131 comments

Adafruit Receives Demand Letter from Fenwick Legal Counsel on Behalf of Flux.ai

https://blog.adafruit.com/
490•semanser•8h ago•212 comments

Fidonet: Technology, Use, Tools, and History (1993)

https://www.fidonet.org/inet92_Randy_Bush.txt
111•BruceEel•4h ago•34 comments

Trump signs downsized AI order after weeks of reversals

https://www.politico.com/news/2026/06/02/trump-signs-downsized-ai-order-00946389
45•_alternator_•2h ago•31 comments

Coreutils for Windows

https://github.com/microsoft/coreutils
124•gigel82•1h ago•109 comments

Why Janet? (2023)

https://ianthehenry.com/posts/why-janet/
377•yacin•9h ago•190 comments

Morningstar values SpaceX at $780B, half its IPO target

https://www.reuters.com/business/media-telecom/morningstar-values-spacex-780-billion-half-its-ipo...
62•berkeleyjunk•38m ago•36 comments

Expanding Project Glasswing

https://www.anthropic.com/news/expanding-project-glasswing
118•surprisetalk•5h ago•123 comments

Anthropic scales Claude Mythos to critical infrastructure in 15 countries

https://techcrunch.com/2026/06/02/anthropic-scales-claude-mythos-to-critical-infrastructure-in-15...
25•Timofeibu•1h ago•6 comments

Rethinking Search as Code Generation

https://research.perplexity.ai/articles/rethinking-search-as-code-generation
24•1zael•2h ago•2 comments

GitHub Copilot App

https://github.com/features/preview/github-app
8•theanonymousone•49m ago•3 comments

Love systemd timers

https://blog.tjll.net/you-dont-love-systemd-timers-enough/
253•yacin•9h ago•172 comments

QBE – Compiler Back end: Version 1.3

https://c9x.me/compile/release/qbe-1.3.html
9•birdculture•1h ago•0 comments

Stop Ruining It

https://seths.blog/2026/06/stop-ruining-it/
177•herbertl•8h ago•88 comments

CSS-Native Parallax Effect

https://dan-webnotes.com/posts/2026-06-02-css-native-parallax-effect/
113•dandep•8h ago•46 comments

Can the stockmarket swallow Anthropic, SpaceX and OpenAI?

https://www.economist.com/finance-and-economics/2026/06/01/can-the-stockmarket-swallow-anthropic-...
635•1vuio0pswjnm7•19h ago•1097 comments

Show HN: Eyeball

https://eyeball.rory.codes/
185•mrroryflint•9h ago•64 comments

BQN: What Is a Primitive?

https://mlochbaum.github.io/BQN/commentary/primitive.html
4•tosh•3d ago•1 comments

Great Question (YC W21) Is Hiring Applied AI Interns

https://www.ycombinator.com/companies/great-question/jobs/J5TNvQH-ai-engineer-intern
1•nedwin•6h ago

Reviving Teletext for Ham Radio

https://spectrum.ieee.org/reviving-teletext-for-ham-radio
48•yarapavan•4d ago•22 comments

Key Chemistry Question Answered, No Quantum Computer Required

https://www.quantamagazine.org/key-chemistry-question-answered-no-quantum-computer-required-20260...
12•defrost•4d ago•0 comments

Why Custom Attributes in .NET Give Me Nightmares

https://blog.washi.dev/posts/custom-attributes-and-why-they-suck/
66•jandeboevrie•2d ago•21 comments

On the nature of autobiographical memory

https://theamericanscholar.org/you-must-remember-this/
8•prismatic•18h ago•2 comments

Show HN: RePlaya – self-hosted browser session replay with live tailing

https://github.com/s2-streamstore/replaya
6•shikhar•1h ago•0 comments

Squillions: How money laundering won

https://www.lrb.co.uk/the-paper/v48/n09/john-lanchester/squillions
134•rwmj•2d ago•123 comments

Apple rejected my dictation app for using the accessibility API

https://www.mitmllc.com/blog/apple-rejected-my-dictation-app/
250•RZelaya•6h ago•152 comments

Larry Ellison: "Citizens will be on their best behavior because we’re recording"

https://www.techradar.com/pro/quote-of-the-day-by-oracle-co-founder-larry-ellison-citizens-will-b...
207•CharlesW•1h ago•126 comments

Preparing for KDE Plasma's Last X11-Supported Release

https://blog.davidedmundson.co.uk/blog/596/
96•jandeboevrie•4h ago•102 comments

Webcam head tracking, webcam to control in‑game FOV

https://www.openfov.com/
80•mwit2023•3d ago•38 comments