I'm curious about Haskell. Is it better than C in run time?
Why do people learn Haskell, I don't see how a "functional" language is superior to a language like C.
What are the cases where Haskell outperforms C? If i write a function in python or C and give the same input parameters, I will always get the same result (right???), so I don't see how Haskell is superior.
What are typical uses for Haskell? I do bioinformatics, so I parse text all day, would Haskell be better for me than say Perl or Python?
Thanks for answering my brainlet questions. I would love to have someone here really shill Haskell for me, just curious.
>I'm curious about Haskell Good for you, it's an interesting language >Is it better than C in run time? Define 'better'. Faster? No. >Why do people learn Haskell It's a popular functional language. >I don't see how a "functional" language is superior to a language like C. What are the cases where Haskell outperforms C? If you can spare the performance loss, Haskell allows you to write declarative code with high level abstractions > If i write a function in python or C and give the same input parameters, I will always get the same result (right???) That is not the case if your function has side effects. You can apply the functional paradigm of functions being idempotent to other languages of course > What are typical uses for Haskell? I do bioinformatics, so I parse text all day This is a great use case for a functional language. Dealing with abstract syntax trees and pattern matching makes this a breeze
Asher Lee
I do I install the GHC on Arch?
Jonathan Watson
>That is not the case if your function has side effects. >You can apply the functional paradigm of functions being idempotent to other languages of course
Can you elaborate on this please? I'm not a CS person by training, so my knowledge is lacking.
Is a side effect like an error message? I think your second statement means that you can glue together functions, right?
Luke Parker
I'm learning it just out of curiosity and because it's refreshing, so far I enjoy it a lot, but make sure you find a book or tutorial that suits your learning style
Bentley Williams
Well, since that there is a haskell thread already, can someone tell me how Haskell programs work on low level? Do they keep the abstractions or the compiler does some preprocessing magic and turns it into a very safe imperative code, then turns it into assembly?
Eli King
I like OReilly books is there one you might recommend?
Julian Bell
>I do bioinformatics, so I parse text all day, would Haskell be better for me than say Perl or Python?
If you're a mathfag, you'll probably love Haskell. It's like a programming language designed around abstract algebra/category theory.
Samuel Myers
>Is a side effect like an error message? An exception / thrown error is a possible side effect, yes. But also reads from disk/network, waiting for IO, etc. Basically your Haskell functions are functions in a mathematical sense, e.g. a function f which maps elements from some set to another set.
>you can glue together functions, right? Yeah, that's one advantage. It also allows you to use higher order functions, e.g. functions that take a function as an argument. You probably have used a higher order function already like map, which takes a function that is then applied to every element of a collection You can do a similar thing in C with function pointers, but Haskell as a functional language is strongly typed and will not compile unless what you're trying to do is safe
Brayden Long
define "meme" just because it might not be relevant to the typical Sup Forums poster, doesn't meme it's a mean.
William Robinson
I'm getting really interested now. There is a lot of stats in my line of work, but most of it would be parsing data files, matching shit and counting them. Pretty tame if you ask me. Haskell sounds like a good challenge.
Angel Morris
>Basically your Haskell functions are functions in a mathematical sense, e.g. a function f which maps elements from some set to another set. Thanks so much for the information. So does that mean Haskell does most of the work in memory? Sorry if that's a really naive question.
I get the map comparison. That's really powerful. Can you recommend any books? Last question, is Haskell typically faster than Python?
Nathaniel Moore
I get that it's 30 years old, but what was the point in making the Haskell syntax so objectively shit?
Julian Kelly
>Thanks so much for the information sure, beats having to study for another shitty exam kek >does that mean Haskell does most of the work in memory? I'm not too sure what you mean by 'in memory', as all programming languages act on memory for pretty much everything But ideally a Haskell program would not depend on any input from the outside world. Which of course is not that useful, so there are ways around that in the language >I get the map comparison. That's really powerful. Map is like the easiest to get higher order function, there are more complex and arguably more useful reduce What makes them even cooler in Haskell compared to most procedural languages: Haskell is lazily evaluated. So you can apply a higher oder function to sets that are infinite in size >Can you recommend any books? I'm afraid I can't as I learned Haskell during an elective course in university. I've heard good things about Learn You A Haskell though. Or take a look at O'Reilly, I've yet to read a bad book from them >Is Haskell typically faster than Python? Because you can compile Haskell it should have a performance advantage over a interpreted language like Python. I don't know exactly how GHCI works but I think there are no type checks in the compiled Haskell problem, the underlying type system of Haskell (check out Hindley–Milner type system if you are into maths) should ensure at compile time that your program works during run time.
What don't you like about the syntax? I think it's pretty straight forward
Gavin Wood
What are side effects? Never heard about it, because I don't write shit code.
>O'Reilly, I've yet to read a bad book from them Awesome thanks for all the advice. I agree, I live by the O'Reilly books
Carter Green
Your ability to understand social cues is amazing. Do you let the spaghetti fall off too often?
Jacob King
Learn haskell. Category and functional programming are the next big thing in science right now. If you work in science you should learn it.
Liam Turner
I pity anyone who thinks Haskell is hard. It's the same as C++ or something. Just sit down for a weekend and give it a shot. It's a meme language but it's also a good language. The meme just means it's attractive to arrogant assholes because of its reputation. It doesn't really reflect on the language. A lot of the interesting qualities of Haskell are shared with all pure, lazy languages. There will be a better language, hopefully exposing the memory model with built-ins (ownership/RC should be default). Haskell pioneered some great syntactic conventions, particularly do notation. Haskell pioneered a lot of implementation research, particularly the desugaring process.
Chase Ortiz
Sometimes its the fastest and most logical solution. Plus, its not like the computer sees "side effects", its just a bunch of memory one can access at will, like in asm or lowlevel forth.
Aiden Rogers
>Is Haskell a Meme Lang Yes >Why do people learn Haskel >What are typical uses for Haskell? To brag about how smart they are, despite it being dead easy, its useless otherwise.
Nicholas Gray
It is a meme language. Waste of time really unless you want to learn it purely for academic purposes and have no plans for using it irl
Juan Ward
>Category and functional programming are the next big thing in science right now
Benjamin Foster
The difficulty of Haskell is it's strictness. You can't learn in a week to do things as complicated as you can in other languages.
Plus there are many normie filters on it, so only very experienced programmers and CS bachelors know what the fuck is going on.
Jaxson Stewart
>purely for academic purposes
Nolan Murphy
> Why do people learn Haskell It's a different way to program, it's (more) bug free, and if you know it you'll be able to understand whatever aspect of haskell a main-stream language chooses to implement. Personally I'm learning it because it's soothing, somehow?
> haskell > performance
> haskell > use cases
Luke Garcia
You must be a really terrible (and dangerous) C programmer to not know what side effects are.
Blake Ross
There's a Functional Programming book bundle on Humble Bundle right now. You can just take the titles and punch them into libgen. But I'm using "Programming Haskell from First Principles" also known as the Haskell Book and it seems to be the most popular one and also the newest release. The other most popular is Learn You a Haskell for Great Good. Neither is O'Reilly but they do exist.
Justin Lewis
Definitely would second programming haskell from first principles -- I don't think I really understood haskell until working through that even tho it's a big bitch
Elijah Robinson
No really they are, at least in terms of funding.
Hunter Richardson
Haskell is for real programmers not meme datafags like you. All I request of you is avoid python, use Perl, Ruby, anything but python.
Parker Ramirez
Not OP but I actually define meme as a positive quality. If something is a 'meme' in my mind, its better than your average