Live data from Hacker News

Rust can be difficult to learn and frustrating, but it's also very exciting

influxdata.com

111–120 of 282 posts

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#111
post #89

Earlier quoted context omitted.

See the thing is that I agree with most of your statements, so you're really not changing my mind with your arguments. > Actually companies are becoming more aware that speed is a feature No. If that were true, Python wouldn't be the fastest growing language, and we'd be hand optimizing everything in assembly and using languages that allowed us to do that (C). That was the entire point I was making. It's why Java won…

Python is growing because it's a good scripting language, and there's a need in the ML community for a standard language to write scripts in. The ML community is growing like crazy, thus Python grows. Even though Python is secretly calling Fortran for scipy, or Tensorflow (C++), or PyTorch (also C++), all of which would make good candidates for Rust replacements. So obviously speed is necessary to enable what people…

tl;dr: despite being relatively slow Python is a fantastic glue language. Some people thing rust is well positioned to steal Python's dinner.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#112

Rust is the answer to the question "can we have speed, correctness, and expressiveness in one language?" My company has been running Rust in production for awhile now, and it's exceeded every expectation. It's fast, it's safe, and it's so productive it's hard to find a reason to use anything else. We've also found that the learning curve is, in our opinion, a bit overstated. We've ramped up several new grads on Rust…

> Rust is the answer to the question "can we have speed, correctness, and expressiveness in one language?" My biggest gripe is that they left out readability. I like the semantics of Rust, and appreciate the performance and the transparent memory model. I am extremely excited to try Rust on an embedded project. Bur honestly, the syntax is gruesome. Coming from Python, Rust looks like two rabid gerbils had a war dance…

[deleted]

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#113

Earlier quoted context omitted.

We have seen production users choose to make this port to save on server costs. You can always scale horizontally, but it comes with a price tag.

Also complexity - managing an order of magnitude more instances is more hassle.

The OP only doubled their performance by rewriting in Rust though...

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#114

Earlier quoted context omitted.

> Rust is the answer to the question "can we have speed, correctness, and expressiveness in one language?" My biggest gripe is that they left out readability. I like the semantics of Rust, and appreciate the performance and the transparent memory model. I am extremely excited to try Rust on an embedded project. Bur honestly, the syntax is gruesome. Coming from Python, Rust looks like two rabid gerbils had a war dance…

Python is pretty to look at, but I hate working in white space sensitive languages. If I have to have another argument about tabs vs. spaces I am going to toss my monitor out the frickin’ window. Also, it makes autoindent in Emacs worse.

Wait, let me get under your window...

> If I have to have another argument about tabs vs. spaces I am going to toss my monitor out the frickin’ window.

Clearly the correct answer is spaces. /s

Seriously though, I like python because not only is it pretty, it's also concise. While it's not perfect, a lot of time has been spent on language features to make them easily comprehendable.

The lesson for me from python is that UX is important, even in programming languages.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#115

Earlier quoted context omitted.

Woah, woah, woah. First, Go and C++ are vastly different languages. Apples and oranges. C++ is huge . It takes an incredible amount of effort to become a proficient C++ developer, and even then, C++ offers none of the amazing safety guarantees that Rust's borrow checker enforces. It's old language with sedimentary layers, including C backwards compatibility. Rust is no where near as complex, and Rust does 5x more to…

> Go isn't really in the same league as Rust, C++, or C. It's syntax is deceptively C like, and it has an equally poor type system, but it's performance is closer to Java, which is a few orders of magnitude slower than C++. Despite pushing outdated concepts like null and raw pointers on to the programmer, it has a runtime with a stop the world GC with no guarantees about object placement on the stack or heap Man, sta…

> it's performance is closer to Java

Go vs Java https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Go vs C++ https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

> pushing outdated concepts like null and raw pointers on to the programmer

I mean this is just a fact. Are you disputing nil and *?

> it has a runtime with a stop the world GC

https://blog.golang.org/ismmkeynote

"On the Y axis we have GC latency in milliseconds. On the X axis we have time. Each of the points is a stop the world pause time during that GC. "

> with no guarantees about object placement on the stack or heap

From the F.A.Q.

" How do I know whether a variable is allocated on the heap or the stack?

From a correctness standpoint, you don't need to know. Each variable in Go exists as long as there are references to it. The storage location chosen by the implementation is irrelevant to the semantics of the language."

> but every other claim you made above is empirically incorrect.

Seems you're empirically incorrect.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#116

Earlier quoted context omitted.

Python is growing because it's a good scripting language, and there's a need in the ML community for a standard language to write scripts in. The ML community is growing like crazy, thus Python grows. Even though Python is secretly calling Fortran for scipy, or Tensorflow (C++), or PyTorch (also C++), all of which would make good candidates for Rust replacements. So obviously speed is necessary to enable what people…

tl;dr: despite being relatively slow Python is a fantastic glue language. Some people thing rust is well positioned to steal Python's dinner.

That's not what I said. I said Rust was a good candidate for all the things Python is using to actually do useful work. The underlying libraries written in Fortran, C, and C++.

Don't tl;dr; if you don't know how to r.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#117
post #75

Earlier quoted context omitted.

Are you? Every app I've ever written that talks to postgres spends way more time...waiting on postgres than doing anything else. It's like the joke about getting a faster processor so you're 99% idle instead of 95% idle.

I always found it easier to improve the time waiting for postgres by tuning critical queries than to track down runaway memory usage and tune garbage collection. I also felt like I spent a lot of my wall clock time during active development waiting for apps to start up and run tests or whatever. There are best practices which speak to most of this, but they were hard won.

But that doesn't come for free with Rust. You still have optimize the DB. And then does it really matter which language you use, since the DB is still going consume most of the time generating a web page anyway, right?

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#118
post #104

Earlier quoted context omitted.

Speed matters, it’s just that it’s far from the top priority. All else being held equal, developers and stake holders will choose the faster language, it just makes sense. The trick is that speed is typically seen as diametrically opposed to usability, since quite a few languages achieve speed by turning all the safety rails off or existing way too close to the metal for comfort. If rust could deliver speed without c…

> If rust could deliver speed without compromising on ease or safety, and I honestly don’t know if it can, then it will absolutely crush the competition. It has to be more than safe and fast. It has to be a productive language to use. A dev can't sit for 6 months trying to figure out how to write a website, when he can pick up RoR and do it in a day.

That’s why I said “ease” too.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#119

Earlier quoted context omitted.

> Rust is the answer to the question "can we have speed, correctness, and expressiveness in one language?" My biggest gripe is that they left out readability. I like the semantics of Rust, and appreciate the performance and the transparent memory model. I am extremely excited to try Rust on an embedded project. Bur honestly, the syntax is gruesome. Coming from Python, Rust looks like two rabid gerbils had a war dance…

Python is pretty to look at, but I hate working in white space sensitive languages. If I have to have another argument about tabs vs. spaces I am going to toss my monitor out the frickin’ window. Also, it makes autoindent in Emacs worse.

Well, tabs versus spaces is not a Python thing, that will bite you in any language eventually. Blame the VT-100 terminal.

Here is the thing about indentation versus curly-braces-and-semi-colons: It boggles me that people find it acceptable to use one mechanism to communicate block structure to the compiler, and a completely different mechanism to communicate block structure to humans, and have no way to automatically check that they have the same semantics. This is a frequent source of bugs, and is entirely preventable. When it comes to the ergonomics of computer-convenient versus human-convenient, humans should win. Therefore, significant white space is clearly preferable simply from the standpoint of eliminating the source of an entire class of bugs.

But the main thing that makes Rust harder to read is all the punctuation noise and short, cryptic keywords. While one friend once said: "A good programmer can write FORTRAN in any language.", I don't feel compelled to help them.

Readability matters.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#120
post #98

Earlier quoted context omitted.

We don’t generally consider other languages as a measure of what complexity is “okay” or something, and are extremely aware of Rust’s complexity. Rust has a lot of requirements that directly lead to a lot of that complexity. But it’s neccesary , not incidental. Or that’s the hope, at least. Rust is also not perfect.

A lot of (but not all) complexity is solved in C/Python/Java by throwing a data structure at the problem. But is it a fair statement to say that not all data structures will work in Rust? Or is it better to say that some data structures work better in Rust than others?

Writing certain data structures in safe Rust can be hard, but not impossible. I’m not aware of any data structures that simply cannot be written in Rust.
Post reply on HN