News for hackers. Stuff that matters.
Re:From TypeScript to ReScript by ahuth on Wednesday January 12, 2022 @12:50PM (#29910310)
I can't get behind the idea that a type system is either completely sound or completely useless.

Surely preventing 99% of issues (or 90%, or 80%) is good?

I'm also not aware of too many real-world instances of unsoundness in TS that has caused problems. Obviously I don't know your specific scenario, but it's possible there are ways to work with TS (instead of against it) to get a good level of type safety.

Re:From TypeScript to ReScript by jshen on Wednesday January 12, 2022 @02:29PM (#29911667)
> Surely preventing 99% of issues (or 90%, or 80%) is good?

You can’t assume there aren’t other trade-offs that you have to factor in to the analysis.

Re:From TypeScript to ReScript by ahuth on Wednesday January 12, 2022 @02:49PM (#29911898)
You're totally right. Different teams and situations require different tradeoffs.

While TypeScript is great for the tradeoffs I deal with, there are certainly others where it's not.

Good call out.

Re:From TypeScript to ReScript by rsrsrs86 on Wednesday January 12, 2022 @07:22PM (#29914967)
I think the gradual typing is just too permissive... It's not the same feel you get with type inference. Not to say that a unsound type system is useless. If you're coming from dynamically typed languages it will certainly feel safer, but if you come from a more strict type system it still feels like just a linter. In my experience.
Re:From TypeScript to ReScript by ragnese on Wednesday January 12, 2022 @01:14PM (#29910703)
> I can't get behind the idea that a type system is either completely sound or completely useless.

EDIT: I'm sorry. I thought you were someone else.

[REDACTED]

Re:From TypeScript to ReScript by ahuth on Wednesday January 12, 2022 @01:38PM (#29911062)
Can you link to where we previously discussed TypeScript? I don't remember that, and can't find it anywhere in my comment history (looked back to 2019).

Also, I didn't mean to misinterpret what you said. Sorry about that.

Re:From TypeScript to ReScript by ragnese on Wednesday January 12, 2022 @02:12PM (#29911472)
Yikes. I'm so sorry. I mistook your username for another one. That was incredibly rude of me to react like that without at least double-checking.

I had a long and frustrating back-and-forth with someone else some time ago where I pointed out what I believe to be several glaring issues with TS's type system (like the fact that `readonly` properties on object types don't actually guard against writes in most situations) and every one of my criticisms was met with the equivalent of "You're saying a type system has to be 100% perfect or it's completely useless". And even though it's the internet and I should know better, it just irritated the hell out of me.

Again, I'm really sorry for jumping at you like that. I think I'm traumatized over arguing about TypeScript... lol

Re:From TypeScript to ReScript by ahuth on Wednesday January 12, 2022 @02:53PM (#29911935)
No worries. I made an assumption about what you were saying that wasn't helpful, either.

All good!

Re:From TypeScript to ReScript by NoahKAndrews on Wednesday January 12, 2022 @11:58PM (#29917042)
Sure, Typescript is vastly better than JavaScript. Its unsoundness still really sucks though.