Rust Programming
!rust@lemmy.ml
help-circle
rss
Dedicated lemmy instance for rustaceans
pin
Hopefully, I'm not breaking any rules by posting this here! I thought that instead of every community being on the main lemmy.ml instance I'd host a different (dedicated) instance for refugee rustaceans to get a hang of the fediverse. It's listed on [join-lemmy/instances](https://join-lemmy.org/instances) and the link is [lemmyrs.org](https://lemmyrs.org), everyone is welcome!
fedilink

GitHub - Atreyagaurav/numrng: Terminal Command to generate list of numbers from human-readable representation
cross-posted from: https://lemmy.world/post/18129059 > This feels like it should already be a feature in a terminal. But I didn't find anything that let me do this efficiently. > > I had a rust library for converting list like `1-4,8-10` into vectors, but thought I'd expand it into a command line command as well, as it is really useful when I want to run batch commands in parallel using templates. > > I wanted to share it since it might be a useful simple command for many people.
fedilink

Hi all, mpv communities seem to be tiny in lemmy, so I'm sharing it here. This is a program I made for music control from local network. You can run it in a computer with some local media files, or youtube links or any other links yt-dlp supports. And then with the server, you can control the media player and the playlist from any devices in your local network. So that you can just show a QR code or something to house guests for parties, or have it bookmarked within family to control the music. I wanted to make something similar to how youtube app let's you play in TV and such, but my skills were not enough to do that. So I tried a simple alternative that works with computers. In an ideal world, I could make "Play with local mpv server" option come while on other android apps, but I have zero experience in android app development and it looks complicated. I know some other programs also give option to control media, but I wanted to give it a go with a simple implementation. Making the web-server was a tricky part. Only tutorial from the rust book was useful here as every other web server developement in rust seems to be async ones using libraries so I would have to make a complicated system to communicate with the mpv. Using the simple Tcp connection let me make a thread with mpv instance in the scope. I do need to support https and file uploads and other things, but I haven't had any luck finding a solution that works with simple Tcp connection like in the tutorial. Let me know if you know anything. Github: https://github.com/Atreyagaurav/local-mpv
fedilink

Jiff is a new date-time library for Rust that encourages you to jump into the pit of success
In which BurntSushi does date/time handling. [Reddit discussion](https://www.reddit.com/r/rust/comments/1e929gb/jiff_is_a_new_datetime_library_for_rust_that/), [HN discussion](https://news.ycombinator.com/item?id=41031037). > Before someone asks: > > - [Comparison with other Rust datetime crates](https://docs.rs/jiff/latest/jiff/_documentation/comparison/index.html) > - [Why build another datetime library?](https://docs.rs/jiff/latest/jiff/_documentation/design/index.html#why-build-another-datetime-library) > - [Why not contribute to an existing library instead of building a new one?](https://docs.rs/jiff/latest/jiff/_documentation/design/index.html#why-not-contribute-to-an-existing-library-instead-of-building-a-new-one)
fedilink

Anyone looking for a fun small rust project? Create a crate for cleaning urls, based on the ClearUrls project
This would entail: - Pulling in the [ClearUrls rules](https://github.com/ClearURLs/Rules) as a git submodule. - Reading / transforming the json there into Rust structs. - Creating a Rust crate that runs a `.clean(input_url) -> String` Lemmy issue: https://github.com/LemmyNet/lemmy/issues/4905
fedilink



[SOLVED] Is there a way to start and stop chromedriver/geckodriver with Rust and Selenium (thirtyfour) automatically like in Python?
So, apparently the chrome/geckodriver processes will terminate on their own if the user sends ctrl+c to the console. It will *not* terminate on its own if the program finishes running naturally. If you're interested in terminating it on your own, like I also was, here is how I went about it. ``` use std::process::{Child, Command}; fn main() { let mut s = Server::default(); s.start(); s.shutdown(); } struct Server { child: Option<Child> } impl Default for Server { fn default() -> Self { Self { child: None } } } impl Server { fn start(&mut self) { self.child = Some(Command::new("./chromedriver") .spawn() .expect("ls command failed to start")); } fn shutdown(&mut self) { input(None); // wait for input so you can observe the process self.child.as_mut().unwrap().kill(); self.child.as_mut().unwrap().wait(); println!("shutdown"); } } pub fn input(prompt: Option<String>) { let mut input = String::new(); match prompt { Some(prompt) => println!("{}", prompt), None => () } io::stdin().read_line(&mut input).expect("Failed to read input"); } ```
fedilink

This Month in Rust GameDev: May Edition Released + Call for Submissions for June
The May edition of "This Month in Rust GameDev" has [just landed!](https://gamedev.rs/news/051). With it, we also released a [statistical analysis](https://gamedev.rs/blog/survey-02/) of the survey we ran last month. Thank you very much to the 52 readers who gave us their feedback on how to improve the newsletter! You rock! This is also your call for submissions. Got a game you're tinkering on? A crate for fellow game devs? Do you want to share a tutorial you've made? Are you excited about a new feature in your favorite engine? Share it with us! You can add your news [to this month's WIP newsletter](https://github.com/rust-gamedev/rust-gamedev.github.io/edit/source/content/news/052/index.md) and mention [the current tracking issue in your PR](https://github.com/rust-gamedev/rust-gamedev.github.io/issues/1523) to get them included. We will then send out the newsletter at the start of next month. Happy coding ✨
fedilink

Stylelint alternative in rust?
I’m wondering if anyone knows knows of something like [stylelint](https://stylelint.io) written in rust? I’ve done some searching but can’t find it, but I feel like it must exist in some form. I’m switching over to [Biome](https://github.com/biomejs/biome) from eslint due to the massive speed improvements and I want to do the same with stylelint.
fedilink

Shoelace: Alternative frontend for Instagram's Threads
cross-posted from: https://slrpnk.net/post/9960845 > Hello Lemmy! Yesterday I released the first version of an alternative frontend for Threads: Shoelace. It allows for fetching posts and profiles from Threads without the need of any browser-side JavaScript. It's written in Rust, and powered by the spools library, which was co-developed between me and my girlfriend. Here's a quick preview: > > ![A screenshot of Shoelace's homepage, showing the logo on top, the title "Shoelace", the subtitle "an alternative frontend for Threads", an input bar with the tooltip "Jump to a profile...", and at the bottom three links: "hub", "donate", and "v0.1".](https://slrpnk.net/pictrs/image/017d0ceb-7c3f-453a-93bb-58e8549454df.webp) > > ![Mark Zuckerberg's profile on Shoelace, showing three posts: One showcasing columns on the official Threads frontend, another congratulating himself for 1.2M+ downloads in his company's new AI software, and the glimpse of a post related to the "metaverse"](https://slrpnk.net/pictrs/image/a4b4d14e-0213-4cac-ab0c-a5b6540bb6d5.webp) > ![Post by münecat on Shoelace, announcing the release of a video essay criticizing the field of evolutionary psychology](https://slrpnk.net/pictrs/image/b9335b5c-f796-4835-bdd8-258f65ce68d8.webp) > > The official public instance (at least for now) is located at https://shoelace.mint.lgbt/, if y'all wanna try it out. There's also instructions to deploy it inside the docs you can find in the README. Hope y'all enjoy it!
fedilink

rustc will use rust-lld by default on x86_64-unknown-linux-gnu on nightly to significantly reduce linking times.
fedilink




  • Alex
  • edit-2
    4M
Rusty Playdate - Toolset and API
I’m working on a big project in #Rust, there is toolset and API for #Playdate. All going great, moving to stabilization step by step, but I’m tired of looking at the dull 90⭐️. Seriously, could you please throw me into the trends of the github, please! ❤️‍🔥 [Project repository](https://a.koz.world/playdate), [mastodon](https://gamedev.social/@playdaters).
fedilink

This Month in Rust GameDev: April Edition Released + Call for Submissions for May
The April edition of "This Month in Rust GameDev" has [just landed!](https://gamedev.rs/news/050/). You may have noticed that this marks the first release since quite a while. To revive the newsletter, we made some [organisational changes](https://gamedev.rs/blog/newsletter-changes/). We want to continue improving the project, so we've put together a [survey](https://forms.gle/oeSb46twWsxRKYJe7) for you to tell us how the newsletter should evolve. We'd be happy if you filled it out and / or shared it with your fellow game devs 🙂 This is also your call for submissions for [May's edition!](https://github.com/rust-gamedev/rust-gamedev.github.io/issues/1505) Happy coding ✨
fedilink

Pop!_OS COSMIC Desktop is coming!
[Source code](https://github.com/pop-os/cosmic-epoch).
fedilink

Rust in Thunderbird
More here: [Rust crate for interacting with Exchange Web Services API](https://github.com/thunderbird/ews-rs), etc.
fedilink

Anybody wanna try a new static site generator?
I just released v0.1.0 of hinoki, my static site generator :)\ The `README.md` should explain usage, and you can also see how I ported my blog to it [here](https://github.com/jplatte/blog.turbo.fish/commit/c11e40699a59b178a84b829efe9e6556175d3ade). This project started because I'm not entirely happy with Zola, which does not support customizing page paths much (e.g. `/year/month/day/title/index.html` style paths) and made some other design decisions that I wanted to explore alternatives to. You can download the binary from GitHub releases, or `cargo install` it from git. Any feedback is appreciated, here or in the GitHub issues!
fedilink

Rust Programming
!rust@lemmy.ml
    • 0 users online
    • 2 users / day
    • 2 users / week
    • 2 users / month
    • 74 users / 6 months
    • 1 subscriber
    • 258 Posts
    • 707 Comments
    • Modlog
    Lemmy
    A community of privacy and FOSS enthusiasts, run by Lemmy’s developers

    What is Lemmy.ml

    Rules

    1. No bigotry - including racism, sexism, ableism, homophobia, transphobia, or xenophobia. Code of Conduct.
    2. Be respectful, especially when disagreeing. Everyone should feel welcome here.
    3. No porn.
    4. No Ads / Spamming.

    Feel free to ask questions over in: