41 points by alzhi7 1 day ago | 4 comments
smj-edison 2 hours ago
Dang, this is really relatable. A couple months I started digging into the Jimtcl interpreter, which is a 20-year-old Tcl interpreter written in C. My goal was to make it thread safe, which I naively thought wouldn't be that hard. Turns out interpreters are really complicated, lol. There were many many times I saw a line of code that made no sense, and only would make sense a couple days after when reading in another subsystem. Variable lookup caching in particular gave me a lot of grief, as I learned how epoch-based invalidation works. It's slightly insane to keep track of a different epoch per call frame, and whenever a variable is looked up, you have to figure out what call frame that variable is referencing based on context, and then check if its epoch is correct. It is incredibly humbling that these systems work as well as they do.

I eventually did end up getting Jimtcl to be multithread-safe, but it ended up being slower than the naive approach of serializing and deserializing between threads. I've been seriously nerd-sniped since, and have slowly been building my own thread safe interpreter, but I still have to cross check with Jimtcl constantly.

samokhvalov 7 hours ago
nice work

I wonder if you considered WAL-G, which is also written in Go

and has this: https://github.com/wal-g/wal-g/blob/master/docs/PostgreSQL.m...

1 day ago
JSR_FDED 6 hours ago
You really get a sense for how much the author learned from this experience. And I like how he developed a respect for C.

Given all the corner cases he describes, it seems like a good example of something you would never ever want to vibe code.

pierrekin 2 hours ago
I think it may be that we agree but because the expression “vibe code” has many meanings it’s hard to tell.

I would absolutely still bring a coding agent with me for a project like this, but I would be in the mindset of “I need to understand and be familiar with every line” rather than say, every function signature or every service behaviour.

So it is almost like vibe coding but the abstraction level is lower?

The question I’ve been asking myself recently is, if the act of thinking about the code from scratch is somehow more good than the potential benefit of being able to let that mechanical part be handled by something else, be it another human or an agent.

To be specific I’m referring to a prompt like “next, add a for loop which iterates over the elements in the array and enumerate an index, then call our function $func by reference for each element.” “Is there a more idiomatic way of doing this in $lang?” etc.

This has the advantage to me of letting me code in languages who’s syntax I don’t know or have forgotten, but I’m not sure whether this is trading some sort of short term gain for long term cost yet.

globular-toast 19 minutes ago
> To be specific I’m referring to a prompt like “next, add a for loop which iterates over the elements in the array and enumerate an index, then call our function $func by reference for each element.”

When you're fluent in a programming language it's quicker to just type that directly in said programming language...

Instead you're training yourself to be able to say this stuff in English which will never be as powerful.

cyberpunk 9 minutes ago
I hear this sentiment a lot but it doesn’t match my experience. I’m an experienced erlang programmer, i’ve shipped thousands of gen-server and gen-statem over the years and coding models can absolutely wire them up faster than I can type them out… I guess if you’re using lombok in Java or something typing @foo probably doesn’t take all that long.
zhainya 1 hour ago
Wouldn't the long-term cost be the reliance on "something else" that did the actual work?