Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dbaupp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
79 ms
·
721.
▲
by
dbaupp
10y ago
> so you can add new interface implementers later and not have to go fix-up old type-switches. Or, rephrased: the compiler doesn't help you find the old type-switches that need new branches. As you say, being closed gives exhausti
722.
▲
by
dbaupp
10y ago
Maybe you're visualising something different, but I don't see how ADT enums are implicit. Could you explain?
723.
▲
by
dbaupp
10y ago
Having a foreign leader (especially that of a superpower) hurt/killed on one's soil is likely to be particularly problematic, diplomatically.
724.
▲
by
dbaupp
10y ago
Incidentally, that function could be s.iter().rev().position(|ss| ss == key), or drop the `rev()` and use `.rposition(...)` if one wants indices from the start of the slice. Although I'm not sure how searching a slice of strings for
725.
▲
by
dbaupp
10y ago
One of the benefits of some common GC algorithms is how efficient it is to allocate (for most allocations), meaning the GC overhead is small and possibly negative. I don't think comparing the (throughput) performance of doing allocatio
726.
▲
by
dbaupp
10y ago
Cloning anything nontrivial (String, Vec, structs containing them, which is when cloning is usually used to ease things) does need to allocate. The comparison to managed languages doesn't make sense: "notifying the GC" sounds
727.
▲
by
dbaupp
10y ago
People are welcome to use Rust for applications programming, but systems programming is where Rust brings the most to the table (memory safety without a GC was barely thought possible), and where development focus is: trade-offs are made wi
728.
▲
by
dbaupp
10y ago
steveklabnik was not saying that it costs Rust to avoid libc, he was saying that "calling C has high overhead" (i.e. the main underlying reason for avoiding libc) is not something Rust can do, given its goals. This also means ther
729.
▲
by
dbaupp
10y ago
What does a package manager "using" SemVer for apps look like in any meaningful way? The package manager never has to do any dependency resolution against the version number of an app, so, I would assume (and know, for the package
730.
▲
by
dbaupp
10y ago
> So, because libstd (well, Rust itself, but you get the idea) all three of FromStr, &str, and SocketAddr, it's allowed to do this. You, in your own package, could not define this, since you wouldn't have defined any of t
731.
▲
by
dbaupp
10y ago
The parse method is an inherent method on the string type (i.e. not connected to a trait, and doesn't need an import), but added by the standard library, yes. > From reading the docs, something provides a method called `FromStr` an
732.
▲
by
dbaupp
10y ago
One can't add methods dynamically like Ruby nor redefine built-ins. However, one can implement traits for built-in types and the functionality in such traits is often provided as methods, giving the appearance of adding/overriding
733.
▲
by
dbaupp
10y ago
> How will you avoid having two variants of each and every lib ? E.g. redis-rs, sync, and redis-tokio, async ? By having one, the async one. If someone doesn't care about asynchronicity, there's always some sort of "wait u
734.
▲
by
dbaupp
10y ago
> Only outside unsafe blocks. This is a relatively uninteresting quibble: the guarantees of any language only apply outside their equivalent of unsafe blocks (e.g. Python is memory safe... until you use ctypes). Pretty much everything ha
735.
▲
by
dbaupp
10y ago
Explicit async IO is the building block which allows the things you mention to be efficient, and Rust's aim is being great at low-level code, e.g. implementing the runtime systems for those languages. Another use of explicit async IO f
736.
▲
ROBOTS.TXT is a suicide note
(archiveteam.org)
65 points
by
dbaupp
10y ago
|
30 comments
737.
▲
by
dbaupp
10y ago
Result is exactly Haskell's Either, just with a different name. > I had assumed that Rust would give me the same They do. ADTs in Rust are very similar to languages like Haskell. The only major difference I can think of is everythin
738.
▲
How we mapped the world’s weirdest streets
(medium.com)
1 points
by
dbaupp
10y ago
|
0 comments
739.
▲
by
dbaupp
10y ago
I think the author is making a good point but possibly couching it in the wrong terms: C shifts a lot of the inherent complexity of systems programming and manual memory management onto the programmer, with the language offering little to n
740.
▲
by
dbaupp
10y ago
(FWIW, I don't think any of those bugs are directly addressed by Rust's memory safety guarantee, since they mostly seem to be string injection problems. The strong abstraction power of Rust versus C may help people create APIs tha
741.
▲
by
dbaupp
10y ago
Other programs are processing pipelines like a compiler, so the dependency graph code that computes when things need to be reprocessed could theoretically be extracted and published as a reusable library.
742.
▲
by
dbaupp
10y ago
The article explains the benefits only needing 2ms to render a frame, and how v-sync means it won't actually be displaying at 500fps.
743.
▲
by
dbaupp
10y ago
It's mentioned in the article as one of the yet-to-be-implemented features.
744.
▲
by
dbaupp
10y ago
You can do that (or spawn in the background from the start, with &) while also using nohup.
745.
▲
by
dbaupp
10y ago
It is a little unfortunate, but Rust isn't blind to the problem. The community is converging on everyone using rustup (e.g. as of a few weeks ago, the install page recommends it https://www.rust-lang.org/en-US/inst
746.
▲
by
dbaupp
10y ago
C itself isn't that close. Vendor extensions and relying on the compiler to pattern match certain code are needed to get access to actual hardware features, like, for instance, rotating the bits of an integer, vector instructions and e
747.
▲
by
dbaupp
10y ago
That response is talking about something else because your original comment accidentally said "PyPy", which is an implementation of Python, instead of "PyPI", the package repository.
748.
▲
by
dbaupp
10y ago
Advanced tools act as force multipliers for specialists, allowing them to focus on just their specialty and execute it even better & more efficiently e.g. instead of having to hand optimise large swathes of a program, -O3 does a good-en
749.
▲
by
dbaupp
10y ago
Which numbers? People keep saying things like that, but things like the Python 3 Wall of Superpowers https://python3wos.appspot.com/ don't seem to support it. Do you have something more concrete?
750.
▲
by
dbaupp
10y ago
It is only nearly a superset because it contains all the features of C except for a few like implicit pointer casts.
More ›