RISC-V Pushes 400 Million Forth Words Per Second

We’ll be honest. Measuring Forth words per second doesn’t seem like a great benchmark since a Forth word could be very simple or quite complex. But we think the real meaning is “up to 400 million words per second.” There was a time when that level of performance would take a huge computer. These days, a simple board that costs a few bucks can do the trick, according to [Peter Forth] in an online presentation.

The key is the use of the Milk V Duo and some similar boards. Some of these look similar to a Raspberry Pi Pico. However, this chip on board has two RISC V cores, an ARM core, and an 8051. There’s also an accelerator coprocessor for vector operations like AI or video applications.

Continue reading “RISC-V Pushes 400 Million Forth Words Per Second”

Go Forth With This Portable Programmer

When choosing a low-level language, it’s hard to beat the efficiency of Forth while also maintaining some amount of readability. There are open source options for the language which makes it accessible, and it maintains its prevalence in astronomical and other embedded systems for its direct hardware control and streamlined use of limited resources even though the language started over 50 years ago. Unlike 50 years ago, though, you can now take your own self-contained Forth programmer on the go with you.

The small computer is built on a design that [Dennis] built a while back called my4TH which has its own dedicated 8-bit CPU and can store data in a 256 kB EEPROM chip. Everything else needed for the computer is built in as well but that original design didn’t include a few features that this one adds, most notably a small 40×4 character LCD and a keyboard. The build also adds a case to tie everything together, with ports on the back for I2C and power plus an RS232 port. An optional battery circuit lets the computer power up without an external power supply as well.

Continue reading “Go Forth With This Portable Programmer”

Forsp: A Forth & Lisp Hybrid Lambda Calculus Language

In the world of lambda calculus programming languages there are many ways to express the terms, which is why we ended up with such an amazing range of programming languages, even if most trace their roots back to ALGOL. Of the more unique (and practical) languages, Lisp and Forth probably range near the top, but what if you were to smudge both together? That’s what [xorvoid] did and it resulted in the gracefully titled Forsp programming language. Unsurprisingly it got a very warm and enthusiastic reception over at Hacker News.

While keeping much of Lisp-isms, the Forth part consists primarily out of it being very small and easy to implement, as demonstrated by the C-based reference implementation. It also features a Forth-like value/operand stack and function application. Also interesting is Forsp using call-by-push-value (CBPV), which is quite different from call-by-value (CBV) and call-by-name (CBN), which may give some advantages if you can wrap your mind around the concept.

Even if practicality is debatable, Forsp is another delightful addition to the list of interesting lambda calculus demonstrations which show that the field is anything but static or boring.

Bit-Serial CPU: Ultra-Tiny VHDL-Based CPU With Forth Interpreter

Soft cores for FPGAs come in many different flavors, covering a wide range of applications. The Bit-Serial CPU (bcpu) soft core presented by [Richard James Howe] is interesting for taking up just about the most minimal amount of resources (23 slices, 76 LUTs) while providing the means to run a Forth-based (eForth dialect) interpreter. To this CPU core a UART can be added (92 LUTs), as well as other peripherals.

As [Richard] states, the entire core with UART fits in 73 slices (220 LUTs) on a Spartan 6, while requiring a single port BRAM (block RAM). It features a 16-bit accumulator and lacks features such as interrupts, byte addressability and function calls, but those are not required to run the eForth interpreter. The main purpose of this soft core (other than the challenge) is to have a UART-programmable core that can be slotted in any FPGA design. For more serious requirements [Richard] also has the H2 SoC, which can run full-fat FORTH.

Continue reading “Bit-Serial CPU: Ultra-Tiny VHDL-Based CPU With Forth Interpreter”

Recreating The Jupiter ACE

What looks like a Sinclair ZX81 but runs Forth? If you said a Jupiter ACE, you get a gold star. These are rare because ordinary people in 1982 didn’t want Forth, so only about 5,000 of the devices were sold. [Cees Meijer] assumes they are unaffordable, so he built a replica and shows you how you can, too. [Scott Baker] built one recently; you can see his video below.

The resemblance to the Sinclair computer wasn’t just a coincidence. Richard Altwasser and Steven Vickers were behind the computer, and both had worked for Sinclair previously. In addition to being famous for using Forth, the machine initially had a badly manufactured case and an unreliable keyboard. A later version tried to correct these issues, but there were fewer than 1,000 made. [Cees’] replica used a design from [Grant Searle] with some modifications.

We liked the realistic look of the 3D printed keyboard. The keyboard uses white plastic with raised letters. A quick black spray paint followed by sanding gives the appearance of black keys with white printed text.

Overall, this is a good-looking build of a computer you probably won’t see in person. We wish Forth had caught on in the early PC world, but it didn’t. [Grant] was prolific with replica computers, and [Cees] isn’t the only one who used that work as a starting point for their own projects. If you want real old-school Forth, you have to go back a few more years.

Continue reading “Recreating The Jupiter ACE”

Tiny Forth Could Be The Smallest

When you think of a programming language, you probably think of a hefty compiler or interpreter. Maybe its on a bunch of floppies, a CD, or even an EEPROM. But what about a language that fits in a single disk sector? A language like that would — in theory — be used to help bootstrap a computer system and that was the idea behind Sector Forth and, later, Sector Lisp. However, there’s a new game in town: milliForth, which claims to be the smallest ever at 422 380 bytes.

Why would you want such a thing? Well, first of all, why not? Even as a form of code golf, packing a functioning language into a tiny space seems interesting. However, you could also presumably use something like this to boot a small system or on a system with limited storage.

Continue reading “Tiny Forth Could Be The Smallest”

Learn Forth On The Commodore VIC-20

Although BASIC was most commonly used on home computers like the Commodore VIC-20, it was possible to write programs in other languages, such as Forth. Conveniently, all it took to set up a Forth development system was inserting the cartridge into the VIC-20 and powering it on, with the VIC-FORTH cartridge by [Tom Zimmer] being a popular choice for the Commodore VIC-20. In a recent video, the [My Developer Thoughts] YouTube channel covers Forth development using this cartridge.

In addition to the video tutorial, the original VIC-FORTH Instruction Manual is also available, together with the 1541 disk image. In an upcoming video, the Commodore 64 version of the cartridge will also be covered, which is called 64Forth, and which is also readily available to tinker with. For those interested in learning more about [Tom Zimmer] and his Forth-related work, a 2010 interview could be interesting. This covers the other platforms which he developed an implementation for.

As for why Forth might be interesting to developers and users, this comes mostly down to the much lower overhead of Forth compared to BASIC, while avoiding the pitfalls of ASM and resource-intensive nature of developing in C, as the entire Forth development system (compiler, editor, etc.) comfortably fits in the limited memory of the average 8-bit home computer.

(Thanks to [Stephen Walters] for the tip)

Continue reading “Learn Forth On The Commodore VIC-20”