Email or username:

Password:

Forgot your password?
Devine Lu Linvega

I'm trying to find practical implementations, and just general fun things people made, with concurrency in #forth. There's a lot of hand-waving and saying that yeah, like, it's easy no problem don't worry 'bout it, but very little linking to actual examples. Does anyone have written concurrent programs in forth? I'd love to see it. :)

18 comments
beesweater

@neauoire
You think there's any GPU stuff written in forth? I know that's pretty concurrent by default. Maybe some kind of shader project written in #forth.

Devine Lu Linvega

@beesweater do you have a link to one that you might have tried?

cancel

@neauoire @beesweater gpu parallel execution is not much like CPU multithreaded execution. you can't write forth for a GPU, anyway.

cancel

@neauoire anyone saying concurrent programming for CPUs is easy has not ever done it

beesweater

@neauoire
I found the boot ROM for this multicore chip called the Parallax Propeller 2 github.com/speccy88/TAQOZ

Devine Lu Linvega

@beesweater thank you! That's not exactly what I was looking for but it'll come in handy. 🙏

mx alex tax1a - 2020 (4)

@neauoire bradrodriguez.com/papers/mtask there's this classic paper about the principles of Forth multitasking; go up a level for this author's other forth articles, they are all pretty good.

Devine Lu Linvega

@atax1a I'm reading it right now :) someone in the thread just sent it. It's exactly what I was looking for.

Devine Lu Linvega

@bx those I'm more familiar with :) It's kind what got me interested into all this.

bx

@neauoire cool, it's been quite a while since i thought of arrayForth, it'd be fun to see if they have an emulator for gur chip to play around with

Michael Alyn Miller

@neauoire Both MFORTH and Enforth implement a cooperative, dynamic (tasks are created at runtime) multitasker. MFORTH is in 8085 assembly, Enforth is in C. Might be helpful as a pair of sample implementations to go along with Brad's article...

github.com/malyn/MFORTH

github.com/malyn/Enforth

Jack Rusher

@neauoire There were a number of single processor cooperatively multitasking FORTHs back in the day, including F83. You can probably find code for that system on the ‘net.

I’ve also built some real multi core stuff in FORTH, which is “easy” only in the sense that FORTH words are usually reentrant so long as each process/task has its own stack (modulo a few details).

William

@neauoire lol I made a forth but it's explicitly not concurrent because safety. It has single threaded events that come from a work queue, including external/hardware/io events.

So much less fun, I know ;)

Xan Gregg

@neauoire Not online or practical, but maybe fun and slightly educational. I dug up code I made in 1986 using MacForth's cooperative multi-tasking to run 4 graphical sorts at once. Syntax core was:
: MY.TASK ( --)
...
ACTIVATE<
...
PAUSE
...
STOP> ;
Required a little extra cooperation to make sure the timing was fair for the visual comparison (not just based on number of PAUSE calls).

Go Up