7 ms·
Part of the magic of learning Rust is realizing that it's a fast compiled language that one doesn't fear to apply to services connected to the open internet. T
by timschmidt 2y ago
Part of the magic of learning Rust is realizing that it's a fast compiled language that one doesn't fear to apply to services connected to the open internet. This is so unusual, it may be unique. And I think that leads to a lot of experimentation and application of the language to the sorts of problem which typically receive attention in memory safe languages, but not compiled languages. Rust, by definition, straddles both.
- hu3 2y ago> Part of the magic of learning Rust is realizing that it's a fast compiled language that one doesn't fear to apply to services connected to the open internet. This is so unusual, it may be unique. Is that sarcasm? If not, thanks for proving my point. From the top of my head, Go/.NET/Java are fast and safe choices. Also safe in the sense that you won't have a hard time hiring devs that are productive from the get go.
- timschmidt 2y ago> often preach replacing GC'd languages with rust in cases where it is not the best fit (mundane web dev for example). > proving my point. Was your point misunderstanding that garbage collection != memory safety? Having garbage collection doesn't make a language any better for web dev. Being memory safe does. If you do not understand the difference and needlessly associate the two, you are validating the work put in by the evangelists.
- hu3 2y ago> Was your point misunderstanding that garbage collection != memory safety? What?! You really think memory safety is binary? > Having garbage collection doesn't make a language any better for web dev. It does though. It's more ergonomic than fighting rust compiler and does add safety over manual memory management from the likes of C/C++. I just want to thank you for demonstrating so clearly how rust evangelists think.
- timschmidt 2y ago> What?! You really think memory safety is binary? Not sure why you'd assume that. The languages you offered are only as memory safe as their runtimes, which are usually implemented in something C flavored, and the compiler for same. Rust identifies memory unsafe areas instead with the unsafe tag. Functionally equivalent but I know which I like more. > It does though. It's more ergonomic and does adds safety over manual memory management. This is the misunderstanding. Rust manages to be wonderfully ergonomic without GC. The type system is really the only thing that makes it wordier than C++. And I've written large Rust applications with no manual memory management whatsoever. Occasionally I'll have to wrap something in an Arc Mutex because something needs to run in another thread. One or two variables in a whole application. Your complaints apply to other languages.
- surgical_fire 2y agoThanks for proving my original point. I rest my case.
- timschmidt 2y agoOK, dude. If you never correct your misconception, you can be annoyed when people attempt to educate you forever X) No amount of complaining about Rust evangelists will change how they use the language, but you could learn to understand why they're using it the way they are.
- hu3 2y ago> This is the misunderstanding. Rust manages to be wonderfully ergonomic without GC. The type system is really the only thing that makes it wordier than C++ Thanks for the laugh. Maybe lifetimes/borrow checking syntax got invisible after a while to you. The only explanation. I'll stop here. Don't have the time nor desire to argue against what seems like passionate opinions.
- timschmidt 2y ago> Maybe lifetimes/borrow checking syntax got invisible after a while to you. I just did a quick scan, in a couple thousand lines of Rust I see two, maybe three lifetime annotations. Nah, not a huge contributor to language verbosity. Most Rust folk seem to work with the compiler's notion of what lifetimes should be, and everything's implicit.
- germandiago 2y agoJava, C#, Go... Not the only one. Maybe the fastest, yes. But... at what cost? Also, I think people seem to believe that memory safety is all safeties. Attacks come in many shapes and forms, from supply chain injection, to SQL injection, to unsanitized input, overflows, secret leaking... memory safety is one of the weak points of a chain, but not the only one.
- timschmidt 2y ago> Java, C#, Go... All require runtimes. Which means they're not in the same class of language as C, C++, and Rust. > Also, I think people seem to believe that memory safety is all safeties. It's 70% of CVEs in C and C++. People focus on it because it's the biggest single category. Enums and Option types and the whole type system for that matter goes a long way toward addressing logic bugs in Rust as well.
- consteval 2y ago> All require runtimes. Which means they're not in the same class of language as C, C++, and Rust Right, which is why it makes no sense to say "no don't use C# for webdev!! Use Rust!" They're different classes of languages. If C# is good for that use case then use it. Also there are genuine benefits to having a runtime.
- timschmidt 2y ago> it makes no sense to say "no don't use C# for webdev!! Use Rust!" Well, first of all, I don't see anywhere where anyone said that. Perhaps in another thread? People did argue against the use of Rust for web dev, for which it's a perfectly reasonable choice among many. Second, I have an embedded HTTP server running on a microcontroller with 500kb of ram in my current project. Works great in Rust. Simply not possible in C#. > If [any language] is good for that use case then use it. Agreed. The best camera is the one in your pocket, and the best language is the one you know. > Also there are genuine benefits to having a runtime. Things which are commonly associated with runtimes - memory safety, automatic memory management, various type systems, high level language abstractions - are all genuinely useful. Folks in this thread seem to want to hold on to a categorization of languages which Rust breaks by virtue of providing features typically only found in languages with runtimes. What Rust shows is that those benefits can be a part of a well designed language, with or without a runtime. And not having a runtime is a hard requirement in areas like embedded, OS development, realtime, etc. There is typically a separation between languages you'd use for that sort of thing and languages you might use for web dev, but the reasons for that separation do not apply to Rust. Which is fun. Some people seem to be salty about it though, lol. One significant downside to having a runtime is that it significantly complicates the process of program verification. Making it much harder to do statically. Necessitating certain things happen at runtime like error handling and performance profiling. Rust mostly has what it needs to get that work done at compile time, which means the developer has an opportunity to fix it, before some user runs into it.