Hacker News new | past | comments | ask | show | jobs | submit login

Are there any languages that have dynamic typing but linear/affine memory management or C-style manual malloc+free? I reckon there would be some real productivity benefits in such a language if you wanted fast code with good C interop (Rust shows that affine types combined with destructors allows fantastic C interop) with faster development speed.



I'm a bit curious about combining RAII or similar with dynamic types myself. It's been discussed at mild length here: https://news.ycombinator.com/item?id=9356925

If we assume some sort of object orientation, or first class functions are available, affine types become (I think) impossible; If a value T with lifetime 'a is handed to a completely unknown method on an unknown object, or to an arbitrary lambda, we can't prove that the method will not destroy T in the middle of lifetime 'a. In otherwords, if typechecking is ruled out, we cannot do borrowchecking either.





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

Search: