News for hackers. Stuff that matters.
Re:Rust is Software's Salvation by rubiquity on Thursday December 29, 2016 @05:50PM (#13280896)
The amount of hype Rust is getting is not going to end well for Rust. This reminds me of Ruby during 2007-2010 where it went from Patron Saint to Scapegoat for every startup that failed using it. Ruby survived it, and I'm sure Rust will too, but that doesn't make it obnoxious for everyone else who inevitably gets swept up in the craze and crash.

Programming is hard. Programming will always be hard. Better/newer tools (and sometimes influences from the old finally making it mainstream, like Standard ML) make programming easier but not fool proof. It's misleading and harmful to hype the crap out of any language.

Unfortunately this stupidity is never going to end as long as language creators measure language success in adoption numbers and TIOBE scores rather than the warm fuzzy feeling of handling certain people's needs really, really well.

Re:Rust is Software's Salvation by spacelizard on Thursday December 29, 2016 @06:29PM (#13281158)
The echoes of Golang hype right now are somewhat ominous. A few years ago it was "concurrency primitives are going to change your life" and now it's "lifetime/ownership primitives are going to change your life."

I am somewhat disappointed that we still feel the need to create entirely new toolchains and rewrite everything just to support what should be an incremental improvement. But at a certain point, a lot of the reason for the hype is that it sells these solutions to newer developers that haven't had exposure to these concepts before. I suppose we can consider them fortunate for not having to do systems programming while suffering through implementing their own reference counting and garbage collection semantics.

Re:Rust is Software's Salvation by stcredzero on Thursday December 29, 2016 @06:43PM (#13281240)
A few years ago it was "concurrency primitives are going to change your life

Those, plus the total package of tradeoffs in Golang did for me, in terms of implementing a game server. The whole package really is game changing for what I'm doing.

I am somewhat disappointed that we still feel the need to create entirely new toolchains and rewrite everything just to support what should be an incremental improvement.

There's something wrong with programming as an entire field. Don't other fields figure out ways of not reinventing the wheel?

But at a certain point, a lot of the reason for the hype is that it sells these solutions to newer developers that haven't had exposure to these concepts before.

Luminaries of our field have been lamenting for decades that programming forgets its own history and discoveries. Maybe we should make it de rigeur that people relate their "inventions" with past art? A lot of times, when I point out past art, I get met with instant open hostility from younger devs. Is it any wonder that programming has the attributes of a popular medium, not a field of engineering study?

If young coders want to be the future intelligentsia and harbingers of a better kind of programming, they need to foster a set of subcultural norms that best leverages collective knowledge. Programming has to become a field that remembers its own history and can learn from its mistakes.

Re:Rust is Software's Salvation by bjz_ on Thursday December 29, 2016 @08:18PM (#13281771)
Maybe we should make it de rigeur that people relate their "inventions" with past art? A lot of times, when I point out past art, I get met with instant open hostility from younger devs. Is it any wonder that programming has the attributes of a popular medium, not a field of engineering study?

[...]

If young coders want to be the future intelligentsia and harbingers of a better kind of programming, they need to foster a set of subcultural norms that best leverages collective knowledge. Programming has to become a field that remembers its own history and can learn from its mistakes.

Graydon has consistently pointed out Rusts influences, indeed it is one of the reasons behind its name - ie. 'rusty old ideas'. But the influences of the creator are not enough. We need to promote the value of a historical perspective in our discourse, and so I I'm glad for your post. As a young developer I see it in my peers, but even sadder I also see it in my mentors and elders. So often there is two extremes of fervent excitement and lack of imagination that things could be better beyond ones own experience... both borne out of a lack of historical literacy.

That said, I don't mind reinventing the wheel in new ways - every time our wheels get better and better. But perhaps they could get better faster with fewer steps backwards with a little schooling on the foundations of our field.

Re:Rust is Software's Salvation by stcredzero on Thursday December 29, 2016 @08:58PM (#13281950)
That said, I don't mind reinventing the wheel in new ways - every time our wheels get better and better.

Not always. Pry debugging Ruby can be pretty awesome but still often leaves a lot to be desired compared to the VisualWorks Smalltalk debugger+environment. Then there's the One Laptop Per Child project. How many developers were trying to recreate things that already existed in Smalltalk? What if they could've freed up the developer power wasted in that wheel reinvention? Seriously, a lot of the advanced state saving/rollback features would've just come for free in Smalltalk.

Re:Rust is Software's Salvation by coldtea on Friday December 30, 2016 @04:33AM (#13283486)
>Not always. Pry debugging Ruby can be pretty awesome but still often leaves a lot to be desired compared to the VisualWorks Smalltalk debugger+environment. Then there's the One Laptop Per Child project. How many developers were trying to recreate things that already existed in Smalltalk?

How many Smalltalks were not closed source and with commercial IDEs and toolsets?

Re:Rust is Software's Salvation by stcredzero on Friday December 30, 2016 @09:49AM (#13284596)
Squeak. That would've been enough. Smalltalk doesn't have an IDE in the traditional sense. The browser is a very small, thin app on top of the meta level and libraries.
Re:Rust is Software's Salvation by coldtea on Friday December 30, 2016 @09:50AM (#13284603)
Squeak only got viable a decade or so after the demise of commercial Smalltalks.
Re:Rust is Software's Salvation by pjmlp on Monday January 02, 2017 @05:22AM (#13300313)
Back in those days we just bought our tools.
Re:Rust is Software's Salvation by ZenoArrow on Friday December 30, 2016 @07:46AM (#13284098)
>"That said, I don't mind reinventing the wheel in new ways - every time our wheels get better and better. But perhaps they could get better faster with fewer steps backwards with a little schooling on the foundations of our field."

You may be interested in Graal/Truffle. One of the main aims is to make it a playground for experimenting with programming language design by reducing the work that goes into the underpinnings of these new languages. It's also meant to offer fairly decent performance.

https://medium.com/@octskyward/graal-truffle-134d8f28fb69#.n...

https://github.com/graalvm/truffle/blob/master/README.md

Re:Rust is Software's Salvation by rch on Thursday December 29, 2016 @07:23PM (#13281464)
> There's something wrong with programming as an entire field

Look at all the research and prototyping in aviation. What's weird about programming is the amazing longevity of experimental ideas vs. heavily engineered products.

Re:Rust is Software's Salvation by stcredzero on Thursday December 29, 2016 @07:41PM (#13281581)
What's weird about programming is the amazing longevity of experimental ideas vs. heavily engineered products.

I like that very much! Also strange are the obscurity and outright myths surrounding heavily engineered products, followed by hyped reinvention.

Re:Rust is Software's Salvation by coldtea on Friday December 30, 2016 @04:32AM (#13283478)
>There's something wrong with programming as an entire field. Don't other fields figure out ways of not reinventing the wheel?

No. In fact even in the actual field of "wheel manufacturing", we have been re-inventing the wheel since for ever.

Those who don't like "re-inventing the wheel", would they rather use stone or wooden wheels for their cars? Or perhaps some of the crude early metal ones? Or they rather use the re-invented modern mix of alloys and plastic?

Re:Rust is Software's Salvation by pjmlp on Friday December 30, 2016 @03:59AM (#13283354)
I would say it is a matter of quality in computing related degrees.

My university did a pretty good job teaching the ways of the past.

Sadly things seem to have changed for the worst in the last 20 years.

Re:Rust is Software's Salvation by coldtea on Friday December 30, 2016 @04:34AM (#13283490)
>My university did a pretty good job teaching the ways of the past.

That's because the past then was still modern.

Re:Rust is Software's Salvation by pjmlp on Friday December 30, 2016 @10:30AM (#13284788)
Meaning teaching in the 90's the computing history of programming all the back to the early days.

Those majoring in systems programming had a good glimpse of OSes and programming languages.

Re:Rust is Software's Salvation by vvanders on Thursday December 29, 2016 @06:38PM (#13281204)
I think you'll find a lot of Rust's supporters actually come from a Systems Programmers background who've felt the pain before.

I've been doing C/C++ for close to 15 years now, I find that the borrow-checker not only helps with safety but also with guiding a good architectural foundation. Nothing keeps you from dropping into an unsafe block and cranking out very c-like code if you want as well.

All my green-field code now is Rust. Sure there's some hype but that's because people are genuinely excited about the language.

Re:Rust is Software's Salvation by spacelizard on Thursday December 29, 2016 @07:16PM (#13281428)
I have too but I don't see any magic in Rust's borrowing beyond what you would get with using shared_ptr, weak_ptr and move semantics in C++11. Yeah there is a certain class of errors that the Rust compiler will check that will still give you a segfault in C++. But it doesn't get around the programmer still needing to have a firm understanding of RAII and the difference between the stack and heap in order to be effective in either Rust or C++, or Golang, or C99, or what have you.
Re:Rust is Software's Salvation by vvanders on Thursday December 29, 2016 @07:38PM (#13281556)
Rust is actually much closer to unique_ptr than shared_ptr or weak_ptr. The use of Rc is pretty small in practice.

The thing is that even with unique_ptr I can easily reach in via get() and I've broken the shared mutable state contract. It's trivial for me to trace what modifies things in Rust, I just follow the 'mut' annotations and since only one thing can hold it at a time it's very straightforward.

Rust also has one the best package managers I've seen. Union types which are the best way to represent states and state machines bar none. An iterator class that's the best I've seen(seriously has anyone actually used <algorithm>? How man begin/end pairs do I need?).

Plus the community is super-welcoming, there's more reasons but those are my top ones right now.

Re:Rust is Software's Salvation by coldtea on Friday December 30, 2016 @04:36AM (#13283502)
>But it doesn't get around the programmer still needing to have a firm understanding of RAII and the difference between the stack and heap in order to be effective in either Rust or C++, or Golang, or C99, or what have you

Who said it does? And why would it have to?

It'a just about catching those "certain class of errors that the Rust compiler will check that will still give you a segfault in C++".

Plus a nicer looking language, with a more modern design.

Re:Rust is Software's Salvation by dbaupp on Friday December 30, 2016 @08:15PM (#13288841)
The more strict static checking in Rust means that the compiler can actually be a teaching tool for concepts like RAII and the heap/stack difference: it flags and explains places where the programmer is doing that doesn't make sense in those settings. A lot of effort has been put into the compiler diagnostics to make this compiler-is-a-teacher concept a reality.
Re:Rust is Software's Salvation by pjmlp on Friday December 30, 2016 @04:04AM (#13283377)
The magic is that there is no way to enforce that in modern C++, in spite of current attempts.

There will always be that compiler or team that doesn't have any kind of reviews, static analysis, making use of binary libraries or legacy code.

Hence why safety at language level is much better than third party tooling, as tools can be ignored.

Re:Rust is Software's Salvation by steveklabnik on Thursday December 29, 2016 @07:23PM (#13281467)
For one, additional safety. Rust's equivalent are more safe. Secondly, speed. Rust has several advantages: with shared_ptr, for example, you have the Rc/Arc split, the decreased number of refcount bumps, etc. (some of that speed comes from the safety, even...)
Re:Rust is Software's Salvation by steveklabnik on Thursday December 29, 2016 @06:39PM (#13281209)
Rust is aiming for more than an incremental improvement. Take Servo, for example. The goal is to provide a generational leap in rendering engines, and while it's not done yet, the initial results are promising.

I agree that "salvation" is a bit much, though.

For whatever hype Go had and may have, it's still a resoundingly successful language that's building meaningful stuff that improves people's lives. Sounds like a success to me.

Re:Rust is Software's Salvation by to3m on Thursday December 29, 2016 @06:54PM (#13281316)
Move semantics, man.

I don't personally divide my life into "before move semantics" and "after move semantics" - but thanks to move semantics, I have to anyway. And I feel like I'm all the better for it.

Re:Rust is Software's Salvation by coldtea on Friday December 30, 2016 @04:28AM (#13283463)
>I am somewhat disappointed that we still feel the need to create entirely new toolchains and rewrite everything just to support what should be an incremental improvement

Any ideas about how to add this small "incremental improvement" of Rust-like safety to C, for example?

Re:Rust is Software's Salvation by jstewartmobile on Thursday December 29, 2016 @06:48PM (#13281280)
If we were betting money, I'd put mine on Golang over Rust just because of the piles of money and effort Google keeps pouring into it. Rust is a little cooler, but I just don't see Mozilla having enough resources to keep-up the momentum long-term.
Re:Rust is Software's Salvation by binarycrusader on Thursday December 29, 2016 @07:21PM (#13281450)
I don't see how Google is really putting piles of money into Go. In fact, in terms of maintainership and porting I'd say collectively that many other companies are investing more in Go than Google. What can you point to as piles of money?
Re:Rust is Software's Salvation by jstewartmobile on Thursday December 29, 2016 @07:23PM (#13281462)
Perhaps not that much by valley standards, but I'm sure just the salaries of Rob Pike and Brad Fitzpatrick alone would amount to more love than a lot of languages get.
Re:Rust is Software's Salvation by mmstick on Thursday December 29, 2016 @09:56PM (#13282166)
Go's not been receiving any piles of money from Google. Compare Go's API documentation to Rust's API documentation. Where's the `cargo` and `rustup` equivalent for Go? Compare the number of Go packages to the number of Rust packages. Seems Go's not doing so great despite being stable for much longer.

> I just don't see Mozilla having enough resources to keep-up the momentum long-term.

Did you forget about Samsung? Mozilla and Samsung aren't the only two companies backing Rust.

Re:Rust is Software's Salvation by jstewartmobile on Thursday December 29, 2016 @10:29PM (#13282286)
By TIOBE's stats, Go's popularity is up 1.74%. Rust's is up 0.316%.

http://www.tiobe.com/tiobe-index/

Call it money or whatever, but Go seems to be getting substantial TLC from the people working on it for every point release.

Of course, this could just be an easier thing for them to do since their approach is not as ambitious as Rust's.

Re:Rust is Software's Salvation by dbaupp on Friday December 30, 2016 @08:18PM (#13288857)
When was the last time you heard of Samsung being involved with Rust as a company? I'm fairly sure that is no longer a thing.
Re:Rust is Software's Salvation by nine_k on Thursday December 29, 2016 @06:51PM (#13281297)
Unfortunately, golang is just a different league.
Re:Rust is Software's Salvation by kmicklas on Thursday December 29, 2016 @06:51PM (#13281291)
These piles of money don't seem to be amounting to much because rust is still an objectively far superior language.

Google is not a language company and doesn't hire good language people so I don't see this changing.

Disclaimer: I work for Google

Re:Rust is Software's Salvation by jstewartmobile on Thursday December 29, 2016 @06:56PM (#13281329)
No argument on superior, it's just that superior doesn't win the day. Look at C++. Look at JavaScript. It would be surprising if the industry made the better choice for a change.
Re:Rust is Software's Salvation by eropple on Thursday December 29, 2016 @07:08PM (#13281396)
Hmm--with some edge-case exceptions that never got a strong push outside of some niches (Ada comes to mind, where it achieved some traction in DoD circles), I wonder if C++ wasn't the superior choice given its time and place. By no means is it perfect, but in the early to mid 90's there weren't many competitors with a similar feature set that had anybody pushing hard behind it. To my mind it seems not dissimilar.

If I have to write native code, right now it'll be C++ precisely because it's able to express complex problems with a high degree of getting-it-right (because while I would never claim to understand C++, I feel confident in my understanding of the subset of C++ that I use). I really like Rust and look forward to it being a better fit for what I want to do, and every time I look at it it's getting closer.

Re:Rust is Software's Salvation by kmicklas on Thursday December 29, 2016 @07:21PM (#13281449)
Spot on, C++ has always been the best systems language for real world projects until Rust came along.
Re:Rust is Software's Salvation by kmicklas on Thursday December 29, 2016 @07:00PM (#13281349)
Yeah but unlike, say, Haskell, Rust seems to have good enough momentum from the right crowds.
Re:Rust is Software's Salvation by foota on Saturday December 31, 2016 @02:46AM (#13290031)
But rust reuses some tooling, for instance, llvm.
Re:Rust is Software's Salvation by bjz_ on Thursday December 29, 2016 @06:43PM (#13281245)
> Unfortunately this stupidity is never going to end as long as language creators measure language success in adoption numbers and TIOBE scores rather than the warm fuzzy feeling of handling certain people's needs really, really well.

I don't think that the language creators are behind this in this instance, more over-excited users continuing the hype cycle. I definitely agree that it does a disservice to the language. I posted this on /r/rust[0]:

> Please don't push the hype train to far - our language, tooling and strong community does a lot of work to sell itself, and we will get a backlash if we are not up-front honest about Rust's problems. Ruby and Go are experiencing that now. Some languages are better than others especially in specific domains, but even the better ones are not silver bullets, and Rust is no different. I use Rust for some things because I feel the trade-offs are worth it.

Not all of us feel the need to sugar coat Rust.

[0]: https://www.reddit.com/r/rust/comments/5kytg5/rust_is_softwa...

Re:Rust is Software's Salvation by jeffdavis on Thursday December 29, 2016 @06:27PM (#13281143)
Do you have any suggestion to maintain hype at a reasonable level? Basically, a lot of people are excited about it, a lot of people are writing good libraries, and they blog about them, which feeds into the hype cycle.

I think the main hype danger for rust right now is that the number of killer applications written it will fall short of the hype. But the linked article is from someone writing redox-os, so it's hard to criticize this article specifically for contributing to overhype.

Ruby had the opposite problem, which is that a lot of people were writing amazing applications, but it fell down technically (applications got messier and slower; or at least that is the perception). In theory the same thing could happen to rust, but it seems less likely.

Re:Rust is Software's Salvation by pjmlp on Friday December 30, 2016 @03:47AM (#13283314)
As Alan Kay says, we have moved from a technical community to a pop driven one, so these hype cycles will never end while this mentality carries on.

Having said this, Go got its killer application in the form of the main language driving container implementations.

Rust might eventually get its one beyond the current browser implementation and get adopted by an OS vendor.

Just with Apple doing Swift, Microsoft .NET Native and C++/GSL, maybe it is left for Google and their Fuchsia project or an embedded OS vendor to do it.

Re:Rust is Software's Salvation by joshmarlow on Thursday December 29, 2016 @06:59PM (#13281343)
Why dear Sir, it almost sounds like you are suggesting that there is no silver bullet!
Re:Rust is Software's Salvation by blowski on Thursday December 29, 2016 @06:21PM (#13281102)
I agree. We are making the same mistakes Fred Brooks talks about in "No Silver Bullets".
Re:Rust is Software's Salvation by slowrabbit on Thursday December 29, 2016 @06:41PM (#13281223)
Programming isn't hard, it is super easy. Most of the things we ask machines to do are sequences of simple steps. It's so easy in fact that children do it successfully with little training. Programming well can be hard but only because of the limitations of our current tools. Rust is a good step in the direction of safer systems programming and the people who are hyped about Rust are the smartest people in the room, just like with Bitcoin when it started.
Re:Rust is Software's Salvation by zaphar on Saturday December 31, 2016 @01:58PM (#13292513)
That's like saying painting isn't hard it's easy. Children do it all the time with just their fingers. Painting a Mona Lisa is hard but only because we don't have good tooling.

It's a vast oversimplification of the real issues while ignoring the reasons programming or are hard.

Re:Rust is Software's Salvation by w8rbt on Thursday December 29, 2016 @06:14PM (#13281061)
I agree. C is fast because it can be unsafe. Skip all the safety checks and run like hell (if you need or want to). We don't care what size that array is, we just want to go really fast. Safety checks come with a performance cost. Rust claims to be faster than C and safer than C at the same time. That's not possible.
Re:Rust is Software's Salvation by wongarsu on Thursday December 29, 2016 @06:46PM (#13281267)
>Rust claims to be faster than C and safer than C at the same time. That's not possible.

Of course it's possible. Say you would fork gcc (or clang) and teach it a few extensions for the C type system that allow some more safety checks at compile time (for example something similar to Rusts borrow checker). Since those checks don't change the generated code, you now have a language that's safer than C, but equally fast. Now you add some language primitives that make it easier for the compiler to understand the intend of the programmer, making it easier to optimize the code (there are already plenty of opportunities used by C extensions, like signaling that some if branch is unlikely to be taken. More opportunities exist if you modify the language more heavily). Now you have a language that's both safer and faster than C.

I don't want to make any claims about Rust performance in practice, I haven't run enough benchmarks for that. But it's perfectly possible that the statement could be true.

Re:Rust is Software's Salvation by pjmlp on Friday December 30, 2016 @04:07AM (#13283385)
Attempted multiple times, always ignored by the C crowd.
Re:Rust is Software's Salvation by averell on Thursday December 29, 2016 @06:20PM (#13281099)
That is very much possible in many cases. Zero cost abstractions exist: https://blog.rust-lang.org/2015/05/11/traits.html
Re:Rust is Software's Salvation by vvanders on Thursday December 29, 2016 @06:26PM (#13281136)
Performance comes from being cache aware and having control over allocations moreso than safety checks.

Maybe not faster than C but at least as fast while bringing modern patterns and better safety.

Re:Rust is Software's Salvation by coldtea on Friday December 30, 2016 @04:38AM (#13283516)
>Rust claims to be faster than C and safer than C at the same time. That's not possible.

It's actually entirely possible. For example it's how Fortran has been traditionally faster than C, by not allowing for aliasing (which is also an unsafe feature) it can give the compiler more room from optimization.

Re:Rust is Software's Salvation by nitroll on Thursday December 29, 2016 @06:22PM (#13281111)
It is, especially if these checks are done at compile time, not at runtime.
Re:Rust is Software's Salvation by berkut on Thursday December 29, 2016 @06:45PM (#13281262)
How can checks be done if the size is dynamic based on run-time data?
Re:Rust is Software's Salvation by prodigal_erik on Friday December 30, 2016 @05:36PM (#13288091)
"Integer between 0 and n-1 inclusive" is the type of valid indices for an n element array. The trouble is most languages don't have type systems that allow expressing that.
Re:Rust is Software's Salvation by pjmlp on Monday January 02, 2017 @05:35AM (#13300362)
The Pascal family are such languages.
Re:Rust is Software's Salvation by 102910201 on Thursday December 29, 2016 @06:43PM (#13281242)
Expect a blog post within four hours "Rust has solved the halting problem!"...
Re:Rust is Software's Salvation by prodigal_erik on Thursday December 29, 2016 @09:18PM (#13282028)
Even when you can't prove what arbitrary code does, proving what well-written code does is useful, and not writing unprovable code would be a small price to pay.
Re:Rust is Software's Salvation by jdright on Thursday December 29, 2016 @06:18PM (#13281087)
And it is not. It is not faster than C but it can be almost as fast someday.
Re:Rust is Software's Salvation by w8rbt on Thursday December 29, 2016 @06:19PM (#13281095)
The rust zealots say it is, "Better performance than C"

That's from the linked article 'Rust is Software's Salvation' (bullet point 3).

Re:Rust is Software's Salvation by EugeneOZ on Thursday December 29, 2016 @06:26PM (#13281139)
Re:Rust is Software's Salvation by kstrauser on Thursday December 29, 2016 @06:42PM (#13281235)
That's just not true. C (in the hands of average programmers) is limited because it's not very expressive. There's no way to say "these 40 things can be run in parallel" or "run these 200 things asynchronously" in a standardized way. Very clever compilers can infer some autoparallelization situations, but I'm not away of anything that can auto-async a project that's not explicitly written that way.

That's C's limitation: it can only be as fast as the compiler geniuses can make it, or as concurrent as its users can explicitly make it. Given that almost all computers where you care about raw performance are multiprocessing now, that's a huge deal. Languages with primitives like async/parallel map() are going to have a hard time keeping up with those that do.

Sure, you can write ultra fast code in C or assembly. The fastest way to do so might be to write it first in Erlang, Go, or Rust and reverse engineer it from the resulting machine language.

Re:Rust is Software's Salvation by comex on Thursday December 29, 2016 @07:00PM (#13281353)
Rust does not have any better builtin support for concurrency than C++ - well, it's supposed to be safer, but it doesn't have the kind of fundamental enabling features you're talking about. In fact, most of the tools I can think of that do sound like what you're talking about, like OpenMP, Cilk, etc., are based on C++. (Both Rust and C++ are likely to gain some sort of async/await support in the nearish future, but they're hardly unique in that respect.) Go has a runtime that makes it cheap to spawn lots of threads, but it's not doing any super high level optimization or abstraction either (quite the opposite). I don't know about Erlang.
Re:Rust is Software's Salvation by burntsushi on Thursday December 29, 2016 @07:08PM (#13281395)
rayon probably deserves a mention here: http://smallcultfollowing.com/babysteps/blog/2015/12/18/rayo...

(It's not built in, but that's a good thing IMO. :-))