3 ms·
There seems to be a pattern of introducing static types into previously weakly typed or dynamically typed languages. I think this is because people have written
by Pannoniae 3y ago
There seems to be a pattern of introducing static types into previously weakly typed or dynamically typed languages. I think this is because people have written many large projects in them, and without types, it's quite hard to enforce an API or document what to pass into it if there are no types.
The drawbacks to statically typed languages have become way less significant since most of them have "var" or an equivalent which saves on typing.
- slondr 3y agoElixir never really didn’t have a static type system, this is just improving it.
- weatherlight 3y agoIt's also not your "standard static" type system. It's a new type system that novel using Set Theoretical Types. Which is kind of interesting. because if Elixir can get this working properly, it would also probably work for other Strong Dynamically Typed languages. Imagine if Typescript's type system if it were actually sound. The research paper is here if anyone wants to read it. https://www.irif.fr/_media/users/gduboc/elixir-types.pdf https://www.irif.fr/_media/users/gduboc/elixir-types.pdf
- srgpqt 3y agoIndeed, even C has caught up! #define let __auto_type
- dlisboa 3y agoWow, I learn something new every day! https://gcc.gnu.org/onlinedocs/gcc/Typeof.html https://gcc.gnu.org/onlinedocs/gcc/Typeof.html Having learned (old) C in college and taking a closer look at it lately, I was surprised how much you can make it look “modern”, what with _Generic, wchar_t, booleans and even this __auto_type. It seems like with a couple #define macros and some discipline you can make it look and behave more ergonomic.
- mvdtnz 3y ago"var" does not "save on typing", at least not in C#. A variable declared with var is still statically typed. Its type is just inferred from context. The compiler will assign it the most specific type possible from that context. That's the important point - this occurs at compile time, not runtime.
- tialaramex 3y agoYou have perhaps misconstrued what your parent was saying. Typing has two meanings, the one intended here wasn't about types - it was about keyboards. The var keyword and similar syntax in modern languages is less typing where "typing" means pushing the little buttons on the keyboard, and the associated squiggles appearing on a display.
- fabianhjr 3y ago> most of them have "var" or an equivalent which saves on typing Do you mean type inference? Most typed-languages have that, even Haskell/Scala. It gets iffy on dependent type systems like Agda/Idris.
- seanmcdirmid 3y agoScala type inference isn't as powerful as Haskell's primarily due to nominal subtyping. Dependent type systems are so power that they defy type inference (in general, the more expressive your types, the harder it is to infer subtyping relationships, which is the primary complexity of type inference).