51
23
52
20

Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?

53
26
submitted 1 month ago* (last edited 1 month ago) by amanda@aggregatet.org to c/rust@programming.dev

Is there a good general-ish purpose scripting language (something like Lua on the smaller end or Python on the bigger) that’s implemented in only Rust, ideally with a relatively low number of dependencies?

Have you used it yourself, if so for what and what was your experience?

Bonus points if it’s reasonably fast (ideally JITed, though I’m not sure if that’s been done at all in Rust).

54
21
submitted 1 month ago by fil@programming.dev to c/rust@programming.dev

I've needed to detect a frequency of an audio signal a couple of times in my life, but I cannot for the love of me remember what does the FFT output actually mean. So I took this knowledge out of my latest project and packed it up in this crate.

Also this is my first potentially useful published crate, so if I missed anything, please let me know!

55
22
submitted 1 month ago by Sibbo@sopuli.xyz to c/rust@programming.dev
56
99
 name                                            diff %  speedup 
 slice::sort_large_random                       -65.49%   x 2.90 
 slice::sort_large_strings                      -37.75%   x 1.61 
 slice::sort_medium_random                      -47.89%   x 1.92 
 slice::sort_small_random                        11.11%   x 0.90 
 slice::sort_unstable_large_random              -47.57%   x 1.91 
 slice::sort_unstable_large_strings             -25.19%   x 1.34 
 slice::sort_unstable_medium_random             -22.15%   x 1.28 
 slice::sort_unstable_small_random              -15.79%   x 1.19
57
15
submitted 1 month ago by mawkler@lemmy.ml to c/rust@programming.dev

Hi! I've created a CLI tool for downloading Rust web books (like The Rust Programming Language) as EPUB, so that you can easily read them on your e-book reader. The tool is heavily based on this gist and a lot of proompting.

Check it out here: https://github.com/mawkler/rust-book-to-epub

58
21
submitted 2 months ago by fzz@programming.dev to c/rust@programming.dev

That was a hard long adventure, massive refactoring with bug-fixing 🥵

59
18
Rust Analyzer Changelog #238 (rust-analyzer.github.io)
60
11

I went to look into the activitypub federation package from Rust and noticed that it does not support JSON-LD. This took me to a search into other libraries, which got me to RDF-based crates. Just thought it was a good idea to share.

61
15

Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?

62
28
submitted 2 months ago* (last edited 2 months ago) by silva@sopuli.xyz to c/rust@programming.dev

Hey,

Is there any way to create a macro that allows a Some<T> or T as input?

It's for creating a Span struct that I'm using:

struct Span {
    line: usize,
    column: usize,
    file_path: Option<String>,
}

...and I have the following macro:

macro_rules! span {
    ($line:expr, $column:expr) => {
        Span {
            line: $line,
            column: $column
            file_path: None,
        }
    };

    ($line:expr, $column:expr, $file_path: expr) => {
        Span {
            line: $line,
            column: $column
            file_path: Some($file_path.to_string()),
        }
    };
}

...which allows me to do this:

let foo = span!(1, 1);
let bar = span!(1, 1, "file.txt");

However, sometimes I don't want to pass in the file path directly but through a variable that is Option. To do this, I always have to match the variable:

let file_path = Some("file.txt");

let foo = match file_path {
    Some(file_path) => span!(1, 1, file_path),
    None => span!(1, 1),
}

Is there a way which allows me to directly use span!(1, 1, file_path) where file_path could be "file.txt", Some("file.txt") or None?

Thanks in advance!

63
78
Announcing Rust 1.79.0 (blog.rust-lang.org)
64
34
65
49
submitted 2 months ago by thomask to c/rust@programming.dev
66
14
rust-analyzer changelog #237 (rust-analyzer.github.io)
submitted 2 months ago by kia@lemmy.ca to c/rust@programming.dev
67
19
submitted 2 months ago by sabreW4K3@lazysoci.al to c/rust@programming.dev

Morning all!

Okay, let me start out by saying that I know absolutely sweet F.A. about Rust. There's simply something I'm trying to get working and it's required me to make a few changes. And with every change, it's getting closer to building successfully… or so I hope.

Anyway, I'm here to bother you for a reason, not just to waffle. I was wondering if someone could be kind enough to explain this rust toolchain malarkey?

When I started trying to "fix" this thing (it's a dockerfile), I updated it to build from the latest and greatest rust and then updated to the latest and… I digress, point being it's failing some cargo stuff and I have reason to believe it's because of the rust toolchain which is set as nightly-2022-07-19 now, I thought I could just set that to stable, but upon reading some docs, I need to set the date. I was just wondering if someone could explain why? Why can't I just have the toolchain set to latest? It seems complicated for nothing.

68
46
The borrow checker within (smallcultfollowing.com)
69
21
70
24
Rust Analyzer Changelog #235 (rust-analyzer.github.io)
71
37
72
16

Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?

73
29
74
64
submitted 2 months ago by kato@programming.dev to c/rust@programming.dev

This is my first try at anything open source so any feedback is welcome :)

75
17
Rust Analyzer Changelog #234 (rust-analyzer.github.io)
view more: ‹ prev next ›

Rust

5590 readers
64 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 1 year ago
MODERATORS