1351
13
1352
6

I've tried to run the example under "Configuring the Parser" and get some errors. What could be my problem?

Errors

  • error: cannot find derive macro Parser in this scope
  • error: cannot find attribute command in this scope
  • error: cannot find attribute arg in this scope
  • error[E0599]: no function or associated item named parse found for struct Cli in the current scope

Cargo.toml

[package]
name = "hello_cargo"
version = "0.1.0"
edition = "2021"

[dependencies]
clap = "4.3.5"
1353
48

I work for a company mostly using Java, but I choose to rewrite a preformance critical part of the system in Rust. Before this rewrite I had only written some smaller thing in Rust, so i was familiar with the language, but not very experienced. When I did the re-write I expected the performance increase, I was also impressed by the concurrency and the safety around that. It is of course still possible to deadlock, but most other issues around concurrency just goes away. I found that rust really lives up to the credo "fearless concurrency". However, all of these things were expected.

One of the things I had a hard time adjusting to was all this Error handling that was required, and getting used to the ? operator, learning to use the thiserror crate. I initially thought that this was the weak point of Rust. After a while I learned to use it and realized that it was quite the opposite. When I learned how to do the error handling, I suddenly found that the result is that there are no surprise errors left in production.

The unexpected benefit I saw was that the logfiles have shrunk with a factor 100 from Java to Rust. In java there are so many things that might go wrong in so many ways, that you need to log the internal state all over the place to be able to understand why something blew up. In the rust version, I get a clean and handled error in my log stating exactly what went wrong. Being forced to handle errors, combined with great mechanisms to do it, is a under appreciated side of Rust.

What is your most surprising benefit of using Rust?

1354
9

A short but interesting background to Linen, a slack alternative written with Tauri/Rust, with some thoughts about the experience of using Tauri.

1355
8

orz is an optimized ROLZ (reduced offset Lempel-Ziv) general purpose data compressor. input data is encoded as ROLZ-matches (reduced-offsets and match lengths), 2-byte words, and single bytes. then all encoded symbols are processed with a symbol ranking (aka Move-to-Front) transformer and a static huffman coder.

1356
3

Powered by Rust, the video codec stack on ARCVM is now bringing faster and more reliable video decoding on ChromeOS. Here's how Collabora has been helping shape video virtualization for Chromebooks, and what it means for end users.

1357
8
1358
4
1359
17
1360
8

Cargo comes with quite a lot of nifty things pre-packaged, like fmt, clippy and so on. But there are a lot of addons out there, and it is a bit hard to discover these, so I thought it would be interesting to hear what everybody is using. The things I have installed is:

  • cargo-outdated - Find outdated dependencies
  • cargo-udeps - Find unused dependencies
  • cargo-flamegraph - Performance analysis
  • cargo-about - I use it to list licenses

Of these, it is cargo-outdated I use frequently. So, what is your cargo addon you cannot live without.

1361
11

Hi guys, I'm a soydev trying to learn rust. It's hard, especially with the references, ownership, the compiler goes crazy every time and I just throw all the references, dereference until it stops. I'm not used to it coming from JS. Do you have some resource, tips to improve on this? Thank you very much. Side note: what is your first project in rust? And what are some interesting open-source rust projects, you go to learn from/ contribute to?

1362
18
submitted 3 years ago* (last edited 3 years ago) by snaggen@programming.dev to c/rust@programming.dev

The full list of changes is found in this mail thread https://lore.kernel.org/lkml/20230618161558.1051269-1-ojeda@kernel.org/T/#u

1363
8
Rust Analyzer Changelog #186 (rust-analyzer.github.io)
1364
5

Interesting to see read about the optimization work done, and why the safe version is slower.

1365
4

Plebbit will hopefully become the Free Software, distributed replacement for Reddit.

There is already a demo which is semi-functioning and a whitepaper.

It might be early days, but the clone should be able to compile to wasm, ios and android. This will eventually help in building clients for ios and android that use native components instead of webview. It will also help creating bindings for other languages like python, etc.

1366
14
submitted 3 years ago* (last edited 3 years ago) by django@social.coop to c/rust@programming.dev

Any rust devs on here looking for a place to contribute?

#Lemmy currently only supports OAuth 2.0 Password grant type, which is legacy since you have to trust the app with your login credentials

Seems like a pretty important adoption barrier
https://github.com/LemmyNet/lemmy/issues/1368

@rust #rust

1367
10
1368
3

Looks like Bogdan, the creator behind the Let's Get Rusty YouTube channel, is starting a developer bootcamp. I was just watched his recent video where he promoted it today, and figured I share it here:

1369
3
submitted 3 years ago* (last edited 3 years ago) by snaggen@programming.dev to c/rust@programming.dev
1370
8

Rust lets you do efficient reference-counted strings and dynamic arrays using Arc basically just as easily as their owning (and deep-cloning) equivalents, String and Vec respectively. So why not use them as a reasonable default, until you actually need the mutability that String and Vec provide? Get into the weeds with me here, feat. some cool visualizations, with special guest appearance from Box.

This video assumes some familiarity with Rust and its core smart pointer types, namely Vec/String/Rc/Arc/Box, along with data structures like HashMap and BTreeMap, and traits like Clone, Hash, Ord, and serde::{Serialize, Deserialize}.

serde feature flag for Rc/Arc
Arc docs
Vec docs
Smart pointers in Rust • Crust of Rust
animations

1371
8
submitted 3 years ago by njaard@lemmy.world to c/rust@programming.dev
1372
6

Since last fall, Neven has been doing an internship to develop a new aliasing model for Rust: Tree Borrows. Hang on a second, I hear you say – doesn’t Rust already have an aliasing model? Isn’t there this “Stacked Borrows” that Ralf keeps talking about? Indeed there is, but Stacked Borrows is just one proposal for a possible aliasing model....

1373
3

I stumbled across this open source video stabilization tool and noticed it was written in Rust.

1374
2

Introduction to Rust by Stefan Baumgartner

1375
17
submitted 3 years ago* (last edited 3 years ago) by snaggen@programming.dev to c/rust@programming.dev
view more: ‹ prev next ›

Rust

8252 readers
30 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 3 years ago
MODERATORS