r/functionalprogramming • u/kichiDsimp • Sep 16 '24
Intro to FP 2nd language after Haskell
I have learnt the basics of Haskell in last 3 months I want to try a new FP language which is more real world and can teach me new stuff My options are
Scala
F sharp
Gleam
Clojure
Any other language that I may have missed
I was also thinking to read the "Red Book" . Any help is appreciated
Topics I would like to learn in depth are
L-Calc
Categ- Th eory
6
u/recursion_is_love Sep 16 '24
which is more real world
What is your real world? Can you describe more?
4
u/kichiDsimp Sep 16 '24
From which I can get a job for
4
Sep 16 '24 edited Sep 18 '24
there certainly are haskell jobs.
Edit: for a list of places that use haskell, https://github.com/erkmos/haskell-companies
1
Sep 17 '24
outside academia he meant
2
Sep 18 '24
There are certainly haskell jobs outside academia
2
Sep 18 '24
outside no red ink and cardano
4
Sep 18 '24
At this point it seems like you're trolling lol. But, yes, there are certainly haskell jobs outside those two companies.
6
Sep 16 '24
Elixir
5
u/kichiDsimp Sep 16 '24
I really love statically typed system
5
3
u/pihkal Sep 16 '24
FYI, Elixir is adding a set-theoretic gradually-typed system.
Also, Clojure has much to commend it, but no static type system (just type hints). There's the typed.clojure library, but it's not very popular, and I don't know how up-to-date it is.
2
Sep 16 '24
Elixir is cool had a blast with it making a dumb chat website.
I liked it so much I am stealing the shit out of the design for my own little dumb languge
1
u/kichiDsimp Sep 24 '24
What's your language? Can you share ?
2
Sep 24 '24
Ya it's very bare bones like I JUST finished making it run with no memory leaks. And i am missing some things that I really wanted in there.
https://github.com/nevakrien/Faeyne_lang
The basic premise is we don't actually need arrays to be productive. And we can also have monads implicitly by simply passing "magic" functions around.
The monads thing i think is really important because Ideally this would be inspectble at runtime. Which let's us do a lot of caching
32
u/corwin-haskell Sep 16 '24 edited Sep 16 '24
Haskell is practical, though a little hard. But,
If you're interested in JVM, try Scala 3.
If you're interested in .NET, try F#.
If you're interested in BEAM, try Gleam.
If you're not a FP clean freak and like the type system of Haskell, try Rust.
If you like Jane Street or want Rust with GC not Go, try OCaml.
If you want to study more theories, try Agda/Lean 4.
3
u/Epistechne Sep 18 '24
I've seen the question come up enough, I feel like your answer should be a pinned/stickied answer.
2
u/agumonkey Sep 18 '24
How is scala3 going ?
3
u/corwin-haskell Sep 19 '24
The language itself is much better than Scala 2 and the ecosystem is catching up. However, as you see, Scala 3 maybe has missed the window and remains a niche language. The Javaers like a better Java not a Haskell on JVM, they may stay on Java (new version) or choose Kotlin. The new developers may choose lighter ones than JVM like Go or Rust.
2
u/Final-Roof-6412 Sep 16 '24
Why not Clojure?
4
u/corwin-haskell Sep 16 '24
Clojure is good. I didn't mention it because the OP said he/she loves static type system. 🙃
27
u/jmhimara Sep 16 '24 edited Sep 17 '24
In terms of real-world use, I would say Scala is top followed by F# and Elixir.
21
u/pauseless Sep 16 '24
Clojure will teach a very different form of FP. It’s much more interactive when you embrace the REPL. I think knowing both an ML family and a Lisp family language, is valuable, if the goal is learning.
5
Sep 16 '24
I alao recommend ocaml for repl driven coding. Its utop with a vim combo (slime) is really nice!
8
u/Il_totore Sep 16 '24
Scala is probably the most job-friendly FP language alongside with Clojure and Elixir and has Cats which is basically category theory in Scala used in many companies.
4
u/Migeil Sep 16 '24
I want to try a new FP language which is more real world
Topics I would like to learn in depth are * L-Calc * Categ- Th eory
These are two conflicting statements imo, at least if you're hoping to do both at the same time.
Neither lambda calculus nor category theory are "real world" in the sense that they help you build applications.
They're very interesting and can provide tons of food for thought. They can push you in a certain direction or style of coding, but if your goal is creating applications, then they won't help you, there is no "mathematically correct" way to perform and http request for instance.
9
3
3
3
u/burtgummer45 Sep 16 '24
new FP language which is more real world
they knew you were going to ask that question and wrote Real World OCaml
1
3
u/HerbM2 Sep 16 '24
You'll really make more progress if you have real projects you want to please and choosing a language that compliments those projects will probably give you the best results.
3
3
u/LambdasForPandas Sep 27 '24
I highly recommend Julia if you have any interest in AI, data science, or scientific computing. I've been using it throughout my graduate program, and I've found it to be incredibly practical for solving real-world problems.
2
u/Arc925 Sep 16 '24
+1 for Clojure! Working with the nREPL (network REPL) plugged directly into your running app and being able to evaluate code directly from the opened file buffer, instead of typing manually into the REPL, is such a joy! Clojure (like any LISP) is also very well-suited for structural editing, which for me drastically descreases the friction between wanting to write/change some code and actually doing it.
2
u/npafitis Sep 16 '24
I'd say Haskell is suitable for realworld. If you want something more "industry"-wide I'd recommend Scala or F# (I prefer Scala).
If it's about learning a different kind of functional programing + metaprogramming I'd say Clojure. Clojure is also fairly used in production, might be even more than F#, but it's untyped (there's a library `typedclojure` that provides a fancy typesystem but not widely used, but the author is developing on it constantly), and there's little usage of category theory.
I'd recommend Gleam but I don't think you'd find many jobs in it as it is super young. Elixir is another one that's somewhat similar to Clojure in many ways (except for syntax), and also widely used in industry but also untyped and not focus around category theory.
Can't really go wrong with any of these choices.
2
u/GunpowderGuy Sep 17 '24
If You want " a real world " fp language, then i recommend racket. But the fp language i recommend the most is idris2
2
u/xiaodaireddit Sep 17 '24
Basics of Haskell. Isn’t Haskell the FP with the most depth? Can’t think of a feature in other FP that are not in Haskell. Maybe eagerness but that can be emulated with the EagerMonad
2
u/nrnrnr Sep 17 '24
Definitely consider OCaml and its amazing module system. F# is also a good transition from Haskell.
2
u/homological_owl Sep 17 '24
Don't use pure functional languages if you want to solve real world problems. Use something that allows you to use both fp and oop (in some of its "denominations") Golang, Kotlin, Scala~, for example
2
u/pkumarn Sep 20 '24
Lots of Scala fans here. I somehow felt a lot of mental pain whenever I used Scala.
I would say try F sharp for .NET Kotlin for JVM. Also OCaml
2
u/sod1102 Sep 18 '24
Take a look at this chart: https://survey.stackoverflow.co/2024/technology#2-programming-scripting-and-markup-languages
2
u/Voxelman Sep 16 '24
It's not really functional, but real world:
Rust
6
u/Asleep-Dress-3578 Sep 16 '24
Not more real than Scala, Clojure or F#, only the hype is louder.
4
u/Voxelman Sep 16 '24
I think there is a reason for the hype because it is the only modern competitor for C/C++. Other system programming languages are much less mature or less robust.
I'm programming firmware for Microcontrollers and Rust is the only option for C/C++.
1
1
Sep 16 '24
[removed] — view removed comment
3
u/Voxelman Sep 16 '24
Rust is still imperative, but highly influenced by functional programming.
1
Sep 16 '24
[removed] — view removed comment
3
u/markehammons Sep 16 '24
Scala can be imperative. It's a multi-paradigm language so it can take a lot of forms. Modern Scala tends to avoid imperative code though except in sections that are perf critical.
0
u/Voxelman Sep 16 '24
Sure. But Scala is multi paradigm, functional first, Rust is imperative with functional concepts.
1
u/GunpowderGuy Oct 18 '24
I highly recommend idris2. Its like haskell 2 ( well 3 , idris1 was haskell 2 ). It has both more innovative features ( dependent types and totality checking ) but less technical baggage
7
u/Epistechne Sep 16 '24
If you'll be developing for a Windows/.NET environment at all then F# will be a natural choice.