4 ms·
Squad: Forth on Chip-8
- RodgerTheGreat 6y agoAs 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 https://internet-janitor.itch.io/applejak [1] https://internet-janitor.itch.io/bulb https://internet-janitor.itch.io/bulb
- ruste 6y agoHey 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!
- RodgerTheGreat 6y agoThank you. It's always nice to hear that my projects are educational and motivational to others.
- deleted 6y ago[deleted]
- guerrilla 6y agoThis 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.
- RodgerTheGreat 6y agoAfter 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.
- guerrilla 6y agoI 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.
- randrews 6y agoThis 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?
- stevekemp 6y agoThere 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 https://news.ycombinator.com/item?id=26111565
- MaxBarraclough 6y agoYep. I like the description that turned up in an earlier thread: it's Forth Week on HackerNews.
- randrews 6y agoI'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.
- MaxBarraclough 6y ago> I've been writing a Forth compiler Well you can't just leave it there. Wacky architecture? Unusual choice of host language?
- randrews 6y agoIt'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.