Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
View Types for Rust (smallcultfollowing.com)
2 points by sizediterable on Nov 5, 2021 | hide | past | favorite | 2 comments


This kind of reminded me of how in Rust you can split a slice type into sub-slices, except in that case you are actually allocating space for those sub-slices. This leads me to wonder if this is possible in a zero-cost way using const generics, where you only need to store the pointer to the backing data, and the index range/length is known at compile time, e.g. Slice<T, Start, Length>.


I also wonder how this might relate to "viewpoint adaptation" as defined in Pony https://tutorial.ponylang.io/reference-capabilities/arrow-ty...




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: