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

Typescript has escape hatches so you can just say "I don't care, or don't know."

With Rust, you're battling a compiler that has a very restrictive model, that you can't shut up. You will end up performing major refactors to implement what seem like trivial additions.



You can always use `Box<dyn Any>` to get the same result in Rust :)


It's not the same because putting it in a box semantically changes the program, adds a level of indirection. It's not just telling it to go away.


There's no avoiding that in a language that's designed to offer low-level control of runtime behavior, regardless of whether it's memory-safe or not. You have to tell the compiler something about how you want the data to be laid out in memory; otherwise it wouldn't know what code to generate. If you don't want to do that, use an interpreted language that doesn't expose those details.


Or use clone everywhere. I am not ashamed of having lots of clones everywhere outside of inner loops.




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: