Live data from Hacker News

Ask HN: Will Rust ever become a mainstream systems programming language?

news.ycombinator.com

161–170 of 291 posts

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#161
post #150

Earlier quoted context omitted.

Why use Rust for web development? There are very few web back ends in the world that need the speed of C++ or Rust. Java, C#, Go, Haskell, OCaml are much easier to ramp people up with and hire for.

If rust ever gets to the point where it's not much harder to write than java/c# then why not got for the fastest one and avoid performance death by a thousand cuts? A millisecond here and there can add up. And then there's the environmental cost of slower code. How many tonnes of CO2 emissions are higher level languages responsible for daily?

> If rust ever gets to the point where it's not much harder to write than java/c# then why not got for the fastest one and avoid performance death by a thousand cuts?

Sure. If it's just as easy for the task then why not?

But I wouldn't recommend Rust for web development for the same reason I wouldn't recommend C++ for web dev: complexity. Obviously, this is entirely subjective but I don't think either language will ever be easier to write than Java or C#, especially for beginners.

I used to TA a freshman data structures class. I can't imagine ever going to a class of new programmers and trying to explain to them when to use Rc>> vs. Rc>>.

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#162
post #27

I had great hopes for Rust as the future of systems programming, but they've decreased over time. Parts of the language are just too cute. The borrow checker was brilliant. Any future language that doesn't use garbage collection will have to have one. That was the big advance in Rust. But the object system (yeah, they're called structures and traits) is too weird. The enum approach to variant records is too weird. Th…

> But the object system (yeah, they're called structures and traits) is too weird. So you praise Go for having structures and interfaces, but you criticize Rust for having structures and interfaces because that's "too weird". > The enum approach to variant records is too weird. Why? Because of the keyword? Swift uses that keyword too! > The error handling is too weird. What would you rather see? > The half-functional…

> I can't think of any way that Rust differs in this regard from, say, Ruby. Or JavaScript.

"Everything is an expression" is pretty different. You can say ML/Lisp, but those are non-top-10 languages/styles.

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#163
post #27

I had great hopes for Rust as the future of systems programming, but they've decreased over time. Parts of the language are just too cute. The borrow checker was brilliant. Any future language that doesn't use garbage collection will have to have one. That was the big advance in Rust. But the object system (yeah, they're called structures and traits) is too weird. The enum approach to variant records is too weird. Th…

> Trying to port something from another language to Rust is difficult because Rust's ways of doing things are so different from other languages.

That's the whole reason to have a new language; if we just wanted a language that works like elcurrent popular languages, we wouldn't need a new language for that.

> I have the feeling that Rust is destined for a niche like Haskell - cool, but not mainstream.

Becoming a Haskell or a Lisp -- never an industrially dominant language but one from which later and more industrially popular languages are continuously mining for some subset of their ideas because they solve problems long before most users of industrially popular languages even recognized the problem, much less the value of the particular solution, is not a failure.

And it makes the language one that is valuable to learn even if you don't often get to use it anger.

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#164
post #65

Earlier quoted context omitted.

I can't think of much real originality in Rust. It just brings together "exotic" features from lesser-known languages. I think you're right. Except for the borrow checker, which was a major breakthrough.

Compile-time checking of owned and borrowed references was in Vala, a C#-inspired language for the GNOME ecosystem, four years earlier.

Doesn't Vala use reference counting? [1] I'm not actually sure; do you have some pointers I could read here?

1: http://www.vala-project.org/doc/vala/Overview.html#Memory_ma...

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#165
post #159

Earlier quoted context omitted.

Rocket is one big one. Just recently though, serde and diesel started working well on stable Rust. Other than that, unless you're doing embedded stuff or SIMD, you should be fine on stable. Unfortunately, Rocket does not appear to be on track to work on stable Rust for the foreseeable future.

I was hoping with serde being on stable things would settle down. What's keeping rocket on nightlies?

Lots of things: https://github.com/SergioBenitez/Rocket/issues/19

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#166

Earlier quoted context omitted.

> But the object system (yeah, they're called structures and traits) is too weird. So you praise Go for having structures and interfaces, but you criticize Rust for having structures and interfaces because that's "too weird". > The enum approach to variant records is too weird. Why? Because of the keyword? Swift uses that keyword too! > The error handling is too weird. What would you rather see? > The half-functional…

> I can't think of any way that Rust differs in this regard from, say, Ruby. Or JavaScript. "Everything is an expression" is pretty different. You can say ML/Lisp, but those are non-top-10 languages/styles.

> > I can't think of any way that Rust differs in this regard from, say, Ruby. Or JavaScript.

> "Everything is an expression" is pretty different.

No, in Ruby, everything is also an expression; this is sometimes unrecognized because some constructs that are cognates to constructs that are statements in other languages are frequently (but inaccurately) referred to as statements in Ruby (the most frequent example I've seen is "case statements").

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#167

Earlier quoted context omitted.

We would lose lots of users from C and C++ if we mandated exceptions for error handling. The code size and complexity of unwinding is too much of a price for many to pay.

Not mandate them , use have them as an options where the monadic Errors types are not enough or are too cumbersome to use.

[deleted]

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#168
post #5

Most C++ developers won't easily develop systems in Rust because of lack of well-known libraries and a stable ecosystem(profilers, static analyzers, concurrency tools, many skilled and mediocre developers, etc). C++11 and subsequent versions have a good amount of memory safety(though not as safe as Rust). Rust is a modern language with very good concepts and features. It's quite complicated to learn. My answer is it…

I'm not sure what "concurrency tools" are. Profiling tools that work on C++ should work on Rust just as well; "perf" and "sysprof" do, at least. "static analyzers" are far less important in Rust since the compiler prevents most of the bugs that C++ static and dynamic checkers look for. Having said that, ASAN and TSAN do work with Rust!

As for "complicated to learn" ... Rust does have a significant learning curve. However, so does C++, and the C++ learning curve never ends: http://whereswalden.com/2017/02/27/a-pitfall-in-c-low-level-... https://bugs.chromium.org/p/chromium/issues/detail?id=683729... I've been programming in C++ for over 20 years, plus I have a PhD in programming language tech, yet there are many dark corners of the language I don't understand, and more keep getting added all the time. "Complexity budget" is not a phrase you hear in the C++ community.

I suspect many C++ fans aren't bothered about this because their knowledge has grown with the language. I pity someone trying to "learn C++" in its full glory.

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#169

The Rust ecosystem has lost sight of the forest for the trees in my opinion. I highly agree with Graydon's opinion in "Rust is mostly safety" [1] that it's raison d'être is memory safety and concurrency in the systems space. But strangely a significant amount of time is being put in to making it usable for other tasks. I think this has to do with the different cultures between C/C++ developers versus other developers…

Web developers have zero issues with using Rust for web development though. The Rocket web framework is rather intuitive. I even built my website entirely in Rust with it. http://mmstick.tk

Maybe it's nostalgia for pre-Web 2.0 designs but I love your website; it has character and feels personal compared to most pages I peruse.

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#170
I think it's important to consider the implications if Rust doesn't become a mainstream programming language.

I'm not shy about my dislike of Rust. I like C, I don't think avoiding buffer overflows and memory errors is that hard, and I chafe at the idea of a language I dislike aesthetically taking over systems programming.

But even I have to admit the arguments for using C instead of Rust are niche. Sure there's probably always going to be some instance where C makes sense technically, but if we could wave a wand and convert the world's C/C++ code to Rust, we'd immediately fix millions of memory errors and data races. It's impossible to overstate that benefit.

Think of the things the Rust team has to deal with:

"Is Rust a good web language?"

Is C or C++? Is Ocaml?

"Is Rust a good language for an OS?"

Is Python? Is JavaScript?

"Is Rust too big?"

Is C# or Java? Rust is a pretty small language, both in terms of features and implementation size.

"Is Rust powerful enough?"

Is Go? Go deals with this all the time ("Go ignores decades of PL research"). Rust's feature set is pretty good, but more importantly it's well thought out.

"Is Rust fast enough?"

Is Java? Is C#? Is Go?

"Does Rust compile fast enough?"

Does C++? Does Clojure?

"Will your Rust program be memory safe and free of data races?"

It sure will be. This is a monumental achievement. Your options for a memory-safe language without GC are... Rust and Ada?

"Does Rust have a good concurrency/parallelism story?"

Rust has one of the best, actually. It doesn't use segmented stacks so it doesn't achieve the M:N performance of Go, but it has memory and data race safety, OS threads, and futures, so no problem.

"Is Rust too hard?"

Honestly, programming is hard, other languages just let you ignore it. There's an example about manipulating a string as a global array in this thread somewhere, which is not really something you should do, and the argument was "this was wildly difficult". It is, yeah, because safely managing concurrent access to a global, bounded section of memory is wildly difficult.

Again, I'm not a Rust fan and I sort of can't believe I'm writing this. But look at what Rust has:

- memory and data race safety

- scripting language ergonomics (after you internalize the borrow checker)

- the speed and memory usage of C

- a low surface area

- advanced features

- great community outreach and documentation

- familiar structure (as opposed to something like Erlang or Haskell)

If a language like that doesn't succeed, you have to start wondering what will.

My personal belief is that it is succeeding, but I think success looks a lot different than most expect: new projects that need a systems language are far more likely to be written in Rust than in C/C++.

Post reply on HN