←back to thread

511 points mootrichard | 1 comments | | HN request time: 0s | source
Show context
azinman2 ◴[] No.23990204[source]
Interesting. I’m surprised they didn’t opt to do this inline with the rest of the ruby code, because now they can diverge from each other. It’s a bit like a separate header file in C/C++/Obj-C, except in those cases the compiler will yell at you if the implementation doesn’t match the header. Having it blow up at runtime instead doesn’t feel like such a big change from the way it is now, other than helping out IDEs.
replies(2): >>23990400 #>>23990613 #
CarelessExpert ◴[] No.23990400[source]
> I’m surprised they didn’t opt to do this inline with the rest of the ruby code,

As they mention in the post, they followed typescript's approach, here. The benefit is it allows you to layer in typing into an existing codebase in a non-disruptive way.

replies(3): >>23990514 #>>23991134 #>>23994235 #
1. tdeck ◴[] No.23994235[source]
But that's not really TypeScript's main approach, is it? When I think of TypeScript I think of the inline colon annotations, not the external files. Those are just a bridge for legacy code.