4 ms·
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
by stewbrew 6y ago
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.
- learc83 6y ago"The benefit of having different files is it doesn't require changing Ruby code to start type checking. You can opt-in type checking safely without changing any part of your workflow."
- HideousKojima 6y agoTypeScript allows this while also allowing inline type declarations, without breaking existing JavaScript
- hombre_fatal 6y agoBut it's not Javascript anymore. Seems reasonable for someone to want types but not have to raise their own entire TypeRuby language + ecosystem + re-tooling.
- saghm 6y agoIsn'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/ https://definitelytyped.org/ for dependencies which don't have their own annotations.
- TomMarius 6y ago.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.