3 ms·
Everybody worth their salt should know that those languages have completely different working models in mind. Java puts everything into the heap and creates ea
by DarkNova6 2y ago
Everybody worth their salt should know that those languages have completely different working models in mind.
Java puts everything into the heap and creates easy expressability by having pointers everywhere. In contrast, Rust often avoids pointers, prefers the stack and is very stingy with memory access.
These languages are completely orthogonal to each other and it has consequences in their usage. Not that a good chunk of people wouldn’t butcher the code they are given in any codebase…
- 1oooqooq 2y agoyou'd be surprised how few developers today even know what general subject you're talking about
- DarkNova6 2y agoI'm afraid you are right. But I believe some programming language communities suffer from a great deal more than others (looking at you Python).
- pjmlp 2y agoPrimitive types are placed on the stack, as are those classes proven to not escape current scope, thus not everything. When Valhala is finally merged, then value class and value record will also not be on the heap by default. Finally, even without Valhala, Unsafe and Panama allow for off heap allocation, thus again, not everything.
- DarkNova6 2y agoYou are correct, I was oversimplifying to get the point across. Valhalla is one of the most promising upcoming technologies I am anticipating, but I don't expect it to change the approach to writing most Java programs. What makes Java so good is that it is a language written for creating high quality libraries and frameworks. Sure, it will be nice to define your own zero-cost classes but the largest benefit will stem from improved an standard library as well as an enabler for high-performance programming and GPU access.