← Back to context

Comment by jsheard

6 months ago

It validates the object shape at runtime, much like you can do in Typescript with a library like Zod. The key difference in this case is that Rust makes it scary to not validate data while Typescript will gladly let you YOLO it and blow your legs off, even in strict mode.

Okay I see, that's a nice secure-by-default point, whereas TS is arguably not secure-by-default.

  • It’s not. And trying to just be a transformation of the source to JS without its own standard library (mostly, some old stuff doesn’t follow this) means it really isn’t possible with just TS alone.

    That’s OK with me. I use TS because I like it and hate the total lack of safety in JS. I have to use JS on the web, so TS it is.

    If I don’t need it to run on a webpage, I wouldn’t be writing it in TS. I like other languages more overall.