It’s a big pain, though. Signed integer overflow, float<->int casting UB, etc. are all things people often don’t want in their language and makes the generated C really ugly. And you can’t do *good* GC. :) You need stack and register maps, which are impossible in C.
No, that's dynamic. Static is a property you can determine in your HLL before doing any transpiling.
-
-
I think you’ll find if you try to implement it that “static lifetimes” end up being equivalent to stack and register maps.
-
It's not because it happens at a level where there's no such thing as stack or registers.
-
All “statically live” objects have to be traced, no? So at collection time you have to find the set of objects that are “statically live”. That’s just a root set. If you’re keeping a dynamic list of “statically live” objects to scan, that’s just a shadow stack. Etc.
-
Not necessarily. No new ref needs to be tracked if you know its lifetime is a subset of that of an already tracked ref. This principle is very powerful for GC or ARC.
End of conversation
New conversation -
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.