4 ms·
Static type systems with global type inference haven't had this problem since the beginning (for example OCaml, right around the time Java came out). However, f
by 5e92cb50239222b 5y ago
Static type systems with global type inference haven't had this problem since the beginning (for example OCaml, right around the time Java came out). However, for some obscure reasons the shittier the technology, the more chances it has at becoming popular.
Try Elm as a simple example (can be done in a weekend), it'll probably blow your mind. You don't have to write type annotations at all, but the compiler complains at build time if the same function is called with two different types in two places.
- thomasz 5y agoLocal inference is a gift sent from heaven, global inference not so much. Reading OCAML (and F#) is exhausting because you have to look into the implementation of each function (or into a separate interface file) to figure out how it's supposed to be called and what it is going to return.
- pharmakom 5y agoMy IDE puts annotations on every function and I can hover over values. Typing them out seems pointless with the right tooling.
- ahartmetz 5y agoYou can hover one thing at a time, you can skim a page with your eyes very quickly. Making important information cumbersome to access is a terrible idea.
- TheMatten 5y agoOne could argue that this is better covered by IDE/tooling showing you inferred types / suggestions.
- lamontcg 5y agoIf the function is printed in a journal article, or you just use something like 'less' to look at the file all that information is not available. I find it kind of weird that we've normalized not being able to read the code outside of the proper program for it. Since those IDEs often cost money it starts to feel a bit like steps towards a walled garden to me, and I'm not sure its good for actual computer science.
- pharmakom 5y agoI think development containers are a better way to deliver code with a paper. Besides, the paper itself should optimise for clarity and global type inference languages allow type annotation where it might help. They simply let you skip type annotations which only add noise.
- brundolf 5y agoNot sure I'd say the IDEs "often cost money" these days
- lamontcg 5y agoWait for VSCode Enterprise.
- ReleaseCandidat 5y agoThat's what your IDE or LSP is for. That's also the difference in 'philosophy' between OCaml, F# and Haskell. Haskell has the 'same' global type inference but the community sees them as (often only ;) documentation.
- xigoi 5y ago> However, for some obscure reasons the shittier the technology, the more chances it has at becoming popular. The reasons are simple: it's promoted by a big company. Same reason why C# and Go are popular.