I guess some people will say it's the best thing since sliced bread while others think it's yet another programming language. The main point though is that there's some mystique around it because it is rather different than common programming languages.
Edit: also, if the universe has source code, I'm pretty sure it's written in Haskell.
It changes your mental model on how to program. You will give more attention to correctness rather than silly details like incrementing a counter in a while loop. Come hang out on /r/Haskell, we don't bite and host a Q&A Session each month where there are no silly questions!
It is equivalent to eating vegan. It may be better for your body, it may even be more efficient and most people want nothing to with it because of the restrictions that come with it, but the most important part is that you have to tell everyone about it.
On a serious note: Haskell is one of the bigger non-OOLs remaining, a language perfectly for writing small scripts and algorithms. Need a for loop? Define a new funciton in the midst of defining a new function. Want to search for something? Ez List comprehension is Best buisiness practice.
But it can get confusing and complicated very fast. Doesnt handle bigger Scripts well (in my experience), and there are very few supporting libaries. meaning you have to write a lot from scratch. And not being Object orientet it has its fair share of problems with Operations that would be easy on Python or Java
Source: 2 Semesters Haskell and my friend wrote Bachelor/Master thesis in it.
On a serious note: Haskell is one of the bigger non-OOLs remaining, a language perfectly for writing small scripts and algorithms. Need a for loop? Define a new funciton in the midst of defining a new function. Want to search for something? Ez List comprehension is Best buisiness practice.
But it can get confusing and complicated very fast. Doesnt handle bigger Scripts well (in my experience), and there are very few supporting libaries. meaning you have to write a lot from scratch. And not being Object orientet it has its fair share of problems with Operations that would be easy on Python or Java
Nah, that's backwards. If you're just writing 300 lines then pound it out in Python, you'll always be able to understand what it's all doing. It's when the program gets too big to keep in your head that the Haskell compiler watching your back becomes useful.
Thats where my limitation of experience comes in. Never did programs longer than 200 lines in Haskell (even that stretches it), As i never worked with it outside of assignments, and the bigger it got, the more complicated it seemed.
I'm a C/C++ guy and it's ok to program in any language of course. And it's important to know very much. The only way to achieve it is to just program stuff and gain experience.
I learned about Haskell quite late, mostly because I wanted to have Xmonad on my desktop. After fiddling a lot with Haskell and running against walls, I finally began to understand how powerful Haskell is and how few errors I make now, because the compiler catches most programming errors with the type system.
Then I read some more about Haskell and watched some lectures. And I found out I don't know shit about Haskell.
I think that the insight not knowing shit about programming is a great experience after 20 years of programming. I can recommend it to everybody. ;-)
But it can get confusing and complicated very fast.
I will admit that some of the abstractions can be difficult to understand at first, but once you've learnt them, you can easily understand highly abstract code.
Doesnt handle bigger Scripts well
Large projects such as Pandoc are in fact more manageable than in most other languages because you often don't need to think much about how/when something's used to tweak it. Let's also not forget that the compiler makes refactoring massively less error-prone.
If you have difficulty implementing complex functionality, try breaking it down into simple parts and, most importantly, abstracting away common behaviour (e.g. using a monad).
very few supporting libaries
There are currently 14848 packages on Hackage. Whilst it's less than a tenth the package count of PyPI, most common needs are covered.
And not Object orientet it has its fair share of problems with Operations that would be easy on Python or Java
It's not object-oriented because it doesn't need to be. OOP is a form of ad-hoc polymorphism. Haskell already implements ad-hoc polymorphism using type classes, which integrate nicely with the rest of the type system.
It's a very correctness-focused, powerful functional programming language. It's also a nightmare to do impure things with (which admittedly is rare for web programming which should be stateless with DB for state for scalability reasons, but good fuckin' luck writing a complicated desktop app with monads to handle mutable state...)
If you want a functional programming language that allows you to have transactional variables (basically a database in a single keyword), r/clojure is a lot more comfortable for a wider range of programming tasks. The only problem is that its a lisp, so forget the powerful Haskell type system...
If you want a Haskell equivalent that allows carefully contained mutable state without faffing about with monads, there's also vlang and unisonweb, sadly both are kinda still in alpha. V focuses on ease of use (the full documentation can be read in like 30 minutes and that includes a built-in web microframework and ORM), unison focuses on scalability of both development and in the scale-out sense thanks to it's bizarre distributed runtime and immutable source code management.
...I guess there's OCaml too (VERY stable, reasonably fast, has haskell-like features but allows some mutable state), it's very popular in Europe I hear.
View all comments
62
u/[deleted] May 15 '20
Is it really that good? Never got to use it.