5 ms·
If your static type system includes dimenions / physical units, you can spot a lot of typos in formulas. (Of course, you will also be required to add some conv
by eru 16y ago
If your static type system includes dimenions / physical units, you can spot a lot of typos in formulas. (Of course, you will also be required to add some conversion factors, when you want to express something like "Open as many connections as the sum of number of hard disks plus number of users.")
- Dn_Ab 16y agoYou're right. I didn't consider this too. Have you tried a language with units? I've tried it in F# and seen it in Frink. I found it cool but havent found a need for it. I suspect that is at least partially due to being used to not having it in a language.
- eru 16y agoA friend of mine hacked up his Lisp, with lots of macros, of course, to check units at compile time. I haven't really used his system, but he was quite keen on it.
- sammyo 16y agoYep, someone here added a type check to Ruby, there are some functions through the codebase that check each argument but I've not seen any real life benefit.