3 ms·
Rust is higher-level than Go, in practice. Rust says "a String is a valid Unicode sequence, an OsString is a valid filename according to your OS, and a &[u8] i
by justinpombrio 4y ago
Rust is higher-level than Go, in practice.
Rust says "a String is a valid Unicode sequence, an OsString is a valid filename according to your OS, and a &[u8] is a sequence of bytes; I'll enforce the validity of these types for you". Go says "a string is a sequence of bytes, make sure you use them correctly."
Rust says "here's an Iterator interface, with hundreds of methods for your convenience". Go says "we didn't have polymorphism when the standard library was developed, so there aren't any fancy iterators; how about you use a for loop?"
Rust says "error handling is important, so there's syntax built into the language for it (the '?' operator)." Go says "just write `res, err = func(); if (err) { handleErr }` over and over again."
Rust says "please think carefully about the difference between shared references, mutable references, and ownership; I'll be checking your work." Go says "you don't need to think about that, I'll keep track of it with GC for you (unless your sharing data between threads in which case you do and you're on your own)".
In the last instance, Rust is lower level than Go. But in the rest, it's higher level.