3 ms·
No. Scala does some interesting things, but it adds a lot of complexity in order to interact with typical JVM code. Haskell doesn't have that kind of baggage,
by chriswarbo 12y ago
No. Scala does some interesting things, but it adds a lot of complexity in order to interact with typical JVM code.
Haskell doesn't have that kind of baggage, so at its heart it's a very very simple language (Lambda Calculus + algebraic datatypes + typeclasses). There are a bunch of extensions, but they can be mostly ignored while getting to grips with the basics.
Programming in Haskell can involve a lot of unfamiliar concepts like monoids, functors, monads, etc. but these are just the APIs used by libraries; the language itself doesn't care about them (except for "do" notation). Just like you don't need to understand design patterns to learn how Java works.
- VLM 12y agoAnd yet that complex JVM interaction makes one possible way to "get toes wet" is to wrap existing lower level java processes (and libraries and things) in a larger functional wrapper. Top down. Assuming you have some experience, confidence, or sample code in java that you can use or understand in the problem domain. So rather than trying to find a way to use recursive functional definition of a factorial in your code (bottom up) it Might be possible to work top down and make the "main loop" or whatever of your java program a functional construct of some sort. I am in no way claiming this is the best way, only way, or even a good way to learn FP concepts but it is a possible way to at least get feet wet, plus or minus your personal characteristics. It is merely an alternative to the extremely popular nearly universally pushed educational strategy of bottom up introduction of FP.
- platz 12y agoBecause Scala is a hybrid language, I feel it doesn't really try to teach FP, but some amalgamation of the two. So you'll end up thinking about case classes, traits, companion objects, unapply, etc... it's a way to solve problems in a unique way, but in comparison with the other more traditional FP languages, it doesn't present the same feel and can obscure which features are the ones necessary for FP - which is important to know if you're specifically trying to learn FP.
- VLM 12y agoYou are technically correct in your observations, but I think we're both stuck in a classic "glass is half empty" "glass is half full" observational trap. Both the good news and the bad news simultaneously about a hybrid language is you can implement the same solution two different ways. If you did both intentionally for educational purposes, it might be fun. I like the many "koan projects" and a side fork that focuses intentionally on doing something two ways might be interesting, if its not already been added while I wasn't looking.