frontpage.
newsnewestaskshowjobs

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!

Norway makes shithouses great again

https://www.visitnorway.com/plan-your-trip/travel-tips-a-z/norwegian-scenic-routes/worlds-best-to...
494•giuliomagnifico•3h ago•260 comments

HackerTube: YouTube built from videos recommended by HN

https://karpathy.bearblog.dev/hacker-tube/
1601•karpathy•18h ago•423 comments

Proving and Improving the Platonic Representation Hypothesis with JEPAs

https://arxiv.org/abs/2610.39302
24•Anon84•1h ago•3 comments

Novellas with Groff

https://movq.de/blog/postings/2026-10-31/0/POSTING-en.html
8•dverlaeckt80•45m ago•0 comments

An Italian farmer found some unknown seeds in his attic and planted them

https://www.smithsonianmag.com/science-nature/italian-farmer-found-unknown-seeds-attic-with-nothi...
570•ecares•15h ago•170 comments

Radiation Map of the World

https://radiaverse.com/
31•slater•3d ago•13 comments

One-minute frequency disturbances from synchronization in power systems

https://www.nature.com/articles/s41560-026-02144-0
19•croes•1d ago•3 comments

Brazilian Court Sanctions Lawyers for Prompt Injection in Court Filing

https://jetstream.security/insights/brazilian-court-sanctions-prompt-injection-filing/
196•doodlesdev•12h ago•97 comments

Memdoor: A team of 5 Qwen3.8-27B models beats Fable 5 on LiveCodeBench Hard

https://github.com/guregodevo/memdoor/tree/main/examples/workflows/team-solve
323•guregodevo•15h ago•153 comments

Domain hacks with unusual Unicode characters (2018)

https://xn--69f31l4t57c0mag4b613h.xn--7uh4898msjaso/🆆🆃🅵/
29•n_plus_1_acc•3h ago•24 comments

TCP Use-After-Free: CVE-2026-98432 / CVSS 9.8

https://atlasum.net/blog/cve-2026-98432-linux-ipv4-tcp-uaf
576•oger•19h ago•275 comments

Running a bootstrapped SaaS for 20 years with my brother

https://blog.zamzar.com/2026/10/30/20-years-766-million-files-two-chameleons/
158•whyleyc•2d ago•40 comments

The Ocean 'Was the Color of Chocolate.' Mexico Declares War on Seaweed.

https://www.nytimes.com/2026/10/28/world/americas/mexico-seaweed-navy.html
28•bookofjoe•1d ago•22 comments

AI agent swarms in Minecraft fail to build civilization, drown in bureaucracy

https://www.tomshardware.com/tech-industry/artificial-intelligence/ai-agent-swarms-unleashed-in-m...
17•entryleveljobsc•50m ago•3 comments

Show HN: Point your camera at a landscape to learn about its geology

https://outcrop.rocks/
47•headsupernova•2d ago•7 comments

Leaking Secrets from Air-Gap Computers by Spelling Radio Signals from RAM (2024)

https://arxiv.org/abs/2409.02292
124•hapax_legomena•12h ago•66 comments

Show HN: I rebuilt my old canvas 3D library as a small WebGL 2 library – phoria2

https://kevs3d.co.uk/phoria2/
3•kevs3d•1d ago•0 comments

The AI cost of JavaScript frameworks

https://nolanlawson.com/2026/10/28/the-ai-cost-of-javascript-frameworks/
166•luu•8h ago•112 comments

Understanding Email Encryption

https://www.fastmail.com/blog/email-encryption/
55•nmjenkins•1d ago•12 comments

No AI, 52 min. Build all Linux Files utils in C by Hand [video]

https://www.youtube.com/watch?v=gQRmSlcTq9c
94•surprisetalk•2d ago•79 comments

Pilot-wave hydrodynamics (Quantum phenomena in macroscopic hydrodynamic systems)

http://thales.mit.edu/bush/index.php/4801-2/
67•peter_d_sherman•1d ago•14 comments

Altoids Project

https://uvdn7.github.io/altoids-project/
130•uvdn7•15h ago•7 comments

Zinc creep in cable spelter sockets brought down the Arecibo telescope in 2020

https://maketecheasier.com/arecibo-zinc-creep-collapse/
137•ohjeez•1d ago•43 comments

Electrification Could Cut Global Energy Use in Half

https://fullycharged.show/podcasts/podcast-361-why-electrification-could-cut-global-energy-use-in...
160•toomuchtodo•19h ago•104 comments

A brief history of just-in-time: forty years of JIT work, from 1960–2000

https://dl.acm.org/doi/10.1145/857076.857077
52•gjvc•3d ago•1 comments

A 1580 Map Shows Why Data Visualization Is Never Neutral

https://thereader.mitpress.mit.edu/a-1580-map-shows-why-data-visualization-is-never-neutral/
65•the-mitr•1d ago•7 comments

It's the memory latency, stupid

https://pivotlake.io/blog/its-the-memory-latency-stupid/
226•ntur1337•19h ago•73 comments

The "Moon Trees"

https://nssdc.gsfc.nasa.gov/planetary/lunar/moon_tree.html
10•momentmaker•1h ago•0 comments

Jepsen: ParticleDB 1.1.4

https://jepsen.io/analyses/particledb-1.1.4
294•aphyr•1d ago•166 comments

Surviving "The Graduate"

https://www.newyorker.com/culture/the-weekend-essay/dustin-hoffman-on-surviving-the-graduate
141•samizdis•18h ago•41 comments