s/FORTH

Forth, discovered by Chuck Moore in 1968, is a timeless, expressive family of concatenative languages that can be ported to any machine in a day. Rivaled only by Lisp in its flexibility, forth is a language construction kit: you create a forth that solves your problem. There is no one true forth - it is a state of mind.

πŸš€ Moderated by: stack

πŸŒ’ Subspaces

πŸ“– Help

❀️ Code of conduct

Sign up

Posts

πŸš€ throf

Custom Forth Interpreter and External Libraries β€” I’ve built a basic forth interpreter (it compiles to a basic byte code which gets executed by a vm). Im trying to add support for external functions, but my current solution is to include them in the VM. I’d rather be able to load from some library, what are you all doing? If it makes any sense, I have the ability for C code to be called from forth but it’s all in one big binary (the VM), how do you all split this up?

πŸ’¬ 1 comment Β· 1 like Β· 2025-05-30 Β· 11 months ago

πŸš€ stack [mod]

Forth Advanced Run-Time β€” I've been coding in assembly on a Forth-friendly 6809 system I slapped together on the $30 Tang Nano 20K FPGA board. I always wanted to try a 6809, mainly because it has a User Stack that works perfectly as a Forth Datastack -- complete with push and pull instructions. Unlike all other processors out there. Well, the 68K allowed any address register to be used as a datastack, I suppose. But the U register is actually designed for Forth. Anyway, I wrote a bootloader,...

πŸ’¬ 8 comments Β· 4 likes Β· 2025-04-16 Β· 1 year ago

πŸš€ stack [mod]

nForth: Back To Pseudo-Interpretation β€” I blew it making nForth compile-dominant (pseudo-interpret only text in square braces). It created annoying complications, and I switched back to normally-interpret and compile only things inside curly braces. This is not traditional Forth, which automatically starts compiling at a `:` and ends the compile at a `;` -- I always hated that convention. The curly braces make code look C-shaped, and that is ok, because { this looks like a function definition ;...

πŸ’¬ 1 like Β· 2023-09-22 Β· 3 years ago

πŸš€ stack [mod]

Metaprogramming and nForth β€” Some popular language are exactly what they are, syntactically. C, for instance, has no provisions for extending itself, other than typedef for providing names for simple or composite _data_ types. A more interesting language, like Lisp, or Forth, is designed to be extended, and is largely largely written in itself. Forth, in particular, has a very straightforward way to write code that generates code. Traditional Forth has two distinct modes of operation:...

πŸ’¬ 2 comments Β· 1 like Β· 2023-09-20 Β· 3 years ago

πŸš€ stack [mod]

Loading files in nForth: implementation β€” Having implemented the normally-compile semantics I discussed in the previous post, I must now tackle the `include` functionality to load more forth code from a file. The problem: since nForth is now a compterpreter (it compiles code and runs/erases it to simulate interpretation), we must compile and run the loading code and the filename into the dictionary to execute the load. If we blindly load on top, the pseudo-interpretive block of code that does...

πŸ’¬ 2 comments Β· 2023-09-14 Β· 3 years ago

πŸš€ stack [mod]

Avoiding compile/interpret modality in Forth β€” If there is one thing I hate about classic Forth is the duality of interpret/compile modes. It makes for a lot of complications, like special versions of conditionals [IF] [THEN], etc. that work in the interpreter but not the compiler. And the whole idea of 'state-smart' words that do different things in compile mode. Yech. So I thought I was smart when I eliminated the problem alltogether by leaving the system in compile mode always. Now,...

πŸ’¬ 1 like Β· 2023-09-13 Β· 3 years ago

πŸš€ stack [mod]

Lambdas in nforth β€” I'm trying out lambdas in nforth. The syntax is simple and I have some good use cases for lambdas. Syntactically, to create a lambda, just surround some code with curly braces: [preformatted] The square braces here ensure that the entire thing gets compiled prior to execution. When nforth processes it, the address of the lambda is left on the datastack. This address can be evaluated using the `eval` word (lambda--) which takes the lambda address off the datastack and runs...

πŸ’¬ View post Β· 2023-09-12 Β· 3 years ago

πŸ‘€ AnoikisNomads

Forth keeps intriguing me. I've written the snake game in forth. The principle of continuously building on more simple words is elegant. But I keep failing to find any "real" programs in forth I'm aware that uxn exists and varavara is another thing that I keep coming back to. Is this forth? Kinda. I think it qualifies. In my head, forth is the perfect starting point for a "degrowth" computing system. Maybe similar to CollapseOS. an ecosystem of commandline programs to get stuff done. Does...

πŸ’¬ 4 comments Β· 2 likes Β· 2023-09-11 Β· 3 years ago

πŸš€ stack [mod]

To nForth and Beyond β€” I've been hacking on my little nForth, which is a simple 32-bit indirect Forth with a few deviations from norm. In the process I shrunk it down to 3.5KB, which opened up my appetite for tiny Forths. Come to think of it, I haven't written more than 64KB of forth for any forth project this century. Not even close. And 64K of forth is a huge amount of code, even with 32-bit tokens. So I've been thinking of spinning up another forth, with 16-bit execution tokens and 64KB (or...

πŸ’¬ 1 comment Β· 3 likes Β· 2023-09-08 Β· 3 years ago

🐦 Arkaeriit

How do you run the Forth you write?

πŸ’¬ 5 comments Β· 2023-08-12 Β· 3 years ago Β· πŸ—³οΈ

🐦 Arkaeriit

Modern Forth utilities β€” Does anyone know modern software written in Forth? I would like to read the source code of one but I don't really know where to look.

πŸ’¬ 6 comments Β· 1 like Β· 2023-08-10 Β· 3 years ago

πŸš€ stack [mod]

I just came across Charles Childer's new experiments with RetroForth. I lost track of RetroForth years ago, and it's great that it's going strong. The new dialects seem to focus on specialized VMs that bundle several MachineForth-like 5/6-bit opcodes into a 32-bit word... [gemini link] [gemini link] [gemini link]

πŸ’¬ 1 comment Β· 2023-08-08 Β· 3 years ago

Options

πŸ—£οΈ Sort by activity

πŸ”₯ Sort by hotness

Gemini feed

Atom feed