3 ms·
> unboxed primitives I'm wondering how this is achieved given the type system and garbage collector. What types are unboxed and when?
by rixed 6y ago
> unboxed primitives
I'm wondering how this is achieved given the type system and garbage collector. What types are unboxed and when?
- jorkadeen 6y agoFor example: Given the type List[Int] the cons cells of each list contain a primitive integer and a pointer to the next cons cell. (In Java, you would instead have List[Integer] where each element of the list is a boxed/wrapped Integer object). I hope that answers your question? (I am one of the authors of Flix).
- rixed 6y agoUnboxed integers is no big feat. Many implementations of garbage collected languages have unboxed small scalars (OCaml and Guile come to mind). What about compound types?