News for hackers. Stuff that matters.
Re:Rust Cryptography Should Be Written in Rust by max_ on Saturday August 26, 2023 @02:11PM (#37275325)
So far the only solid use case for Rust that I have seen in applications where security is extremely important.

Not wonder it is becoming the de-facto language for building applications in the blockchain space.

Does anyone else use Rust outside the blockchain/cryptography space? What are you working on?

Re:Rust Cryptography Should Be Written in Rust by potatochup on Saturday August 26, 2023 @02:36PM (#37275599)
At my $BIGCORP, we have a multi-mode (discrete/continuous) simulation engine written in Rust. It has to be extremely fast, and interface with both firmware written in C, and scripts written in Python. C++ was the only other viable option, but none of us were confident writing safe and performant C++, so we picked rust instead.

Now that I've been using rust for ~5 years, I reach for rust for when I have to do almost anything else. I write small backend services in rust[1], and small utilities that would previously have been python scripts[2]. The only thing I still use any other language for is python for writing test scripts + interactive data exploration, and typescript for front end stuff. We still use a lot of C for firmware because the Rust target support isn't as good as C yet.

[1] you might argue that Go might be better suited for this, but I disagree. The lack of null safety and less strict typing would come back to bite me a lot. A typical backend service we write is 10x simpler than our simulation engine so 1) compile times are approx the same as the project is small and 2) we usually don't care that much about performance for these services so we can just clone or RC away any problems we might have with the borrow checker. Swift might be a nice, but the ecosystem isn't there for backend apps last time I looked.

[2] Total LoC for small scripts ends up being about the same for python/rust in my experience. Development time is approx the same, but I much prefer maintaining small rust apps when I come back to it after 6 months. You _can_ set up safe and maintainable python projects with external libraries for validation, but its too much effort when rust has it all out of the box. Also, python deployment/venv management is still immensely frustrating

Re:Rust Cryptography Should Be Written in Rust by SeanAnderson on Saturday August 26, 2023 @02:38PM (#37275615)
I'm building a 2D simulation game compiled to WASM using Bevy!

It's nicer writing in Rust than JS, no GC makes Rust a good WASM candidate, theoretically the performance can be better if you're careful, people take 2D game engines more seriously in lower level languages, and it keeps the door open for shipping on Steam later.

I've found it much slower to develop in, though. Compilation times are an issue and after working in JS for decades I realize how big the JS ecosystem is compared to something like Rust.

I doubt the decision was a good choice overall in terms of trying to ship an MVP, but it might still pay dividends for a finished product, if the game gets there, due to having a higher cap on performance

Re:Rust Cryptography Should Be Written in Rust by andrew_shay on Saturday August 26, 2023 @02:16PM (#37275392)
I use it for a desktop file transfer app [0]. I chose Rust because my primary language is Python and I just wanted to learn something new and really different for this project. Go would have been easier, but Rust just feels bullet proof. It's so strict. If it compiles, it works! It's been a very interesting journey.

[0] https://github.com/transmitic/transmitic

Re:Rust Cryptography Should Be Written in Rust by jasonjmcghee on Saturday August 26, 2023 @02:24PM (#37275474)
It's become rather popular in the graphics (e.g. https://wgpu.rs/) and game dev (e.g. https://bevyengine.org/ ) spaces.

It's pretty popular for AWS Lambda functions.

Pretty popular for terminal / shell applications.

Definitely a great way to write wasm for compute or graphics intensive browser/web apps.

Re:Rust Cryptography Should Be Written in Rust by heavyset_go on Saturday August 26, 2023 @02:34PM (#37275580)
> Does anyone else use Rust outside the blockchain/cryptography space?

Cross-platform desktop app development, systems programming and authorization which is still cryptography related, I guess.

Re:Rust Cryptography Should Be Written in Rust by IshKebab on Saturday August 26, 2023 @02:41PM (#37275647)
Rust is just a nice general purpose language. It's good more or less everywhere.

There are a few places where I wouldn't recommend it - for beginners, when compile time is really important (e.g. as a scripting engine in games), or where you need a repl (science).

But otherwise it's a better choice than most languages for most tasks.

Re:Rust Cryptography Should Be Written in Rust by bigfish24 on Saturday August 26, 2023 @02:30PM (#37275547)
All of our core code is Rust and even in web backend and k8s tooling at http://www.ditto.live

Been a great choice even with trade offs like needing to train some hires and compilation speeds.

Re:Rust Cryptography Should Be Written in Rust by throwawa14223 on Saturday August 26, 2023 @02:28PM (#37275520)
I use it for one off stuff I used to use Ruby for at the hobby level. The learning curve was high but it is very easy to reason about correctness.
Re:Rust Cryptography Should Be Written in Rust by tines on Saturday August 26, 2023 @02:15PM (#37275370)
> So far the only solid use case for Rust that I have seen in applications where security is extremely important.

Playing devil's advocate, when is security not extremely important, except maybe in throwaway bash script-type applications?

Re:Rust Cryptography Should Be Written in Rust by ronsor on Saturday August 26, 2023 @02:23PM (#37275457)
* Toy one-off scripts, not even shell scripts necessarily

* Small things for one's personal use or local network use only

* Quickly prototyped experiments, as long as they're not used in production

Re:Rust Cryptography Should Be Written in Rust by cshimmin on Saturday August 26, 2023 @02:27PM (#37275512)
* academic/scientific research
Re:Rust Cryptography Should Be Written in Rust by TillE on Saturday August 26, 2023 @04:05PM (#37276364)
Games. The attack surface for third-party input is very limited, and you can just secure those bits rather than adopting a new language for the entire program.

Like, you need to be able to sandbox mods if they're a thing, and Rust's memory safety only handles a tiny part of that.

Re:Rust Cryptography Should Be Written in Rust by ZiiS on Saturday August 26, 2023 @04:55PM (#37276828)
Single player games maybe, cheating in multiplayer games can be big business.
Re:Rust Cryptography Should Be Written in Rust by tines on Saturday August 26, 2023 @06:34PM (#37277505)
Multiplayer games have huge attack surfaces.
Re:Rust Cryptography Should Be Written in Rust by adwn on Saturday August 26, 2023 @02:38PM (#37275617)
For our client, we've developed a desktop application in Rust – with a thin GUI frontend in C++/Qt – to filter, process, and visualize sensor data streams (3D point cloud data from a Lidar). Each data stream was about 400-500 Mbit/s in 55k UDP packets per second, with support for at least 4 simultaneous streams. The focus was on high performance and development speed, security didn't matter at all.

We chose Rust for its unique position in the performance/productivity tradeoff space, and didn't regret it even for a second. There's no way we could have pulled this off with C++ in the same time, especially the bug-free parallelization.

Re:Rust Cryptography Should Be Written in Rust by jenadine on Saturday August 26, 2023 @02:46PM (#37275692)
Why use C++ for the front-end though?
Re:Rust Cryptography Should Be Written in Rust by adwn on Saturday August 26, 2023 @03:24PM (#37276006)
We selected Qt as a cross-platform solution. The C++/Rust interface is the clunkiest and ugliest part of the application, and rather complex because some state is shared between several windows in the GUI and several threads in the backend, and any component might modify that state at any time, and updates have to be transmitted to the other components without introducing inconsistencies. However, using cxx [1] helped a little.

The project began in 2020, and I'm not sure what I'd choose as a GUI framework today – definitely not Qt Widgets, though.

[1] https://cxx.rs/

Re:Rust Cryptography Should Be Written in Rust by agsgs on Wednesday August 30, 2023 @02:02PM (#37326241)
Have you considered this: https://pub.dev/packages/rust_in_flutter ? It really provides smooth connection between these two
Re:Rust Cryptography Should Be Written in Rust by riku_iki on Saturday August 26, 2023 @02:15PM (#37275374)
there are some data processing projects, www.pola.rs for example
Re:Rust Cryptography Should Be Written in Rust by umanwizard on Saturday August 26, 2023 @02:45PM (#37275691)
> Does anyone else use Rust outside the blockchain/cryptography space? What are you working on?

I work at Materialize which is building database software in Rust. One of my coworkers blogged about our experience with the language here: https://materialize.com/blog/our-experience-with-rust/

Re:Rust Cryptography Should Be Written in Rust by gochi on Saturday August 26, 2023 @02:46PM (#37275698)
Defect language in the blockchain space is still JS/TS. Not sure you should be relying on their signals for security assurances.
Re:Rust Cryptography Should Be Written in Rust by max_ on Saturday August 26, 2023 @03:02PM (#37275844)
I am talking about building nodes that execute the underlying consensus protocols. Not the front end client side applications.
Re:Rust Cryptography Should Be Written in Rust by olix0r on Saturday August 26, 2023 @02:54PM (#37275770)
Linkerd's sidecar proxy (https://github.com/linkerd/linkerd2-proxy) is implemented in Rust. It implements transparent mTLS, HTTP load balancing, telemetry, etc. Rust gives us safety and security with a minimal resource footprint.
Re:Rust Cryptography Should Be Written in Rust by junon on Saturday August 26, 2023 @03:08PM (#37275894)
Yes, in fact I see hardly any cryptocurrency stuff with rust.

I'm building an OS in rust, and write most firmware with rust too.

Re:Rust Cryptography Should Be Written in Rust by rvz on Saturday August 26, 2023 @03:48PM (#37276195)
> Yes, in fact I see hardly any cryptocurrency stuff with rust.

Really?

Solana [0] a top 10 market cap cryptocurrency is written in Rust and so is its smart contracts.

NEAR Protocol is another [1] one as well as Sui [2] and Polkadot [3] written and using Rust.

[0] https://github.com/solana-labs/solana

[1] https://github.com/near/nearcore

[2] https://github.com/MystenLabs/sui

[3] https://github.com/paritytech/polkadot-sdk

Re:Rust Cryptography Should Be Written in Rust by junon on Saturday August 26, 2023 @04:01PM (#37276323)
I didn't say it didn't exist. I said I don't personally ever see any cryptocurrency stuff in my Rust experience aside from coming across a few crates here or there related to it.
Re:Rust Cryptography Should Be Written in Rust by petesergeant on Saturday August 26, 2023 @04:04PM (#37276352)
As an outsider with some good feelings towards Rust and some negative one towards crypto, almost all Rust jobs I’ve seen have been in crypto
Re:Rust Cryptography Should Be Written in Rust by junon on Saturday August 26, 2023 @04:19PM (#37276500)
That's a fair point, my experience as well. I think I was mostly talking about the code I see on e.g. GitHub.
Re:Rust Cryptography Should Be Written in Rust by brigadier132 on Saturday August 26, 2023 @03:45PM (#37276168)
Im using it for a highly multithreaded real time web app. Also i disagree with your assessment, i think rust can really be used for everything.

For the business im building the frontend is written in js but everything on the backend is rust. i needed one highly multithreaded realtime server and rust was the right choice for that. For everything else (api, file server) I decided to just use rust too, maintaining a node backend and a rust backend and having to deal with typescript build systems when i could just use rust for everything made my life easier.

What ive found is that open source authors interested in releasing libraries in python and nodejs choose to write it once in rust then release python and js libraries using rust ffi.

See polars, yrs, rapierjs, lancedb, candle, etc.

Re:Rust Cryptography Should Be Written in Rust by bsder on Saturday August 26, 2023 @06:15PM (#37277387)
> So far the only solid use case for Rust that I have seen in applications where security is extremely important.

But that's basically anything that touches the internet.

Not having buffer overflow vulnerabilities in your communications code is huge.

Re:Rust Cryptography Should Be Written in Rust by xedrac on Sunday August 27, 2023 @12:58AM (#37279542)
I've used Rust for years in embedded Linux devices and more recently in signal processing.
Re:Rust Cryptography Should Be Written in Rust by pjmlp on Sunday August 27, 2023 @02:20AM (#37279915)
Only hobby coding, leetcode stuff and such.

Work is all about Java, .NET, Web and mobile OSes, Rust hardly brings anything to the table there, other than less capable tooling, higher attrition with existing ecosystem and complexity in designing borrow checker friendly algorithms versus automatic memory management.