3 ms·
I don’t know what you mean by strings embedded in Rust syntax nor package management (unless you mean crates and modules, which are basically just namespaces; t
by School-Cotton 4y ago
I don’t know what you mean by strings embedded in Rust syntax nor package management (unless you mean crates and modules, which are basically just namespaces; the only “package management” is done by higher-level tools like Cargo).
To answer your other questions: no, Rust has neither garbage collection, nor templates. I don’t know what you mean by hardcoded weird and expansive memory allocation model; Rust’s is basically the same as C++’s.
- sylware 4y agoIt was crates and modules, ok then it was weird namespace system. But I clearly remember "strings" being hardcoded in the syntax. So you mean rust has grotesque and absurd object orientation like c++ (or java)? Please, say no.
- School-Cotton 4y agoNo, it doesn’t. Why don’t you take the time to read a Rust tutorial rather than just assuming everything bad you can imagine about it and asking people to correct you?
- sylware 4y agoI was not keen on spending time reading rust syntax specs the moment you said rust is actually c++.
- School-Cotton 4y agoWhen did I say rust is actually C++? I said its memory allocation model is the same: normally done in containers or smart pointers, but malloc and free are still available under the hood if you really need them. Many other things about rust are extremely different from C++.
- sylware 4y agoOk, now I see the semi-colon. So rust has heavy memory allocation implicit in the syntax (not meant only for the stack). I remember now I did not want that (like those horrible c++ new/delete). Thx to have refreshed my memory about rust syntax.
- School-Cotton 4y agoIt's very unlikely you would ever have to use something like C++'s new/delete in Rust unless you are doing something like re-implementing the Vec class.
- sylware 4y agoIn c++, it is not only with new/delete, heavy allocations do happen implicitely everywhere. Now, I recall I did not want that. thx anyway.
- steveklabnik 4y agoThere is no syntax that allocates in Rust. This was one of Linus' big reasons for accepting it into Linux. Functions can call malloc or equivalent, and while constructors don't exist, destructors do, so you can call free in them.
- sylware 4y agothe syntax implicit expensive free is the same issue than the syntax implicit expensive allocation. I clearly recall when I read early rust specs that I did not want that (and more). Additionally, I wonder if they fixed the other C issues, namely removing integer promotion, implicit casts (but different explicit casts for compile-time and runtime), enum, _generic, typeof, 1 loop keyword is enough, no switch, goto is not harmful, have only sized primitive types, change extern/static... Hopefully, rust does not have object-orientation. And you can bet, you will find a bunch of sickos not writting simple and core rust for linux... but rust with tons of extensions only in 1 or 2 compilers like the "C" from linux which is actually the C from gcc and nothing else (clang and icc playing catchup). I should re-read the language syntax specs though. But I guess, I would drop that reading if I encounter a definitive nono again.