6 ms·
the arc of progress in software engineering bends towards static typing. in the future, our type systems will be so powerful they'll be able to do more inferenc
by yawboakye 3y ago
the arc of progress in software engineering bends towards static typing. in the future, our type systems will be so powerful they'll be able to do more inference so that we have to be less explicit. then people who have come to hate static type because of these explicit type declarations will know they hated the costume after all, not the person in it.
- sodapopcan 3y agoOCaml had this figured out many years ago. Elixir/Erlang's dynamism can be particularly good compared to other dynamic languages if you lean into it properly. But yes, the world is loving static typing right now, and I'm actually a bit excited myself with their ideas for Elixir's type system.
- pxeger1 3y agoWhat exactly do you mean that OCaml has figured out?
- sodapopcan 3y agoIt's a statically typed language that doesn't require explicit type declarations (in most cases, at least).
- sodapopcan 3y agoEr, to clarify, I mean it has very strong type inference. If you're making a record or complex type then yes, you still need to define the type, so maybe that is what OP was actually talking about?
- raphlinus 3y agoYeah, Rich Feldman has a good talk on this, entitled Why Static Typing Came Back[1]. It makes a good argument that static typing can recover most of the advantages traditionally accounted to dynamic typing. Rapid iteration you can get from incremental compilers, being concise you can get from powerful type inference, etc. Conversely, the advantages of static typing (largely boiling down to increased reliability) cannot easily be captured by dynamically typed languages. Gradual typing, particularly successful by TypeScript, might be an interesting middle ground, or it might just be a reflection of the dynamic history of JS. [1]: https://www.youtube.com/watch?v=Tml94je2edk https://www.youtube.com/watch?v=Tml94je2edk
- munificent 3y agoThis talk is so good!
- weatherlight 3y agoit's a good talk. the static typing (of the future) at the end of the video isn't, say, the static typing of C# or Java. Static typing should be more like OCaml, Elm, Rust, Haskell (and ideally Roc)
- mrkeen 3y ago> in the future, our type systems will be so powerful they'll be able to do more inference so that we have to be less explicit And in the past too! In my Haskell workflow I constantly use the _ (typed hole) keyword. When the compiler hits that expression, it tells me what type I have to put there. If I were using Idris, it can oftentimes provide and implementation too! Two caveats about what you said though: - More power is not always better (depending on how you define power). Structured programming removes the power of goto. Functional programming removes the power of mutation. - There are limitations to what can be inferred. The more your type system can do, the harder it is for type inference to do its thing.