4 ms·
In my opinion , I like golang's way better because then you have to be thoughtful about your dependencies and it also prevents any drama (like rust foundation c
by Imustaskforhelp 2y ago
In my opinion , I like golang's way better because then you have to be thoughtful about your dependencies and it also prevents any drama (like rust foundation cargo drama) (ahem) (if you are having a language that is so polarizing , it would be hard to find a job in that )
I truly like rust as a performance language but I would rather like real tangible results (admittedly slow is okay) than imagination within the rust / performance land.
I don't want to learn rust to feel like I am doing something "good" / "learning" where I can learn golang at a way way faster rate and do the stuff that I like for which I am learning programming.
Also just because you haven't learned rust doesn't make you inferior to anybody.
You should learn because you want to think differently , try different things. Not for performance.
Performance is fickle minded.
Like I was seeing a native benchmark of rust and zig (rust won)
and then I was seeing benchmark of deno and bun (bun won) (bun is written in zig and deno in bun)
The reason I suppose is that deno doesn't use actix and non actix servers are rather slower than even zig.
It's weird .
- deleted 2y ago[deleted]
- jvanderbot 2y agoThere are some influential fair comparisons of compiled languages, but for the most part my feeling is that people are moving from an extremely high level language like Python or JS, and then going to Rust to get performance, when any single compiled language would be fine, and for 90% of them, Go would have been the right choice (on backend or web-enabled systems apps), there was just a hurdle to get to most other compiled languages. It's just Rust is somehow more accessible to them? Maybe it's that pointers and memory just was an inaccessible / overburdensom transition?
- bombela 2y agoNot sure how much it weighs on the balance in those types of decisions. But Rust has safe concurrency. That's probably quite a big boost of web server quality if anything else.
- jvanderbot 2y agoGo's concurrency is unsafe? Rust's concurrency is automatically safe? I am not saying you're wrong, I just don't find it any better than C++ concurrent code, you just have many different lock types that correspond to the borrow-checker's expectations, vs C++'s primitives / lock types. Channels are nicer, but that's doable easily in C++ and native to Go.
- School-Cotton 2y ago> Go's concurrency is unsafe? Rust's concurrency is automatically safe? Yes and yes... Rust statically enforces that you don't have data races, i.e. it's not possible in Rust (without unsafe hacks) to forget to guard access to something with a mutex. In every other language this is enforced with code comments and programmer memory.
- pjmlp 2y agoAs long as that something is in the process's own memory.
- School-Cotton 2y agoCorrect, rust doesn’t magically prevent all bugs. It just makes a large class of bugs harder to write.
- consteval 2y ago.. but most concurrency is done in distributed systems, where Rust provides little to no protection. Although making a Rust monolith would be great!
- thinkharderdev 2y ago(Un)safe is a bit of an overloaded term but Rust's concurrency model is safe in the sense that it statically guarantees that you won't have data races. Trying to mutate the same memory location concurrently is a compile-time error. Neither C++ nor Golang prevent you from doing this. Aside from that
- School-Cotton 2y agoRust is the only mainstream language with an ergonomic modern type system and features like exhaustive matching on sum types (AFAIK... maybe I'm forgetting one). Yes things like OCaml and Haskell exist but they are much less mainstream than Rust. I think that's a big part of the appeal. In Go instead of having a value that can be one of two different types, you have to have two values one of which you set to the zero value. It feels prehistoric.
- jvanderbot 2y agoThat strikes me as an incredibly niche (and probably transient) strength! But I will remember that.
- School-Cotton 2y agoIt's not niche at all; it's extremely common to need this. Maybe I'm not explaining it well. For example, an idiomatic pattern in Go is to return two values, one of which is an error: func f() (SomeType, error) { // ... } In Rust you would return one value: fn f() -> anyhow::Result<SomeType> { // ... } In Go (and similar languages like C) nothing enforces that you actually set exactly one value, and nothing enforces that you actually handle the values that are returned. It's even worse if you need to add a variant, because then it's easy to make a mistake and not update some site that consumes it.
- consteval 2y agoTo be fair even Java solves this problem with checked exceptions. It forces you to handle them or pass them on. It's really just C++ and C# that have a bit of wild west error handling.
- School-Cotton 2y agoMy point has nothing specifically to do with error handling, that was just the first example that came to mind.
- 2y ago
- timeon 2y ago> It's just Rust is somehow more accessible to them? Going to lower level languages can be scary. What is 'fighting the borrow-checker' for some, may be 'guard rails' for others.