As an extreme example, in Chicken Scheme there is literally no difference between stack and heap. There's only bump allocation.
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
The eternal trade-off is that once users know and design for this, it's no longer a detail that implementations are free to re-optimize as they see fit.
-
Yep. Arguably this is an advantage of fully GC’d languages: more room to optimize.
- 1 more reply
New conversation -
-
-
That would be nice, though one hurdle is statically knowing the cost of allocation. When we get something on the stack today we know statically that allocation basically is too cheap to meter. Worst case on the heap is serious CPU. Good research problem.
-
Worst case on the stack is blowing it. I don't think stack allocation provides any way to avoid the hard problems here.
- 10 more replies
New conversation -
-
-
You mean C isn't the way the machine works??
-
You will not find the words "stack" or "heap" in the C specification either.
- 1 more reply
New conversation -
-
-
That might break the illusion that the knowledge we gleaned from learning C is a perfect representation of the inner workings of current computers though... wouldn’t want THAT now would we
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
There is an isomorphism between SSA and CPS IR. a PHI is basically a closure. Instead of extending the stack we can chain and copy into a bump allocated closure of the continuation. Return doesn’t pop stack rather it returns to the previous closure on the heap.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
That’s an interesting thought. Reminds me of how memory management is often divided in only three strategies (manual, GC, RC), but that model can’t describe Rust’s approach at all (which, if I had to summarize in a simple label, I’d call “single ownership”)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.