by titzer · 1w ago · 0 comments
I don't think that making programs a lot more complicated because they have to prove a very specific memory management discipline is the right way to go.
With AI we don't need expressive programming languages for humans to read and understand at line-level details. Instead, we need stronger guardrails and fewer building blocks so that AI generates consistent solutions.
GC became poplar only because it was hard for programmers to keep track of memory management in languages like C and C++. And back then I was a huge proponent of GC based languages.
This is just a step along the same path that Go introduced. Many programmers switching from other languages complain about Go's restrictive and seemingly verbose syntax but once the benefits are realized the tradeoffs become worth it.
As I said elsewhere in the thread, GC is not inherently less efficient than manual memory management, so I don't really agree with this. It's better for programmers and makes for more ergonomic and evolvable APIs.
GC is a pervasive, system-wide service that makes ownership and management orthogonal to program logic. It does this by being a runtime service that comes with some runtime cost. Even manual memory management comes with runtime cost--different ones.
> With AI we don't need expressive programming languages for humans
Actually I think it's completely the opposite. PL is for humans to understand algorithms. We need AIs to reduce their thinking to algorithms and then present their solutions as algorithms to us. When we want to communicate precisely, reason and understand precisely, we don't write prompts, we write and understand programs.
That's not really a popular opinion right now because so many people are excited to be freed from thinking and staring at shitty code, but that isn't how it's going to go down. Programs are proofs that something has been reduced to a deterministic algorithm instead of a sloppy, ill-defined prompt or skill.
And to that, I for one do not want to have the communication medium be littered with memory management nonsense.
What are your thoughts on something like oxcaml? I kind of think that doing GC by default is very sane (and only having more complicated code when you want to do manual memory management and/or hint stuff to your compiler feels pretty nice). And with this people can still tune their GC for perf, or choose to link in their own memory allocator or whatnot also for perf. (Also do you feel like GCs should be faster? I kind of think the interface they provide seems to be more restrictive so we should have more room to optimize but idrk if that's totally true).