Live data from Hacker News

Rust's 2017 Roadmap

blog.rust-lang.org

161–170 of 274 posts

Re: Rust's 2017 Roadmap

#161
post #156

Earlier quoted context omitted.

> I'm not sure why that's an option you'd need to accomodate. Again, it's about control. Maybe you're only loading a small configuration file, and so fetching it all in one go is better than dealing with a buffer. > an obvious way to do this. If you search for 'line' or 'lines' in rustdoc, the correct thing is right near the top, which will show you how to use it with BufRead.

> Maybe you're only loading a small configuration file, and so fetching it all in one go is better than dealing with a buffer. If it's small, it can't be that much worse to buffer. What's wrong with reasonable defaults? Can you tell me what it means to search for 'line' or 'lines' in rustdoc? Is this a command-line tool? I'm aware of the 'rustdoc' that generates documentation, but not of anything by that name that se…

> Can you tell me what it means to search for 'line' or 'lines' in rustdoc?

Rustdoc has a search bar at the top. with 'line' it's the third result, 'lines' is the first https://doc.rust-lang.org/stable/std/?search=lines

and the short description makes it clear that the first two results are irrelevant in this case.

> It would be great to have an offline way to search Rust documentation and examples,

It all works offline. These docs are pre-installed for you when you install Rust, and 'cargo doc' will generate them for your whole project.

> perhaps because you are an expert in the language and know exactly what to search for.

I copy-pasted my search term exactly in the previous post.

Re: Rust's 2017 Roadmap

#162
post #156

Earlier quoted context omitted.

> Maybe you're only loading a small configuration file, and so fetching it all in one go is better than dealing with a buffer. If it's small, it can't be that much worse to buffer. What's wrong with reasonable defaults? Can you tell me what it means to search for 'line' or 'lines' in rustdoc? Is this a command-line tool? I'm aware of the 'rustdoc' that generates documentation, but not of anything by that name that se…

> Can you tell me what it means to search for 'line' or 'lines' in rustdoc? Rustdoc has a search bar at the top. with 'line' it's the third result, 'lines' is the first https://doc.rust-lang.org/stable/std/?search=lines and the short description makes it clear that the first two results are irrelevant in this case. > It would be great to have an offline way to search Rust documentation and examples, It all works offl…

> I copy-pasted my search term exactly in the previous post.

I'm bringing up a problem with how the language presents itself to beginners, not asking you to solve a specific problem for me. If searching is the answer to everything, then there needs to be a concerted effort to take Google-juice away from bad or deprecated answers.

Incidentally, the search result you're describing for "lines" says "An iterator over the lines of an instance of BufRead.", which only appears to be the answer to "how do I iterate lines of a file?" if you already know what the answer is.

Re: Rust's 2017 Roadmap

#163
post #156

Earlier quoted context omitted.

> Maybe you're only loading a small configuration file, and so fetching it all in one go is better than dealing with a buffer. If it's small, it can't be that much worse to buffer. What's wrong with reasonable defaults? Can you tell me what it means to search for 'line' or 'lines' in rustdoc? Is this a command-line tool? I'm aware of the 'rustdoc' that generates documentation, but not of anything by that name that se…

> Can you tell me what it means to search for 'line' or 'lines' in rustdoc? Rustdoc has a search bar at the top. with 'line' it's the third result, 'lines' is the first https://doc.rust-lang.org/stable/std/?search=lines and the short description makes it clear that the first two results are irrelevant in this case. > It would be great to have an offline way to search Rust documentation and examples, It all works offl…

> It would be great to have an offline way to search Rust documentation and examples,

>> It all works offline. These docs are pre-installed for you when you install Rust, and 'cargo doc' will generate them for your whole project.

Not by default, anymore[0], as I found out when I wanted to read the book offline.

To set up offline documentation, do:

  rustup component add rust-docs # One-time thing
  
Now to open the docs in a browser, do one of:

  rustup doc
  rustup doc --api
  rustup doc --book
The second and third forms open up the API documentation and the book, respectively. Bookmark for one-click access.

[0] https://users.rust-lang.org/t/psa-rust-documentation-is-now-...

Re: Rust's 2017 Roadmap

#164
post #111
post #70

I'm happy to see the focus on productivity. I saw the long awaited Non-Lexical Lifetimes tentatively mentioned in there, and I can only hope this will help move things forward, since it's pretty frustrating spending time fighting the borrow checker and refactoring correct code that really ought to run as-is. Cheers and happy 2017 to the Rust project!

As far as fighting the borrow checker goes, how familiar are you with more functional style programming approaches, mainly immutability? I'm extremely new to rust so I don't know if fighting the borrow checker is in my near future or something I will largely avoid.

Mutability makes it worse, but there are at least some issues with borrowing that have nothing to do with mutability. If your experience is with garbage collected languages, I suspect you'll encounter errors that surprise you.

Re: Rust's 2017 Roadmap

#165

Earlier quoted context omitted.

In that case, it sounds like "officially blessed crates" are a second-level stdlib with weaker guarantees about availability across time and across platforms. I'm fine with that idea, but from my outside perspective this is a confused message. Better to call the blessed crates "stdlib extensions" or something like that.

Why "weaker guarantees across platforms"? These crates have the same guarantees about platform support. Availability across time is also similar, really.

It speaks to my confusion about the role of these "blessed" crates that I assumed the reason for not including them in the standard library was that they were not supported on all platforms, or that you didn't want to commit to having them in stdlib forever. If neither of these is the reason, and you intend for these crates to persist indefinitely and be available on all supported platforms, surely they belong in the standard library?

For context, I'm a Python programmer by day and well used to the comforts of its expansive standard library. From that perspective, splitting your stdlib into a first-class and a second-class stdlib seems weird, and I'm trying to make sense of it.

Re: Rust's 2017 Roadmap

#166
post #91

Earlier quoted context omitted.

Yep, that's what I meant about "large". If you have a large project, with many developers you're going to want types + generics to maintain it over the many-years and 100,000s to millions of SLOC life.

Rust is hardly the only language to have a type system that supports generics.

I didn't say it was! I said it was an "excellent choice". Right?

Re: Rust's 2017 Roadmap

#167
post #100

Earlier quoted context omitted.

In most other programming languages functions in the standard library: * Are guaranteed to work correctly on all platforms where the language works. * Will always work with the latest stable release of the language. * Will be available under one single permissive license (with a single copyright holder (body) for any purposes of required notices etc.) * Will be supported (security patches, bug fixes, etc.) with backw…

Most of these are true for rand. It's in the nursery so it might (probably not though) be deprecated in favor of a different library, but it would continue to work because Rust is backwards compatible. https://github.com/rust-lang/rfcs/blob/master/text/1242-rust... has some of the motivation behind this.

Thank you for the link, that clarifies the Rust team's thinking! As an outsider considering Rust for a project at work, I'd recommend you put that somewhere front and center -- it's one of the more confusing things about the Rust world.

Re: Rust's 2017 Roadmap

#168
post #103

Earlier quoted context omitted.

stdlib or in a crate for just the trait similar to log?

The parent is worried about 2.0, so that would imply in stdlib. No reason it couldn't be done as a crate just for the trait as well, but that at least leaves the possibility of a 2.0 open.

Not worried about 2.0.

Rand is at version 0.3 and stagnating. I'm worried about 0.3, 0.4, 0.5. Those that have rand as a public dependency cannot release 1.0 now, if they do, they need to release 2.0 when rand goes to 0.4 and so on.

Re: Rust's 2017 Roadmap

#169
post #160
post #155

Earlier quoted context omitted.

String == &str works. Maybe you were encountering some other problem.

Oh, I guess the case of this I encountered most recently was actually Option == Option . I get why that's different, but it would be great if the type system could figure that out, so that the literal Some("foo") could be an Option if necessary. Maybe I'm still being spoiled by Haskell's OverloadedStrings.

You can do:

  foo() -> Option

  foo().as_ref() == Some("str")

Re: Rust's 2017 Roadmap

#170
post #156

Earlier quoted context omitted.

> Maybe you're only loading a small configuration file, and so fetching it all in one go is better than dealing with a buffer. If it's small, it can't be that much worse to buffer. What's wrong with reasonable defaults? Can you tell me what it means to search for 'line' or 'lines' in rustdoc? Is this a command-line tool? I'm aware of the 'rustdoc' that generates documentation, but not of anything by that name that se…

> Can you tell me what it means to search for 'line' or 'lines' in rustdoc? Rustdoc has a search bar at the top. with 'line' it's the third result, 'lines' is the first https://doc.rust-lang.org/stable/std/?search=lines and the short description makes it clear that the first two results are irrelevant in this case. > It would be great to have an offline way to search Rust documentation and examples, It all works offl…

> Rustdoc has a search bar at the top.

Let me assure you that I mean only the best for this language and I appreciate your persistent willingness to help, but I want to help debug your use of internal terminology that doesn't help beginners.

"rustdoc" is not how you should be telling beginners to look for documentation. As far as I can tell, "rustdoc" is the tool for generating documentation, not searching it. I assume you use rustdoc a lot and that's why the name comes to mind.

Maybe the term is overloaded, but I cannot find anything called "rustdoc" that involves a search bar. Googling for "rustdoc" gives many forms of Rust documentation, none of which have a search bar. DuckDuckGo-ing for "rustdoc" (as some documentation suggests instead of Googling) gets me some of the same things, plus rustdoc.com, which is a big honking security warning on top of someone's broken personal blog.

I know that exact link you gave me includes a search bar, but that's an example of finding the answer because you already know it.

And if you know to go to doc.rust-lang.org and go to the Standard Library API Reference, you get a search bar, but that's not where I would think of going to answer the question "how do I iterate lines".

That's why I end up Googling and getting to Stack Overflow, full of wrong answers and someone named Shepmaster yelling at newbies.

Post reply on HN