4 ms·
Rust solve memory issues of C/C++ at the cost of simplicity and with convoluted, complicated syntax. It will bring in new class of bugs when it becomes popular
by dragonsh 6y ago
Rust solve memory issues of C/C++ at the cost of simplicity and with convoluted, complicated syntax. It will bring in new class of bugs when it becomes popular enough and when large parts of Firefox are rewritten in it.
I am not sure why some programmers think, complex and convoluted the syntax, the better the language, especially taking rust as an example. Go has been successful in it’s niche as systems programming language because it’s syntax is easy and can fit the brain easily. A similar simple good programming language I see is zig language which makes memory safety as a choice for the programmer to implement rather than forcing on them with complex borrow checker syntax. On top rely of unsafe C library and code to do anything useful. Zig eschews complexity and embraces C with simple syntax and semantics and provide easy tools to build memory safe code and not shoot the foot. But anyways like democracy in programming complicated languages can win due to majority by marketing or in fashion.
- monocasa 6y agoZig and golang aren't solving the same problem as rust. Zig isn't memory safe, and golang achieves memory safety with the help of a GC.
- dragonsh 6y agoGo even with GC is very popular as systems programming language in its niche of writing network servers, can’t say the same about Rust except it’s in Fashion on HN, because it looks complex and difficult for programmers. Rust rely on underlying C library for doing anything useful today and still hasn’t demonstrated any real large benefits. Zig helps programmer with tools to write memory safe programs by not shooting in foot with sane and easy syntax and memory allocator. Still like Rust it needs to prove, so time will tell whether marketing and fashion or simplicity and sanity wins. There are enough examples where fashion and marketing with minuscule benefits did win.
- monocasa 6y ago> Go even with GC is very popular as systems programming language in its niche of writing network servers Nine times out of ten a network server isn't systems programming. And even at google, golang is starting to be banned for real systems use by some projects. > Rust rely on underlying C library for doing anything useful today Go relies on libraries everywhere except Linux too, because that's where the stable boundaries are. And even in Linux it was a bad plan for them not to rely on the C lib, because they miss out on other system configuration stuff like locale information because of their choices there. > Zig helps programmer with tools to write memory safe programs by not shooting in foot with sane and easy syntax and memory allocator. So.. the same way C does?
- pdimitar 6y ago> * And even at google, golang is starting to be banned for real systems use by some projects.* Quite curious. Got a source? Would like to read more on that.
- monocasa 6y agohttps://fuchsia.googlesource.com/fuchsia/+/refs/heads/master/docs/project/policy/programming_languages.md https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master...
- littlestymaar 6y agoWhen it comes to syntax, it's always a personal feeling. For instance I always found Rust syntax much easier to work with than Go's (which looks really alien to me, with both var and :=, the type annotations which are C's but backwards, the syntax for structs methods, the several for syntax, the defer statement, etc.) Actually I don't really understand why some people complain about Rust syntax. The only alien thing is the lifetime ('a) syntax, but you don't need it that often, and the concept behind it is way more difficult to learn than the syntax itself (and it's where Rust's breakthrough comes so you have to learn this concept anyway).
- littlestymaar 6y agoPeople who don't like Rust like to point at Zig as an alternative, but as long as it's developed by a single guy and there's a lot of breaking changes at each release, it isn't really an option. At this point this could still change a lot and even add a borrow checker! (Rust didn't start with it, it used to have a GC back in the 0.* releases)
- dragonsh 6y agoYes it’s started by one man like Go by Dennis and Python by Guido and many more, only time will tell.
- littlestymaar 6y agoOnly time will tell if your one-persone startup in your garage is going to kill Facebook eventually. But until it grows, it's a bit awkward to compare them.
- dragonsh 6y agoCorrect it's bit awkward given Rust is in the same league as Zig when compared wit Go language, which is widely adopted and used in many core network infrastructure systems programming, powering Internet today. So if Rust can come close to Go language, same is the case for zig language against Rust.
- pdimitar 6y ago> * Go language, which is widely adopted and used in many core network infrastructure systems programming, powering Internet today.* Is there a place where I can read more on this?
- dragonsh 6y agoLook at any modern container orchestration framework most are written in golang (including kubernetes), I see many SDN control plans and data plane software written in golang. You can find cockroachdb, raft etc and many more. Rust is just a fringe language at present in fashion on HN, may be zig might replace it as fashion language one day unless there is some critical system are using it like for C, C++, Python or go.
- rcxdude 6y ago>It will bring in new class of bugs when it becomes popular enough and when large parts of Firefox are rewritten in it. It's quite hard to see how these bugs will come from 'the syntax is complicated'. For one, the syntax is simpler than C++, and secondly, complex syntax is not necessarily a cause of bugs: Rust is not prone to errors in syntax becoming runtime bugs.