Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SUBLEQ eForth book

349 views
Skip to first unread message

Richard Howe

unread,
Jul 21, 2022, 3:28:07 PM7/21/22
to
Ahoy Forth programmers! I have made a book about porting Forth
to an esoteric target platform known as a SUBLEQ machine (this one
is a 16-bit twos compliment version), which is a single instruction
machine. The resulting Forth is surprisingly usable despite the complete dearth of
instructions, and it is self-hosting, it can generate new eForth
images.

The book, called "SUBLEQ EFORTH: Forth Metacompilation for a SUBLEQ Machine", is
available here:

* <https://www.amazon.com/SUBLEQ-EFORTH-Forth-Metacompilation-Machine-ebook/dp/B0B5VZWXPL>.

The original project is available here:

* <https://github.com/howerj/subleq>.

Along with the image source code and a virtual machine written in C, but
to save you from installing anything the system can be tested in your
browser at:

* <https://howerj.github.io/subleq.htm>.

The project is not meant generate a Forth that can be used for general
programming but it does show that Forth can be ported to nearly anywhere
and shows you how you can build up a meta-compiler/cross compiler to assist in
porting.

For those unfamiliar with the SUBLEQ instruction the Wikipedia article
on One Instruction Set Computers is informative and is available at
<https://en.wikipedia.org/wiki/One-instruction_set_computer#Subtract_and_branch_if_less_than_or_equal_to_zero>,
as is the Esoteric Languages pages at <https://esolangs.org/wiki/Subleq>. In
short the instruction stands for "Subtract And Branch If Less Than Or
Equal To Zero", and is Turing complete, all operators from multiplication
to the bitwise operators are implemented with this single instruction.

Have fun! It's not meant to be too serious.

Jurgen Pitaske

unread,
Jul 21, 2022, 3:57:51 PM7/21/22
to
Let's add another a few more important links in this context
- and how I started with the Ultimate RISC many many years ago
https://homepage.cs.uiowa.edu/~jones/arch/risc/

Last year I could convince Steve to implement it :

Steve Teal did a complete project last year:
the one Instruction Processor in VHDL
he adapted an eForth as well,
and I have it running here as well on a Trenz FPGA board.

You find it all on his github account under eForth MISC 16:
https://github.com/Steve-Teal/eforth-misc16

And by the way,
a similar version had been implemented as ASIC about 25 years ago,
manufactures by AMS in Austria
then running Assembler;
and Bernd Paysan adapted a Forth to the VHDL version running in a Lattice CPLD then,
it took just a long weekend as he stated.

Jurgen Pitaske

unread,
Jul 21, 2022, 4:03:25 PM7/21/22
to
and the post regarding our MISC16 Project from end of last year
https://groups.google.com/g/comp.lang.forth/c/QJu7L6gSEwI

Jurgen Pitaske

unread,
Jul 22, 2022, 2:37:06 AM7/22/22
to
From the documentation I have seen about this new book,
it is unclear to me, which of Ting's eForths this book is based on
http://forth.org/OffeteStore/OffeteStore.html

Richard Howe

unread,
Jul 22, 2022, 4:18:28 AM7/22/22
to
It's not based on any of them

Jurgen Pitaske

unread,
Jul 22, 2022, 4:21:36 AM7/22/22
to
in your post you say:
The book, called
"SUBLEQ EFORTH:
Forth Metacompilation for a SUBLEQ Machine", is
available here:

How does eForth get in there then?

Paul Rubin

unread,
Jul 22, 2022, 4:43:33 AM7/22/22
to
Richard Howe <howe....@googlemail.com> writes:
> The book, called "SUBLEQ EFORTH: Forth Metacompilation for a SUBLEQ
> Machine", is available here:
> <https://www.amazon.com/.... >

Is the book downloadable in a non-Kindle format? Thanks.

Richard Howe

unread,
Jul 22, 2022, 5:44:36 AM7/22/22
to
I'll see if can cajole Amazon into providing more formats later, I haven't
tried to purchase it myself yet, but that's a good point, cheers.

Richard Howe

unread,
Jul 22, 2022, 5:51:29 AM7/22/22
to

> The book, called
> "SUBLEQ EFORTH:
> Forth Metacompilation for a SUBLEQ Machine", is
> available here:
> How does eForth get in there then?

I first learned about eForth and metacompilation from https://github.com/samawati/j1eforth
I used what I learned there to make a reimplementation for one of my projects, which eventually goes on to influence
this implementation. I quite like the eforth model, and included references in the book to other implementations (and I think the
original implementation, although I'm not a Forth historian).

Paul Rubin

unread,
Jul 23, 2022, 9:26:57 PM7/23/22
to
Richard Howe <howe....@googlemail.com> writes:
>> Is the book downloadable in a non-Kindle format? Thanks.
> I'll see if can cajole Amazon into providing more formats later

Well part of the idea is to avoid dealing with Amazon, but every little
bit helps.

Jurgen Pitaske

unread,
Jul 24, 2022, 3:45:04 AM7/24/22
to
There are different opinions allowed here.
I like amazon.
Rather than me driving to 5 different shops,
pay for petrol and parking,
not to find what I wanted,
when suitable i buy on amazon.
It would be an interesting calculation
which approach is greener if you calculate this over say a year.

And amazon helped me to get many of the Forth documentations published.
Without these tools and the KDP platform I would not have started.
Had looked at other options before.
amazon does free promotion for Forth by sending out many many emails to potentials.
To people who might be interested in Forth and in those for example
https://www.amazon.co.uk/Juergen-Pintaske/e/B00N8HVEZM

Many here rather want to keep Forth a secret it seems.
I sometimes wonder, if this is for reasons of imprtance.
If there are less people, the relative importance goes up.

dxforth

unread,
Jul 24, 2022, 4:27:48 AM7/24/22
to
Every little bit helped send Bezos and Shatner into space. How is
the realization of their fantasy not a goal worthy of your support?
Nobody asks whether workers on the Pyramids were given time for a
piss. Labour is an ever-renewable resource.

Jurgen Pitaske

unread,
Jul 24, 2022, 4:55:05 AM7/24/22
to
As you are ...

Paul Rubin

unread,
Jul 25, 2022, 7:38:36 AM7/25/22
to
dxforth <dxf...@gmail.com> writes:
> Every little bit helped send Bezos and Shatner into space.

It didn't work. They came back a few days later.

Zbig

unread,
Jul 25, 2022, 10:13:34 AM7/25/22
to
> Many here rather want to keep Forth a secret it seems.
> I sometimes wonder, if this is for reasons of imprtance.
> If there are less people, the relative importance goes up.

Rather hard to believe it.
So many fine compilers given away — and even with documented
assembler listing — that such plea doesn't sound credibly. Especially
when a term „many” is used.

Jurgen Pitaske

unread,
Jul 25, 2022, 10:57:07 AM7/25/22
to
On Monday, 25 July 2022 at 15:13:34 UTC+1, Zbig wrote:
> > Many here rather want to keep Forth a secret it seems.
> > I sometimes wonder, if this is for reasons of imprtance.
> > If there are less people, the relative importance goes up.

> Rather hard to believe it.
> So many fine compilers given away — and even with documented
> assembler listing — that such plea doesn't sound credible. Especially
> when a term „many” is used.

There are probably 100 Forths out there or more?
Is there a list somewhere?
And I do not belittle the work that has been done there
creating and documenting them (if done so).
These were not the ones I meant.

But I have seen over the last 10 years, that there are too many Forths,
but probably less applications that use them.
Which would mean less than one application per Forth in general?
Nowhere I have seen a documentation what has been done with them.
Unfortunate
There are lists on Forth INC and MPE.

In contrast, look at the Arduino IDE or others
and what is done using them in the Maker scene.

The 50 year old Forth community has not done anything similar.
And it seems adding libraries is a NONO.
So it is a completely different community.
But there we are.

I have a great time with Forth until now,
and communicating with Chuck, Elizabeth, Ting, Steve and many others,
and quite a few years doing consultancy for MPE,
and my Forth Bookshelf has grown over these years as part of it
https://www.amazon.co.uk/Juergen-Pintaske/e/B00N8HVEZM

And it lead to my own 16 Bit MISC Processor
realized in VHDL after 25 years,
running an adapted eForth in FPGA.
All with the great support of others.

Zbig

unread,
Jul 25, 2022, 11:36:15 AM7/25/22
to
> In contrast, look at the Arduino IDE or others
> and what is done using them in the Maker scene.

Arduino uses C-like script language, and C is taught
at universities (in various variants) as „THE language”.

Besides: some companies seem to see its business
tied to Arduino. For example: ever heard of Pinguino
(„Pinguino project”)? But it does exist as well, since years.

> The 50 year old Forth community has not done anything similar.
> And it seems adding libraries is a NONO.

Why? For example: CIForth variants use libraries in the sense
that you seem to mean.
If you mean „shared libraries” — well, it's a being from C-world,
and nothing that marvellous, actually. It's a filler-up for gigabytes
of RAM in our machines, presently.

> So it is a completely different community.
> But there we are.

It's a different language. Maybe indeed it's not „for the masses” somehow?
Or maybe it's the lack of promotion — at the universities, in the learning
phase.

Really a pity Linus Thorvalds created Linux in C — instead of some kind
of Forth/OS. Forth is ideal language for Open Source world.

Richard Howe

unread,
Jul 29, 2022, 12:27:33 PM7/29/22
to
On Sunday, 24 July 2022 at 02:26:57 UTC+1, Paul Rubin wrote:
I couldn't see anything that would allow different formats unfortunately, but I did get the hardcover option working.

Paul Rubin

unread,
Jul 29, 2022, 9:06:34 PM7/29/22
to
Richard Howe <howe....@googlemail.com> writes:
> I couldn't see anything that would allow different formats
> unfortunately, but I did get the hardcover option working.

Why does Amazon have to be in the picture at all? Can you just put up a
pdf, or offer it for sale, or whatever?

Jurgen Pitaske

unread,
Jul 30, 2022, 3:28:02 AM7/30/22
to
Richard, keep up the good work.
You did whatever you liked and found useful.

And you are visible now in the amazon Bestseller list
https://www.amazon.com/best-sellers-books-Amazon/zgbs/books/3970/ref=zg_bs_pg_2?_encoding=UTF8&pg=2
Today on place 62 ( it changes)
Congratulations.

If people do not appreciiate your work
and hesitate to buy the ebook even - using the free reader
- or do not want to invest the 10 Dollars and scan it in to have the PDF they want -
they are not really interested anyway. Or want it all for free.

If it is free , the value of your work is a lot less appreciated.
I went through a similar process and now after 10 years, there is a list of books available on amazon.
Covering Forth, other fun stuff and translation work.
https://www.amazon.co.uk/Juergen-Pintaske/e/B00N8HVEZM.

Thanks for making your book available to the Forth community.

Jurgen Pitaske

unread,
Jul 30, 2022, 3:33:00 AM7/30/22
to
and here as well the link to your github, as there is a lot of free information anyway.
https://github.com/howerj/subleq

Jurgen Pitaske

unread,
Jul 30, 2022, 3:58:40 AM7/30/22
to
I wonder, if there is a better list of Forth Books available elsewhere?
https://wiki.forth-ev.de/doku.php/en:projects:litlist

Richard Howe

unread,
Aug 2, 2022, 5:55:42 PM8/2/22
to
Thanks for the support! I think that's good advice. I've given away projects and technical
documentation for free before, and I may do it again, but I thought this might make a nice
book.

I don't really have a problem with Amazon, and it certainly is the most convenient way of distributing
books / self publishing. To cut out Amazon I'd either have to self-host a web-site and application,
integrate payment processing with all that entials (an interesting task in itself, and something I might
be interested in the future, but not as part of this project) or use another, less known publishing house
who I would still be beholden to, and I don't feel like that's worth it, especially for such a niche topic
as a Forth interpreter for a One Instruction Set Machine (and interesting topic for sure, but very niche).
0 new messages