Rust

7539 readers
43 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 2 years ago
MODERATORS
1
 
 

cross-posted from: https://programming.dev/post/41939535

Hello everyone, i recently published a post about this app launcher (https://programming.dev/post/41551778) and i released version 0.2.0

Many useful features have been added, such as a configuration file and custom themes, and performance has improved

RAM consumption has increased slightly (~5 MB, now ram usage is ~40 MB, but it's still a minor issue)

Here are some highlights of the app launcher:

 Starts up in about ~0.1-0.2s

 Written using the Iced GUI framework

 Supports navigation using arrows

Project GitHub: https://github.com/dest-lab/stryde

Catppuccin Themes GitHub: https://github.com/mxghj/catppuccin-stryde

Feedback and suggestions are welcome

2
3
4
5
6
7
 
 

Alex Gaynor recently announced he is formally stepping down as one of the maintainers of the Rust for Linux kernel code with the removal patch now queued for merging in Linux 6.19.

Alex Gaynor was one of the original developers to experiment with Rust code for Linux kernel modules. He's drifted away from Rust Linux kernel development for a while due to lack of time and is now formally stepping down as a listed co-maintainer of the Rust code. After Wedson Almeida Filho stepped down last year as a Rust co-maintainer, this now leaves Rust For Linux project leader Miguel Ojeda as the sole official maintainer of the code while there are several Rust code reviewers.

8
 
 

I've been experimenting a bit with Rust and seeing what I can get to work and what I can't.

I've been able to mostly recreate the Django workflow using these programs: actix web, tera, and butane.

Butane seems to be the least mature out of all of them, and has also given me the most trouble. That said, it's still the closest thing that I can find to Django's ORM.

I'm just letting you guys know in case you're interested and want to try it out.

9
10
11
12
 
 

The Wild linker is a very speedy linker written in the Rust programming language that has become quite competitive with the likes of Mold. A patch sent out this weekend adds Wild support for use with the GNU Compiler Collection (GCC).

The patch adds support for GCC for using the Wild linker with the compiler's "--with-ld" option for specifying the linker. This patch for Wild has been successfully tested with the "vast majority" of tests passing.

13
14
 
 

cross-posted from: https://programming.dev/post/40815478

Introducing YT-Feeds.

I was looking for an ultra lightweight YouTube client that would allow me to avoid the algorithm, clickbait thumbnails, and AI generated comment sections. After months of work, and getting side tracked many times, YT-Feeds was born. It can be found on GitHub, but is available on the AUR, and can be installed with binstall, github releases, or via cargo directly.

It is built in Rust with no graphical framework. It functions entirely on key binds and the design philosophy is to have only one page to view at any time.

Features List:

  • Fast startup and navigation
  • Uses minimal resources (under 1 Mb RAM!)
  • Distraction and short form content free
  • Allows for searching/subscribing/unsubscribing channels
  • Automatically tracks and resumes watch history locally
  • Shows recent videos from subscriptions organized by date
  • Groups subscriptions into a collective "feed" organized by date
  • Categorize and view videos in the 'watch later' menu
  • Never requires leaving the terminal or using your mouse
  • Cross platform support for ARM and x86_64 Windows, MacOS, and Linux

Note: I expect there to be bugs in the future - feel free to submit an issue and I will get to it when I can find the time.

15
 
 

For example, is there any problems with doing this?

fn main() {  
	static mut BUF: [u8; 0x400] = [0; 0x400];  
	let buf = &mut unsafe { BUF };  
}  

and is this code the same as just using an array directly? From my understanding local variables get put on the stack but do the static variables do too?

I'm essentially trying to find the most performant way to get a simple read/write buffer.

16
 
 

cross-posted from: https://programming.dev/post/40764432

AWS Lambda adds support for Rust - AWS

17
18
 
 

A minimal, declarative setup for productive Rust hacking on Emacs + Guix

I noticed there was a blatant lack of resources and documentation on this particular setup. So I rolled up my sleeves and wrote this article, which hopefully you find useful.

https://jointhefreeworld.org/blog/articles/rust/simple-guix-emacs-rust-development-environment/index.html

See image here of my Emacs with rust-analyzer and clippy working: https://ibb.co/whxq8dX1

19
 
 

We adopted Rust for its security and are seeing a 1000x reduction in memory safety vulnerability density compared to Android’s C and C++ code. But the biggest surprise was Rust's impact on software delivery. With Rust changes having a 4x lower rollback rate and spending 25% less time in code review, the safer path is now also the faster one.

(Emphasis in original.)

Of course, we should probably take the numbers with a grain of salt here; it's not a controlled scientific experiment, and the estimated vulnerability density for Rust in particular was calculated with a numerator of 1, so it could be way off.

Still, I think it's a good reminder that advocacy for using Rust over C and C++ isn't purely out of some irrational fanboy-ism for the language. The numbers here would have to be extremely off for there not to be a major effect.

Further down in the article:

This near-miss inevitably raises the question: "If Rust can have memory safety vulnerabilities, then what’s the point?"

The point is that the density is drastically lower. So much lower that it represents a major shift in security posture. Based on our near-miss, we can make a conservative estimate. With roughly 5 million lines of Rust in the Android platform and one potential memory safety vulnerability found (and fixed pre-release), our estimated vulnerability density for Rust is 0.2 vuln per 1 million lines (MLOC).

Our historical data for C and C++ shows a density of closer to 1,000 memory safety vulnerabilities per MLOC. Our Rust code is currently tracking at a density orders of magnitude lower: a more than 1000x reduction.

20
21
 
 

More on Maras blog (2 years old post) and on reddit.

22
23
24
 
 
25
view more: next ›