I really want an excuse to try making something in #retroforth, but a) I don’t have a project that it seems suited for at the moment and b) I haven’t finished the other ten projects I’ve already started and c) I don’t have time for any of them anyways 😅
Loving #retroforth so much!
For some reason I, apparently, am fluent thinking in it.
Starting to code some stuff in literate programming style with unu. Also great format to convert to gemini/html to share on pachapunk.
Okay, I'm several days behind in #adventofcode and I have a little time before I should get to bed, so let's start at day 7 and go backwards, shall we?
As usual, streaming at my #owncast server. Come hang out while I grumble at #RetroForth for a bit! https://stream.cincodenada.com
#livestream #programming #forth #adventofcode2021 #retroforth #owncast #adventofcode
This year for #adventofcode, all the languages I was interested in playing with felt like they were gonna be a lot of work to learn and actually solve things in. I didn't feel quite up to it this year so I hacked out day 1 in #QB64 - which is a delight but hardly new, QBasic is the first language I coded in!
But then @nihilazo started poking around in retroforth. Forth was high on my list but I didn't know what flavor to go with, so I gave retro a run, and it's nice, just enough bells and whistles to be approachable.
After porting over my initial #QB64 solution to Forth and tearing my hair out over variable declarations, I took a fresh run at it with stacks in mind, and ended up with what I think is a pretty nice, tidy solution. Especially nice was that when I needed to clean up the stack to do the full solution rather than leave the whole list in memory, it was literally removing one word. Fun! Yay fedi folks!
https://gitlab.com/cincodenada/advent-of-code-2021/-/blob/main/day1.forth
#adventofcode2021 #forth #stackbasedlanguages #retroforth #programming
#programming #retroforth #stackbasedlanguages #forth #adventofcode2021 #qb64 #adventofcode
ahhh crap, just realized I could probably take the p-boot source that Megous put together as a bootloader gui for the #pinephone and jettison a fair bit of the code and slot in #retroforth instead and have a non-functional yet nicely bootstrapped forth-based smartphone to flesh out... if it wasn't trying to run a full operating system this allwinner a64 hardware could scream as a purpose-built "embedded" device...
now @JF has me thinking about a CP/M implementation and maybe a #retroforth implementation for the @PINE64 #pinetime lol
so I got my port of #retroforth for the #teensy to the point where it can load a .retro file from the SD card into the dictionary, but all of my I/O at this point is a mess of hacks trying to serve the desires of the arduino libraries and the needs of libc's fopen et al and I hate it.
So, I'm going to be reworking all of that before it gets any worse.
my #retroforth port for teensy now has a random number generator (backed by the Entropy library and the teensy's rng hardware)
for a Monday I'll take it.
so, my sketchy mental roadmap of next steps for my #retroforth port goes like
y'all, I cannot begin to tell you how much fun I am having porting #retroforth to the #teensy 4.1 (not to mention how much I'm learning about both, as well as the SdFat library)
here, have a screenshot of the first time I've successfully read and displayed the contents of a text file on the micro SD card.
heckin' impostor syndrome is up against the ropes at this point in my weekend even if I did forget that cr
isn't a word of its own (yet!).
gotta say, though, now that there are u-boot builds with display supported on the pinebook pro, I'm hecka tempted to make a go of porting #retroforth to aarch64 as a uefi application once I'm pleased with my teensy port
@natecull@mastodon.social song goes well with the Code-It-Yourself Manifesto included at the end of the #retroforth book
found my bug (NUM_DEVICES really should be the number of devices, not a larger number) so my #retroforth port now actually really supports floating point numbers
RETRO Listener (c) 2016-2021, Charles Childers
#3 n:to-float f:to-string s:put
3.000000
f:PI f:to-string s:put
3.141592
huzzah!
decided to take a quick detour on my way to filesystem support in #retroforth
Connected at 115200
vm and image initialized.
Starting execution of listener.
RETRO Listener (c) 2016-2021, Charles Childers
#3 #0 #2 io:invoke
s:empty dup #3 #2 io:invoke s:put 3.000000
doesn't look like much, but it's the first sign of validation that I've got at least some of the floating point support working
now I'll track down why none of the prefix:f words are working and then start on filesystem support
made a bit of progress with my #retroforth port to #teensy 4.1 today, got rid of a bunch of hacky calls to Serial.read() & Serial.write() and put back the calls to getchar() & putchar() and still have a working system - huzzah!
need to spend time on the lab reorg work this weekend so I can get @rosalind back online again & have room for solderin' but I'm quite happy with how this is goin' and might sneak in some file IO handlin' via SdFat in between other labors over the next couple days.
eventually I want to have a few little 32-bit #retroforth machines to play with, interconnect, and examine some of the dustier corners of computing for the lost nuggets of gold.
anyway, got stdout redirecting to Serial successfully now in my #retroforth port so that's nice and should lead to an easy stdin redirect, after which I'll get going on filesystem support on the microSD card.
woooo!
it's not much, but it executes code!
@crc@mastodon.social's #retroforth #forth (barebones) on #teensy 4.1 over serial
cc @vertigo because he <3s the forth and platform hax ;)
Been having some fun today getting the Nga virtual machine and #retroforth, both by @crc@mastodon.social, built and running on my teensy 4.1 MCU using serial for I/O.
Definitely getting closer, though obviously still have some issues to track down.
Regardless, it's making me pretty happy.