←back to thread

511 points mootrichard | 1 comments | | HN request time: 0.365s | source
Show context
stewbrew ◴[] No.23990645[source]
Separate ruby header files with type information? Seriously? What's the rational behind that? Is it just to make clear that the ruby interpreter doesn't really care about the type information and doesn't use it to improve the code's performance?

With all due respect, but IMHO this is too little and much too late.

replies(2): >>23990674 #>>23990677 #
saghm ◴[] No.23990677[source]
Isn't this similar to how TypeScript allows annotations for JavaScript to live in separate files? My (possibly naive) assumption is that the goal is to make it easier for developers to write type annotations for projects they use without necessarily having to convince the maintainers to add them to the project itself. I've heard of people using TypeScript annotations from https://definitelytyped.org/ for dependencies which don't have their own annotations.
replies(1): >>23990757 #
1. TomMarius ◴[] No.23990757[source]
.d.ts files are mostly compilation output, only if the original source is JavaScript you write the definitions by hand. TypeScript developers normally work with types inside their ordinary .ts (JS+types) module file, not in a separate source file.