Haskell

Convince me not to learn Haskell.

Other urls found in this thread:

wiki.haskell.org/99_questions
twitter.com/NSFWRedditGif

Why? It's super fun and makes you a better programmer, even though you will never make a penny with it.

Is it really that fun? What kind of things did you program with it?

Uhm, only Haskell excercises.
wiki.haskell.org/99_questions

Ok.
Even after more than 20 years Haskell still seems pretty experimental to the point where important parts of the ecosystem aren't maintained or abandoned directly from the start of their existence. In particular, bindings are a mess. The compiler to have bugs that even something trivial like a web frameworks can't be compiled on occasion.
Their package manager is crap, basically the same like npm, but has to compile everything from scratch.
Development of the language seems to happen arbitrary.
Community is mostly scientist with the usual "who cares about maintainable code I'll throw it away after my thesis" attitude.
The claim "if it compiles, it is mostly right" is bullshit, Haskell basically switches some categories of errors for others, harder to detect ones, like leaks through lazy evaluation.

>inb4 source
no u, Jewgle is your friend

If not haskell, then what is the language of the future?

Natural languages interpreted by an AI.

I'm curious your thoughts on OCaml?

>the language of the future meme
but for functional programming I'd say an ML language, but it I'm getting told they don't have an actually good standard - to be more specific, both OCaml and SML are crap - nor a good implementation.

It's a meme and requires too much time to learn it compared to the gains you're going to get from it - i.e. it's a bad time investment.

For the most part, my post here: I can only tell what I get from OCaml users.
- forget about maintained libraries, in particular bindings as well
- native OCaml still has a GIL
- .Net isn't an option and I hear F# has performance problems here and there
- JVM isn't an option and I guess the JVM based compiler isn't there yet

>OCaml is crap
b-but Jane Street uses it

Sup Forums is a bad time investment

Sssssssooooooo?
Python is used by NASA...

Most languages, OSs and frameworks are objectively crap and could be done better by a 5 yr old with the necessary hindsight.

But we are talking about THE FUTURE, user.

anything with JS output for the foreseeable future

+ anything that runs on JVM/CLR

I have invested in the meme, had high expectations and was disappointed. Setting up a working environment was a chore already. Dependency management is shit. I mean cabal. Community is full fedora.

Monads are easy, the real problem is no useful error feedback loop to actually learn from your mistakes. You will get a ton of type errors because some smartass put in some coolio abstractions in the library you are trying to use.
Haven't check out idris though.

The right way to go about these things is try to build something and try different tools. Using X for the sake of it will slow you down.

Then why do people learn Haskell?

10/10 spot on

this

>Haven't check out idris though.
I dare say the experience will be similar. After all, those scientific languages usually are implemented to prove a point
>muh fancy dependent types
and neglect all other aspects.

For the same reason they tend to 1337 haxxor bistros or something they perceive as that: to upgrade their worthless egos

so wtf, should I just use then

ye

fuck, pls interpert without the comma
im not a druggie

use it anyway.
after all by staying on Sup Forums we have proven that our time isnt worth anything

it's pointless, no real software that anyone actually uses is written in it, learning functional programming will alienate you from other programmers and make you seem simultaneously incompetent and pompous, nothing about the language teaches you any fundamental or transferrable skill only how to create the most terse, incomprehensible, nonportable nonsolutions to invented problems

you should learn a useful language that works the way real computers actually work, like C++

How is NixOS with it's haskell package manager?
GUIXSD is trying to do something similar to it in Lisp.

what about C? too old?

>im not a druggie
dat overspecific dementi
I bet you have dozen of syringes hanging in your left and right right now.

Alright. So like right now dude, I'm programming MATLAB and Python. I'm a mathematics student and I want to learn a language that will enhance my career prospects. So I'm looking for a language that handles computations well, it doesn't necessarily have to be a language to build websites or something.

b-but muh functions that operate without mutable state

im only addicted to Sup Forums and fapping
nothing serious
the only side effects are wasting my life away and achieving nothing

b-but muh arrays that are actually arrays

C++ is kind of C + fancy useful features and libraries. When learning C++, you get to know C for free.

Clojure is better.

you seem to know stuff
anyways, what is the market for programmers lookoing like right now
what type of programmers are being hired the most?
e.g. web devs or financial analytics programmers

You could learn scala, it implements pretty much all the functional stuff you get with haskell. Note that scala is what I'd call a pretty damn good attempt at making a good language, but it's still irredeemably shit like literally every single programming language is, and it has some really ugly warts. The reason is I believe when a half decent language finally comes along I think much of it will be at least partially inspired by scala (which in turn has taken heavy inspiration from haskell)

Clojure vs Scala. Discuss.

Try it, make your own decisions. I like it, though it has some annoying sides. On the other hand, all languages have some annoying sides.

I fucking hate object oriented programming languages.

this, language debates are shit tier red herring, only useful to sort out the pleb developers

It is not about the language, you can go balls deep with MATLAB and Python. If you are worried about work you should look into engineering principles and practice. If you want to be a competent software engineer your best bet is to be language agnostic. Granted, all code monkey job posting will list you have to know X, it does really not matter. Teamwork, communication visibility and connections do though.
I would argue practicing git / sql is more useful than learning Haskell

> learning functional programming will [...] make you seem [...] incompetent
Could you explain this?

install gentoo

chix with big tittiez wont liek ya

/dedthred

tryhard cool kids usually incompetent, it is like a frogposter is a level 1 memer

I mean, Python has tons of support for mathematics, and there are more jobs out there for number crunchers that know Python than any functional language by a long shot.

Ah, that's what you meant by it. Thanks.

What can one use haskell for?
I just started reading a book from the gentoomen library and although it seems like a fun languages I dunno if it's practical.

everything since it's Turing complete

I'm not that guy, but web devs for sure. Everything is on the Internet and it's not going anywhere. There are a lot of ways to answer your question, and I can't predict the future, but web development is broad enough that there will be more total jobs.

Scala doesn't feel object oriented at all unless you want it to. Of course it does run on the jvm, but I wouldn't say it's object oriented as much as it has objects. I'm not gonna sugar coat the fact that there is a lot of things wrong with scala, but I think it's worth a shot if you learn it with the book functional programming in scala

is haskell good for webdev?

Lots of languages are Turing Complete. Even TeX is Turing complete.

im anewfag, define turing complete

hahahahahaahah

haha

hahahaha

In computability theory, a system of data-manipulation rules (such as a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing complete or computationally universal if it can be used to simulate any single-taped Turing machine. The concept is named after English mathematician Alan Turing. A classic example is lambda calculus.

A Turing machine is an abstract machine[1] that manipulates symbols on a strip of tape according to a table of rules; to be more exact, it is a mathematical model of computation that defines such a device.[2] Despite the model's simplicity, given any computer algorithm, a Turing machine can be constructed that is capable of simulating that algorithm's logic

Simply a language in which every program can be written (there is a more formal definition, see wikipedia). It is very easy to make such a language so it doesn't tell much. In practice it is much easier to do something with some languages and something else with other languages.

It can do anything a turing machine can. Pretty much every programming language is turing complete, meaning you can implement any other programming language in it. Some languages like CSS and regular expressions are not turing complete, there are things they simply cannot express.

Yeah, but the academical nature of the language means that you should use another language unless you're really interested in making it work. Languages like node.js are absolute utter dogshit, but you will have an easier time using it than haskell for webdev

why r u laughing?

I haven't used it for that, I've only dabbled with the language. I do know that there are some frameworks for it, I think Yesod is the one people seem to use most. That being said, its not common at all in the webdev world, better to just learn something like js if you want to work there.

nope, there are a few frameworks but they are changing all the time and the documentations is lacking. You might find a nice tutorial for your particular problem, only to realize it is from 6 months ago, and the new version is completely different. Of course, you try to fix things, only to find yourself in dependency hell.

if you are proficient though, you can use it for webdev, but why would you want to do that?
webdev is about delivery and you want to move fast. If you want to collaborate, good luck finding interested people.

afaik prezi uses haskell to generate JS though.

so then brainfuck should be turing complete

But I wanna have a soul and good conscience.
I don't want to conform to languages I don't like or see beauty in.
Haskell is my first language, and I like it very much.
I can make webdeving work, right?
I can get a job, right?

it is

I tried Yesod then switched to Scotty and finally arrived to Postgrest. At this point I only wanted to implement a simple rest api and use Warp for it. After a few days of fucking around I just switched to nginx/openresty and be done in an afternoon.

>Haskell is my first language, and I like it very much.
first like first or mother language?

pls take me seriously

>I can make webdeving work, right?
absolutely

>I can get a job, right?
not a chance, there are very few haskell jobs around and many high functioning autist to compete for them. Webdev is a very very small slice of that.

imo there is nothing cool about using haskell and no fedora points awarded for it

Learn clojure than, it is similar and at least you can use jscript.

you're the annon advocating c++, right?
maybe I should try that
I heard C is only used for drivers

>I heard C is only used for drivers
yes, it's mainly embedded programming and kernel development these days.

It's useless. Simon Peyton Jones himself acknowledges that. All languages are moving to same direction. You are better off learning functional programming within for example Python3 and Java8 now. Trust me on this. Utter waste of time. Been there done that.

not they

If you want webdev, go with vanilla JS/ES learn the standard web technologies.
If you want a more general purpose language, I would pick Java/C# over C++.

I'll just reiterate what I said a moment ago, if you want to work in webdev, it doesn't make any sense for you to start with Haskell. You'd be much better served to start with the obvious javascript or maybe another scripting language for server side shit. Ultimately, you are going to have to work with teams of people, and those people are emphatically not using Haskell.

But user Haskell is the language of the future.

I like it mostly because I don't have to deal with null pointer exceptions and algebraic data types are literally the most useful addition to any typed languages. Why the fuck do most modern languages not have algebraic data types? Monads also make doing most things easier.

Other than that, it's minor things like syntax, conventions, and lack of doing things "pragmatically" which almost always means "it works as long as we never modify the code again and hope nothing goes wrong"

Interesting, tell me more about your experience. What did you use Haskell for?

Because learning languages is relatively easy and enjoyable and sitting down and solving real problems is often neither. Haskell users are usually lacking on algorithm knowledge and their ability to implement them efficiently as well.

If you want to learn a language for employment learn C#, Java, PHP or Javascript. That's literally 90% of the market. I'd suggest going with C# or Java.

> I can mak webdeving in Haskell work, right

Yes you can but you will always be unemployed.

I wish the "way real computers actually work" meme would die. Object-oriented languages are no closer to the metal than functional languages, they just reflect differently terrible ideas about how to build abstractions. OO takes basically the first thing at hand (hurr durr taxonomy), and functional languages use mathematization.
The relative success of OO mainly seems to come from the fact that taxonomy seems intuitive, even while it immediately falls apart on exposure to the real world, but enough blood and sweat has been spent hammering the round peg through the square hole.
This isn't to say that C++ is bad or Haskell is good, my point is that "works the way real computers actually work" is a terrible metric. Even assembly languages are highly stylized compared to actual hardware electrodynamics. Beyond that, your post is just the usual sort of in-group litmus-testing that one should expect from programmers.

>Haskell Curry
>Curry
>Poo In The Loo
>DROPPED

As soon as you need some kind of mutability, it goes to complete and utter shit.

>99 questions/Solutions/2
>(*) Find the last but one element of a list.

myButLast :: [a] -> a
myButLast = last . init

myButLast' x = reverse x !! 1

myButLast'' [x,_] = x
myButLast'' (_:xs) = myButLast'' xs

myButLast''' (x:(_:[])) = x
myButLast''' (_:xs) = myButLast''' xs

myButLast'''' = head . tail . reverse

lastbut1 :: Foldable f => f a -> a
lastbut1 = fst . foldl (\(a,b) x -> (b,x)) (err1,err2)
where
err1 = error "lastbut1: Empty list"
err2 = error "lastbut1: Singleton"

lastbut1safe :: Foldable f => f a -> Maybe a
lastbut1safe = fst . foldl (\(a,b) x -> (b,Just x)) (Nothing,Nothing)

myButLast''''' [] = error "Empty list"
myButLast''''' [x] = error "Too few elements"
myButLast''''' (x:xs) =
if length xs == 1 then x
else myButLast''''' xs

hmmmmmmmmmmmmmmmm makes you wonder why nobody actually uses this language

You can write it cleaner than that.

But all the Haskell answers for this question perform like shit anyways. The only way to get decent performance in Haskell for this question is to use one of the mutable array/vector packages on hackage and then you're stuck with a function signature that includes IO.

bimp

...

99 Questions but Haskell ain't one

It's a good thing your preposter didn't mention OOP, then. And didn't even imply it.

He's probably one of those retards that thinks the imperative paradigm and OOP are the exact same thing. Did you really expect knowledgeable posts on Sup Forums?

>Dependency management is shit. I mean cabal.
>Monads are easy
These are the only true and useful things in your post.

>Languages like node.js