r/Forth • • 9h ago

zeptoforth 1.17.2.1 is out

8 Upvotes

You can get this release from https://github.com/tabemann/zeptoforth/releases/tag/v1.17.2.1.

This release:

  • fixes bugs in the USB stack that were preventing USB from working properly with Windows and which were making mounting USB Mass Storage Devices less than smooth on Linux.

  • extends support for 0x hex prefixes to anything that uses parse-base, including parse-integer, parse-unsigned, parse-double, parse-double-unsigned, and parse-fixed.

  • corrects a minor issue in zeptoed where on exit it would attempt to place the cursor on the row below the last row on the terminal rather than on the last row on the terminal; this in most cases had no practical consequences.

  • adds optional support for generating Bézier curves in extra/common/bezier.fs in a graphics-backend agnostic fashion.


r/Forth • • 12h ago

Forth interpreter for the ZX Spectrum

9 Upvotes

r/Forth • • 7d ago

zeptoforth 1.17.2 is out

14 Upvotes

You can get this release from https://github.com/tabemann/zeptoforth/releases/tag/v1.17.2 .

This release:

  • adds new kinds of literals (i.e. string literals, execution token literals, name token literals, and character token literals).

  • adds 0x as a hex prefix for integer and fixed-point numeric literals.

  • adds support for UTF-8, which is evaluated to Unicode code points, to char and [char]

  • fixes bugs in float32::vexp, float32::vexpm1, and float32::v>f64.

  • improves exp, expm1, fixed32::f32exp, and fixed32::f32expm1.

  • fixes a cursor-placement bug in zeptoed on exit.

Note that the new kinds of literal have the following forms:

  • string literals have the form "<string>" and can replace any usage of s\" and can include escapes accepted by such.

  • execution token literals have the form \<name>` and push or compile the name's execution token depending on state.

  • name token literals have the form \`<name>` and push or compile the name's name token depending on state.

  • character token literals have the form '<character>['] and push or compile the Unicode code point corresponding to the UTF-8 provided depending on state.


r/Forth • • 8d ago

After Qwenputer, I wondered if a smaller model could do it too. So I built a Forth interpreter into Nemotron 3.5 Lightning's weights

Thumbnail reddit.com
6 Upvotes

This might interest a few people in this community.


r/Forth • • 9d ago

Help finding GreenArrays GA144 DevBoard

14 Upvotes

GreenArrays site seems to be down, the newest articles are quiete old and I can't find alternative stores or marketplaces where to find, at least, a used Dev Board...

Anyone knows what is the status of GreenArrays? Anyone willing to sell to me a spare DevBoard?

Thanks!


r/Forth • • 9d ago

voxel sprites in r3forth

Thumbnail
youtube.com
17 Upvotes

r/Forth • • 14d ago

Some additions to zeptoforth, inspired in part by gforth 1.0

17 Upvotes

While these are not in a release yet (they are in the master and devel branches), inspired by some new features of gforth 1.0 I have added to zeptoforth "foo\r\nbar" string literals with support for escapes, 'x' character literals with support for UTF-8, backtick-prefix execution token literals, double backtick-prefix name token literals, and 0xDEADBEEF integer hex prefixes.

I have also extended char and [char] to support UTF-8, and added ansi-term::get-unicode-from-utf-8 to get a Unicode code point read from console input as UTF-8 and ansi-term::emit-unicode-as-utf-8 to emit a Unicode code point to console output as UTF-8.

There is validation of UTF-8 to prevent overlong encodings and to limit code points to a maximum of $10FFFF, with U+FFFD being used to replace invalid Unicode. Also, when parsing UTF-8 read from console input, if there is a saved byte it is used, and if there is an error in the UTF-8 and the byte read from console input is a valid beginning to another code point is saved to be read by a subsequent call to ansi-term::get-unicode-from-utf-8 or ansi-term::get-key.

Note that I have not yet implemented literals of the form 7k4 or 3M4 for floating-point numbers. Also, I do not plan on implementing <baz> or <quux+$10> type literals, as execution tokens in zeptoforth are already the address of the first byte of the code of a word, and <quuux> is already established by convention to be how classes are named.

I also have no current plans to implement recognizers, as for most purposes zeptoforth already has extensible literal parsing and name looking-up, and implementing recognizing would require significantly more redesign than I am planning on doing at the present.

For the record, if you are looking for the repository, it is at https://github.com/tabemann/zeptoforth/ .


r/Forth • • 15d ago

My PC game has gone free. Happy Halloween 👻

Post image
26 Upvotes

https://inkajoo.itch.io/untitled-kvn-game

Leave a comment on the Itch page! It means the world 🙏


r/Forth • • 15d ago

My RetroChallenge port of CamelForth to the Sega SG-1000 is wrapping up for October. Can camels eat pumpkins?

Thumbnail
leadedsolder.com
8 Upvotes

r/Forth • • 19d ago

Gforth 1.0 released

Thumbnail gforth.org
76 Upvotes

r/Forth • • 19d ago

RetroChallenge is almost over, so I'm fixing bugs and testing my Forth port on my homemade SG-1000 clone

Thumbnail
leadedsolder.com
8 Upvotes

r/Forth • • 20d ago

zeptoforth 1.17.1.1 is out

9 Upvotes

You can get this release from https://github.com/tabemann/zeptoforth/releases/tag/v1.17.1.1.

This release:

  • fixes a bug introduced in release 1.17.1 in the PicoCalc terminal emulator scrolling logic.

  • adds the ability to search in the history to the line editor.


r/Forth • • 21d ago

8th 26.07 released

7 Upvotes

Lots new in this version, including task-safety and gui improvements, and biometric authentication functionality for Pro+ users.

Full details on the forum


r/Forth • • 21d ago

VIDEO My latest game written in Forth is out! Untitled KVN Game (PC)

40 Upvotes

Buy now! 👉 https://inkajoo.itch.io/untitled-kvn-game

If you'd like to support independent game development in Forth, buying a copy is a great way to do that!

Actively fixing bugs and taking suggestions, which you can submit here, on the itch.io product page, or on the Discord.


r/Forth • • 22d ago

BoxLambda Update: A Forth VERA Graphics Driver.

Post image
10 Upvotes

A new Blog post about the BoxLambda's Forth-based graphics driver:

https://epsilon537.github.io/boxlambda/forth-vera-gfx-driver/


r/Forth • • 23d ago

zeptoforth 1.17.1 is out

14 Upvotes

You can get this release from https://github.com/tabemann/zeptoforth/releases/tag/v1.17.1.

This release:

  • fixes a significant bug in fat32::seek-file where it was broken when seeking outside of the first sector of a file.

  • adds the ability to redefine colors in the PicoCalc graphical and text-only terminal emulator colors (note that this pertains to the terminal emulator colors specifically, not to the underlying RGB332 pixel format, which is yet unchangeable).

  • adds the ability to refresh all characters on the PicoCalc terminal emulators, overwriting all user-drawn pixels on the display.

  • adds support for DEC terminal margins to the PicoCalc terminal emulators.

  • disables blocks FAT32 by default in the PicoCalc terminal emulator installers, to enable the user to use blocks storage for their own purposes (note that if the they previously had a PicoCalc terminal emulator installed they may want to manually erase blocks storage before using it for traditional Forth blocks); this can be manually enabled at installation time if so desired.

  • adds a replace mode to zeptoed and the block editor.

  • adds online help to the block editor.

  • fixes a number of minor bugs in zeptoed and the block editor.

  • makes a number of improvements to the 'Rocks' game to make it a more full Asteroids clone.

  • eliminates an extra task from the USB Mass Storage Device support, saving SRAM and processor time.


r/Forth • • 23d ago

Forth++ Update

Post image
20 Upvotes

Huge progress on Forth++.

It's still running in QEMU only - I haven't tried to boot it on real hardware. I need to get the NVME driver working (it's on my TODO list) or the initial INCLUDE of most of the Forth words can't work. I hope that since it's Limine booted, it should at least come up and run up to some point that I can debug from there.

So what this screenshot shows is 3x Windows with Forth ok> prompts. The window system is rendered entirely with the CPU. I was initially saddened and ready to quit because the screen update was taking 45ms and the mouse motion was too slow. I ended up reworking the assembly routines that copy rectangles (e.g. the screen/wallpaper, offscreen-to-framebuffer, and windows to offscreen) using vector register instructions and that time went from 45ms to 5ms. I'll know better when I see it run on real hardware.

So the multithreading is clearly working (time sliced, not cooperative, and it knows how to render active window in bright red borders and inactive in darker red. The mouse pointer changes from arrow to hand when over the active window's titlebar and while dragging, into a finger when mouse is over the [NEWCLI] text in the screen's titlebar, and each window has it's own cursor for when it is active and the mouse is over (e.g. text editor can have ibeam while paint program can have crosshairs). Clicking on an inactive window activates it.

The newcli code is written in Forth.

I mostly ported the existing ReadLine class from Inspiration so applications can have their own command line editor with history - this is used by the OK> prompt, for example, but also would be used by a vim or emacs like editor for inputting command lines.

Features include:

  • IOAPIC used for interrupt control

  • LAPIC used for timer

  • Per CPU task scheduling

  • ATA driver

  • FAT32 filesystem

  • MMU for paging and virtual memory

  • Interrupt driven Keyboard Driver

  • Interrupt driven Mouse Driver

  • Real Time Clock (RTC) Driver

  • Graphics based Console driver (that works within windows)

  • Graphics library for Forth programs to render graphics in their Window(s)

Code is at https://codeberg.org/mschwartz/aforth

(No AI used to make any of this)


r/Forth • • 24d ago

My Inference Engine with eForth

3 Upvotes

Hello,

I’ve been working on this project for over 15 days now. It has reached a functional stage. Everything is here:

https://github.com/MPETREMANN11/eForth-Windows/tree/main/INFERENCE

Admittedly, it is written for eForth Windows. However, its code is portable to all other versions: ESP32forth, eForth web, etc.

However, to test an inference engine, it must have a knowledge base—consisting of facts and rules—that is relevant to potential users. As an electric vehicle owner, I became interested in the OBD2 error codes for such vehicles. It’s quite enlightening. I am now at the stage of building a knowledge base of facts and rules for diagnosing faults in electric cars.

My inference engine retains FORTH syntax for the rules. The CONDITION and ACTION parts are compiled. The engine processes this code using recursion.

So why does a project take me so much time?

First of all, I don’t work on it all day long.

Furthermore, I produce comprehensive documentation—in both French and English—which is available here:

https://github.com/MPETREMANN11/eForth-Windows/tree/main/INFERENCE/docs

Because I want to go beyond simply making code available—which is typically done without any further explanation—on GitHub or elsewhere.

Documentation accounts for 90% of an application's value.

Once the knowledge base of facts and rules has been sufficiently expanded, I will likely also create a video, or perhaps even an online demo running on the web-based version of eForth.

Your opinions, comments, and suggestions are welcome.


r/Forth • • 25d ago

PunyForth for ESP32-C3

Thumbnail
github.com
8 Upvotes

r/Forth • • 26d ago

r3forth REPL

Thumbnail
youtube.com
12 Upvotes

r/Forth • • 26d ago

View of a Blue (colorForth) program

10 Upvotes

Been quitely iterating on Blue, my colorForth dialect/assembler. In v7 I have made some simplifications to the colors/interpreter which I believe may be of interest. Also just to note, I wouldn't be surprised if others have stumbled upon these or similar things, but there's not a lot of colorForth discussions that I've found, so everything in Blue is self-found, ai/llm free. I have seen screenshots/videos of the traditional colorForth system but have never used it.

Since Blue is bytecode based, I serialize it for source control and external viewing, in this case as html. The following is written for x86_64/Linux.

To get started, this is an html view of likely the most minimal Blue program that will emit a valid binary (124 bytes):

https://jbirddog.codeberg.page/blue/example/x86_64/true.b.html

However the one I'd like to show is more representative of an actual Blue program and shows how one goes from hand jit'ing with green numbers to higher level words, macros, variables and assemble-time execution of user defined words. This yields a 129 byte binary:

https://jbirddog.codeberg.page/blue/example/x86_64/true2.bl.html

There is a lot to unpack here, but for an overview of how the bytecode is interpreted: The interpreter starts each time with a clean slate - there are no built in words. The dictionary and data stack only exist at assemble time.

Color tag bytes have the sign bit set, so values between 0-127 are skipped, which allows for comments/whitespace in the bytecode.

The simplifications I'd like to mention are a reduced color set and dropping the `forth` and `macro` modes.

First, the colors for v7 have been reduced to:

red word: define label

green word: compile call/jmp to word in output

green number: write number to output

blue word: execute word at assemble time

blue number: push number onto the data stack

magenta word: push address of word onto the data stack

By default every color is immediate, however any color can be postponed. This allowed removing the `macro` and `forth` words that toggle the interpreter's mode - which lead to the ability to remove yellow and cyan words. This simplified the interpreter which dropped to 172 lines of non code-golfed asm.

For example, to define `;` its red(;) postpone(green(0xC3)) green(0xC3). Then when you write a blue(;) it will execute the postponed code to compile the number 0xC3 into the output, then hits the already compiled 0xC3, which is `ret` and returns to the call site. In short, `;` is a macro that when called does the exact same thing as if you had just written a green(0xC3). A very simple example but it shows the mechanics of it all.

In Blue a `;` following a green word does not implicitly turn the call into a jmp. I have found that error prone (since it basically looks back 5 bytes for 0xE8), so instead you set a flag on the green word to signal a jmp vs call. Likewise, magenta words can be flagged to return either the assemble time or runtime address of the word.

Anyway, sorry that got long, just wanted to share some colorForth. Happy hacking.


r/Forth • • 26d ago

My RetroChallenge port of Forth to the SG-1000 continues; now we've got sprites!

Thumbnail
leadedsolder.com
8 Upvotes

r/Forth • • 27d ago

My latest game written in Forth is coming out on Friday.

Thumbnail
gallery
60 Upvotes

Hi everybody,

I've been very busy working on my game engine SUPERSHOW and a spooky little flagship platformer called Untitled KVN Game.

The genre of it is a mixture of horror, roguelite, and action-puzzle-platformer and it takes influence from various beloved games of mine including Super Mario Bros 2, Prince of Persia, and even Dark Souls.

A Russian artist I teamed up with on Discord conceived it and did the art and music, and an audio-engineer-musician friend from Baltimore did the sound effects.

I thought that SUPERSHOW was going to be released by now, but this game, originally meant to be a simple "demo" game, turned into something more serious than expected and I decided to dive right into attempting to go into business for myself as an indie developer, delaying SUPERSHOW's release. All the better - 1.0 will be more polished when it does release, probably sometime around mid-December. I think it's going to be something special that people will have fun with.

SPUNK, the same room-based framework as the one used in its spiritual prequel, KVN, is reused (updated for the latest engine). UKG also shows off a few technical advancements, including a brand spanking new physics-modelled CRT filter and advanced platformer physics. In addition, all of the maps were created with a proprietary level editor.

Here is a link to the pre-announce on itch.io:

https://inkajoo.itch.io/untitled-kvn-game/devlog/1717552/my-spooky-indie-game-releases-on-friday

Gameplay videos:

https://www.youtube.com/@cardboard-tv-games


r/Forth • • 28d ago

Is Forth still a viable solution for low level programming in 2026?

35 Upvotes

I played with Forth about Forthy years ago (pun intended) while taking a break from BASIC. Now I program almost exclusively in Python. But I was wondering, if I wanted a targeted helper function that needs to be fast and it's simple enough to write in assembly (which I don't know), could I write it in Forth instead? I work on PCs and I should mention that I am an amateur programmer (in any language).

And when it come to fast (size is no longer an issue) does Forth have advantages over C?

If so, how would you do it? Which Forth interpreter / compiler do you recommend on a PC?

I guess what I am asking is, aside for the fun of it, is there any practical reason to dust off my Forth?

Thanks