[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Click for more| Home]

Haskell is undeniably, completely, and truly the best programming

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 136
Thread images: 9

Haskell is undeniably, completely, and truly the best programming language. Whoever disagrees is objectively wrong.
>>
File: 1355318809012.png (497KB, 491x387px) Image search: [iqdb] [SauceNao] [Google]
1355318809012.png
497KB, 491x387px
>>47046246
I am disagreeing.
>>
It's okay.
>>
>>47046246
Haskell is simply Idris for retarded babbies.
>>
>>47046246
I love Haskell too, but for some problems, other languages are better suited.
>>
>>47046246
>no web, no fb
deprecated by JS.
>>
>>47046246
Probably not the best, but it's up there with C and racket/scheme.
>>
>>47046246
LISP IS.

Not this shit.
>>
>>47046380
>no web

Are you fucking retarded? Haskell web is more performant than nginx.
>>
>>47046390
Are you fucking retarded? Lisp has no monads, monoids, functors, fucking nothing other than simple types and recursion. It's like the retarded shitbaby of functional programming languages.
>>
>>47046429
>ru retarded
does it scale
captcha:hanging
>>
>>47046246
if it's so good why isn't there a browser or OS written in it?
>>
>>47046547
C confirmed for best language.
>>
>>47046547
https://github.com/k0ral/hbro
https://stackoverflow.com/questions/6638080/is-there-os-written-in-haskell

google shit yourself faggot
>>
>>47046246

https://www.youtube.com/watch?v=iSmkqocn0oQ
>>
File: 1426067481661.jpg (142KB, 803x688px) Image search: [iqdb] [SauceNao] [Google]
1426067481661.jpg
142KB, 803x688px
>>47046571
>responding to a tripcode
>>
>>47046246
That's objectively not as good as OCaml.
>>
>>47046571
>https://github.com/k0ral/hbro
>Layout engine : WebKit
So 99% of the code is C++.
>>
Haskell is merely pretending to be functional. It just hides all the many non-functional aspects of itself behind operators, classes and built-in functions.
>>
>>47046246
>not assembly
>>
>>47046246
What's great about it?
>>
>>47046246
I'm not sure I follow.
>>
>>47046613
There's literally no such thing as classes in Haskell, what the fuck are you talking about.

>hides non-functional aspects

You're thinking of lisp there.
>>
File: 1422124042436.gif (66KB, 1277x758px) Image search: [iqdb] [SauceNao] [Google]
1422124042436.gif
66KB, 1277x758px
>>47046246
Simply beautiful.

main = putStrLn "What's your name?" >> getLine >>= putStrLn . ("Hello " ++)
>>
>>47046429
>Haskell web is more performant than nginx.
[citation needed]
>>
>>47046647
Get out of here with your shitty non-pure bullshit.
>>
>>47046514
You know you could write macros and have all of those things in a few days time right?
>>
>>47046667
He said best programming language, not best functional language.

Haskell isn't even the best functional programming language.
>>
>>47046661
I came.
>>
>>47046688
Maybe, but they'd be made useless by the inherit lack of pureness (AKA inferiority) in lisp.
>>
>>47046429
>Haskell web is more performant than nginx.
LOOOOOOOOOOOOOOOL
https://www.techempower.com/benchmarks/
>>
>>47046661
Simply better.
(format t "Hello, ~*~a." (format t "What's your name? ") (read-line))
>>
>>47046690
>Haskell isn't even the best functional programming language
Maybe if you're a mutablefag.
>>
>>47046523
Yes.

>>47046666
http://www.aosabook.org/en/posa/warp.html#the-performance-of-warp
>>
>>47046661
ruby:

puts "Hello, #{print "What's your name? "; gets}"


shorter, more readable (a bit)
>>
>>47046748
>implying that ugly ass bullshit is better
>implying that lack of pureness is a good thing
>>
File: 2DjIX.jpg (36KB, 594x443px) Image search: [iqdb] [SauceNao] [Google]
2DjIX.jpg
36KB, 594x443px
>>47046767
>ruby
>>
>>47046771
>implying that ugly ass bullshit is better
That is what I am implying.
>implying that lack of pureness is a good thing
How does the Haskell do input/output? Oh right, it uses a monad, whatever the fuck that is.
>>
>>47046798
>it uses a monad, whatever the fuck that is
Holy shit, are you retarded? Are you actually fucking using your own ignorance as an argument?
>>
>>47046825
Haskell hides impurity through monads, right?
>>
>>47046767
>forgot the question part
lol rubyfags
>>
File: chef.jpg (245KB, 625x1290px) Image search: [iqdb] [SauceNao] [Google]
chef.jpg
245KB, 625x1290px
>>47046865
>u dum
>>
>>47046847
https://wiki.haskell.org/IO_inside
Yes, specifically to make laziness work with input/output.
>>
post some Haskell code for some programs you made :3
>>
>>47046890
Well, have fun with complicated I/O. I prefer optional purity.
>>
>>47046985
>Implying people actually write programs in Haskell

They'd never sully it's purity and beauty. Anyway, that would east into valuable time to spend wanking over the purity and beauty of the language.
>>
>>47046999
>I don't understand it therefore it's complicated

Do you really think like this?
>>
Monads are cumbersome because they're too sequential.
If you write x + y you don't care whether x or y is fetched first (or both at the same time) but in Haskell you have to order the reads explicitly, which isn't even necessary in some assembly languages.
>>
>>47047173
I don't understand it because I have better things to do with my time then learn the complicated ins and outs of a system based around pride and its own complicated nature.

No decent computing books use Haskell. This is because Haskell is relatively new compared to many other languages and because it is overly complicated.

TAOCP uses an assembler language. SICP uses Scheme. You can see the pattern here.

Why do you like Haskell so much?
>>
>>47046847
>>47046890
No. Monad is a typeclass. The IO type hides impurity. IO is a monad, but IO is also an applicative functor, among other things.
>>
>>47047217
When you program stuff in a sane language for a while, say C#, you notice that the functional idioms are great. You also notice that the most common issue in your programs is a runtime exception, null pointer reference to be exact.

Okay so with Haskell we get rid of that. And we also get rid of a lot of other problems, because we have the nice things: monads, immutability, pattern matching etc.

Bad things? I don't really know. At some point I'm gonna run into problems with laziness. And at this point, most of the discussions in the community go way over my head. This is not a problem per se, just makes the community and the language seem more intimidating than necessary.
>>
Is Haskell truly the only option I have when I want a statically typed, functional and fast language?
>>
>>47047851
I think Shen also fits that description.
>>
>>47047851
>>47047861
Also OCaml?
>>
>>47047944
Oh and F#.
>>
>Unreadable shit
>Good
>>
>>47048198
still more readable than java, perl, c++
>>
>>47048198
Once you have more than 10 braincells, it becomes one of the most easily readable languages around.
>>
>>47047594
>null pointer reference to be exact.
The OOHaskell library uses mfix so bottom and null pointer serve the same purpose with open recursion.
>>
>>47046767
>ruby
Elixir is a pure functional language that has syntax that is as clean and intuitive as Ruby and has the best concurrency built into the VM, eventually Elixir will make js and Ruby obsolete both in frontend and backend web programming

for speed and static type inference, Ocaml is superior to Haskell
>>
Haskell is a bit of a PITA in terms of deployment across platforms with all the dependencies that really are crappy to manage with cabal-install and stuff like that.

I really don't like that very much.

>>47048198
It's actually very readable in most cases...
>>
>>47048432
>for speed and static type inference, Ocaml is superior to Haskell
The only reason OCaml is still around is because Haskell is lazy and sometimes laziness is harmful.
>>
>>47048569
>The only reason OCaml is still around is because Haskell is lazy and sometimes laziness is harmful.
the language designers have admitted over and over that default laziness does not bring increased purity, safety or runtime optimizations

people using Haskell are using a needlessly complicated language simply because they bought into snake oil hype
>>
>>47048640
I agree about laziness but Haskell's type system and type inference is better than OCaml's.
data Tree a b = Branch (a (Tree a b)) | Leaf b
data Pair a = Pair a a
a = Branch [Leaf 1, Branch [Leaf 2, Leaf 3], Leaf 4]
b = Branch (Pair (Leaf 1) (Branch (Pair (Leaf 2) (Leaf 3))))

In OCaml, AIUI, you would need explicit modules and type inference won't work there.
>>
>>47046246
>objectively
You need to prove your claim when stating that if you don't want to look like a complete retard like everyone on /g/.
>>
I've been trying out Haskell for the past week.

It's decent.
>>
>>47048640
Laziness may not make the language more pure, more safe, or faster, but it is convenient.

E.g:

Generate a list of all numbers:
[1..]
Find the ninth number divisible by both 9 and 7:
(filter (\x -> x `mod` 9 == 0 && x `mod` 7 == 0) [1..]) !! 9
Generate a list of all prime numbers (assuming that you have a function that find if a number is prime):
filter isPrime [1..]
Find the first prime number greater than 6534:
head $ filter (\x -> isPrime x && x > 6534) [1..]
Or, do the same thing:
head $ filter (>6534) (filter isPrime [1..])
>>
Will I impress employers by having Haskell on my resume?
>>
>>47046716
lack of inferiority in lisp?
>>
>>47050296
What is formatting

Generate a list of all numbers greater than 1:

[1..]

Find the ninth number divisible by both 9 and 7:

(filter (\x -> x `mod` 9 == 0 && x `mod` 7 == 0) [1..]) !! 9


Generate a list of all prime numbers (assuming that you have a function that find if a number is prime):

filter isPrime [1..]

Find the first prime number greater than 6534:

head $ filter (\x -> isPrime x && x > 6534) [1..]


Or, do the same thing:

head $ filter (>6534) (filter isPrime [1..])
>>
>>47050337
lack of pureness = inferiority, not pureness = inferiority.
>>
>>47050340
>head $ filter (\x -> isPrime x && x > 6534) [1..]

I love defining infix operators

head $ filter (isPrime &. (>6534)) [1..]
>>
>>47050337
kek
>>
>>47050314
bump for interest
>>
>>47046246

I find debugging a Haskell program that actually compiles to be somewhat difficult. I've been trying for the past few days to augment xmonad with some functionality that will move the currently focused window to a free workspace and then switch the view to that workspace. It moves the original window and switches to the correct workplace, but the original window is hidden ... somewhere ... rather than on the workspace I intended it to go to. I can't figure out what is wrong and can't set a breakpoint because the order of execution is below my level of abstraction.

Are there any languages kind of like Haskell but with side effects and mutability? I have heard of disciple but never used it. I have used OCaml but don't like the lack of overloading. TypeClasses are nice and intuitive, sometimes using a module for everything is too heavy-weight.
>>
>>47046716
Why not both?
http://clemens.endorphin.org/ILC07-Liskell-draft.pdf
>>
>>47050796
Maybe F#? I'm not too familiar with it, but it might be worth looking at.

I really like Haskell's syntax, so I too would like to know if a similar, mutable language exists.
>>
>>47050796
>Are there any languages kind of like Haskell but with side effects and mutability?
What do you mean by like Haskell?
>>
>>47050824
what does this give you over template haskell?
>>
>>47050901
How hard could it be to write one? We can even address the record namespace bullshit while we're at it.
>>
>>47050796
>>47050901
http://homepages.inf.ed.ac.uk/slindley/papers/frankly-draft-march2014.pdf
>>
>>47050796
>like Haskell but with side effects and mutability
Lisp, more specifically, any Scheme variant.
>>
>>47050340
interested in response from ocaml fan re: advantages and disadvantages of laziness
>>
>>47050924
similar syntax, similar type system.
>>
>>47051157
Have you looked at Shen? That may be what you want.
>>
>>47051213
I have heard of Qi and briefly looked at Shen, but it had a weird license so I stopped reading about it (we all had that phase.)
>>
>>47051271
>it had a weird license so I stopped reading about it (we all had that phase.)
It switched to a 3-clause BSD license a while back.
>>
>>47051427
cool, I'll check it out. Does it still have an embedded almost-prolog?
>>
>>47051503
>Does it still have an embedded almost-prolog?
I don't know. Sorry.
>>
>>47046279
>I ain't even monad
>>
>>47046246
>Weak typing
>No runtime guarantees
>Haskell confirmed for sloppy hobbyist language
>>
>>47051566
>Weak typing
Haskell has the most complex type system of almost any language. It'll let you do some weak typing, but almost no one uses that feature, because you'll likely end up with a function returning a type you didn't intend it to return.
>>
>>47046246
Solid justification as to why it's the 'best'. Functional programming isn't good for most most problems anyway.

I think languages like Scalla which have a nice blend between the imperative and functional style is the future.
>>
>>47051613
Types in Coq, Epigram and Idris:
>this function returns a list of prime numbers that when multiplied results in the input

Types in Haskell
>This function could possibly return a list of numbers
>>
>>47051811

Scala:

sealed abstract class Tree
case class Node(left: Tree, right: Tree) extends Tree
case class Leaf[T](value: T) extends Tree
case object Empty extends Tree


Haskell:

data Tree a = Empty | Leaf a | Node (Tree a) (Tree a)
>>
>not *basic
>not smalltalk

I stopped reading.
>>
>>47051811
>Functional programming isn't good for most most problems anyway.
[citation needed]
>>
Why do I keep going to this place? Why do I do this to myself? This is not a productive website. It's just a bunch of people who brag about their limited knowledge and are hostile over the smallest things. Why do I keep returning? Do I hate myself that much?
>>
go back to work codemonkey

you are not paid for slacking off
>>
>>47052679
It's fun.
>>
Hello gentlemen.

I am planning on learning Haskell sometime this year because FP looks sexy.

Meanwhile this is what I work with when not at $DAYJOB. Shit is $$$.

Have fun!
>>
>>47052679
Shitposting one of mankind's proudest and most noble traditions
>>
>>47052785
>Ada
>job
what sorcery is this?
>>
>>47052849
>when not at dayjob

no sorcery here
>>
I made a server with happstack that lets me upload an image and then displays that image.

And no, I don't have any error handling or validation.
>>
>>47052849
Poor reading comprehension.
>>
>>47052875
Link?
>>
>>47052785
I think that if Ada looked like the 1979 Red language it would have been more widely used.
http://iment.com/maida/computer/redref/toc.htm
>>
why are my fucking posts not getting through
>>
>>47052898
>Link?
localhost:8000

So to be serious, it's just for my local network. I've been moving all my files to central home server to keep it from getting fragmented so now I'm going to try and make a server-side program to organize and view all the shit I download from 4chan and boorus.

I could probably use existing booru software, but their UIs aren't really great if you want to take full advantage of LAN speed/bandwidth (i.e. being able to scroll through full-size images instead of just thumbnails).

I'll probably put it up on Github once I have a decent footing with Haskell. Hopefully other anons will like it.
>>
>>47052960
Ada does look like that.

I have heard from a lot of sides that Ada's adoption was hampered due to slow initial compilers and government ties. Even though business, academia and government participated.

Some trivia - Ada is the only language GCC does not translate to C first before producing assembly code.
>>
>>47046661
So readable. So intuitive. Clearly the hallmarks of a great programming language.
>>
>>47053012
Do you also think Unix pipes are unintuitive?
>>
>>47051945
Types in haskell
This absolutely will return the type specified, no matter what, and this is detected at compile time. How fucking retarded are you?
>>
>>47053172
Only if it terminates.
>>
>>47053005
>Some trivia - Ada is the only language GCC does not translate to C first before producing assembly code.
I thought GCC had different frontends for each language it supported that translated them into the intermediate language GCC uses.
>>
>>47051945
Dependent types are indeed more powerful. But none of these languages are useable enough to do real-life stuff, it's a pity...

>>47053172
Types in these languages are more precise than the ones in Haskell, which is good and they are forced to terminate. But it is a hassle to write functions like that.
>>
>>47046246
> Starts to install Haskell to check it out
> pacman says compiler is 1GB
> Fffff that
> End of story.
>>
>>47053417
It's the size of a normal movie, with a billion times more fun. And after using Haskell a little you will understand why the compiler is so big...
>>
>>47053389
You're right. I guess this is some old stuff or fake propaganda I've been reading.
>>
>>47053468
Would rather use lisp to understand some real AI instead of understanding the size of the compiler.

Bye!
>>
>>47053417
the Utrecht Haskell Compiler is smaller.
>>
>>47053005
>Ada does look like that.
Just looking at the 1979 reference manual, there are a lot of syntactic features in Red that Ada doesn't have which makes it feel more modern than C/C++ and Pascal. Ada is more verbose than C but Red was less verbose and much more elegant than C. This verbosity led to the reputation that Ada is one of those cumbersome languages like COBOL and so people used insecure languages instead.

In Ada, you have to declare subprograms and types at the top of a block before you can use them. In Red, statements and declarations can be mixed and subprograms can be called even if they are defined further down in the program source.
In Ada, you have to explicitly instantiate a generic. In Red, it's automatic and the compiler determines the necessary types, like with C++ templates.
In Red, you write an export list at the top of a module like you do in Haskell.
These make a language more pleasant to use.

I think some of these changes were because of a government requirement, but people writing ordinary programs don't need these requirements.
>>
>>47053890
Oh, nice observations!

Technically, ada does allow you as you probably know, to deckare variables further down with DECLARE/BEGIN/END.

But yeah, I don't know the motivation behind not choosing red. Or did they choose it and then reworked it? I forgot all about red green blue and strawman tinman etc and how it worked.
>>
do
foo <- getFood
let bar = getBar


Looks like shit so I do

do
foo <- getFood
bar <- return getBar


fuck the poh-lice
>>
>>47054079
They chose Green. The Red and Green documents are available online. I've never seen Yellow or Blue.

I read that there were 17 Ironman and 4 Steelman (the 4 colors).
One of the Ironman languages was called TARTAN.
>>
>>47047217
>it is overly complicated
>I don't understand it therefore it's complicated

It's an incredibly simple and elegant language based on intuitive mathematical concepts. A lot of universities use it in introductory classes.
>>
File: 1420162813144.jpg (36KB, 960x960px) Image search: [iqdb] [SauceNao] [Google]
1420162813144.jpg
36KB, 960x960px
>>47054332
OOOOOOH DAAAMNNN
>>
>>47053740
You... are you okay? Like, do you actually have a mental condition? I'm so sorry you have to live like this.
>>
>>47046764
It doesn't look like they configured nginx correctly.
Also
>nginx 1.4.0
that's pretty old.
>>
>>47046246
Why isn't anything important written in it then?
>>
>>47055005
XMonad is pretty wildly used and an EXCELLENT window manager.

Also: https://wiki.haskell.org/Haskell_in_industry
>>
>>47055012
>ricer shit and mostly used as replacement for web/scripting languages
>important
>>
>>47052785
You know what I want? A good FFI for Haskell to Ada and vice versa. Would be udder perfection for application programming.
>>
>>47055005
Pandoc
>>
I can't read Haskell.
Thread posts: 136
Thread images: 9


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]
Please support this website by donating Bitcoins to 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
If a post contains copyrighted or illegal content, please click on that post's [Report] button and fill out a post removal request
All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site. This means that 4Archive shows an archive of their content. If you need information for a Poster - contact them.