Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Squad: Forth on Chip-8 (internet-janitor.itch.io)
82 points by RodgerTheGreat on Feb 19, 2021 | hide | past | favorite | 12 comments


As noted in the writeup, Squad is part of a triptych of interpreters working within the same constraints; the other two interpreters are Applejak[0] and Bulb[1].

[0] https://internet-janitor.itch.io/applejak

[1] https://internet-janitor.itch.io/bulb


Hey Rodger! The simplicity of Applejak inspired me to work on my own toy APL in the k family and I've really enjoyed it so far. Optimizing for cache coherency and linear memory layout has been the most fun I've had programming in a few years. Keep up the great work!


Thank you. It's always nice to hear that my projects are educational and motivational to others.


This might be the baader meinhof phenomenon since I've been writing one, but does it seem like there are a lot of Forth-related things happening lately?


There has definitely been 5+ posts over the past few days relating to FORTH.

I love the language, it is fun to tinker with, but despite that I've never used it for anything practical. Almost all FORTH posts get an upvote from me, though my own recent submission about writing a simple FORTH-like interpreter sank without a trace:

https://news.ycombinator.com/item?id=26111565


Yep. I like the description that turned up in an earlier thread: it's Forth Week on HackerNews.


I've seen a couple on Hackaday too! I didn't know if it was just me, because I've been writing a Forth compiler so I'm probably more likely to notice them.


> I've been writing a Forth compiler

Well you can't just leave it there. Wacky architecture? Unusual choice of host language?


It's part of a larger project that's not finished yet. First I made up a CPU architecture and wrote an assembler for it. Then I made an emulator for the machine. Then I wrote a Forth compiler targeting that assembly. Now I'm working on interactive dev tools, web-based emulator, polishing everything, etc, so other people will be able to use it.

Later on, a way to run it on hardware, probably some kind of FPGA / fast-microcontroller hybrid board.


This is beautiful. I like the simple subet you chose. How long did this take? It just says checked in 5 days ago.

Thanks for including the gif too because the player didn't work on Firefox 85 on my Android tablet, so it was nice to have the expected output to verify.


After writing Bulb, I'd say it took about two afternoons to write Squad. Most of the "terminal IO" routines have been reused.

The loop structures in Squad are different, and somewhat simpler than, the usual Forth looping words. I think `loop ... (again|until|while)` may be my own invention; I've used these in most of my Forths.

Apologies for lack of tablet accessibility.


I noticed your simpler loops and prefer those for sure. It feels like that's what they should have been from the start for flexibility of implementation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: