r/rust • • 2d ago

Laptop recommendations for rust programming

Folks, I’m wonder if a MacBook Air M5 with 16 GB RAM is enough for the workload. Do I need more RAM? What is the minimum SSD size?

Thanks

0 Upvotes

30 comments sorted by

14

u/KellysTribe 2d ago

probably enough ram (but more is always better). you will need a lot of drive space if you're working on many projects/worktrees

1

u/Gloomy-Lab4934 2d ago

Thanks. Is the fanless design ok? Not sure how much performance will be decreased if the task is heavy

7

u/fixedpointfae 2d ago

get fans

2

u/Stunning_Respect1219 2d ago

More RAM is never a bad call but 16GB will handle most things fine, the real killer is storage if you're juggling a bunch of target directories.

1

u/Amadex 2d ago

can use a lot of ram during compilation depending on options (LTO, codegen units, partition,...) also if they want to do multiple compilations in parallel, but for a hobbyist (I assume OP is looking for a personal device) it's probably not important and will not reach the codebase complexity and optimisations that would require more memory

1

u/Roeun-Zambrelyn 2d ago

incremental build artifacts dont get garbage collected automatically either, so a single repo can easily balloon to tens of gigs over a few months

4

u/Healthy-Zebra-9856 2d ago

If you work on many projects, your target folder tends to get huge. So whatever highest on RAM & SSD you can get, the better it is.

1

u/Gloomy-Lab4934 2d ago

Thanks. Is the fanless design decrease the performance a lot even I have 32GB RAM and 1TB SSD?

3

u/JamesGecko 2d ago

The MacBook Air will run at full speed until the CPU gets too hot. Then it will throttle your CPU speed. More RAM will let you compile larger projects, but no fan means large builds will take a lot longer.

Small personal projects don’t tend to need much RAM or have long compile times, though. It depends what you’re planning on doing.

1

u/Healthy-Zebra-9856 2d ago edited 2d ago

The other comment by JamesGecko is correct. However, I would add that, If you could, go for 2 TB then do it because when all said and done 1TB fills up fast.. Also I use laptop fans. For my MBPs I use https://www.amazon.com/dp/B0CDC3KBC1

5

u/monty-mar 2d ago

"enough for rust programming" is really very relative. I do a lot of my Rust dev in a pretty old thinkpad. It's more than enough for my smaller projects.

For my larger projects, like Bevy games and such, it's very slow to compile. Way too slow if you want to get stuff done in a reasonable amount of time.

7

u/git_oiwn 2d ago edited 2d ago

16Gb RAM is more or less enough. But Rust is very storage hungry, expect 70+Gb "target" size per non-toy project. I suggest to get 1Tb. Personally i have m4pro 24Gb/512Gb (only for work) and i'm already tight in space, need to be careful and "cargo clean" projects i'm not working on.

4

u/creativextent51 2d ago

Just clean once a week

1

u/nicoburns 2d ago

I sometimes clean multiple times a day if I'm compiling a lot!

1

u/creativextent51 2d ago

And you are getting 70 gig builds? Crazy

1

u/nicoburns 2d ago

Not for a single build (although something in the 10-20GB range is not unheard of), but you can get a lot of builds done in an hour... and say you're doing something like trying different profiles to optimise binary size, or different compiler versions to check MSRV, then each of those will take up separate space!

2

u/velocityvector2 2d ago

non-toy? macroquad's target folder is only 300MB

1

u/git_oiwn 2d ago

Only Polars artifact 700Mb straight. Leptos + Polars bring your target to 70GB easily. SurrealDB + something like dioxus / rmcp / axum - same story.

2

u/velocityvector2 2d ago

I don't understand why 1TB is necessary for 70GB? My MBP 2016 has 500GB of total disk space, which is more than enough. Plus, an external hard drive can be connected.

1

u/dragonnnnnnnnnn 2d ago

rust analyzer loves ram on heavy projects,if you at the same time have some docker stuff running, web browser open with a lot of pages it can strugle with 24GB RAM

1

u/Zde-G 2d ago

Personally i have m4pro 24Gb/512Gb (only for work) and i'm already tight in space, need to be careful and "cargo clean" projects i'm not working on.

I solved space issue with BaseQi UHS-II 420A — but that was when 2TB “Extreme Pro” SD card was only $199… these days I'm not entirely sure that's sane solution (although I suspect Apple asks for even more per GB of SSD storage which may mean even with today's prices this may be an adequate solution).

3

u/velocityvector2 2d ago

I’m writing a game using macroquad crate on a MacBook Pro 2016 with 16GB of RAM (running Fedora 45).

2

u/Amadex 2d ago

I work on backend and our infrastructure uses several linux-only features like io-uring so I prefer a linux

but if you really want a mac and doing more higher level things (like webdev), or you don't care about the kernel level stuff, you're fine (and there are ways around it (cloud dev, vms,...)).

as others have said, compilation artifacts can take a lot of space so you should take enough disk space to feel comfortable and not feel the need to spam cargo clean everyday.

1

u/kei_ichi 2d ago

Isn’t you can just spin up a Linux docker or even Linux VM?

2

u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount 2d ago

Between 2017 and 2019, I contributed to clippy and the rust compiler (besides other projects) on a HP ChromeBook 13 G1. That thing had a dual core 1.1GHz mobile skylake, 4GB of RAM and 32GB of disk. Also fanless.

I had to enable filesystem compression to make sure the disk space doesn't run out, and compile times were somewhat brutal, but it worked. That said, my wife has a M2 macbook and I've done some stuff on it and it's fast enough for light to medium use without getting hot. If you have larger projects, it will throttle.

1

u/diagraphic 2d ago edited 2d ago

I have a Macbook Pro M5 (Pro). 24GB memory, 1TB NVMe bought it couple months ago, mind you this is not my main computer, its a side piece for basic work. I'd say very, very powerful laptop for most programming tasks. 16GB and an air, honestly I don't think would be enough. I had an air before and it wasn't enough for the type of programming and research I do (heavy on the processes). I'd be weary on getting it unless you are just browsing and writing simple systems, nothing large. This is non agentic, if you going agentic, way more as you want parallelism, getting agents on tasks require resources!

1

u/wyvernbw 2d ago

i get by on a macbook air m2 with 8gb ram and 256gb ssd, cold builds can be annoying but other than that no complaints

1

u/nicoburns 2d ago

16GB of RAM will be fine today. But I'd buy 32gb, because you'll probably save money overall on the increased longevity of the machine (if you continue the have enough RAM, you could probably keep one of these machines for 10 years).

I'd say 1TB minimum for Rust dev. More would certainly be useful, but I wouldn't personally be willing to pay for it.

1

u/tanmaynargas2901 2d ago

16GB is fine for most Rust work. Disk is the thing that actually runs out, like people said.

Some stuff that helps if you end up on 512GB:

cargo install cargo-sweep, then cargo sweep --time 30 inside a project drops build artifacts older than 30 days instead of wiping everything like cargo clean does.

Turn down debug info for dev builds. In Cargo.toml:

[profile.dev]
debug = "line-tables-only"

You still get backtraces with line numbers and target/ gets noticeably smaller.

A shared CARGO_TARGET_DIR saves space across projects with overlapping deps. The catch is two projects can't build at the same time since they wait on the same lock, and one cargo clean wipes all of them.

1

u/bombay-boyz 2d ago

RAM is enough. Clean storage regularly