Hacker News new | ask | show | jobs
by andrewstuart 1066 days ago
Zig seems more interesting but it’s not mature enough yet.

I’ve been so spoilt with IDE support, documentation, massive community and ChatGPT for Python typescript and others that I really can’t pick up Zig yet.

One of the things I heard is that ChatGPT doesn’t actually “get” the hard parts of rust, and that’s a huge issue because the whole point of AI in programming is it’s meant to be able to lead and guide you in learning and understanding.

“Rust is so hard to learn that the AI doesn’t get it” is a bad place to be for rust.

1 comments

>"Rust is so hard to learn that the AI doesn’t get it" is a bad place to be for rust.

I don't think this is really a big point against Rust; in my experience, ChatGPT doesn't write good code in general.

To be honest, I think Rust's borrow checker won't seem very hard if you've used C++ smart pointers before, which are like Rust's references/Box<T>s, but there's no borrow checker. The borrow checker just formalizes and enforces existing good practice for using pointers in C and C++, and makes sure they're followed 100% of the time unless specifically opted out of.

What actually seems more interesting to me than Rust is the ATS language. Rather than a borrow checker, you have proof objects that you pass around with pointers (and these proof objects exist only at compile time), which prove to the compiler that the pointer has a valid address. What's cool is that you can do things like pointer arithmetic in a type safe way. The downside is that it's more verbose than either C or Rust. I'm still trying to learn it.