logoalt Hacker News

Cagire: Live Coding in Forth

100 pointsby surprisetalk07/10/202614 commentsview on HN

Comments

codesniktoday at 10:26 AM

Nice. When I saw some javascript live music arrangement experiments, I thought that forth is syntactically better for that task because of postfix notation - no need to select and execute parts, keywords could be self-adding/playing.

eggyyesterday at 7:12 PM

Cool, and I love the retro font. I had a Vic-20 (early 80s) and Commodore PET 2001 (1977) I am learning Odin, and I was going to try creating live coding environment with scripting in Forth and with the gui and rest in Odin, but for audio and graphics. I was inspired long ago by Paul Batchelor's Sporth and Tidal (now tidal cycles?). Forth is a great language. You can make an compiler/interpreter in a few days. John Earnest's ok.js is also cool. I like stack and array languages, so when I am not playing in J, I use Uiua. Uiua has the capability to do audio and graphics/animations and scratches my array/stack itch.

quaverquaveryesterday at 4:32 PM

for FORTH like synthesis environment you will want to check out SAPF! (by James McCartney author of SuperCollider) https://github.com/lfnoise/sapf

show 2 replies
hankbondyesterday at 6:33 PM

This is a neat project and I don't think I'm aware of any sequencers that allow for arbitrary execution per-step (not that I am that deep into the space). The font choice for the website is really... interesting. I don't think I can recall ever feeling this dyslexic trying to read the copy here.

eluusiveyesterday at 11:23 PM

This is super cool. I've been thinking about doing something like this for awhile as a retirement project.

chantepierreyesterday at 8:22 PM

Very cool. Are you near Aspet ? I often hike with a friend who lives there. The Cagire is one of my favorite peaks of the Pyrénées.

alex7oyesterday at 9:20 PM

Oh it seems like forth is a pretty good candidate for this. Like most of these things are a post processing steps

octettayesterday at 6:39 PM

Neato... I'm glad stuff like this exists in the world. I'm gonna steal some ideas for my own project (Skred). Thanks!

DonHopkinsyesterday at 5:43 PM

Toffoli and Margolis's CAM-6 cellular automata machine board for the IBM-PC was programmed in FORTH. I made a simulator, and this video shows some of the original FORTH code that I saved, as well as my own compatible FORTH CA rule computer that le me run the rules from the book, which produced lookup table for the hardware, which the simulator is compatible with. I've since rewritten it in JavaScript. It's not live coding, but it has a live performance user interface (quite weird and hard to figure out, especially if you haven't read the book, but I demonstrate it in the video).

CAM6 Demo

https://www.youtube.com/watch?v=LyLMHxRNuck

Original FORTH code that drove the actual CAM-6 board:

tomt-cam-forth-scr.txt: https://donhopkins.com/home/code/tomt-cam-forth-scr.txt

tomt-users-forth-scr.txt: https://donhopkins.com/home/code/tomt-users-forth-scr.txt

My compatible CA compiler and glue to the simulator written in C:

cam.f.txt: https://donhopkins.com/home/code/cam.f.txt

compile.f.txt: https://donhopkins.com/home/code/compile.f.txt

An old version of the simulator written C, before I rewrote it in JavaScript:

https://github.com/SimHacker/micropolis/tree/master/Micropol...

The JavaScript CAM6 simulator:

CAM6.js: https://github.com/SimHacker/CAM6/blob/master/javascript/CAM...

show 1 reply
phreda4yesterday at 4:17 PM

Nice! I try this

lipenghui222today at 10:09 AM

[flagged]