Live data from Hacker News

Announcing Rust 1.12.1

blog.rust-lang.org

21–30 of 30 posts

Re: Announcing Rust 1.12.1

#21
The two imaginary futures I daydream about where performance is a concern are robotics and serious AI algorithms (RL especially). I'd assumed I'd need serious C (or C++) chops for the embedded development of the first, and real access to GPU parallelism for the second.

Does anybody have experiences to share using Rust like this?

Re: Announcing Rust 1.12.1

#22
post #18

Earlier quoted context omitted.

Rust is a replacement for C++. It is meant to be a modern, general-purpose systems language, where "systems" generally means anywhere you need to be close to the metal. This includes areas like embedded systems and high performance computing. Modern means it has features and tooling you expect from languages in 2016. For example, on a language level, Rust has type inference, sum types, pattern matching, proper generi…

If you think Rust is ready for high performance computing, I suspect you don't do HPC for a living and you haven't tried to do it with Rust. It's not just missing the needed libraries.

What else is missing?

Re: Announcing Rust 1.12.1

#23
post #18

Earlier quoted context omitted.

Rust is a replacement for C++. It is meant to be a modern, general-purpose systems language, where "systems" generally means anywhere you need to be close to the metal. This includes areas like embedded systems and high performance computing. Modern means it has features and tooling you expect from languages in 2016. For example, on a language level, Rust has type inference, sum types, pattern matching, proper generi…

If you think Rust is ready for high performance computing, I suspect you don't do HPC for a living and you haven't tried to do it with Rust. It's not just missing the needed libraries.

I think it works as a C replacement in HPC. Maybe not a C++ replacement (mostly because of missing integer generics).

Re: Announcing Rust 1.12.1

#24
post #13

Earlier quoted context omitted.

Rust is a replacement for C++. It is meant to be a modern, general-purpose systems language, where "systems" generally means anywhere you need to be close to the metal. This includes areas like embedded systems and high performance computing. Modern means it has features and tooling you expect from languages in 2016. For example, on a language level, Rust has type inference, sum types, pattern matching, proper generi…

Yes, what wcrichton said. Additionally, I have a suggestion. One of the deciding factors for me to fall in love with Rust was my habitual use of metaphor to distance my personal feelings from the issue at hand to reach an impartial decision. In this case, I suggest you replace "libraries" which may hold emotional significance for you with another concept of similar enough nature. Bias may also come from misperception…

[deleted]

Re: Announcing Rust 1.12.1

#25
post #3

Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?

It's difficult to answer this question with 'one main reason'. Rust is what you get if you build a language that is intended to operate in the same space as C and C++, but benefits from the last 30 years of advances in programming languages.

Some things that are better as a result of things that are hard to do right in C++:

* Compiler monitors ownership of memory

* Compiler monitors ownership across threads

* Generics aren't handled as templates, and you can explicitly describe support using things like * trait bounds

* Macros are useful but need to operate on something more like the AST rather than text tokens

* A richer type system can help you express much more in the types (Rust enums)

Re: Announcing Rust 1.12.1

#26
post #3

Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?

Rust is basically a safe C++, written by people who like functional languages. Also, it has an official package manager in Cargo, something that C++ lacks completely.

As such, it targets essentially the same niche as C/C++.

Re: Announcing Rust 1.12.1

#27
post #8

Earlier quoted context omitted.

I wrote a Donald Trump text to speech server in Rust. It's blazingly fast. If I'd written it in Python, it'd have taken seconds to generate audio. If I'd written it in C++, it'd likely have memleaked or segfaulted since I'm not skilled or patient enough to write safe C++. Rust is pretty much the coolest thing ever in my opinion. It's easy and fun to write. Cargo is the best package manager ever, and makes importing l…

Have you tried with Go?

I'm honestly not a very big fan of Go. We use it at work and it just isn't something I want to come home and write. Different strokes, I guess.

I'm sure that Go would have performance characteristics closer to Rust than Python would, but I'm almost certain Rust would still edge out Go.

I'm getting to the point where I'm almost as productive in Rust as I would be in either other language, and that makes Rust a no-brainer for me.

Re: Announcing Rust 1.12.1

#28
post #17

Earlier quoted context omitted.

For higher level stuff Erlang/Elixir is a much better option. Productivity will be way higher. For lower level stuff Rust is a better option. Better productivity, equal performance, much higher safety. Unless you have specific needs that require Java/C of course.

I see, thank you! The reason for java was mostly because I had prior albeit small experience, and the way the job market looks.

Java probably still has a long future ahead, especially because Android app dev is done in Java. There are also lots of jobs around.

On the other hand, a lot of Java jobs involve stuff like enterprise Java, which can be horrible to work with.

C is probably good to know, so I'd play around with it for a few weeks and then move on to Rust. Knowing C probably lets you appreciate Rust even more.

Java is also good to know and not hard to get into. But for hobby projects I'd choose something else, unless you want to do Android apps.

Edit: Python is also a great all-round high level language and there are many Python jobs around :)

Re: Announcing Rust 1.12.1

#29
post #21

The two imaginary futures I daydream about where performance is a concern are robotics and serious AI algorithms (RL especially). I'd assumed I'd need serious C (or C++) chops for the embedded development of the first, and real access to GPU parallelism for the second. Does anybody have experiences to share using Rust like this?

No direct experience here, but I know there is Vulkano[1], a Rust library that wraps around the Vulkan API. But until (and if) a SPIR-V target is available to the Rust compiler, the compute shaders will still have to be programmed in another language (typically, GLSL). This covers the GPU side of your interest.

I don’t know how things stand in the embedded Rust camp, however.

[1] https://github.com/tomaka/vulkano

Re: Announcing Rust 1.12.1

#30
post #8

Earlier quoted context omitted.

I wrote a Donald Trump text to speech server in Rust. It's blazingly fast. If I'd written it in Python, it'd have taken seconds to generate audio. If I'd written it in C++, it'd likely have memleaked or segfaulted since I'm not skilled or patient enough to write safe C++. Rust is pretty much the coolest thing ever in my opinion. It's easy and fun to write. Cargo is the best package manager ever, and makes importing l…

Have you tried with Go?

I'd like to respond by this and saying I'm porting a largeish codebase over to Rust for one purpose: I can embed it other languages, and I can into it from any language that exposes an FFI.

The goal is to move all business logic out of javascript on an nwjs desktop/crosswalk mobile app and move it to Rust. The interface would still be javascript, but the core logic (and crypto) would live in Rust. This gives me a portable core I can move between platforms, and in theory all that has to change is the UI (but not really, because in most cases the platforms run Javascript).

I don't think Go can be as easily embedded (because of its runtime) but perhaps I'm wrong.

Post reply on HN