3 ms·
> I have found Haskell very difficult to use with Cabal and its package management. The reason I went to Haskell was to teach myself functional programming. Aft
by chriswarbo 11y ago
> I have found Haskell very difficult to use with Cabal and its package management. The reason I went to Haskell was to teach myself functional programming. After struggling and going through 2 books I still felt like I hated Haskell due to making the environment just work. I work in three different locations and to get all 5 computers to work in Haskell was a serious pain.
Package management is certainly the worst thing about Haskell at the moment. Just yesterday I had to fight with cabal, and sit through hours of compilation, to build my application with profiling enabled :(
There's recently been a surge of activity in this area though, which seems to have been driven by FPComplete and consulting with industry:
- First there's "Stackage", which is basically a curated version of the package repository Hackage. Anyone can upload a new package to Hackage, and package authors can make breaking changes whenever they like. Stackage takes consistent snapshots of Hackage, where the package versions are known to work together.
- Next there's "Stack", which is an alternative UI for Cabal (ie. it replaces the commandline tools, but uses the same libraries and infrastructure). Nice features of stack are that it can fetch/install GHC (so "bootstrapping" is much easier), and it doesn't use a global package database (cabal has this feature with "sandboxes", but they're opt-in).
- Personally, I use Nix for managing Haskell packages. It's a bit like stack or cabal sandboxes taken to the extreme, although its Windows support is still pretty experimental. It will fetch pre-built packages from a cache, rather than building stuff locally (as long as you're using the defaults, at least).
Take a look at https://www.fpcomplete.com/blog/2015/06/stack-0-1-release https://www.fpcomplete.com/blog/2015/06/stack-0-1-release for more info.
> This lead me to see what else is out there. It lead me to https://www.coursera.org/course/proglang https://www.coursera.org/course/proglang which introduced me to Racket and I loved it and felt that Racket was the perfect fit for me.
Racket (and Scheme in general) is also an excellent functional programming language. Having dynamic types and macros makes it a very different beast to Haskell, so it's definitely worth learning both :)
- peatmoss 11y ago> Having dynamic types and macros makes it a very different beast to Haskell, Can you speak to how the type systems in Typed Racket and Haskell differ? I ask because I too have tried scaling Mount Haskell and noped out not long after the base camp. If I continue with Typed Racket, am I getting some or most of what I'd get by learning Haskell? Or is Haskell simply a beast I must slay to become whole?
- chriswarbo 11y agoSorry, I've not used Typed Racket so I can't comment. I've only played around a little with Racket itself, although I've used various Schemes in anger (and more Emacs Lisp than I'd like!) One cultural issue, rather than a technical one, is that the whole of Haskell is strongly typed, lazy and pure; there's no getting away from it, so every idiom, library and API must take them into account. I imagine Typed Racket's ability to mix and match features will result in more "conservative" code (ie. choosing the type system to match a known approach, rather than inventing a new approach to fit the type system).
- peatmoss 11y agoThat's a good answer. I'm still fairly novice in Racket, so I don't yet have a good intuition for where Racket is asserting its own cultural norms. Haskell definitely communicates its concepts of purity early on, and so I can see where the community would continue to push itself in these directions.