News for hackers. Stuff that matters.
Re:Go Is the New Ruby by panpanna on Monday October 28, 2019 @06:22PM (#21382373)
Go is the new Java.

It runs everywhere, is easy to learn and use and people who don't get it hate it with passion.

Anyway, comparing go documentation with rust docs, I'm surprised anyone can get any work done with rust.

Re:Go Is the New Ruby by schrodinger on Monday October 28, 2019 @09:39PM (#21383574)
I’m a devout Go developer and I feel like this is accurate. It’s got some uglies (eg no generics, verbosity in general), but man, overall, it’s so pleasant to work with. Which is probably how great Java developers feel. Thanks for inspiring empathy!!!
Re:Go Is the New Ruby by paulddraper on Tuesday October 29, 2019 @03:58AM (#21384982)
And Java also didn't start with generics either. They were bolted on later.

Which is why it uses type erasure for generics rather than reification like C#.

Re:Go Is the New Ruby by cpx86 on Wednesday October 30, 2019 @02:13PM (#21400720)
C# didn't either, it was introduced in C#/.NET 2.0. As I've understood it, Java chose type erasure to stay backwards compatible with older JDK versions, whereas .NET instead chose to break compatibility with 1.x and force dependents to target 2.0.
Re:Go Is the New Ruby by littlestymaar on Tuesday October 29, 2019 @03:59AM (#21384989)
> Anyway, comparing go documentation with rust docs, I'm surprised anyone can get any work done with rust.

That's an unexpected comment. Rust has among the best documentation I've seen, and arguably the best ecosystem around documentation, which helps a lot and encourage third party developers to write high quality doc. I understand when people complain about the learning curve (like this article, because fighting the borrowchecker is only a thing while learning) but docs, really?

Re:Go Is the New Ruby by mkr-hn on Tuesday October 29, 2019 @08:57AM (#21386572)
For comparison:

https://doc.rust-lang.org/std/fmt/index.html

https://golang.org/pkg/fmt/

I don't know why I find Go's version easier to follow, but I do.

Re:Go Is the New Ruby by steveklabnik on Tuesday October 29, 2019 @11:02AM (#21387912)
Context: I wrote most of the stdlib docs

the fmt docs are... not ideal. That said, there's a lot there, and it's all useful, but it's just tough. Frankly, I just punted on improving them, and haven't taken the time to do so in the years since.

Re:Go Is the New Ruby by mkr-hn on Tuesday October 29, 2019 @12:47PM (#21389218)
It seems like enough people find their way around them. Refinement might make them easier for people like me with less experience navigating language documentation, but that might come at the expense of developing the language. Priorities are important. Especially since Rust doesn't have Google's resources.
Re:Go Is the New Ruby by setr on Tuesday October 29, 2019 @09:40AM (#21386995)
In terms of content, they seem to be on par, and I think it's safe to say that's true for both stdlibs.

Across the ecosystem (and particularly the third-party culture of documentation) is much more important; in my own experience playing with both languages, I tended to encounter more useless 1-line descriptions in golang than I did in Rust.

Also golang struct descriptions always seem to be a bit lackluster..

But I can't point to any particular lib at the moment though.

Re:Go Is the New Ruby by littlestymaar on Tuesday October 29, 2019 @05:22PM (#21392190)
Even if it's not the author's favorite piece of doc, this is still a pretty good example of why I like rust docs. The rust version has :

- syntax highlighting

- a quick example of the feature

Re:Go Is the New Ruby by lacker on Wednesday October 30, 2019 @11:53PM (#21405596)
I am not a fan of Rust’s documentation. To take one example: sending a HTTP request. There is tons of documentation of properties of the the HTTP classes built into the standard library, but it is extremely hard to find an example of working code. Wouldn’t a simple usage example of something like sending a single HTTP request be one of the most useful things to document?

As far as I can tell, the best-documented approach is to use some external library and ignore the http support built into Rust.

Re:Go Is the New Ruby by steveklabnik on Thursday October 31, 2019 @09:19AM (#21408363)
Rust’s standard library has no http support, so this post is a bit confusing to me.
Re:Go Is the New Ruby by lacker on Thursday October 31, 2019 @02:37PM (#21412155)
This stuff, for example:

https://docs.rs/http/0.1.19/http/request/index.html

"standard library" is probably not the correct term for this in Rust-world because it is under the "http" namespace rather than the "std" namespace. I just meant, "the stuff you use via typing `use http`".

Re:Go Is the New Ruby by steveklabnik on Thursday October 31, 2019 @10:36PM (#21415817)
Yes, that is not the standard library, that’s a third party package. Its documentation does explain that it’s not a client or server.
Re:Go Is the New Ruby by lacker on Friday November 01, 2019 @01:40PM (#21421619)
Hmm. Its documentation doesn't explain that very well at all, to me.

I am comparing the experiences of:

1/ Trying to do some http requests in go, searching for "golang http", and coming across the fairly well documented standard "net/http" library in go, at https://golang.org/pkg/net/http/

2/ Trying to do some http requests in rust, searching for "rust http", and coming across this as the first result:

https://docs.rs/http/0.1.19/http/

which includes statements like

"It's intended that this crate is the "standard library" for HTTP clients and servers without dictating any particular implementation."

That's cool, I don't mind if no particular implementation is dictated to me. I just want to know how to use it by reading this documentation... but that never becomes possible.

You could say the problem isn't that rust is documented poorly, the problem is that the standard library is missing some things that are in the standard library of other languages, and it's those third-party libraries that are documented poorly.

Re:Go Is the New Ruby by littlestymaar on Monday November 04, 2019 @09:52AM (#21442141)
The big issue here, is that you assume that you can get the same ultra-light Google search to give you the same answer for Go and Rust. That's a totally unrealistic expectations! If you google “nodejs http”, “PHP http”, “python http” or “Java http” you don't have the answer you're looking for either!

“How to perform an http request in Rust” is a Google query that makes much more sense, and works for all the aforementioned languages.

Re:Go Is the New Ruby by lacker on Monday November 04, 2019 @12:46PM (#21444153)
I disagree.

Searching for [python http] works fine. Top result is this page:

https://docs.python.org/3/library/http.client.html

which explains precisely how to send http requests.

Searching for [nodejs http] works fine as well. You get this page:

https://nodejs.org/api/http.html

Which does, in fact, give you a library that can make http requests.

I won't dig into php and java because I'm not familiar enough with those languages to say what a decent way of sending http requests is.

Finally, searching for [how to perform an http request in rust] does not work! It sends you to https://docs.rs/http/0.1.5/http/request/index.html which is the same fundamentally broken library as you get with [rust http].

In conclusion, the Rust documentation is worse than any of Go, Python, or Node.

Re:Go Is the New Ruby by steveklabnik on Monday November 04, 2019 @12:51PM (#21444232)
The second link for "rust http" for me (and in incognito mode) points to https://github.com/hyperium/hyper, which is exactly what you want.
Re:Go Is the New Ruby by kerng on Monday October 28, 2019 @08:59PM (#21383374)
I'd say Go is more like Basic.
Re:Go Is the New Ruby by warmind99 on Tuesday October 29, 2019 @11:56PM (#21394563)
Agreed, the Rust docs seriously suck, but once you get used to the language you can write incredibly fast code witgh only about 15% more effort than Python. Also, Cargo.toml is great.