5 ms·
"I for one can't wait for Typed FP to become mainstream as soon as possible." This will never happen till there is a typed FP language that has solid tooling,
by plinkplonk 8y ago
"I for one can't wait for Typed FP to become mainstream as soon as possible."
This will never happen till there is a typed FP language that has solid tooling, documentation, solid libraries for most common programmer tasks, a welcoming and active community and at least one of a killer app, or framework (Rails for ruby), killer platform (objective c/swift for AppStore dev) or targets an underserved domain (Julia for Scientific Computing).
The existing typed FP language implementations (OCaml, Haskell, SML, not sure of F#) are full of cruft and/or are just lacking with respect to one or more of the above.
Haskell comes the closest I think, but that maybe because I've been using Haskell for decades, and so I am biased in its favor (and I'd still hesitate before using it on a large team + long timescale project).
Try writing a 'mainstream' application in any of the above, and you'll see what I mean. Yes you can write a typical web app /CRUD app/mobile app in (say) Haskell, but to be honest, Yesod (say) is no Rails.
Reason might be 'the one' I guess, at least in bringing TypedFP to the javascript ecosystem, especially with FB's corporate backing.
Rust gets/is getting most of the above right, but it isn't really an FP language.
OCaml or Haskell being the mainstream will never happen imho. If there is a TypedFP mainstream language in the future, it is yet to be invented (or is being invented right now! touch wood).
What is more likely to happen is some FP features moving into mainstream languages. Not sure if that counts as "typed FP becoming mainstream", but it likely to be a long wait ;-)
I honestly don't see any typed FP language ever having the success of say, Python, for at least a few decades yet.
(all imho, ymmv, as it should)
- jasim 8y agoThe killer app for OCaml is front-end webdev with Reason. Most new large-scale Javascript projects are using gradual typing with TypeScript, and the experience is not the same as having types natively. It gives you the safety and rigidity of types, but not as much the ability to think with types. These projects also toy around with immutability - using a library like Immutable.js which is a boxed data structure that needs explicit handling and conversion to and from native types, need to pick a state management library like Redux which implements a version of variants through constants and manual dispatch, and all these projects need large test suites to check for things that types would've caught and so on. A typed functional language eliminates almost all of these issues and grants more powers of abstraction. If not Haskell or OCaml, I suspect Elm has a good shot at it. I'm all for new languages! If I remember correctly, the ideal one is Lispy with Hygienic macros, ML-like type system baked in, multi-core, good stdlib, and tools that don't stand in your way.
- plinkplonk 8y ago"The killer app for OCaml is front-end webdev with Reason." I'll make a 1000$, 10 year bet with you that in 2028, if browsers still exist, ReasonML (or its successors) will be nowhere near mainstream status (which is the point we are discussing here). I like Reason, or at least the idea of it. Javascript itself might incorporate more static typing in 2028 than today's version does, but I suggest the 'advances' will be relatively miniscule.
- MaxBarraclough 8y agoI agree that JavaScript isn't going to change significantly, but fortunately it can be treated as a compiler's target platform, not only a source language. We're not going to see any language supplant JavaScript in the browser. Dart got nowhere, and that was with the backing of Google. But there are already toolkits out there that compile down to JavaScript. GWT, for instance.
- vram22 8y ago>We're not going to see any language supplant JavaScript in the browser. Dart got nowhere, and that was with the backing of Google. Never say never (again. With apologies to Ian Fleming). Just because Dart couldn't do it (even with Google), doesn't mean that nothing else can. I, for one, hope something better does supplant JS. https://en.wikipedia.org/wiki/Never_Say_Never_Again https://en.wikipedia.org/wiki/Never_Say_Never_Again https://en.wikipedia.org/wiki/Ian_Fleming https://en.wikipedia.org/wiki/Ian_Fleming
- jasim 8y agoI hold hope, but not certainty!
- cbzbc 8y agoI think the problem here is that OCaml/ReasonML is a relatively large language - the flip side to the nice syntactic sugar, and there's a paucity of material to get people into ReasonML if they haven't touched FP before (which for FP to take off is the target audience).
- tom_mellior 8y agoYou didn't mention Scala. It has access to all Java libraries, and it doesn't force you to into a single fixed mindset like Haskell's purity at all costs. That said, it doesn't seem to have taken off, and it doesn't really look like it will. Not sure why, though I hear a lot of complaints about compile speeds.
- plinkplonk 8y ago"you didn't mention Scala" my hypothesis (and it is only that) is that trying to unite FP and OO, as Scala tries to do, leads to unnecessary complexity in learning and usage. Also see 'tooling'. That said, many impressive + widely deployed systems have been built with Scala, which is more than other typed FP languages can claim.
- lmm 8y agoI've been doing Scala full-time for several years, so as far as I can see it's taken off pretty well. I can't really claim it has a welcoming community though (though many of the most unpleasant people are those who've apparently quit the language, but still hang around and hassle people).
- pkolaczk 8y agoCompile speeds are a problem of the past. When you use Scala 2.12+ together with incremental compilation with modern Zinc-based compile server, compiling Scala after each change takes a low few seconds. Sometimes less than a second. And Dotty (Scala 3) shall improve compile times even further.
- asplake 8y agoCould Kotlin or Swift do it? I like Python/Flask/Sqlalchemy for backend web dev, but I long for a modern, statically typed FP alternative that’s equally (or nearly as) practical and accessible. Just a pipe dream?
- kod 8y agoKotlin doesn't belong in these discussions, no exhaustive pattern matching.
- pjmlp 8y agoThe language is not set in stone.
- icebraining 8y agoHave you tried Mypy? It certainly has limitations, but it provides some static typing to Python.
- weberc2 8y agoI've tried mypy, but it's still too immature (creates more issues than it solves). Specifically it's buggy and very limited (IIRC support for recursive types hadn't landed and many popular libraries--like SQLAlchemy--can't be annotated or stubbed).
- billfruit 8y agoThere is hardly anything FP about Kotlin.
- losvedir 8y agoWhat about F#?
- gameswithgo 8y agoF# is pretty close. The tooling isn't up there with C# but it is close. If microsoft would double the budget for tooling support I think it would get there quick, and that wouldn't be a ton of money.
- pjmlp 8y agoIt is more than just the budget. F# isn't properly part of the .NET team, hence only VB.NET and C# get all the goodies. They didn't even took F# requirements into consideration when doing .NET Native and the whole VS refactorings, leaving the F# team to play catch up on their own.
- _hardwaregeek 8y agoRust isn't a FP language in the strict, traditional terms of Haskell and OCaml, but it's pretty damn close. If people started switching to Rust, they'd probably get 80% of the gains (concurrency, excellent typing, non nullability, etc.). If Rust gains traction, I wouldn't exactly complain; don't let perfect be the enemy of good, after all.