Re:Functional programming languages should be better at muta...
by andrepd on Wednesday July 31, 2024 @10:58AM
(#41119791)
GC does force you into a memory layout for your objects that negates any advantage in the allocation routines proper.
[ Parent
| on HN ]
Re:Functional programming languages should be better at muta...
by quotemstr on Wednesday July 31, 2024 @12:49PM
(#41120854)
No it doesn't. GCs need to be able to traverse objects. They don't impose object layout constraints.
Re:Functional programming languages should be better at muta...
by tsimionescu on Thursday August 01, 2024 @01:41AM
(#41126461)
I'm guessing you're referring to the fact that the most popular GC languages allocate almost every object on the heap, even when used as a field of another object. This is by no means a constraint of the GC, it is a separate design choice.
And in fact C# has always supported "value objects", which do get allocated in-place, Java is adding the same support probably in the next release, and Go actually defaults to it.