r/functionalprogramming • u/kinow mod • Jan 25 '23
Question Do you guys know a pure functional language with good tooling?
/r/ProgrammingLanguages/comments/10i02jd/do_you_guys_know_a_pure_functional_language_with/
13
Upvotes
15
u/[deleted] Jan 25 '23
F# and Scala has pretty good tooling.
8
u/[deleted] Jan 25 '23
If you mean by pure a language that prohibits all type of side effects or you need to clearly know where the side effects can come from, I don't think there is a language with better tooling than Haskell
If you're willing to forego strict purity but get all the goodies of advanced functional programming then OCAML. Scala is also an option but I've heard bad things about errors in its type system.
If you go even further there is F#, which is a functional first language but it misses advanced functional concepts like HKTs. It's meant to be a pragmatic functional language. And becayse of it's interoperability with C#, the programmer needs to handle things like nulls at the interface boundaries.On the other hand tooling is great with Rider from Jetbrains and vscode and it also has an REPL and scripting mode
So I'd suggest:
Otherwise you're stuck with Haskell
There's another functional language I love called Idris, which despite being more feature rich than Haskell is also a joy to use. But its tooling is severely limited from my limited time with it. It is a strictly pure functional language
6
u/danielstaleiny Jan 25 '23
Purescript.
6
u/dipittydoop Jan 25 '23
Elixir has best in class tooling and developer experience. Very pragmatic set of sharp tools.
1
u/kinow mod Jan 25 '23
From 3 days ago, so a good number of comments. Probably related to https://old.reddit.com/r/functionalprogramming/comments/10gnzji/is_haskell_mature_in_terms_of_tooling/
5
u/[deleted] Jan 25 '23
Haskell is not too bad
5
u/[deleted] Jan 25 '23
Scala can work this way as a great part of the community uses it in this style. 2 main libraries ecosystem that are all pure fp: cats and zio.
Tooling is good enough to be used by many companies. Could be better, could be worse. But at least there's a great ide - intellij - and a lsp that keeps improving that works reasonably well in vscode. A a sure way entry point there's now a new effort called scala-cli which allows one to start scripting and using libraries very quickly.
At least compared to some suggestion it's in a better stated than others.
4
u/matteosister Jan 25 '23
Elm if you are into frontend!
3
u/jmhimara Jan 25 '23 edited Jan 25 '23
I believe Elm is purely functional and people speak very highly about its tooling. Haven't tried it myself though, so I can't really say.
I'm a big fan of Racket mostly because of its great ecosystem and tooling. It's a scheme, so mostly functional, but not really the level of Haskell.
3
u/fbn_ Jan 26 '23
Racket?
2
u/vakkineni Jan 25 '23
Ocaml
2
u/hoimass Jan 31 '23
GHC, OCaml, possibly SML, and quite likely F#.
3
u/[deleted] Jan 25 '23 edited Jan 25 '23
Pick almost any modern language with tooling you like.
When I watched Rich Hickey's talks I fell in love with his ideas, the entire mindset for which Clojure was built. I ported much of it into my own library and have been using it for almost a decade. It's just plain JavaScript, no transpiler, no build required.
The point I'm making is FP is a discipline and most modern languages have everything you need to write functional code. The quest for the perfect language makes syntax the holy grail since a developer can in almost any language otherwise realize almost any feature with just libraries. I implemented protocols in JavaScript with just libraries.
JavaScript's objects and arrays are mutables. Records and tuples, their counterparts, will eventually come but they're not there yet. And so for the time, I use a library which treats mutable objects and arrays as immutables. Even though this is not as performant as proper immutable types, this technique works well enough in most situations.
Java and C# have persistent data structures. Dart too. JavaScript has Immutable.js and, eventually, records and tuples.
I understand languages designed with FP in mind are better suited, but with a bit of persistence, you can do FP in any language. You just need suitable libraries. And, in my case, I built those.
2
u/[deleted] Jan 25 '23
purely functional languages arent used as broadly in industry as imperative, procedural, and OO languages, so the tooling isnt nearly as good or plentiful
you're probably better off picking a multi-paradigm language with good tooling and using it to do functional programming. JVM languages like kotlin and scala would be my first things to consider. if you're a windows users, f# might have good tooling, but i dont know
there is some okish support for elixir/erlang via plugins in jetbrains IDEs, but it's nothing to get excited about. IIRC, there's something similar for VSCode
in general though, picking a single paradigm language probably isnt a great solution, unless it's for research or educational purposes