News for hackers. Stuff that matters.
Re:Rust can be difficult to learn and frustrating, but it's ... by ilovecaching on Monday October 22, 2018 @10:52PM (#18280393)
> I don't mean to burst your bubble here.

You won't.

> But people need to feel productive quickly with a language, otherwise they'll drop it and move to something else which makes them feel that way.

This is relative. Rust is far easier to learn than C++. It has a compiler that will even enforce that you don't shoot yourself in the foot. It also has nice tooling to get you up and running quickly. It has good documentation. It has a free book. We've had no trouble getting our new grads up and running with Rust. It's not that hard.

> Javascript is thought of as a terrible language by language snobs, and yet it has a huge following.

Having a huge following doesn't make it less terrible by the measures of PL theory or sensibility. It's also the only choice on the web, but that may soon change, Rust has first class support for wasm so it's in a good spot there.

> Haskell, on the other hand, is much beloved, and doesn't. Don't get me wrong, it's got its share of love, but hasn't seen the explosive growth that python or java has.

By most accounts the Haskell ecosystem and user base are quite large considering it is intended as a research language, and the community is still growing. Rust isn't intended for research, and it's incredibly young compared to Java or Python, so it has plenty of time to catch up.

> but people were so much more productive with Java.

Hahaha. You mean people wrote a lot of Java. Let's please make the distinction between productivity and writing a bunch of enterprise crapware churned out by barrelful.

> They didn't have to worry about memory management, segfaults, crazy C++ semantics, etc.

That's exactly what Rust does for you.

> Companies were more willing to throw hardware at a problem to reduce risk/time in development. And that is still true today.

Actually companies are becoming more aware that speed is a feature, and that Moore's law isn't holding out. We're also moving to smaller form factors: phones, watches, glasses... the future is not on the desktop by any means, and no one wants to waste capacity in a datacenter needlessly.

Re:Rust can be difficult to learn and frustrating, but it's ... by bb88 on Monday October 22, 2018 @11:32PM (#18280537)
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.

I can't figure out if Rust is serious about being a true competitor, or just merely riding the peak on the Gartner Hype Cycle [1].

[1] https://www.gartner.com/en/research/methodologies/gartner-hy...

Re:Rust can be difficult to learn and frustrating, but it's ... by ilovecaching on Monday October 22, 2018 @11:45PM (#18280582)
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 are doing in Python.

I make the distinction between script and what we software engineers do, because I had the misfortune of spending half a decade in research doing ML, and those guys are not writing production programs. They're hacking out Jupyter notebooks and writing precariously balanced code that barely works.

That doesn't make Python suitable for large applications. It doesn't diminish the fact that CUDA is growing, SGX is growing, embedded is growing, that we're now unlocking 100G fiber, that we've reached the limits of single core performance, that intel is rolling out 8+ core consumer CPUs. Python is not going to shine for any of these things, but Rust will.

Re:Rust can be difficult to learn and frustrating, but it's ... by scardine on Tuesday October 23, 2018 @12:32AM (#18280732)
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 ... by mbo on Tuesday October 23, 2018 @01:12AM (#18280869)
To be fair, it's much more likely that Julia will be stealing Python's dinner, rather than Rust.
Re:Rust can be difficult to learn and frustrating, but it's ... by olavk on Tuesday October 23, 2018 @03:13AM (#18281367)
Django is not going to be rewritten in Julia. Neither is Linux going to be rewritten in Python. Different languages have different domains. Some of these comments seem to think all languages is competing in the same domain as if Rust is a direct competitor to Julia or JavaScript.
Re:Rust can be difficult to learn and frustrating, but it's ... by mbo on Tuesday October 23, 2018 @05:30AM (#18281963)
The context of the comment I replied to was that Python was fantastic glue code _for scientific computing_. Julia won't won't impinge on Django's usage share.
Re:Rust can be difficult to learn and frustrating, but it's ... by olavk on Tuesday October 23, 2018 @03:09AM (#18281350)
Rust will not steal Pythons dinner, they are used for completely different domains. The comment was saying that Rust might be a realistic alternative to C/C++/Fortran for modules which are not written in Python.
Re:Rust can be difficult to learn and frustrating, but it's ... by ilovecaching on Tuesday October 23, 2018 @12:43AM (#18280775)
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 ... by village-idiot on Monday October 22, 2018 @11:46PM (#18280590)
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 compromising on ease or safety, and I honestly don’t know if it can, then it will absolutely crush the competition.

Re:Rust can be difficult to learn and frustrating, but it's ... by ilovecaching on Tuesday October 23, 2018 @12:00AM (#18280626)
Safety and speed are the big words on the box. Usability is harder, because it's somewhat a matter of opinion. As someone who has professionally worked with the expression based Haskell, Erlang, Elixir, and OCaml, I find Rust to extremely expressive. If you come from that camp and feel that OOP is a bad toolkit of abstraction and that higher order functions, typeclasses, type parameters, and ADTs are much more powerful, then I think yes, Rust ticks all the boxs.
Re:Rust can be difficult to learn and frustrating, but it's ... by bb88 on Tuesday October 23, 2018 @12:01AM (#18280630)
> 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.

Re:Rust can be difficult to learn and frustrating, but it's ... by village-idiot on Tuesday October 23, 2018 @12:48AM (#18280797)
That’s why I said “ease” too.
Re:Rust can be difficult to learn and frustrating, but it's ... by dman on Monday October 22, 2018 @11:02PM (#18280425)
I think Rust should stop looking at C++ as the becnhmark / comparison point for complexity. The expectations that developers have from languages has increased over time, and Rust itself has contributed to raising that bar.
Re:Rust can be difficult to learn and frustrating, but it's ... by steveklabnik on Monday October 22, 2018 @11:31PM (#18280536)
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.
Re:Rust can be difficult to learn and frustrating, but it's ... by bb88 on Monday October 22, 2018 @11:47PM (#18280593)
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?
Re:Rust can be difficult to learn and frustrating, but it's ... by ovao on Tuesday October 23, 2018 @01:06AM (#18280845)
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.
Re:Rust can be difficult to learn and frustrating, but it's ... by Tuna-Fish on Tuesday October 23, 2018 @04:15AM (#18281644)
Of course, since anything that can be written in C can be written in unsafe Rust.

Though, reading the post above yours, I was thinking more about the use of data structures than the implementation of them. In C++, when faced by the need to efficiently iterate through a data structure in different, incompatible orders, the tool of choice is often just to make intrusive linked lists with multiple next pointers per element. I think I've even once implemented something that was a priority queue (heap), two different lists and a tree at a same time.

While doing that in Rust is by no means impossible, it seems to me that the use of such a structure would be much more clumsy in Rust, to the point where I would try hard to solve the problem in some different way.

The languages are all turing-compatible anyway, so it's not about what can be done, it's about what approaches does the language make easy and promote. Overall I really like the kind of code idiomatic Rust tends to end up like.

Re:Rust can be difficult to learn and frustrating, but it's ... by bb88 on Tuesday October 23, 2018 @10:00PM (#18289090)
Thanks for the thoughtful post. I do have a question, that maybe you can answer?

> The languages are all turing-compatible anyway, so it's not about what can be done, it's about what approaches does the language make easy and promote.

Turing completeness is kinda besides the point. We probably wouldn't be talking about it on HN if it wasn't. :)

I guess what I'm wondering is does Rust encourage simpler but possibly slower data structures, or are there some complex data structures which are simpler to ensure safety than other simpler ones?

In other words, does Rust encourage simplicity at the cost of speed?

Re:Rust can be difficult to learn and frustrating, but it's ... by steveklabnik on Wednesday October 24, 2018 @10:07AM (#18292520)
As with all performance questions, the answer is “it depends.” For a look into this question, see http://dtrace.org/blogs/bmc/2018/09/28/the-relative-performa...
Re:Rust can be difficult to learn and frustrating, but it's ... by bb88 on Wednesday October 24, 2018 @10:09PM (#18298072)
Hey thanks for the response.

I'm happy that rust has a good set of performant data structures, but on the other I feel like it's too soon to say Rust is the big winner here as the author does. I've been very skeptical on fantastical claims by language promoters.

But taking the pain out of making common data structures is a good start.

Re:Rust can be difficult to learn and frustrating, but it's ... by steveklabnik on Thursday October 25, 2018 @10:50AM (#18301298)
I think if you'll look into the author's credentials he is far from a "language promoter."