This one could use a bit of a caveat, in that typically mutable structs are heap allocated and typically immutable structs are stack allocated, but the compiler is free to optimize things either way or even remove them entirely (if it can do so unobservably). See, e.g., A nice explanation of memory stack vs. heap - #2 by sylvaticus and the subsequent posts.
mbauman
7
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Does Julia Create a "1.5" Language Problem? | 133 | 6781 | January 1, 2024 | |
| HN comment on Julia vs Swift type checking and auto diff | 24 | 3054 | May 14, 2019 | |
| Can we bring dynamically typed languages back into trend? | 74 | 5410 | November 12, 2023 | |
| About static compilation and static analysis | 22 | 3480 | September 28, 2022 | |
| Blog post: Rust vs Julia in scientific computing | 145 | 26643 | December 18, 2025 |