November 30, 2024

Tiny Forth Could Be The Smallest

2 min read
rb_thumb

rbs-img

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.

As you might expect, there are compromises. There are only a few keywords but since Forth can define new words, that might not be a problem The input system is a little different than you might expect, but you are unlikely to want to use this as an interactive interpreter, anyway.

Of course, this implies a challenge: Can you write more with less? If you want to try, there’s no need to actually boot a system. Virtualization software makes it easy to spin up a virtual machine to try things like this out.

SectorLisp is a little larger, but not much. Forth is a great candidate for putting on small computers.

Source: hackaday.com

Leave a Reply

Your email address will not be published. Required fields are marked *