5 ms·
This is a generalized feeling about good static type systems. What is missing is a language with good static type system (Algebraic data types, stream/iterator
by entha_saava 6y ago
This is a generalized feeling about good static type systems.
What is missing is a language with good static type system (Algebraic data types, stream/iterators, generics), simple and having GC, for application domains where prototyping speed matters.
- neilparikh 6y agoI think Swift satisfies all of those those criteria, and doesn't have a steep learning curve since you can write in an imperative style if you want. F#, OCaml and Haskell (and other ML-family languages) satisfy the first 3 criteria (type system, simple and GC) and depending on your familiarity with the language, can be fairly suitable for fast prototyping. For example, I write most of my new personal projects in Haskell, and I'm able to iterate pretty rapidly once I have a skeleton of the system in place (with liberal use of typed holes to ignore things I don't care about implementing right now). For some projects, I find I'm actually able to prototype more rapidly than I would be able to in an untyped language, because the language helps me express the shape of the data through algebraic data types, and then the functions end up having "one obvious implementation" that follows the structure of the data.
- entha_saava 6y agoReference counting still requires you to keep track of cycles. Also performance is less than GC, especially in multithreaded environments. And Swift is not a serious language outside apple ecosystem. OCaml is actually very good language. I hate how people outright dismiss it mentioning multicore. Neither JS nor Python have great multicore story. And most applications don't need multicore. Wish there was a good static compilation toolchain for .net core. F# would gain much more traction then.
- azernik 6y agoBoth Javascript and Python are perfect for this, IMO - both languages have syntax for type annotations which are ignored by the intepreter, but are respected by external typecheckers. Mypy for Python (https://mypy.readthedocs.io/en/stable/ https://mypy.readthedocs.io/en/stable/) and Flow for Javascript (https://flow.org/en/docs/ https://flow.org/en/docs/) are my personal favorites, and have all the features you describe. And importantly, both languages have very strong library support.