Rust

8312 readers
26 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 3 years ago
MODERATORS
126
 
 

Is it possible to create hyprland ui components (like topbar, notification panel) using slint+rust? Has anyone tried this?

127
 
 

Tutorial Link

Continuing my Bevy + Rust tutorial series. By the end, your player can pick up items on the map while the camera smoothly tracks their movement.

Inventory System

Walk near a plant or mushroom and watch it disappear into your inventory. The game logs what you collected and keeps a running count.

  • Automatic pickup when you get close to items
  • Track multiple item types (herbs, flowers, mushrooms, wood)
  • See your total collection in console logs

Camera System

Zoom in 2× for a closer view of your character and world. The camera follows smoothly as you move.

  • Zoomed-in view that shows your character and world up close
  • Smooth camera motion that keeps the player centered

You'll also learn about Rust's borrow checker and its rules while having the usual fun.

128
129
 
 

Finally I can stay forever on lemmy even not opening the browser! 😂

Thinking of using it as a mod tool to see new posts in communities I moderate.

Sharing it early, maybe get some ideas on how to make it better.

Developer @tracyspcy@lemmy.ml

130
131
 
 

Tutorial Link

Continuing my Bevy + Rust tutorial series. In this chapter, your character finally interacts properly with the world, no more walking through trees or floating on top of water.

What you'll build:

  • Player collides with trees, rocks, and water.
  • Character walks behind objects, creating depth in your 2D world.
  • Loading screens and pause menus.
  • Debug feature to visualize the collision map
132
133
134
 
 

Tutorial Link

Continuing my Rust + Bevy tutorial series. This chapter demonstrates data-oriented design in Rust by refactoring hardcoded character logic into a flexible, data-driven system. We cover:

Deserializing character config from external RON files using Serde Building generic systems that operate on trait-bounded components Leveraging Rust's type system (HashMap, enums, closures) for runtime character switching The tutorial shows how separating data from behavior eliminates code duplication while maintaining type safety—a core Rust principle that scales as your project grows.

135
136
137
5
submitted 5 months ago* (last edited 5 months ago) by remustan37@sh.itjust.works to c/rust@programming.dev
 
 

Hi everyone I was thinking of creating a backend module that has functione for a note taking app (search, sort, etc). So anyone can implement a ui on top of it.

I have some basic understanding of rust (made a just-working chip-8 emulator). But I've never used SQL or other database.

Is this plausible? Is there a similar project that I can use as reference? What are the mistakes I should avoid?

138
139
140
141
 
 

I'm happy to announce the release of diesel-async 0.9. This release changes how diesel-async expects AsyncConnection::transaction calls to be written, moving from using a closure returning a boxed Future to using proper async closures.

Additionally, this release officially moves the GitHub repository from my personal space to the diesel-rs organization. As I'm one of the maintainers of Diesel, this is mostly a symbolic change.

Finally, this release fixes an unsound cast between a #[repr(C)] struct and the underlying memory as a byte slice. This cast could result in accessing the padding bytes in the struct. This vulnerability was discovered by Paolo Barbolini.

Checkout the full announcement post for more details.

I'm happy to answer questions about anything related to the release or Diesel in general.

142
 
 

It was a bit more quiet recently. I hope to add the libcore tests (compiled with rustc_codegen_gcc) in the CI of the Rust repo soon in order to prevent test failures from coming back at every sync: this will greatly help us to focus on feature development.

143
144
145
12
submitted 5 months ago* (last edited 5 months ago) by ISO@lemmy.zip to c/rust@programming.dev
 
 

I checked some of the issues out, and this looks legit. Although a good chuck relates to obscure platform abstractions.

146
 
 

Chapter 2 - Let There Be a World (Procedural Generation) This chapter teaches you procedural world generation using Wave Function Collapse and Bevy.

A layered terrain system where tiles snap together based on simple rules. You'll create landscapes with dirt, grass, water, and decorative props.

By the end, you'll understand how simple constraint rules generate natural-looking game worlds and how tweaking few parameters lead to a lot of variety.

It also gently touches on rust concepts like references, lifetimes, closures, generic and trait bound. (Hoping to go deep in further chapters)

147
148
 
 

A ~200 LOC Rust crate benchmarked against ten other languages — came out ahead of a monomorphized C++ lib by ~4× at sub-fanout dispatch. Hot loop is six instructions. Can you make it faster?

149
18
Rust Koans (users.rust-lang.org)
submitted 5 months ago by SorteKanin@feddit.dk to c/rust@programming.dev
150
view more: ‹ prev next ›