
BB4Wforth after all these years
-
- Posts: 2
- Joined: Thu 18 Jan 2024, 21:11
BB4Wforth after all these years
Hello! I was digging through my old Forth files the other day when I found a copy of BB4Wforth. (For the uninitiated, it's a port of jonesforth which uses BBC Basic for Windows for IO.) I've had a nice time tinkering with it, to the point where I didn't want to go back to my more practical projects. Perhaps it was the nostalgia brought on by looking through the BBC BASIC reference for IO details. Perhaps it was the font.
But seriously, I really like the OSCLI mechanism. It's given me ideas for my system; I'm planning to link pforth with SDL. I almost wish I could keep using BB4Wforth but I'm aware it's only 32 bits, and did I read in a post on here that BBC Basic for Windows is unmaintained now? I've forgotten quite what I read last night. Or perhaps I'll switch languages and just use BBC Basic for SDL, Forth is a funny fish when all's said and done, and I'm still getting the hang of it after several years.

Re: BB4Wforth after all these years
There's an open issue about this at GitHub.eekee wrote: ↑Fri 19 Jan 2024, 21:08 I almost wish I could keep using BB4Wforth but I'm aware it's only 32 bits, and did I read in a post on here that BBC Basic for Windows is unmaintained now? I've forgotten quite what I read last night. Or perhaps I'll switch languages and just use BBC Basic for SDL, Forth is a funny fish when all's said and done, and I'm still getting the hang of it after several years.
-
- Posts: 2
- Joined: Thu 18 Jan 2024, 21:11
Re: BB4Wforth after all these years
Thanks for the link. I've left a couple of comments about different C-based Forths, in case they're suitable.
Re: BB4Wforth after all these years
Maybe I'm missing the point here (I probably am) but I don't see the link between a Forth written in C and BBC BASIC.
The whole idea of BB4WForth and Forthlib was to leverage a major feature of BBC BASIC, the built-in assembler, to create a kind of 'hybrid' language in which Forth code could use BBC BASIC's graphics and other I/O capabilities. The resulting package was a self-contained BASIC program with no external dependencies, which is what made it 'interesting'.
But if the Forth is coded in C where is the 'integration' with BBC BASIC? In a cross-platform context you would have to compile the C code for each of the supported platforms (there are currently ten of those) to create a set of shared binary libraries, make available those shared libraries to the BASIC programmer, who could then call them using SYS in the usual way.
How would Forth code executed by such an external library be able to utilise BBC BASIC's graphics, sound and other output? How could it read from the keyboard, or a file, or the mouse? How could it raise an error which is trappable in BASIC? I'm just not seeing how the 'integration' could work in such an environment.
It seems to me that with a Forth coded in C it would probably be easier to cut out the 'middleman' (the BBC BASIC interpreter) entirely and simply link the Forth code with the Open Source BBC-style input/output routines! That would be an entirely separate project.