Earlier quoted context omitted.
When writing in loosely typed languages, some folks aim for 100% line coverage, to make it more feasible to refactor down the line. Which then of course ends up being a lot of tests for fairly basic stuff that the type system could help you with...
line coverage but also branch coverage. Every safe navigation operator used in "defensive" coding, ex. `foo?.bar` is actually another branch that needs to be covered if that's the metric people are using. All of those tests are unnecessary in a language where the type is known at compile-time.
Was Rust Worth It?
621–630 of 736 posts
Re: Was Rust Worth It?
#622Earlier quoted context omitted.
Which opinions do you disagree with? For transparency, I tend to find myself agreeing with almost all of its models/abstractions.
There are a few, and they aren't something that I can't live with, of course. A great example of the sorts of things I'm talking about are Rust's insistence on camel case and snake case.
Re: Was Rust Worth It?
#623Earlier quoted context omitted.
It’s not just that. There’s a few big problems with Rust async aside from the normal coloring problem that is inherent to async and not worth talking about. * The async runtime and async functions are decomposed but tightly coupled. That means while you could swap out runtimes, a crate built against one runtime can’t generally be used with another unless explicitly designed to support multiple. I believe C++ has a si…
Async in traits feature doesn’t use boxing (which is coming in 28 December), only async-trait crate use boxing.
Re: Was Rust Worth It?
#624Earlier quoted context omitted.
> I think nobody is arguing the need for static memory safety, just that the poor Rust ergonomics aren't a good tradeoff Unless the "poor ergonomics" and lack of shortcuts are explicitly what provides the static memory safety.
IMHO Rust's ergonomics problems aren't caused by the borrow checker itself, but have the same cause as similar problems in C++ (mainly a "design by committee" approach to language design and implementing features that should be language syntax sugar in the stdlib instead, which then directly results in the stdlib being too entangled with the language and "too noisy" hard to read code). Apart from the static memory sa…
The problem is that there is too much syntax, too many symbols, and too many keywords. I just keep forgetting how to use impl and lifetimes and single quotes and whatnot. It makes it really tough to use as an occasional language. And if I can't do that, then how can I get confident enough to use it in my job?
Re: Was Rust Worth It?
#625Perhaps my biggest critique is that crates.io has no namespacing. Anyone can just claim a global and generic package name and we mostly have to deal with it (unless you avoid using the crates.io repository, but then you'll probably have more problems...). Some of these globally-claimed generic packages are not really the best package to use. Maybe it was a reaction against the Java-style reverse DNS notation, which i…
> Perhaps my biggest critique is that crates.io has no namespacing. Anyone can just claim a global and generic package name and we mostly have to deal with it (unless you avoid using the crates.io repository, but then you'll probably have more problems...). Some of these globally-claimed generic packages are not really the best package to use. This is true that with no namespace anyone can end up squatting a cool nam…
Do you really think nobody has ever been able to google a Go import path? Some of these arguments are ridiculous.
Re: Was Rust Worth It?
#626Earlier quoted context omitted.
Go packages is yet another design item that I dislike on the language, exposing SCM URLs directly on the source code, and no story for binary caching.
> exposing SCM URLs directly on the source code Incorrect. You're able to use any URL you control, regardless of where your SCM is located.
Re: Was Rust Worth It?
#627Earlier quoted context omitted.
Recently tried writing some async Rust to compare the error handling when nested async calls are made to how errors are handled in Go, and it seemed like the trivial example I was trying to write up simply couldn't be done without involving Tokio. That barrier simply doesn't exist in Go, or C#, or Typescript. For instance, you apparently cannot `await` in the main function without a decorator you import from, you gue…
Why are you trying to avoid Tokio lol, tokio is the defacto async runtime in rust, saying you're trying to avoid it is like saying you're trying to avoid async while writing async, somehow people act like if they merged tokio into std and instead of #[tokio::main] or whatever you had to do #[async::main] it would somehow be better. Once you stop fighting the fact that tokio = async rust for 99% of cases, things are q…
Re: Was Rust Worth It?
#628Earlier quoted context omitted.
mainly, you can trust that anything under the foo/ namespace is controlled by only a smaller group of people, as opposed to the current situation on cargo where people pseudo-namespace by making a bunch of packages called foo-bar, foo-baz, and you can't trust that foo-bin wasn't just inserted by someone else attempting to appear to be part of the foo project. It also helps substantially with naming collisions, especi…
If you want to check your dependency tree for the number of maintainers you're dealing with instead of the number of dependencies, this can be done with cargo tree + checking the Cargo.toml/crates.io ownership info for each of the found packages. I don't know if there's a command written to do that already, but I've done that with a small script in the past.
Re: Was Rust Worth It?
#629Earlier quoted context omitted.
> exposing SCM URLs directly on the source code Incorrect. You're able to use any URL you control, regardless of where your SCM is located.
Thanks for pointing out you didn't got what the whole point of the wrong design is about.
Re: Was Rust Worth It?
#630Earlier quoted context omitted.
C# is a lovely language to work with. The only issue I have is with the .NET ... that is, building self-contained binaries to distribute. For comparison: * Hello World win-x64 binary self-contained in .NET 7 is around 70 MB * The same for Go results in 1.2 MB Edit: Missed 'trimming' in .NET, which would result in a binary of size around 11 MB in win-x64
I was making Windows 98 apps with Delphi 4, and they were 350 KB large And I was upset that they were so big. Sometimes I used UPX. Or I kicked out all Delphi GUI libraries, and created the GUI with the Win32 API calls directly. I got 50 KB Hello Worlds.