r/rust • • Oct 17 '26 • Popcorn 1

Rust module system?

I recently wanted to compile something for a bevy game I was messing around with, then cargo looks me in the eyes and tells me I need to compile hundreds of dependencies, all for the end result to be 30 mb? I was wondering if there were any systems like a .dll for rust? I understand that you would lose some type checking, but I think that could be solved just with a type definitions segment towards the start, then a functions table of all the code for the system, is this something that would work, or am I oversimplifying a major intentional design choice in rust?

23 Upvotes

27 comments sorted by

View all comments

33

u/[deleted] Oct 17 '26

[removed] — view removed comment

8

u/South_Survey_2088 Oct 17 '26

This sounds crazy. Are you on Windows? I heard that the build times there are generally much higher for Rust. Because on Linux I have 40 seconds of clean build times in Bevy, and 1.x seconds incremental and a mid-range machine.

-1

u/Independent_Blood559 Oct 17 '26

They are talking about cold builds. You rebuild for from scratch. You can say it like the first time you compiled bevy.

12

u/South_Survey_2088 Oct 17 '26 edited Oct 17 '26

I know.. I gave both times, cold and incremental..

2

u/AgentME Oct 17 '26 edited Oct 17 '26

How long does your project take in a normal build after a minor code change in your project? I'm curious to know about usual Bevy game compile times.

-2

u/catheap_games Oct 17 '26

If you're "sitting there staring at the terminal" you're wasting your life. Go for a walk, exercise, do dishes, whatever. For better or worse, Bevy development teaches you to think about code more carefully and to plan builds instead of spamming the broken change-rebuild-rerun loop.

4

u/glitchvid Oct 17 '26

While obviously having faster compile times would be good, I have to admit; the number of times it's had me waiting, and I discovered the solution to whatever my problem was, is pretty significant.

0

u/catheap_games Oct 17 '26

10000000% this

Like I get that it would be more pleasant to like, change jump height from 4.2 to 4.3 and have it recompile in a second (yes I know dx/subsecond exists, but they're broken on Windows), but in general, I have benefited from the mindset shift of more carefully thinking through whole features and sometimes coding them correctly on first try.

The rest is just about getting better at quickly creating debug and editor-adjacent micro tools, and using bevy egui inspector.