Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I tried implementing a scheme like this once. What you do for efficiency is allocate some extra header space with the array size, and access it with negative pointer offsets. You pass to fat pointers if asked to take slices of the array. This way the common use case has good locality. The way you get things onto the stack is with a macro, which preallocates and initializes the array with the (statically known) array length.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: