Be honest, Jow Forums - is this language actually useful for real-world applications, or is it a meme?

Be honest, Jow Forums - is this language actually useful for real-world applications, or is it a meme?

Attached: HaskellLogo[1].jpg (544x176, 52K)

Other urls found in this thread:

hackage.haskell.org/package/fay-base-0.21.1.0/docs/Data-Mutex.html
github.com/search?utf8=✓&q=language:haskell stars:>1000.
youtube.com/watch?v=iSmkqocn0oQ
twitter.com/AnonBabble

it's a meme like everything else Jow Forums tells people to do. Learn Java, get a job, enjoy being employed.

It's fills a niche, yes.

It's not general purpose.

Is it actually more laborious/difficult to write a typical vanilla C-style program in Haskell, or is it more a matter that fewer people can program in Haskell, and so it's not as portable?

It's a matter of "C is useful in most cases" versus "Haskell is useful in some cases".

What comes to mind is any huge parallel system that needs to scale. Haskell shines there. Would be a hell to write it in C, whereas it's rather trivial in Haskell.

What makes Haskell inherently better for parallel systems than C?

If you say CSP, I'm going to slap you silly. CSP is a paradigm that's not only possible to write in C, but highly encouraged.

The functional paradigm. Since everything is immutable, you don't run into race conditions. You can parallelism a huge system and survive without a headache.

If you're given a complicated parallel software to write with C, you better hire a priest if you want to finish it.

>The functional paradigm
I fucking warned you about bringing up CSPs...

>Since everything is immutable, you don't run into race conditions
This is nonsensical. You can use immutable data structures in C as well.

Not to mention that immutability in itself is not the same as parallell. If your problem is parallel in nature, and doesn't require any data synchronisation, there is nothing that makes Haskell inherently more suited for that than C.

You're talking out of your ass, user. Admit it, so we can move along.

I'm not so much talking out of my ass as I'm regurgitating information I've been told over, and over, and over again.

I have some friends who developed web applications and even (browser-)games with it.

I dont even have a clue how to do that with Haskell

Well, I appreciate your honesty user. My point is that I honestly think that Haskell is a nice functional language, but being functional does not make it inherently better at dealing with parallel designs: problems that are parallel in nature are dealt well with parallel designs. Functional programming *do* make you take a different approach to problems, and that *may* make you see possibilities for parallelism, but there's nothing in the language itself that is inherently better suited for it.

That being said, while we're on the subject of immutability, I actually *do* think that mutability and side-effects should be considered more when writing C code, and it's only in the most recent years that I've seen what I would say "well-written C code" that doesn't mutate state here and there.

/thread

I think one of their main selling points is also that you can prove program correctness, which essentially ensures it works. It's impossible to formalize C programs in the same manner.

My exposure to FP is limited but I'm exposed to FP programmers daily so I tend to absorb some of their thoughts.

>I think one of their main selling points is also that you can prove program correctness, which essentially ensures it works. It's impossible to formalize C programs in the same manner.
While I guess that is technically true (and I know this is a selling point for Erlang as well), I have to comment that I've never seen formal proofs of program correctness as something the industry really cares about. Don't get me wrong, there is a giant market for software verification, especially for embedded critical systems. But they don't rely on formal proofs in the Haskell sense.

>X is not better at Y because you can implement that in C
Guess what, you can implement any language in C. I can't really argue much but I think that Haskell just makes it a bit simpler
>you don't have to reinvent a garbage collector for immutable data structures
>immutable structures don't need any special treatment because all structures are immutable
>you can't shoot yourself in the foot (either by accident or because you know better) because you just can't mutate values
>you can parallelize any computation that doesn't depend on some yet uncomputed value
>you get a higher level of abstraction than goddamn C

As someone who programs C for a living, I agree with all your points, particularly the last one. But the same can be true for all sensible modern languages, it's not inherent to Haskell.

How the fuck does the functional paradigm automatically imply CSP

Because, as far as I know, that is the only way to do parallel computing in a functional programming language.

At least the built-in concurrency data types in Haskell implies it, see mutexes for example: hackage.haskell.org/package/fay-base-0.21.1.0/docs/Data-Mutex.html

Well, isn't the second one (which is is tied to the next two) about immutability a little peculiar? But yeah, I can imagine any other high level language doing non-cumbersome immutability. But if you want to talk about what is inherent to Haskell, it's laziness. The main point of Haskell was to make a lazy functional language. Purity is a consequence of that. Is laziness cool? Well, ensuing purity turned out to be cool. Laziness itself is sometimes cool but sometimes a pain in the ass. Sometimes it allows you to reach higher levels of abstraction but sometimes something explodes because laziness complicates analyzing performance of programs a lot.

Rarely. It has its niches (mission-critical code that you need to really trust and... I don't know) and there are various people working in Haskell and they like it. I like Haskell but I think it's difficult to write regular programs (like, programs that are supposed to do a specific thing) because you need to be so explicit about side-effects (monad transformers). Maybe I just need to read a book about practical use of Haskell.

Attached: mspaint_2018-06-13_12-30-23.png (1213x820, 44K)

I don't know enough Haskell to make a qualified judgement, so I'll take your words for it. As far as I understand it, you need to have a garbage collection per parallel process/thread, so I guess it's not an indeterministic collector, like Java's is (in the sense that you don't really control when it runs or for how long, so timing can be tricky). But wouldn't lazy evaluation also lead to some indeterministic behaviour wrt timing?

>What are Applicative Functors?

It's both. Haskell is useful for real-world applications, as shown by the real-world applications written in it, like the Wire messenger server. Here are the most popular open source ones: github.com/search?utf8=✓&q=language:haskell stars:>1000. It is a meme because it's hard to master and programmers love dick-measuring contests. It is also a meme thanks to its use and abuse in academia.

Attached: wire-logo1.png (620x336, 40K)

it is a meme used by university to teach functional programming

It is //possible// to use C in more cases than Haskell, but a memory-safe language like Haskell is more useful in most cases, because most cases are line-of-business web applications.

Clever pic. Did you draw it?

God himself drew it. youtube.com/watch?v=iSmkqocn0oQ

based

>it's a meme like everything else Jow Forums tells people to do.
>Learn Java, get a job, enjoy being employed.

Attached: hmm spinner.gif (320x320, 240K)

Finally, someone got it.

What do you think? And yes, there's no Haskell in this picture, why do you think that is?

Attached: main-qimg-37dde8411e9f7f433330d84e928d792e.png (602x371, 96K)

>"""enjoy""" being employed
No one enjoys being employed unless there's some kind of niche novelty to it, like developing with Haskell or using Gentoo all day

I've been studying Haskell for the past 6 months.

Honestly, I don't think I can go back to non FP languages. I probably will have to use Java or some shit for work, so that sucks.

Haskell gets a bad reputation because it's hard to learn, because "trivial" stuff like printing "Hello World" requires monads, you also don't have for-loops and conditionals don't are more than you average if-else blocks.

But in turn, the "hard stuff" like making parallel procedures that require synchronization become trivially easy.

If a professional Haskell programmer starts using monads it's almost like he is writing in a different language. You need some experience to understand that concept so an average programmer will never understand your code. I think that's certainly a weakness of that language.

Not that user.

But CSP is not the only paradigm, moreover, it is not even the most used.

Most Haskell parallel programming is done in some kind of temporal logic formal language.

Haskell expanded my brain

>You can do it in C
Time and time again I see this argument made to attack languages like Haskell or Rust for doing things differently. You can use immutable data structures in C! You can manage memory safely in C!
We have decades of experience in programming in C and the stark reality is that programmers make many, many mistakes, take shortcuts, do things unsafely, overlook things. If you think you're different, you either haven't written anything of size or are deluded.

do notation is as noob friendly as it gets.
turn on applicativedo and you’ll likely get parallelism for free.

>did you pull that out of your ass again?

Fixed.

Attached: rust.png (1213x820, 39K)

Most brainlets wouldn’t bother reading about the theory behind it and just get intimidated by the name.

I think you should actually try parallel programming in Haskell and learn the difference between parallelism and concurrency. Parallelism in Haskell is trivial because the purely functional interface means that everything is immutable and has no inherent state. This means you have deterministic parallelism, you can instruct Haskell to run anything you want in parallel with anything else and it'll still give you the right answer. And don't talk about "You can do this as well in X language" there's something called the Church-Turing Thesis that made that obvious a long time ago. The important thing is that the language makes it easy, and Haskell does.

There's a different interface when it comes to concurrency, mostly through something called mVars for communication between threads, I don't feel like explaining how they actually work though.

>Rust faggots trying this hard

>Haskell faggots not trying at all

Attached: benchmark_game.png (1180x364, 56K)

>i haz shiny turd
>i know senpai! let’s rewrite coreutils with it

I regularly see job posts about haskell and FP, so it isn't a meme

a particular one also mentioned Idris

The first step is being dangerously autistic

>is this language actually useful
For you probably not., but some smart kids might make use of it.

Good programmers don't make mistakes.
The burden is on you to not be a bad programmer

That's right, good programmers write flawless machine code. They don't need any abstraction because they don't make mistakes anyway. Also pleb compiler is not needed when you know better.

I can confirm. Since I became autistic my Haskell skills increased by 176%.

Java is trash stfu

>Good programmers don't make mistakes.
BAWHAHAAHBAHAWWHASBAHHAHABHAAQHAH

only people who never invent anything new in software would say that. the life of a genius programmer is actually making bugs. safer languages reduce the number of bugs a programmer creates. pure functional languages are useless, proven by the fact that there is no software of significance written in them. BUT safe(r) languages are very much a thing esp. for prototyping. C (+ assembly) is best if you want to replicate something that's already been done 50+ times and just need to make it more hardware-efficient
that's the only reason why a lot of end-consumer software is written in C/C++. novel/innovative software isn't. they generally port an idea once it's already working.