3 ms·
> is now working on an optional typing system where you choose to describe types in a separate file. (Reminds me of C/C++ and OCaml header files.) My experienc
by TulliusCicero 7y ago
> is now working on an optional typing system where you choose to describe types in a separate file. (Reminds me of C/C++ and OCaml header files.)
My experience using C/C++ is limited, but this always feel felt rather cumbersome to me.
- pdimitar 7y agoIn C/C++ it definitely is. But it sounds Matz wants to do it similarly (but not exactly) like in OCaml, where the "interface" file only describes all public modules and functions and their typing signatures, which serves the purpose of (a) limiting access to the users of your modules/functions to only those you want to expose and (b) help the compiler's typing system. Do note that in OCaml explicit typing is rarely needed. The compiler is quite amazing at inferring the data types of your functions. In Ruby though, it seems the typing definitions will be the front and center of those suggested interface/header files.