1
16

However, there are some important features that WinSock just doesn’t expose. […]

Rust’s current async ecosystem is built atop a particularly cursed concept. It’s an unstable, undocumented Windows feature. It’s the lynchpin of not only the Rust ecosystem, but the JavaScript one as well. It’s controversial. It’s efficient. […] Without it, it’s unlikely that the async ecosystem would exist in its current form. It’s called \Device\Afd, and I’m tired of no one talking about it.

2
35

So I've been writing an allocator. A difficult task and in Rust it is currently a dream to write.

The patterns I'm on about are small quick scopes to get a mutable reference and store or read data.

pub fn some_func(&mut self, s: &[u8]) {
    // Mutable borrow 1 and write
    {
        let writable = &mut self.buf[..8];

        writable[..8].copy_from_slice();
    }

    // Mutable borrow 2 and write
    {
        let writable = &mut self.buf[8..16];

        writable[8..16].copy_from_slice();
    }

    // And so on . . .
}

No other language feels like this. No other language is so precise on reads and writes always taking a length or the length can be obtained from the type (such as a slice).

Writing to different parts of a buffer and selecting parts of like this feels amazing. For writing an allocator i can just make array's and then write any bytes to them and just read them back and cast them about.

So much better than just using raw pointers, and safer as sizes are usually know with slices.

Anyway i just love Rust and this was an excuse to share my love of Rust <3

3
13
4
10
5
8
submitted 3 days ago by cm0002@lemmy.world to c/rust@programming.dev

Developer @tomtau@aussie.zone

https://pest.rs/book/examples/awk.html 🎉

I aimed to keep it in line with the "demonstration of the Rust ecosystem" goal, so it can also be a great introduction to Rust for beginners who are looking for a fun project to work on. It's not perfect, but that's part of the fun! It leaves room for potential language extensions (to make the AWK clone more complete) and optimizations up to the reader as a follow-up.

6
8
7
9
submitted 6 days ago by cm0002@lemmy.world to c/rust@programming.dev
8
21
9
32
Async Isn't Real & Cannot Hurt You (videos.abnormalbeings.space)
10
22
submitted 2 weeks ago by dessalines@lemmy.ml to c/rust@programming.dev
11
14
submitted 2 weeks ago by cm0002@lemmy.world to c/rust@programming.dev
12
33
13
10
14
15

An interesting article that lays out a problem and goes through a few different solutions, some of which I haven't thought about much before.

I'm working on a video game in Rust, and I'm running into this kind of modelling problem when it comes to keeping track of the game state. So far I've refactored something that resembles Approach 5 into something that looks more like Approach 3. As I get more confident about the final shape of the data, it (seemingly) becomes a better idea to represent it in a more structured way.

15
45
crates.io: development update (blog.rust-lang.org)
submitted 3 weeks ago by nemeski@mander.xyz to c/rust@programming.dev
16
11
This Week in Rust 607 (this-week-in-rust.org)
submitted 3 weeks ago by mrbn@lemmy.ca to c/rust@programming.dev
17
22
18
29
Stabilizing naked functions (blog.rust-lang.org)
19
18
submitted 4 weeks ago by cm0002@lemmy.world to c/rust@programming.dev
20
9
This Week in Rust 606 (this-week-in-rust.org)
submitted 1 month ago by cm0002@lemmy.world to c/rust@programming.dev
21
12
submitted 1 month ago by cm0002@lemmy.world to c/rust@programming.dev
22
11
This Week in Rust 605 (this-week-in-rust.org)
submitted 1 month ago by cm0002@lemmy.world to c/rust@programming.dev
23
27
submitted 1 month ago by cm0002@lemmy.world to c/rust@programming.dev
24
69
25
3
submitted 1 month ago* (last edited 1 month ago) by asyncthoughts@mastodon.social to c/rust@programming.dev

Just added some serious discipline to CharmGuard, an open-source focus assistant in @rust!
✨ Now blocks distracting apps during deep work using:
- sysinfo to monitor processes
- A YAML blocklist of "uh-oh" apps
- Instant reports when temptation strikes 👀
CLI-native, structured logs, GitHub CI, and... sass. Like a librarian judging your tabs ☕💻
📎 https://github.com/zosob/charmguard.git
❤️ to Hannah for the original spark!
#RustLang #OpenSource #DigitalMinimalism #Productivity #FocusApp #CLI

view more: next ›

Rust

7202 readers
41 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