Live data from Hacker News

Announcing Rust 1.35.0

blog.rust-lang.org

71–80 of 111 posts

Re: Announcing Rust 1.35.0

#72
post #69

RangeInclusive is an interesting API: 1. How does this handle ranges whose length is larger than can be represented in an integer? 2. How does iterating a range work for floats? It looks like it just adds one [1], won't this mean that it will loop forever if the next representable float is +2? 1: https://doc.rust-lang.org/src/core/iter/range.rs.html#297

1. It doesn't. 2. The Iterator implementation for RangeInclusive requires the underlying type to implement Step [1], which floats do not. So you can't iterate over a range of floats (although you can still construct one). [1] https://doc.rust-lang.org/nightly/std/iter/trait.Step.html

What do you mean by "it doesn't?" For example say I construct a range [INT_MIN, INT_MAX] which should have a length of 2^32. Am I prohibited from constructing this range?

Re: Announcing Rust 1.35.0

#73
post #69

Earlier quoted context omitted.

1. It doesn't. 2. The Iterator implementation for RangeInclusive requires the underlying type to implement Step [1], which floats do not. So you can't iterate over a range of floats (although you can still construct one). [1] https://doc.rust-lang.org/nightly/std/iter/trait.Step.html

What do you mean by "it doesn't?" For example say I construct a range [INT_MIN, INT_MAX] which should have a length of 2^32. Am I prohibited from constructing this range?

I misinterpreted your comment; I thought you meant ranges that were so large they couldn't fit in any integer type (presumably of floats).

But actually, it's weirder than I thought.

RangeInclusive doesn't have an inherent len() method, but one is provided by the ExactSizeIterator trait, which is implemented only when the underlying type is i8, u8, i16, or u16. len() always returns usize, regardless of the original type; thus I believe the reason for that particular list of types is that usize is only guaranteed to be at least 16 bits. But I'm not sure why it's not also implemented for RangeInclusive and RangeInclusive...

Re: Announcing Rust 1.35.0

#74
post #63
post #28

Earlier quoted context omitted.

You can work completely offline. All official tools support it. Rust team can't do much about ecosystem though. There are some libraries which download resource (say, large data table) over the network at build time. I consider these bugs, but maintainers of those libraries may disagree.

Got any examples? I have some spare time and I'd like to improve that situation.

https://www.reddit.com/r/rust/comments/bki8yo/warning_exists... was one recent case.

Re: Announcing Rust 1.35.0

#75

Earlier quoted context omitted.

> Part of the problem is conceptualizing this as a reference (which, admittedly, it is without optimization). Isn't that also the official name of the feature in Rust? Isn't &T in Rust pronounced "reference to T" and "&mut T" pronounced "mutable reference to T"? That is the impression I get from: https://doc.rust-lang.org/book/ch04-02-references-and-borrow...

It is a reference, yes, and without optimization, is a pointer to a value. Your parent is suggesting to not think of it in such a low-level way, and instead think of it as a permission. In this case, the pointer being optimized away makes more sense, as it’s not really about it being a pointer. I’m of two minds about it, to be honest.

If you had a Range then it would make a lot of sense. I can’t remember if Range’s constraints on T would support that, though.

Re: Announcing Rust 1.35.0

#76

Earlier quoted context omitted.

Most of the arguments may not be new, but given the overwhelming reaction to the recent blog post, I think it would be worth reflecting on that reaction and seeing if there isn't a reasonable way for the crowd to be heard. For example, I don't know if this was a new idea or an old one, but standardizing the general concept of dot-keyword before following through with dot-await, even if it ultimately doesn't change th…

The crowd was heard. There are also many people who are in favor of the syntax that was chosen! This is not a situation where the community is overwhelmingly settled on one thing and the team is settled on another. Yes, that has been discussed. It hasn’t been committed to in any way.

[deleted]

Re: Announcing Rust 1.35.0

#77
post #51
post #48

Earlier quoted context omitted.

I totally understand your desire to develop things in a sandboxed environment but the source code for Rust/Cargo/Etc. is all available under their organization at GitHub. [0] It would be easy to audit and raise issues if you have any concerns. [0]: https://github.com/rust-lang

Auditing rust and cargo sounds like easily 1000x more work than copying some source files.

Really? How did you get the source code for those dependencies in the first place? Whatever you used likely has just as much power as Cargo does. (And is perhaps similarly hard to audit.)

Re: Announcing Rust 1.35.0

#78

Earlier quoted context omitted.

How useful are these discussions? In the end, boats still prefers prefix and others still prefer postfix. This is pretty fake discussion. Everyone already has a position and pretend to be open to discussion.

They exposed all the options. That’s very useful. They made their case. That’s very useful. This is the most discussed feature of Rust ever. The team spent a lot of time and energy on it, way way way more than any other feature. Several team members flip flopped positions several times.

And the team seemed to ignore the users. The two polls I saw, both had the method syntax below 50% approval and below the other front runners. It seemed to me they basically said, "Sure, tell us want you want so we can note it and ignore it." Kind of a real dick move. Why bother even asking for input?

(For disclosure, I preferred postfix punctuation similar to `?` that most people hated - so I'm not gettng my way either.)

Re: Announcing Rust 1.35.0

#79
post #28

Coming from C/C++. Is working with the online package manager (Cargo?) mandatory? Or is there a sustainable way of working/developing with Rust while completely offline? I'd like to start a project, manually import libraries (downloaded manually, no dependency hell), read documentation, etc. Is it possible?

You can work completely offline. All official tools support it. Rust team can't do much about ecosystem though. There are some libraries which download resource (say, large data table) over the network at build time. I consider these bugs, but maintainers of those libraries may disagree.

[deleted]

Re: Announcing Rust 1.35.0

#80

Earlier quoted context omitted.

They exposed all the options. That’s very useful. They made their case. That’s very useful. This is the most discussed feature of Rust ever. The team spent a lot of time and energy on it, way way way more than any other feature. Several team members flip flopped positions several times.

And the team seemed to ignore the users. The two polls I saw, both had the method syntax below 50% approval and below the other front runners. It seemed to me they basically said, "Sure, tell us want you want so we can note it and ignore it." Kind of a real dick move. Why bother even asking for input? (For disclosure, I preferred postfix punctuation similar to `?` that most people hated - so I'm not gettng my way eit…

Framing this as “the users” is disingenuous, again, a lot of users favored the decision too. The arguments of those users were taken into account, but the decision was made against it anwyay.

Those polls were incredibly non-scientific, and don’t really mean anything.

Post reply on HN