4 ms·
The same can be said about Rust: its popularity exceeds its scope, because 99% of applications I see that are written in Rust are better off written in a GCed l
by amelius 3y ago
The same can be said about Rust: its popularity exceeds its scope, because 99% of applications I see that are written in Rust are better off written in a GCed language.
- brigadier132 3y agoExcept when you suddenly do need performance and predictable latency but all your software is written in python. Its always funny how these performance requirements just creep up on you like that.
- ycuser2 3y agoC# is GCed but has 'unsafe' blocks.
- pjmlp 3y agoAlonside value types, manual memory allocation if needed. Not all GC based languages are made alike.
- neonsunset 3y agoYup, and (monomorphized) struct generics, first-class SIMD vectors and ability to transparently work with memory ranges because Span<T> can also wrap T* + Length from unmanaged code, which lets you directly plug whatever data you got from C/C++ dependency into most CoreLib APIs. In this regard, Go is far inferior as a systems programming language.
- amelius 3y agoYeah what we really need is a GCed language that allows you to implement parts in no-GC mode. And ideally where you can iteratively migrate GCed parts to no-GC parts when required. Anyway, Python is not a good comparison, as performance is not one of its main qualities.
- jjgreen 3y agoAs fast as C but with correctness, Rust kind-of owns that space (not a big fan personally).
- narinxas 3y agowhat about Zig? I think they're a strong contender... it's somehow simpler than Rust then again the correctness guarantee may be weaker??
- usrbinbash 3y ago> Rust kind-of owns that space True. But it's a pretty small space to be in. And there are good reasons for that: a) The only correctness Rust can, mostly, guarantee, is that there won't be unexpected data races or memory bugs. While this is proudly announced often and loudly, it also isn't the most common problem in code...logic bugs...against which the rust compiler can do as little as any other language. b) Rust can only give these guarantees because it is ALOT more complex than C. That means harder to read, harder to write, harder to learn. And developer time matters. Alot. If I can already ship features, while my competition is still stuck in onboarding, it won't matter if my code has the odd memory bugs...those can be fixed...I will already have the market to myself.
- rapsey 3y ago> a) The only correctness Rust can, mostly, guarantee, is that there won't be unexpected data races or memory bugs. While this is proudly announced often and loudly, it also isn't the most common problem in code...logic bugs...against which the rust compiler can do as little as any other language. A powerful type system helps quite a lot with logic bugs actually.
- rapsey 3y agoI went from Erlang to Rust and frankly I would not say Erlang is more productive, despite being a very high level language. When building a non-trivial system one should think about total cost of ownership. A Rust program is by default going to be CPU and memory efficient. It is not likely to negatively surprise you in production with weird bottlenecks and unexpected behavior. The time invested in producing a solution which is statically typed, pays of in spades when it is time to refactor or change something (which is pretty damn often if it is your product). Refactoring a Python/Erlang/Elixir/C/PHP solution is a major PITA and fraught with new bugs. The time spent optimizing solutions in high level languages when they are falling on their face in production is generally ignored and extremely common. You do not have to be github to face performance problems in Ruby.
- frankjr 3y agoExcept when you actually enjoy things being fast. For example, HTTPie easily adds 0.5-1s delay to every request because it's written in Python, especially on the first invocation. xh (https://github.com/ducaale/xh https://github.com/ducaale/xh), on the other hand, starts immediately because it's written in Rust. I very much like this trend.
- jkbr 3y agoI don’t know when you last tested the start-up time, but we significantly improved it in HTTPie CLI 3.0 [0]. Now it’s still slower by ~0.1s. $ time http --version 3.2.2 real 0m0.113s user 0m0.087s sys 0m0.020s $ time xh --version xh 0.18.0 -native-tls +rustls real 0m0.007s user 0m0.002s sys 0m0.002s [0] https://httpie.io/blog/httpie-3.0.0#speed-ups https://httpie.io/blog/httpie-3.0.0#speed-ups
- frankjr 3y ago> Now it’s still slower by ~0.1s Not for me. Printing HTTPie's version takes longer than to finish a real http request with xh. I suspect it's because I'm testing it on a relatively old server where the differences are even more pronounced. [link redacted] I'm using HTTPie 3.2.1 because Arch doesn't have the latest version available but based on the release notes that shouldn't make a difference.