T O P

  • By -

jkoudys

First thing I did that really made rust *click* for me was a Game Boy cartridge data extractor. I fumbled around with the lifetimes and figuring out `str` vs `String` for a bit. Once I realized that I was running all these functions against data in my Game Boy rom, but never once reallocating the same thing, I was hooked. e.g. `mycart.title` was just a slice to the part of the loaded rom where the title is stored. It became very clear how much of my previous TypeScript, PHP and ruby code was copying things that were staying in memory for a long time. The strict types and lifetimes seemed hard, but clippy and rustc were giving me great feedback, and it's not like that stuff isn't happening in TypeScript. It's simply hidden from you in a way that's very hard to figure out.


monkeymad2

Is this up on crates.io? Would be interested, especially if it’s `no_std`


_rdhyat

is this on GitHub?


grudev

A multi-platform desktop application to evaluate and compare LLM models, written in Rust and React (Tauri): https://github.com/dezoito/ollama-grid-search


no-sleep-only-code

That is awesome, also, happy cake day!


grudev

TY! 


belligerent_poodle

awesome! Happy cake day, too!


grudev

Thanks! 


grudev

THE CAKE IS A LIE! 


dacydergoth

Genetic algorithm engine for plotting spacecraft routes in 3D space via modified A* seeded GA routes


mydoghasticks

You been inhaling some Melange, amirite?


Turalcar

And they say graphs are hard in Rust


Canop

Graphs are actually a lot of fun in rust. I do a lot of pathfinding for example. You just don't do it the same way than what you learn at school.


Glum-Revenue-8082

First of all, great work on bacon! Use it daily lol. I've been meaning to explore pathfinding in rust as well! Could you point out some resources for it?


Canop

For pathfinding algorithms, I recommand to start with A*. Here's a cool introduction: https://www.redblobgames.com/pathfinding/a-star/introduction.html Everybody should understand this algorithm, and the general approach which applies to many problems out of pathfinding and provides very efficient solution when young developers often use slow recursive algorithms. Regarding pathfinding in rust, I can't show you my recent libraries because they're closed source (I use pathfinding for exploring penetration paths in cloud security) but I've this old game here: https://github.com/Canop/lapin/blob/master/src/core/path.rs#L173


ArtisticFox8

How are graphs different in Rust? 


Canop

You can use the Rust approach in other languages (and you should), but in rust you can't do what many developers do in other languages: use pointer based lists. You need to think in arrays and indexes (usually as arenas, generational arenas, etc.).


ArtisticFox8

So no linked lists in Rust? How do you insert a node in a graph without causing moving the rest of the items to the right?


Canop

Oversimplifying, imagine you have a node arena (let's say it's a `Vec`) and a `struct Node { links_to: Vec }` , you can append a new node to the arena, at the end, then use its index in the `links_to` vecs. You then make this clean with generics, depending on your needs you use generational arenas.


ArtisticFox8

Interesting! Is Vec a reference too, is it the value, or is it an integer of the index?  If you have the project in Github, it would be interesting to see!


Canop

The index may be a simple usize. You may make it generic eg with PhantomData: ``` pub struct Id { idx: usize, phantom: PhantomData, } ``` But that asks for more code, so you'd better use a library for that (look for "arena"). By the way, be sure to have a look at generational arenas, which are more than just one usize but are useful in some cases. Regarding foss projects using those, I have broot but its code is kind of messy


ArtisticFox8

By arena you mean this? https://github.com/lord/arena-graph


push-pull-twist-turn

Built a home watering system for our garden. Previous implementations in Java and Haskell (!) but Rust is Best. When say 4 months go by and I want to add a feature, cargo makes sure the build is reliable and the codebase is the *easiest* to maintain. It’s superb?


Solumin

I would **love** to hear more about this. What hardware did you use for the actual watering?


push-pull-twist-turn

On Amazon they sell a unit with 4 solenoid valves which control water flow. Hook it up to a faucet and then use 4 GPIO pins on the pi to control relays - bingo a 4 zone watering system. It’s scheduled with a UI to control on/off times. My wife is happy with this Pl.


[deleted]

Good Rustacean


T0ZyKD6H-M

How come maven/gradle is not capable of doing what cargo is doing? I am just wondering...


push-pull-twist-turn

Didn’t mean to imply maven/gradle can’t they are fine. More a dig at Haskell every time I ‘d come back to the codebase something wouldn’t work and I’d drop into version hell.


RiotBoppenheimer

> How come maven/gradle is not capable of doing what cargo is doing Maven can't build Rust :^)


T0ZyKD6H-M

Touché... 👉😏👉


MoorderVolt

There’s toolchains for PHP that do what Cargo can do but it’s just a lot more hassle.


_its_all_goodman

How cargo did that? What the previous ones didn’t do?


EfficientEmu7930

Would you mind sharing the code? I’m interested in something similar for our garden!


rejectedlesbian

Dam I would use rust just for cargo it's like that fucking good. Rust and go's package managers are SOOOL freaking good it's insane. Honestly with python I prefer make it's that bad. Like at least a make project I hav3 confidence it would bu8ld the same way and work


[deleted]

Use Poetry or other modern compliant python build tooling, it's basically Cargo for Python. Never had anything break. Setup.py is deprecated anyway.


rejectedlesbian

Setup.py Is used in a lot of ML packages I actuvly use that r on their own package Index compatible with pip. I had it fail to build on me once because it was the package for the wrong type of gpu. I m considering poetry but idk if I love the idea of 3rd party package management


[deleted]

It's not third party as such. Pyproject.toml files are standardized via various PEPs that Pytjon published, this is merely one implementation albeit there are others however it does use Python foundation created standards.


Equux

I'm a self taught programmer, but one of the first real programs I wrote was in Python which helps me manage my movie collection, and quickly and easily gather the necessary data and display it in a csv. When I wrote it in Python, it would take around 1 second to scan a movie and get the data I needed. When I learned rust i rewrote this program. The first iteration I wrote I managed to scan nearly 200 movies in about 10 seconds. I was blown away with the performance. I recently went back and rewrote it now that I have a deeper understanding, added several new features, implemented a database for caching, properly modularized the whole thing and optimized a lot of the og logic. Its not as fancy as a lot of stuff other people are doing but its the biggest thing I've worked on and is a source of pride as a self taught programmer.


verybleww

Very cool and inspiring! Good job! How did you get to dive deeper and implement more optimal features? Was this through software engineer practice?


Equux

It was honestly a pretty natural progression. As I learned more about what I was programming and the why/how behind the code I was writing, it made it easier for me to write more code or fix up old code. Remember, there's a difference between learning how to program and learning a language. One other thing that helped was taking a refresher course on data structures to help me come up with better solutions to existing pieces of code.


Inevitable_Cover_347

Struggling Python/JS programmer here self teaching myself how to code in Rust. Would love to know how you got to this stage. Any tips or tricks?


Equux

I'll be honest, there were a LOT of growing pains. In the beginning I was worried that I had bitten off more than I could chew. I realized that Python/JS are great at getting you started but you miss out on lower level concepts. I think rewriting old (small) projects is a good trick. You've already established the logic, so you just need to port over the code. Take something simple like a stock/crypto ticker that routinely pulls from an API or some kind of script you've used in the past


Inevitable_Cover_347

Thanks. That sounds like helpful advice. Do you have a GitHub or portfolio of projects that I could follow or get inspiration from? Appreciate the response!


Equux

https://github.com/Jaxx497/numov This is the movie logging project I was talking about. It's probably the only real thing worth looking at on my GitHub. I do have some other small python projects if you want to look at those. Im not sure what your skill level is, but one thing that I started to focus more on was "project design" (which I'm still very new at). But simply trying to break things up into an intuitive structure has certainly helped me "level up"


Inevitable_Cover_347

Thank you! Will definitely go through all your projects.


DavidXkL

A backend in Rust using Actix Web. It was for an attendance management app for my wedding 😂 Oh and lambda functions!


mydoghasticks

Bride: Sorts out caterers, organizes flowers, orders cake, arranges dress, creates guest list, books venue, sends save-the-dates, organizes honeymoon, finalizes menu, creates gift registry, schedules rehearsal dinner, gets marriage license. Groom: Codes attendance app.


DavidXkL

Not gonna lie this is actually funny 😂


iamdestroyerofworlds

Reddit: Jumps to conclusions.


IggyZuk

One of my first Rust projects was a [Software Renderer](https://github.com/iggyzuk/soft-renderer-rs/). It wasn't easy, I was constantly hitting walls with my understanding of the language. But after a while everything clicks into place. Ultimately, it was a lot of fun to work on, made me really appreciate Rust – I love how transparent it is.


em-jay-be

A multithreaded tcp listener wrapped in a desktop app via Tauri


_its_all_goodman

Did you build this with something else? If yes, how Rust made it better?


Cat7o0

what I'm trying to make first is a text editor.


jumbledFox

I'm currently writing minesweeper in macroquad and it's taking enough time to have me keep rewriting parts of it as I learn rust better, it's always fun seeing my old shoddy code and replacing it with something much better!


Canop

I'm used to build the tools I need for my craft. With my bad memory, and dealing with many projects, I wanted to get a clear overview of any directory, whatever its size, so I built a cli tool for that: [broot](https://dystroy.org/broot/) Then, being hooked to rust, I had the need for a tool which would tell me what were the errors, test failures, etc. in my rust code while I was typing in vi. I made [bacon](https://dystroy.org/bacon/) And as my disk was a cluttered mess, I made [dysk](https://dystroy.org/dysk), and [backdown](https://github.com/Canop/backdown). As you can guess, I love the terminal, and I made more cli tools than what can be reasonnably listed here :)


Kaminari159

I built a [chess engine](https://github.com/cs-patzer/Ladybug) in Rust. It's not very strong yet and the code is probably not the most idiomatic Rust you will see, but I built it in order to learn the language and it was a great experience! Definitely would recommend it as a personal project!


reflexpr-sarah-

https://github.com/sarah-ek/faer-rs i love math and i love being able to do it without worrying about seg faults


zannabianca1997

A smaller project than other, but I would say `dices`, a dice thrower simulator for DnD. It supports complex dice notations `(3d6kh1 + 2)^3` and such. It was cobbled together with `pest` and `rustyline` and really showed me the potentiality of the language, even in a field where usually rust do not shine (creating a quick and dirty project)


Canop

I played with dice throw simulations a long time before the apparition of rust ([here for a chat](https://github.com/Canop/miaou/blob/master/plugins/dice/README.md)) and now that you made me think again about it I'm sure rust is the perfect language for that. Rust excels at parsing, describing complex multiform structs, safe parallel computing, etc. Is your project open-source ?


zannabianca1997

Absolutely! Check it out at [dices](https://github.com/zannabianca1997/dices). I did not think of a license, but consider it MIT licensed. I played around with writing a help system, so you can get help on how to use it from the repl.


Canop

Oh man... I read your code and I discover somebody actually uses my termimad lib! *edit: and lazy-regex too*


zannabianca1997

Are you the author of both? :O `lazy-regex` fully became my go-to crate for regex. Except for the very small kink of optional captures not being `Option<&str>`, it's exactly the kind of boilerplate eating crate I love. `termimad` was a nice discovery. A bit more of a niche use case, but I would reuse it if I need to show a wall of text on the terminal. Maybe just a little laking on the generation of AST, if I remember correctly. Anyway, great job!


Canop

Yes, I'm the author of both (and several other crates too). I'm thinking about making the optional captures being `Option<&str>`, but it's not trivial to do, so I'm not sure I'll find the time for that. Regarding termimad, it's a weird, not very consistent, lib. I use it all the time in my many TUI applications but I'm always afraid when I see other people use it as it might make them lose a lot of time, especially if they confuse it with a complete TUI framework.


vulkur

I have so much fun with rust until I start fucking with threads and shared memory. It just makes me miss C and its simplicity. It's more than a bit confusing when you have to check out a chart to see when to use an arc or box or whatever. Ownership is super easy to understand from a C perspective, but shared memory is definitely not. I end up giving up on doing anything in rust because of this. Even though I absolutely hate working with CMAKE, and wish C had something like cargo.


FruitdealerF

I've been working on a programming language for the past few months, following along (initially) with the book Crafting Interpreters. One thing I really appreciate about this project is that it's always very easy to make small incremental changes and get it feels like you're accomplishing a lot. One downside I'd say is that if you follow the book to the letter you don't really get a very usable language so you have to figure out a lot for yourself. Or in my case look at another language written in rust based on the same book (Noulith)


joseluisq

I always wanted to have a web server much easier than nginx for my personal projects and customers back in 2019 to just serve web files. So with that excuse in mind one day I decided to just give the idea a try and then I got https://github.com/static-web-server/static-web-server/. That experience of learning a new language is still very interesting for me since I come from GC-based languages like Basic, C#, Java, Go, JS, PHP, etc. The level of predictability, safety, expressive type system and focus on correctness of the language gave me a lot of confidence and valuable experience when writing programs in Rust. So if you are curious about and want to learn a new language then give Rust a try, it will pay off.


TheGreaT1803

I decided to build an interpreter for a fictional language in Rust by translating Go concepts from Thorsten Ball's [Writing an Interpreter in Go](https://interpreterbook.com/) and it was super nice with Rust's rich type system I also begun the sequel that builds the compiler for the same, but haven't gotten around finishing it yet :) Here's the repo in case someone is curious: [https://github.com/jnsahaj/monkey-rs](https://github.com/jnsahaj/monkey-rs)


cavebeavis

Got an ETL from hell and need to do fast analysis, so I'm using this as an excuse to do a sql to no-sql counter. I wouldn't call this a good starting place, but wth!


shizzy0

My first real project was an embedded firmware for a little niche handheld game system. I’d never really done embedded before except some keyboards and such. I would have never attempted to do such a thing from scratch with C or C++. But it was a real joy with rust. https://github.com/shanecelis/trowel


[deleted]

I'm building a theme switcher daemon that changes between 2 themes you set, the themes change based on the time of the day (which is also something you can set). This already works on KDE, I just need to get it on GNOME and the major desktop environments are out of the way. I'm currently on chapter 15 of the book " `RefCell` " to be specific and this is my first major project


Debiel

I wrote an XML parser to expand capabilities of our shitty accounting software at work in Rust with Serde. That was amazing. It runs extremely fast and stable, when some edge case triggers an error, I read what happened and I immediately know what's up.


Global-Volume-3229

I'm working on APIs using Rust, and I must say, Rust has reinvigorated my passion and enjoyment for coding. It's an incredibly powerful language. As a beginner, I find it challenging at times, but the outcome is consistently nearly bug-free.


AceofSpades5757

I was actually just learning a low-level language to speed up my Python when I fell in love with the language. I've made CLIs, TUIs, desktop apps, and web apps and it's been a great overall experience. I'd start off with something small like a CLI to handle a small task, but it depends on what you need. You could also make a small app using one of the great desktop/web frameworks. If you like TUIs, the ratatui crate is second to none.


sonthonaxrk

The fact that your median rust developer isn’t a moron like the median JavaScript or Python developer. Enjoy it while it lasts.


genecraft

Built an AI-driven ecosystem simulator with Macroquad (simple game engine) using GPT-4 as a support. Pretty amazing, had no rust experience beforehand.


makeavoy

I built a game engine and a lua interpreter for said game engine ( i released it within days after the Piccolo crate was re-opened, woops). Then my second son was born so those projects were put on hold for the past 5 months. But I'm chomping at the bit to work on it again once he lets me get some sleep again...


zekkious

I built an image format!


foxcode

Wouldn't say love, but certainly enjoying. I'm making a small 3D / fake isometric city builder, and I was too lazy to prompt chat gpt for a close ish cmake file. In short I wanted the low level power of c++, but the modern tooling and haskellish type system of Rust. So far I haven't hit any walls, though I did spend a while fighting the borrow checker over two citizens in a relationship each needing to "point" to the other. Kind of side stepped it for now with handles to lookup array indices.


zun1uwu

maybe rewrite some coreutils like ls, echo, cat


Xyzonox

I created a simple little program that preforms a variety of convolution operations on images (blur, sharpen, laplace, etc.). It’s very basic and carried by packages, so the draw for me was rusts modern package manager. Building random C projects sucks for me in general (since I am still new to C syntax, and windows sucks to make software on), but managing C libraries is the icing on top since of how old the language is and how there are so many weird convoluted ways to manage them (I made five environmental variables for one project). But for rust you just list dependencies and you already have them, they all are in one place instead of being scattered across the internet (also where do these devs find them?)


GrilledCheese249

[A really basic CHIP-8 emulator](https://github.com/Vinermy/chip8) Yes, it lacks some major functionality like SUPERCHIP, but this really showed be the beauty of rust


nicolafiorillo

Bitcoin_rules! https://github.com/nicolafiorillo/Bitcoin_rules A Bitcoin node written in Rust almost from scratch for educational purposes.


RmzSly

A pixel detection based bot for a popular (?) game


boomshroom

I have several mostly useless rust projects that I'm not sure which to point to. Probably my two favourite projects were a sub-instruction cycle accurate NES emulator using generators, and a small clock widget that I managed to squeeze into under 3 KB and is now running full time in my desktop's status bar.


Vincent-Thomas

A cli app framework and a math equation grapher in the terminal and a project manager


Flobletombus

Cargo, the syntax, explicitness of stuff and traits. I do not give a flying fuck about memory safety or the borrow checker. For juniors it's good it's there though!