Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tatterdemalion
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
tatterdemalion
9y ago
Fortunately there are many languages which will provide a generic abstraction for you, so you don't have to deal with any of the complexity of implementing a hash set and you can just treat it like a set.
32.
▲
by
tatterdemalion
9y ago
> Rust has the complexity of C++ plus additional complexity from the functional community. Plus lots of fancy template cruft. This is so patently false. C++ contains an order of magnitude more complexity than Rust (as one would expect fo
33.
▲
by
tatterdemalion
9y ago
Yes of course (I work on Rust). I mean that the difference between f32::NAN and std::f32::NAN is a small convenience.
34.
▲
by
tatterdemalion
9y ago
The consts are currently defined in modules with the same name as the type, `std::f32::NAN;`. This feature allows them to be associated with the type itself - `f32::NAN`. A small convenience.
35.
▲
by
tatterdemalion
9y ago
Associated consts allows constants to be derived from our trait-constrained parametric polymorphism. C++ currently has no analog to this system (templates can be used, but don't provide a constraint system; concepts are not in C++17 af
36.
▲
by
tatterdemalion
9y ago
This doesn't do anything at all to resolve the ambiguity in this sentence.
37.
▲
by
tatterdemalion
9y ago
That's the problem.
38.
▲
by
tatterdemalion
9y ago
Then you have to do a deep clone every time. Arc<Vec<u8>> is also not sufficient, because Bytes lets you share a reference count among slices to different offset into the buffer.
39.
▲
by
tatterdemalion
9y ago
Bytes is intended for use with the tokio ecoystem where you cna't use references often because borrowing across a yield point in a future would be a lifetime error.
40.
▲
by
tatterdemalion
9y ago
Parsing would get into policy choices this crate doesn't want to make, like DoS protection (max request size, mid-request timeouts, etc), and often is intertwined with reading data from IO, which this crate definitely doesn't want
41.
▲
by
tatterdemalion
9y ago
Want to echo this part: > nobody has put in that work to come up with a proposal. Features like this mainly need a champion who really cares about getting it into the language & can work with the language & compiler teams to comp
42.
▲
by
tatterdemalion
9y ago
That's not correct. cargo will fail to resolve your dependencies if that happens. For example (cargo_metadata 0.2.1 depends on serde ^1.0.2): [dependencies] serde = "=1.0.0" cargo_metadata = "0.2.1"
43.
▲
by
tatterdemalion
9y ago
Other people have addressed the question about epochs, but I'd also note that we do work to mitigate the code bloat issues of multiple versions of libraries. cargo is designed to unify all dependencies on a library within each major ve
44.
▲
by
tatterdemalion
9y ago
Your "IIUC" is just a restatement of the sentence you quoted. You understood the bug correctly, but its not a bigger problem. You probably are lacking context on auto traits, but this blog post contains the context you need if you
45.
▲
by
tatterdemalion
9y ago
> Go also has zero-sized types (struct{}), so I wonder if this is also possible? No. It specifically uses Rust's generics system, and the fact that generics are monomorphized at compile time, whereas Go interfaces are not. C++ templ
46.
▲
by
tatterdemalion
9y ago
A Sufficiently Smart Compiler would be able to. The second just increments a pointer which starts at the first elem of the array; the first increments a counter and then uses it as an offset into the array, which is bounds checked (the seco
47.
▲
by
tatterdemalion
9y ago
What's overblown in my opinion is the treatment of "functional" or "object-oriented" programming as a feature of languages and not programs (though certain languages definitely make it easier). I've never found
48.
▲
by
tatterdemalion
9y ago
Yes, thats what the second point is.
49.
▲
by
tatterdemalion
9y ago
> Is the Rust community claiming that the entire history of computing has lead up to this point, where Rust exists, and now nobody needs to write anything in not-Rust? Are people 200 years from now going to write Rust and nothing else? L
50.
▲
by
tatterdemalion
9y ago
I think we all agree that future chaining isn't great surface API in the long-term, but we have a pretty good idea of how to desugar async/await to the futures we have. That's why we're build the runtime around them; bec
51.
▲
by
tatterdemalion
9y ago
Its hard for me to imagine that requiring every value to be explicitly dropped would produce code which is easier to read and understand.
52.
▲
by
tatterdemalion
9y ago
There is a very long comment in the cargo source which explains this decision and some of the trade offs involved. https://github.com/rust-lang/cargo/blob/master/src/cargo/sou... I know that so
53.
▲
by
tatterdemalion
9y ago
As the blog post mentioned, we solve the issue by deleting the crate from the package repository and reserving these problematic names. The incident lasted about 2 and a half hours. Crate names have to be one or more valid idents connected
54.
▲
by
tatterdemalion
9y ago
Might be that, might also be that SliceConcatExt only had connect in 1.2, not join.
55.
▲
by
tatterdemalion
9y ago
Both of these errors are reproducible with the 1.2 compiler, but not with the 1.17 compiler. Most likely this user believed they were compiling with 1.17 but they were compiling with 1.2.
56.
▲
by
tatterdemalion
9y ago
TL;DR Animats's errors were attempting to compile code from a more recent version of Rust on 1.2, or something similar. When I attempted to reproduce, I got the same errors on 1.2, and no errors on 1.17. Rust does not guarantee forwa
57.
▲
by
tatterdemalion
9y ago
I wonder if this might not be a good opportunity to rethink your strategy of finding some trollish snark to comment on every post about Rust.
58.
▲
by
tatterdemalion
10y ago
This example code must be monomorphized at compile time, meaning that each closure will have a different representation. "Tail call optimization at the type level" is not possible with this compilation model. (The problem is solve
59.
▲
by
tatterdemalion
10y ago
In the near future, Rust's trait system literally will be a logic language similar to Prolog that runs at compile time. We walk the AST and generate statements to prove. This is expected to be easier to reason about, to be easier to ex
60.
▲
by
tatterdemalion
10y ago
Hey I'm the person who raised the question (and I work on Rust, mainly on the trait system discussed in this post). I agree with the author that while this is interesting, for users it doesn't matter much. In particular, the folks
More ›