News for hackers. Stuff that matters.
Re:First Impressions of the Rust Programming Language by Animats on Saturday June 09, 2018 @04:15AM (#17272071)
Not too helpful. Just comments from a new programmer.

I'd like to hear something like "This is how our team used Rust to do (really hard thing involving heavy concurrency and lots of state)". From someone not involved with the development of Rust.

I was recently looking at a large, non web related C++ program which needs to be made multi-thread to increase capacity. I realized that if it was in Rust, it would be much easier to break out functionality into another thread. You need to classify data as immutable, locked, or unshared to make the program multi-thread. Rust has language support for that. C++ does not.

Re:First Impressions of the Rust Programming Language by nevi-me on Saturday June 09, 2018 @06:23AM (#17272338)
It might not qualify as "really hard thing involving heavy concurrency and lots of state", but I'm nearly done writing a service that interacts with http://tile38.com. I initially wrote it in Kotlin, and 2 weeks ago I ported it to Rust.

I'm still learning the language, so I haven't touched the "fearless concurrency" stuff, but so far it's looking very good.

~30% CPU time, 1-5% RAM use at peak; compared to the JVM.

I plan on writing about it, and open-sourcing the code (both Kotlin and Rust repos). Chasing a hectic work deadline at the moment.

Re:First Impressions of the Rust Programming Language by jblindsay on Saturday June 09, 2018 @07:46AM (#17272556)
Over the past year, I've been porting my GIS project over to Rust (https://github.com/jblindsay/whitebox-tools). I'm sitting at over 100k lines of Rust code now. My experience with the language has been very good and, in particular, its concurrency support is extremely productive and aligns well with the spatial algorithms that I work with. The one thing that I wish for, however, is a better GUI story.
Re:First Impressions of the Rust Programming Language by dman on Saturday June 09, 2018 @10:09AM (#17273090)
I am surprised there has not been a Qt like project spring up that is written in Rust.
Re:First Impressions of the Rust Programming Language by rapsey on Saturday June 09, 2018 @11:24AM (#17273461)
Right now https://github.com/maps4print/azul is looking the most promising.
Re:First Impressions of the Rust Programming Language by jblindsay on Saturday June 09, 2018 @11:29AM (#17273486)
I'll look into this. Thanks for bringing it to my attention.
Re:First Impressions of the Rust Programming Language by fcantournet on Saturday June 09, 2018 @10:37AM (#17273240)
This is a really massive undertaking, and the UI space is really crowded and moving in all sorts of directions. It's not that it would be without value, but it's really risky and a lot of work, so not very surprising.
Re:First Impressions of the Rust Programming Language by Retra on Sunday June 10, 2018 @05:34PM (#17280268)
There are a couple. But people don't just want any old GUI, they want a GUI that is marketed toward them and stamped with official approval.
Re:First Impressions of the Rust Programming Language by MrBuddyCasino on Saturday June 09, 2018 @02:54PM (#17274435)
I‘m not sure its needed anymore. WASM in the browser could be both efficient and be the new UI paradigm - why pay the cost of mapping to OS widgets?
Re:First Impressions of the Rust Programming Language by dman on Saturday June 09, 2018 @03:03PM (#17274469)
I would imagine people looking at UIs for a systems programming language would want a lighter abstraction than pulling in an entire browser (for things like embedded).
Re:First Impressions of the Rust Programming Language by MrBuddyCasino on Monday June 11, 2018 @01:33AM (#17282052)
On the other Hand, you wouldn’t need a UI abstraction layer on embedded, because those things don’t have standard controls and code is often platform specific, not portable.
Re:First Impressions of the Rust Programming Language by Retra on Sunday June 10, 2018 @05:34PM (#17280272)
Gross.
Re:First Impressions of the Rust Programming Language by jblindsay on Saturday June 09, 2018 @10:33AM (#17273221)
Yes, I'm kind of surprised by this too, but I guess that the whole industry has been moving away from desktop applications for quite some time.
Re:First Impressions of the Rust Programming Language by bchjam on Saturday June 09, 2018 @11:12AM (#17273392)
Figma's Rust in production post was pretty good https://blog.figma.com/rust-in-production-at-figma-e10a0ec31...
Re:First Impressions of the Rust Programming Language by ekidd on Saturday June 09, 2018 @05:44AM (#17272250)
> I'd like to hear something like "This is how our team used Rust to do (really hard thing involving heavy concurrency and lots of state)".

Our team uses Rust for moderately complex concurrency.

TL;dr: There are tradeoffs, but Rust can be quite nice when you care about performance.

In my experience, concurrency is actually pleasant in Rust. The borrow checker eliminates 99% of problems before they ever occur. As for libraries, the popular crossbeam library provides scoped thread pools, which make it easy to spin up a bunch of local worker threads. https://docs.rs/crossbeam/0.3.2/crossbeam/struct.Scope.html#... For "parallel iterators", Rayon is excellent. https://github.com/rayon-rs/rayon For async I/O, the tokio library still demands solid Rust skills (at least until Rust 2018 lands), but once you figure it out, it Just Works. https://tokio.rs/

As for our other experiences using Rust:

- Rust is amazing for fast, cross-platform CLI tools.

- For most kinds of programs, I barely notice the borrow checker any more. But this is partly because I don't write programs with giant webs of objects that all try to mutate each other (like some game engines, for example). Also, I've never needed to implement a non-hierarchical data structure in Rust (the gory details of which are described at http://cglab.ca/~abeinges/blah/too-many-lists/book/), mostly because anything I needed was already on crates.io.

- Library support is much better than I would expect for a young language, but I do occasionally find myself overhauling the guts of an AMQP library or something. This costs me maybe a week or two per year?

Flavor-wise, Rust feels like a simpler C++ without the sharp edges or footguns. It has much better package-management tools. Safe Rust code doesn't have data races or buffer overflows. If you fuzz Rust code, the worst that will normally happen is a controlled panic caused by an invalid array index.

But Rust is going to be more challenging to somebody who has never thought about stack allocation versus heap allocation, or who has never written "my_list.map(some_function)". And sometimes the type names can get a bit hairy, if somebody uses too many parameterized types.

But overall, I'm really enjoying Rust at work. It's basically the language I spent the entire 90s desperately wanting, back when performance was always a big deal.

Re:First Impressions of the Rust Programming Language by oconnor663 on Monday June 11, 2018 @11:24AM (#17285026)
> And sometimes the type names can get a bit hairy, if somebody uses too many parameterized types.

`impl Trait` just landed in stable! I think the most interesting use cases (putting an impl Trait in a struct) aren't stable yet? But the basics are working great.

Re:First Impressions of the Rust Programming Language by nazka on Saturday June 09, 2018 @04:24AM (#17272093)
Yes I agree. From what I remember from a feedback of +1 year of Rust, Rust makes a whole point at treating panic and errors that C++ or other languages don’t do. It goes to a lot more length than what we have our there.

Maybe you will find you want here if you didn’t know this website already.

https://hn.algolia.com/?query=rust&sort=byPopularity&prefix&...

Re:First Impressions of the Rust Programming Language by jcelerier on Saturday June 09, 2018 @08:10AM (#17272631)
A simple pattern I follow for C++ concurrency is to have each thread run an event loop and use https://github.com/cameron314/concurrentqueue as `concurrentqueue<std::function<void()>` for execution of code in the other thread ; I don't remember getting threading problems by doing like this as long as any shared resource either outlives both threads or is in a shared_ptr of sorts.
Re:First Impressions of the Rust Programming Language by mcguire on Saturday June 09, 2018 @10:09AM (#17273091)
Can I interest you in some Pony?

https://www.ponylang.org/

Re:First Impressions of the Rust Programming Language by mpartel on Saturday June 09, 2018 @11:35AM (#17273511)
I found "The list of reference capabilities" at https://tutorial.ponylang.org/capabilities/reference-capabil... especially interesting to compare with Rust's borrow checker.
Re:First Impressions of the Rust Programming Language by 0xmaverick on Monday June 11, 2018 @04:06AM (#17282611)