Recently started introducing Rust in my team and here are my notes on some of the issues we have run into so far. We are primarily a Scala/JVM shop with a little bit of Python.<p>- `Error Handling` is a bit of a dumpster fire right now. Rust has something called a `Result` enum which is similar to `Either[Error,T]` monad in Scala however every single Rust crate I have used so far its creating its own `Error` enum which makes it really hard to compose `Result`. Ideally I would like to chain `Results` as `e1.and_then(e2).and_then(e3)` but its not possible due to incompatible error enums. Ended up using `<a href="https://docs.rs/crate/custom_error/1.3.0`" rel="nofollow">https://docs.rs/crate/custom_error/1.3.0`</a> to align the types.<p>- A lot of basic things are still influx and community wide standards have not been established. For example: I needed to externalize some environment specific settings in a Config but couldnt figure out where to put non-code assets in a cargo project and then how to reliable read them. In JVM world `src/main/resources` acts like a standard place for stuff like this but that patterns has not been established yet.<p>- Distributing code inside the company is hard because there is no integration with Artifactory or similar tools. We are directly referring git sha in Cargo right now and waiting for better solutions.<p>- Rust comes with a default unit test framework but it pretty bare bones. I havent seen examples of test fixture, setup/teardown support and loading test configs etc.<p>- I really like Rust compiler because of really good error messages it produces but its really slow and you start to notice it as you add more code/external crates<p>-IDE support is good but not great. I am using IntelliJ with Rust plugin as we use IntelliJ for Scala/JVM and it is nowhere as good as even Scala plugin which is pretty mediocre in itself.<p>Overall I am pretty happy with the language (except for Error issue) and most of my gripes are around the ecosystem and tooling around the language. Hopefully these will be resolved as language gains more momentum
What I would like to see is something where people could submit a small working program in one language and a Rust expert would make a program that does the same thing in idiomatic Rust. This doesn't need to be anything too complex. A wiki would be fine, the work would be in having volunteers to make the demos.<p>If you don't know the idioms you end up doing a sort of transliteration of the source language where the concepts may work against the nature of Rust. A developer can spend a long time barking up the wrong tree with few indicators as to which is the right tree.<p>As an example of what I mean. Here is a program that I wrote in JavaScript specifically because I could not find a way to write it in Rust that felt like I was doing it the right way.<p><a href="https://codepen.io/Lerc/pen/yQxmob?editors=0010" rel="nofollow">https://codepen.io/Lerc/pen/yQxmob?editors=0010</a><p>I could come up with Rust versions that were basically emulating pointers with array indexes(and a mess when something is deleted), or map versions that incurred lots of run-time lookup. The crux of the problem, I think is either how to do a mutable graph of mutable nodes, or how to do map on a immutable graph of immutable nodes to a new immutable graph of immutable nodes in the next state along.<p>I'm sure others have this issue of "I know how to do it in X, doing it that way in Rust is a mess, what's the right way?"
I continue to admire the Rust PR. This "everybody blog what Rust should do in 2019" generates a lot of publicity from my point of view.<p>Other language communities, take note.
One of my 2019 goals is to try and be more involved with Rust in some way or shape. Hoping to go to meetups or the like. Rust as a language is really special to me, and I'd love to be able to give more back.
>The embededded working group could probably use a page listing all the platforms<p>I haven’t looked into which micros are supported by Rust in actuality because I checked their main site and saw an old Nordic, a few old STMs, an old NXP, and some old MSPs, then left the page.<p>If I was a hobbiest this might be ok and I might research it more. As a professional, I pretty much noped out of there assuming that it’s just nowhere near ready for me.<p>I’d like to see it work! But until there is an IDE with debugging using code overlay and breakpoints... Rust is just not for me. I wonder what year they get there?<p>Edit: apparently there is a gap between what hobbiests consider acceptable and what my company would need that the Rust fans can’t imagine - this somehow means my opinion isn’t valid. Let me know when Keil or IAR or anyone sells a supported and professional IDE with a Rust compiler.