A little bit of context on this course. As part of my MAT program, I had to take a class on English as a Second Language (ESL) teaching. In that course, there was a fundamental question of what does it actually mean to be literate in English? In short, it means you can read, write, speak, and listen. Moreover, a common stance for teaching an ESL course is not to tell students how to do these things, but to give students a LOT of opportunities to *practice* all of these things.
So, I'm thinking about what literacy might mean in the context of programming. What does it actually mean to be a literate programmer? Well, I think a big part of it means you can read, write, speak, and listen to others talk about code. So, that's what I'm doing in this course. In short, providing an environment to do *ALL* of those things.
It's come to my attention that John Bradley, author of the "xv" tool has died. I never knew John, but I used "xv" a LOT in the early days of my career as a graduate student working in computational physics.
In many ways "xv" might have been more pivotal to my early career than even Python.
In this thread, I'm going to offer my tribute to "xv" and say a bit about its role in my 1990s "vibe"-coding project that definitely did NOT involve any AI.
Well, I'm about 90 minutes into this project so far. It's, uh, freaky. But, I'm making progress. Translating C to Rust is a whole different game than translating Java. I don't really feel like doing all of this low-level byte oriented free/malloc business. No, I'll just use Vec<> and other nice Rust stuff.
After some playing around, I definitely think this needs to happen. Maybe I'll work through the 2nd half of Crafting Interpreters with Rust/ed. Maybe I should record this frivolity as some kind of 20 hour YouTube video.
Not sure how long this is going to take, but I'm guess it's definitely going to be a multi-day project (maybe even a week). Pondering: Should I upload the video in progress or wait until the whole thing is done?
About 3 hours in now. Made it to the start of scanning (section 16.1.2 in Crafting Interpreters). Wrote a Rust macro. Floundered about with some ed regex for a bit. However, making steady progress.
Ok, let's continue onward with scanning! I already continue this once before in Rust, but the implementation in the second half of Crafting Interpreters takes a different approach with ownership. So, I'll try to stay in the spirit of that as I go.
Well, up for day 3 of the crusted-ed project. Had a very sloppy bike ride in the rain to prepared for the day. Will now clean up and take care of the pooch before plowing onward into some code cleanup and further chapters.
Looks like the next few sections implement features that Rust already has (strings, hashmap, etc.). As instructive as that might be, I'm not going to reimplement all of that from scratch. At least I don't think so.
So, I've decided to do my own GC. Have now reached the hash table chapter. Rust already has its own HashMap. I could use that as a shortcut. Or I could try to roll with the book and make my own.
At the moment, the Hash in the book seems somewhat disconnected from everything else. And I don't recall Lox as having HashMap as a kind of value that you could use in user code. Somewhat inclined to use Rust HashMap<> for this until I run into a reason not to.
The book sets up linked lists of heap-allocated objects (in C). Could be dicey trying to replicate that. Part of me says the whole problem could be avoided by slapping Rc<> on everything. But, that feels like cheating and not in the spirit of the overall affair. So.... hmmm.
Well, I seem to have made it as far as the great abyss--the point where Crafting Interpreters wants me to think about garbage collection. Coding in Rust, this is about to get "interesting." Maybe a short nap is in order first.
Educator and musician living in Evanston, Illinois. I wrote some Python books, but you'll probably find me yapping on about bikes, trombones, dogs, and other random stuff here. Currently pursuing a MAT in Secondary Education with the hope of becoming a high school math teacher.