3 ms·
If you don’t need to understand/inspect the details of a HashMap implementation then you are not doing ‘systems programming’. The attitude that ‘someone has don
by throwaway17_17 7y ago
If you don’t need to understand/inspect the details of a HashMap implementation then you are not doing ‘systems programming’. The attitude that ‘someone has done it for me’ and therefore I don’t care about it is not a characteristic of ‘systems programming’. It may be simpler to just use some standard implementation of a data structure, but if that is the case, then you can get by with most of the commonly accepted language paradigms. I’m not saying everyone need to implement a unique hashing algorithm tailored to use case, but that is what systems programming is.
System Programming is the custom tailoring of data conditioning to a particular set of circumstances and then taking responsibility for the benefits and consequences of that those choices that differentiates systems programming from the other broad categories of program construction.
Rust is a fine language if it fits your use case, and you feel as though the purported benefits of the ‘borrow checker’ assist you in writing quality code, but if you just want a programming language that provides a large library of pre-written solutions, then the difference between language is dependent only on use case and usage requirements. Saying Rust is simpler than C because you can use a pre-written HashMap implementation is ridiculous, because you can do the same thing in C (I mean use someone else’s HashMap). But if ‘systems programming’ is the area of interest, being able to inspect/implement the actual HashMap is a key concern, and just dismissing that aspect is not an acceptable proposition.
- echelon 7y ago> If you don’t need to understand/inspect the details of a HashMap implementation then you are not doing ‘systems programming’. The attitude that ‘someone has done it for me’ and therefore I don’t care about it is not a characteristic of ‘systems programming’. Don't gatekeep. Rolling your own containers has no bearing on whether or not the language is a systems programming language. I'm using it to do real time audio and graphics, but I don't have the time to hand roll my own data structures because I have a demanding day job and other responsibilities. I still get to have the benefit of using a fast, modern, bare metal language. > Saying Rust is simpler than C because you can use a pre-written HashMap implementation is ridiculous No it's not. HashMap is literally there in std::collections to import and use. You don't need to find a library, know about the linker, etc. Rust makes working in this domain so much easier than C and C++. You can go from zero to productive in a reasonable amount of time.
- adev_ 7y ago> Rust makes working in this domain so much easier than C and C++ C++ has a hash map in its standard Library since 10 years. > You can go from zero to productive in a reasonable amount of time. That's definitively a very WRONG assumption. Anyone starting to use Rust, even with 10 years of C++ experience, will spend from HOURS to DAYS fighting the borrow checker. It is not "zero to productive", Rust is not easy to learn, nor productive for beginner. Is it however worth the effort ? I believe it is. Especially if you are looking for a language providing you safety first.
- echelon 7y ago> C++ has a hash map in its standard Library since 10 years. OP was talking about C, not C++/STL. > Anyone starting to use Rust, even with 10 years of C++ experience, will spend from HOURS to DAYS fighting the borrow checker. You might have learned Rust pre-1.0 or non lexical lifetimes. They've made a tremendous amount of work to improve the language and make it beginner friendly. A few weeks ago I watched one of my coworkers implement a simple toy state machine app after having just read a tutorial. The compiler literally hand holds you now. The meme that Rust is hard needs to die.
- adev_ 7y ago> You might have learned Rust pre-1.0 or non lexical lifetimes. They've made a tremendous amount of work to improve the language and make it beginner friendly. I still use Rust almost every week for personal projects, I enjoy it and I still would not qualify it as quick "zero to productive". It still fall behind C++ in term of productivity for me. Many things that few lines of C++ allow you to do in few lines requires mental gymnastic to wrap around the borrow checker, strict typing and Rust error report system in 10-20 lines. Comparatively speaking, I program in C++ since 15 years and in Rust since 3 years. Still, everything I do in rust takes between 1.5X to 3X more times to do than in C++, even if the tooling is better. I know I am going to make enemies saying that with the number of Rust fanboys on YC, but... this is my experience. And it is not a surprising experience.... Anyone that programmed in OCaml or strict typing language like ATS already experienced that... The strict typing gives you runtime safety and make your program "just" run (less bug-prone) compared to Weaker typed language.... But... it has a cost... like everything... And the cost is much more mental gymnastic... meaning time... meaning less productivity.