[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 | Free Show | Home]

What is your honest opinion on the Haskell programming language?

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: 150
Thread images: 10

File: 1499488055298.png (39KB, 600x600px) Image search: [Google]
1499488055298.png
39KB, 600x600px
What is your honest opinion on the Haskell programming language?
>>
Laziness is a bad idea.
>>
>>62285906
it's the best tool for learning functional programming concepts. other than that it's rather useless outside academia
>>
>list with 1000000 elements
>add an element to the end of the list
>1000001 elements get copied into a brand new list
>cue Haskell users wondering why their toy language doesn't take off in the enterprise
>>
>>62285906
See >>62285966 and >>62285983
Also, they haven't even been able to ship a sane compiler for almost 20 years.
>>
>>62285983
focking this, mate
>>
>>62286065
there are highly efficient vector and sequence modules
>>
>>62285966
Conceptually it is a good idea.
But I don't know if it's a good idea for a useful programming language.
It might be better if haskell gets replaced by something strict as THE functional language to program in.


>>62286065
Then simply don't use a list, you fucktard.
The good thing about this language is that you don't even need to change your code much if you make it an instance whatever you need.
>>
>>62286065
>doesn't take off in the enterprise
>what is finance
>>
>>62286065
-- ([a], [a])

add_first x (xs, ys) = (x : xs, ys)
add_last y (xs, ys) = (xs, y : ys)

get_list (xs, ys) = xs ++ reverse ys


Haskell wins again! AGAIN! CUTE!
>>
>>62286096
>what is finance
A sector dominated alone by Java and COBOL.
Maybe with C++ and OCaml mixed in, if you believe in the wallstreet meme.
>>
>>62285906
Tedious and difficult to learn, produced binaries are slow. It offers me nothing
>>
>>62286128
>he thinks Java and Cobol are used in the same context as C++ and functional languages
You don't know shit m8
>>
>>62286135
>Tedious
wrong.
>difficult to learn
maybe.
>>
>>62285906
programming is all about side effects. it's too much of a hassle to deal with IO monads and crap to get working programs. otherwise cool. F# is much better for writing code, like lisp, as it isn't strict and asshole about FP
>>
>>62286144
I never said that, illiterate faggot.
>>
>>62286144
>>62286198
But that being said, they are.
You don't know shit, m8.
>>
>>62285906
>1TB of virtual memory
>>
File: (you)-.jpg (58KB, 372x450px) Image search: [Google]
(you)-.jpg
58KB, 372x450px
Not brainlet-friendly enough to ever take off, as demonstrated by this very thread. Every halfwit that can't grok monads (let alone how efficient immutable data structures work) necessarily ends up jumping on the efficiency meme-wagon and perpetuating the lie that Haskell is not efficient enough for... well... they never specify. Apparently it's not efficient enough for anything.
>>
>>62286209
>maintaining legacy transaction systems is the same context as doing algorithmic trading
Yet again proving you're a retarded faggot
>>
>>62286181
>programming is all about side effects
If you were competent, you would discover that very little of it is about side-effects.
>>
>>62286144
not him, but C++ and Java are used in trading in exactly the same context
>>
>>62286270
They are same. In fact people use even slower shits there. Get over it, brainlet.
>>
>>62286313
Not at all, no financial firm uses Java for performance critical applications. Most of it is done in C++, sometimes C and asm
>>62286316
>They are same
Oh so you're just baiting
>>
>>62286181
>programming is all about side effects.
that's the stupidest thing i've ever read on /g/
>>
>>62286377
No, were not. I bet, you plebosaur and that >62286387 fagrocket are the same, though.
>>
>>62286423
>m-muh samefag
truly pathetic
>>
>>62286450
you're the samefag, buddy
>>
>>62286377
>Not at all, no financial firm uses Java for performance critical applications.
false
https://www.cinnober.com/hubfs/Website_2016/content/White%20papers/The-benefits-of-Java-white-paper-1.pdf?t=1504622649992
>>
>>62285906
Fun to write from a creative problem solving and/or math standpoint but not particularly useful for anything besides parsers and compilers.

The prelude is pretty crufty and could use an update. Immutable singly-linked lists being a first-class feature means that idiots like this >>62286065
think that you're supposed to use them everywhere, but they are certainly not more important than any other data structure.

>>62286231
Monads are cool but they are not a panacea. Big haskell programs seem to deteriorate into this style where everything just returns a monadic value, which makes it pretty similar to a procedural or object-oriented language. I hope people come up with some new monads to remedy this.
>>
>>62286144
>C++ and functional languages
Don't compare Haskell to C++, moron. Haskell is, like, even higher level than Python.
>>
>>62286554
>>62286377
i'm currently at work at a financial firm that uses java for performance critical software. Can confirm there's constant memory and performance and indian code issues.
>>
>>62286574
Sounds more like your own fault.
No problem here, with my Azul JVM and Excelsoir JET compiler.
/shilling
>>
>>62286573
>implying I compared them
Learn to read
>higher level than Python
You don't know what you're talking about
>>
>>62286557
>Monads are cool but they are not a panacea.
I wasn't implying anywhere that monads are a panacea. It was just an example of a typical stumbling block.

>Big haskell programs seem to deteriorate into this style where everything just returns a monadic value
I don't see why that would be the case unless the bulk of your program is I/O handling.
>>
>any functional mumbo jumbo in real world finance
kek no
t. QA desk at footsie IB
>>
>>62286387

kindly pull the giant FP abstraction you have jammed up your ass out and take a look at what computers are used for
>>
>>62286608
You clearly attempted to indicate some sort of analogy such as follows. Learn to write.

Java : Cobol :: C++ : Functional Languages
>>
>>62286635
>unless the bulk of your program is I/O handling.
So basically everything except babbies first servers, converters and compilers.
>>
>>62286594
>Azul JVM
i don't write the code, i just fix the system after the fact. honestly i'd like to bring up azul & excelsior
>>
>>62286655
i'm not trying to advocate a purely side-effect-free approach like haskell, but saying programming is all about side effects just means you're a bad programmer. if you can't do the simplest thing without something undefined happening invisibly then you need to refresh yourself on some basics
>>
>>62286656
No I didn't, fuck off.
>>
File: 1476540933228.jpg (4KB, 200x200px) Image search: [Google]
1476540933228.jpg
4KB, 200x200px
>>62286668
>the bulk of every program he's seen consisted of I/O handling
Sounds like babby's first programming job involves nothing more than writing utilities.
>>
>>62286681
I was half kidding. I wonder how much tuning the stock JVMs garbage collector actually helps.
Any experiences here?
>>
>>62286653
>lying on the internet
>>
>>62286687
in haskell's FP perspective, IO is side effect. UI is a side effect. state is a side effect. come on man.
>>
>>62286703
Or browsers, CAD & CAM software, actual web servers, GIS software, most of (You)r computers libraries, DAWs, most industrial software.
>>
>>62286724
And that's why I said I'm not advocating that.
>>
>>62285906
I'm familiar with typeclasses coming from rust traits, but i'm annoyed with the omission of method syntax.
>>
>>62286700
Your inability to properly form your thoughts into words is not my problem, Anon. Git gud, and stop responding to debate with hostility, it will only get you into trouble in the real world.
>>
>>62285906
Solves the wrong problem. Comes with a shitty standard library.
>>
>>62285906
I don't use it. That's my fucking opinion. Go suck the shit out of my ass hair.
>>
File: mfw-this-shit-again.png (197KB, 294x256px) Image search: [Google]
mfw-this-shit-again.png
197KB, 294x256px
>>62286755
>implying I/O handling is the bulk of the code in any of those examples
>unironically thinking anyone will buy it
>>
>>62286770
>it will only get you into trouble in the real world.
>implying he isn't sperging in his basement after throwing some tantrum at his last and only job about them not using Hasklel
>>
>>62286785
It is. Turns out IO doesn't only mean keyboard interaction.
>>
>>62286787
I'm actually working on an Access solution for a workgroup at an organization right now. I learned VBA on my own to build it and have been training the admin staff how to write SQL and VBA so as to maintain it when my contract is up.
>>
It's a shitty obscure language that nobody uses.
>>
File: mfw-you-exist.jpg (17KB, 246x374px) Image search: [Google]
mfw-you-exist.jpg
17KB, 246x374px
>>62286805
>It is.
My experience conflicts with your assertions. Can you actually prove your claim? Otherwise, kindly fuck off.
>>
Are there some actual FP jobs?
hard more: no clojure and web shit
>>
>>62286756
maybe not but you're assuming i have no clue what i'm talking about when i'm just using the haskell perspective in a fucking thread about haskell. is it good design to write a bunch of functions that throw side effects around that make no sense? no, but side effects are a necessary portion of every program.
>>
>>62285906
Ctrl+f "haskell" in an employment website.
>>
>>62286635
Monads are about encapsulating side effects, not just I/O. Any sufficiently large program is going to have many interconnected parts that cause various side effects with each other (some of those side effects being I/O related). Also, if you want to write performant haskell, you need to use a memory management monad everywhere. Curiously, I think this is one of haskell's strengths that you can do this, whereas in other languages you would need to write some C FFI code just to even get down to that level. Of course you can still do that in haskell too if you really want.
>>
>>62286865
No, I just assumed you didn't read my post. Why would you respond to a statement saying "I don't support all the assertions of the Haskell philosophy" by pointing out the assertions of the Haskell philosophy that don't make sense?
>>
>>62285906
It's fun.
It teaches a lot.
It can do the big stuff if you really want to (though you're probably better off with a language that has more ready-made libraries).

What's to hate?
>>
>>62286905
because you called me a bad programmer and we're gonna nerd fite
>>
>>62286825
I meant OP, the Hasklel sperg. >>62286832
Yes, look at the source code of any browsers.
>My experience
consists of sitting in basements and watching animuh.
>>
>>62286932
Well ok that makes more sense. I take it back, we don't really disagree after all I guess.
>>
File: (you).jpg (53KB, 488x393px) Image search: [Google]
(you).jpg
53KB, 488x393px
>>62286872
>Monads are about encapsulating side effects, not just I/O.
I don't know why you're still moaning on about monads. I never said they are a panacea, that they're just for I/O, or whatever bizarre strawman you're going to pull out of your ass next.

>Any sufficiently large program is going to have many interconnected parts that cause various side effects with each other
Plumbing looks like plumbing in any programming language. If most of your program is just plumbing, feel free to use something more suitable than a functional language. Python should suit you.

>you want to write performant haskell, you need to use a memory management monad everywhere
And once again someone brings up the performance meme without specifying any context.
>>
>>62286939
>browsers
That's the only example on your list that remotely makes sense. Either way, provide evidence or piss off. I'm not interested in discussing your subjective opinions.
>>
>>62286986
>That's the only example on your list that remotely makes sense.
Actually that's the example that makes the least sense, you sperg-o-rama, it was almost a bait part of the list, because big parts of it can be implemented side-effect free. But if you actually knew shit you'd know that instead of falling for it.

representative for Hasklel programmers
/thread
>>
>>62285983
>the best tool for learning functional programming concepts.
That's would probably be a teaching language like Standard ML. Learn Haskell after you've learned an ML.
>>
File: wtf-did-i-just-read.jpg (116KB, 536x640px) Image search: [Google]
wtf-did-i-just-read.jpg
116KB, 536x640px
>>62287054
>spouting opinions without being able to provide a shred of evidence
Typical /g/ brainletism.
>>
>>62287078
>not deducing the obvious in your brain
Typical Hasklel brainletism.
>>
>>62286065
>add an element to the end of the list
This is not what linked lists are for. A programmer who doesn't know his way around data structures has no business dissing Haskell. There are many reasons why Haskell sucks, but immutability isn't one.
>>
File: 1496998730043.jpg (33KB, 493x386px) Image search: [Google]
1496998730043.jpg
33KB, 493x386px
>>62287105
>pulls an opinion out of his ass
>unable to back it up with any evidence
>i-i-it's obvious!
Off you go, tard.
>>
>>62286135
>produced binaries are slow
No, they are actually quite fast on average, on par with properly warmed-up HotSpot Java, but use much less RAM. The problem (caused by non-eager evaluation) is that the performance is somewhat unpredictable. Small changes to your code are more likely to kill the compiler's ability to optimize it than in a language like Java.
>>
Haskell was an experiment to see if a functional language that defaults to lazy evaluation could be highly optimized. The experiment failed, if you watch any interview of the language designers they will tell you that they no longer care about lazy evaluation.

A misconception about Haskell is that its a pure functional language and that other functional languages like Ocaml and Erlang are only hybrid functional/imperative. This is not true, Haskell is not functional in the mathematical sense, it has state, its not any more pure than say Ocaml. The only difference is the use of monads that try to isolate I/O from program logic. Monads are also a failure which is why no other languages uses them.

That said, Haskell has the prettiestt syntax of any programming language so I wouldnt blame anyone for wanting to learn it over other functional langauges.
>>
>>62285906
Haskell will never become popular with it's shitty syntax. It should have used s-expressions.
>>
>>62286377
I know for a fact that a lot of Vanguard is straight Java
>>
>>62288014
Why is Ocaml so unpopular if it's better? Not to say Haskell itself is popular but still
>>
>>62288135
it doesnt run on windows for one, which is why F# was made

some say SML is better than Ocaml, there are a lot of implementations of SML (Intel just released theirs), there is only one Ocaml implementation

Ocaml is honestly a better and more productive language than Haskell, but lack of use means lack of libraries. Janestreet released their standard library for Ocaml which is called Core, its better for general purpose programming than the standard library that comes with the official Ocaml implementation
>>
>>62288220
Aren't functional languages almost exclusively used in academia or to just learn about algorithms and theoretical CS? why care about general purpose programming if nobody's going to do any with it?
I mean sure erlang is very popular but that's because of its special circumstances. The other FP languages are mostly dead
>Ocaml is honestly a better and more productive language than Haskell
Why learn Haskell then? pretty syntax isn't a good enough reason
Are there any things it does better than other FP langs?
>>
>>62288275
Just about every modern programming langauge has functional programmng features like high order functions, closures, mapping functions. You use high order functions all the time in Javascript. The only difference between functional languages like Ocaml, Elxir, etc is that they use immutable data structures like lists and tuples whereas in a scripting language like Javascript or Ruby you can reassign variables and container objects.
>>
>>62285906
It has some good but too much bad.

The bads:
- significant whitespace
- gc instead of region-based (see: MLKit)
- laziness
- forced immutability instead of immutability by default with an easy override
- many libraries but they're all absolute trash (some are downright incorrect, most are so incomplete it would be faster to rewrite from scratch than to learn to use them)
- bad support for language extension (e.g. macros or other mechanisms for DSLs)

The goods:
- the type system
- the ffi
- it's pretty fast
- strong static typing with great type inference
- the case-based (thus extensible) function definition
- pattern matching
- the module system

The missing nice-to-haves
- no ability to modify a running image (see: lisps)
- no idiosyncrasy
>>
>>62286957
I'll repeat: Monads are not just about I/O. Look at all the instances of Monad in the prelude if you want to see more of why this is. This tip will serve you well if you wish to write more haskell. And yes, there is plumbing in haskell, but the benefit is that you can write a lot of it in haskell. Python is a poor example because there is still tons and tons of plumbing in that, perhaps moreso than in haskell. It's one of those languages where you need to dive into C FFI if you want to get anywhere with it.

There is no performance meme in haskell. The issue has to do with how you need to implement efficient data structures that map correctly to immutable data types without creating too many thunks. If you want an easy to understand context for plebs about the issue I'm talking about, look at the history of how hash tables have been implemented in haskell.
>>
As others have said, OCaml is a much better language than Haskell. The former is at least not afraid of using side effects when necessary.
An even better choice would be any Lisp.

People complain about Common Lisp "encouraging procedural programming", not at all. It's simply a truly unopinionated language. Just because it allows functional programming it doesn't mean it has to force it down your throat. That's why most purely functional languages will never be relevant.
>>
>>62285906
It seems like a "trendy" language that has no use other than javascript type "web portal" interpreters that let kids roleplay as programmers for an hour or two.
>>
>>62288133
So is TIAA.
>>
>>62289361
Common lisp is extremely opinionated. In fact, there's a reason nobody seriously uses higher-order functions in common lisp: the nature of lisp-2's is that using functional-like constructs in them makes an unsolvable mess. Thus the opinion. Common lisp is antiquated in that regard. The only reason to use it is the compilers. The GCs are shit, the libraries are shit, the standard tools are shit and the language itself is cumbersome. Schemes are significantly better in all regards but the libraries, but no implementation has a good compiler.

Ocaml is a better language than haskell in almost all ways in a similar way that schemes are better than cl in almost all ways, but ocaml can't into parallelism while haskell does not have that problem. Also ocaml has so many fewer users that libraries are a much bigger issue. Plus there are lots of conflicting problems such as different standard libraries (in particular, the "normal" standard libraries is full of bugs and actually unusable for general programming, for instance). It ultimately has much of the same problems as haskell, though not all.
>>
Haskell is the best way to learn FP.
>>
>>62289204
> bad support for language extension (e.g. macros or other mechanisms for DSLs)
template haskell is actually equivalent to lisp macros

>no ability to modify a running image
this would not make sense in haskell as it's based on lambda calculus, not the turing machine, despite both of them being functionally equivalent

>laziness, forced immutability
i agree these are dumb and useless for a lot of programs, but they're the only real reasons to write in a pure functional language
>>
>>62289562
>this would not make sense in haskell as it's based on lambda calculus, not the turing machine, despite both of them being functionally equivalent
Lisp is based on lambda calculus and does not have that problem. Moreover, the fully functional model of haskell implies this would make even more sense than in lisp where methods can have side-effects, since what you're replacing, and what you're replacing it with, cannot fuck up your global states or work in fucked up ways due to the current state of the global states, or whatnot.

>template haskell is actually equivalent to lisp macros
Template haskell is hacky as all fuck is the main problem. The lack of homoiconicity also makes it nowhere near as nice as the lisp stuff.
>>
>>62288275
>Aren't functional languages almost exclusively used in academia or to just learn about algorithms and theoretical CS?
The primary benefit of functional languages is increasing productivity. However to realize those benefits you need skilled programmers, not just whoever you can hire straight out of university cheapest.
>>
>>62287108

>What is a doubly linked list?


>>62289615

I don't think you should compare Lisp to Haskell.
They have different goals, different paradigms and different advantages/disadvantages..


>>62285906

Haskell is like the death star:
"You just wait, Tatooine! In five days I'm close enough to vaporize you!"

I guess what I'm trying to say is, Haskell makes difficult problems easy and easy problems difficult.
>>
>>62289459
>Schemes are significantly better in all regards but the libraries, but no implementation has a good compiler.
Racket has pretty good libraries, and Racket 7 will use the Chez Scheme compiler which is great.
>>
>>62286065
>Uhhhh what is immutability guys??? And why is it important
>>
>>62286708
I've heard a person in the biz say that it's Azul or bust. You couldn't turn HotSpot in real-time.
>>
>>62289748
>skilled programmers
How do you measure skill in that case?
Most people who use FP are scientists, and scientists are notoriously bad programmers
>>
File: erlang-logo.png (6KB, 156x137px) Image search: [Google]
erlang-logo.png
6KB, 156x137px
why do we get daily Haskell threads but there is hardly ever a thread about erlang or any other functional language?
>>
useless and shit
>>
>>62289833
into real-time*
>>
>>62289848
>Most people who use FP are scientists
I have no idea where you get that impression.

>skilled programmers
>How do you measure skill in that case?
Ability to a variety of PL paradigms. AKA, skilled beyond what their undergrad java programming courses taught them. A professional who takes their profession seriously.
>>
>>62289615
i never considered lisp to be based on lambda calculus, it is a language centered around list iteration, and the curious property of lists such that if you nest them, you get a tree structure that maps well to a traditional stack-based design. this is why lisp was popular initially, because of its power given the low memory requirements. by contrast, ML-family languages are based on functions: lambda calculus is about just reducing functions over and over again until you get the desired result

yeah template haskell is hacky it is but it's the future, giving full access to the AST is the only proper way to extend a compiler, it's the closest you'll get to homoiconicity in a compiled language. the penalty for having that flexibility at compile time is unfortunately that you don't get runtime code modification
>>
>>62286862
There is quite a bit of Erlang in webshit and assorted client-server shit, even at some large orgs. Elixir (aka Erlang |> Protocols) is on the rise in webshit, especially real-time webshit, but more at startups and young companies.
>>
>>62289851
Nobody on /g/ cares about Erlang and OCaml because they're not hard enough
Also there isn't a tiling WM written in either
>>
>>62290074
you mean unlike java erlang is not taught in community colleges and coding camps
>>
>>62290096
Haskell isn't either. No functional language is taught in coding camps, JS doesn't count
Also Erlang and Ocaml don't have a cool logo like Haskell's lambda
>>
>>62288014
>its not any more pure than say Ocaml
This is incorrect. State is simulated in Haskell through monads and pure functions. It may seem like a theoretical distinction, but it is an important one. OCaml has no model of state.
>>
>>62288014
OCaml is getting a new, some argue prettier, syntax thanks to Facebook (https://reasonml.github.io/), and a potential killer app in the form of BuckleScript.
>>
>>62289957

>i never considered lisp to be based on lambda calculus

What the actual holy motherfucking fuck??

Lisp was THE first implementation of the lambda calculus. All you do in Lisp is Alpha conversion and beta reduction, all day every day.. The "curious property of lists" you mentioned.

Read here:
>http://www-formal.stanford.edu/jmc/recursive.pdf

For your interest:
Church created the untyped calculus first, which he intended as a foundation for mathematics. Then he developed the simple theory of types as well, but that wasn't the original point of the system.

See:
>http://hope.simons-rock.edu/~pshields/cs/cmpt312/cardone-hindley.pdf


Typical snotty Haskell kid, thinks he knows it all..
>>
>>62285906
Gay meme for people who can't into ML.
>>
>>62290542
not sure what your point is, here is a direct quote from the second paper proving you wrong:

>LISP was not directly based on λ-calculus, although it owed something to λ (and its abstraction notation was even called “LAMBDA”). LISP’s substitution procedure was not defined exactly the same as in λ, in particular identifiers were handled according to so-called “dynamic binding” rules. This choice simplified LISP’s implementation by means of interpreters, but it greatly complicated the use of bound variables by the programmer.

yes, lisp could technically do lambda calculus, (as could, realistically, any other turing-complete programming language), but this isn't and has never been the point of lisp. the memory limitations of old computers forced them to use dynamic binding which is equivalent to having free variables everywhere, which is not lambda calculus nor is it pure FP. so while executing a lisp program sure can LOOK like it's equivalent to α-conversion and β-reduction, in strict terms, it is not the same.

>Typical snotty Haskell kid, thinks he knows it all
i do know it all, u mad
>>
>>62289459
Good CL code usually is OO and uses CLOS a lot.
>Schemes are significantly better in all regards
I would not put it this strongly. Take a gander at http://wiki.c2.com/?LispSchemeDifferences.
>no implementation has a good compiler.
If you mean it should produce fast code, there is Chez Scheme. It has been recently open sourced. If you mean clever or fun to work on but still practical, CHICKEN Scheme is all that.
>>62288077
>It should have used s-expressions.
http://docs.racket-lang.org/hackett/
>>
>>62289957
>>i never considered lisp to be based on lambda calculus,
Then you're historically illiterate.
>>
>>62290667

You don't really get it..

Yes, Lisp isn't an exact clone of Lambda-Calculus. Just as Haskell or OCaml isn't. This starts with that fact that a "pure" Lamda-Calculus doesn't even have numbers, but you wrap a certain function (which you can identify with 0) in other functions (which we can identify with a "successor" function). You also have no boolean logic (TRUE and FALSE are defined in a very special way in lambda calculus) and therefore you don't really have control flow (let alone pattern matching) as we know it. Good luck, doing arithmetics with that, it's a completely different beast.

So come down from your moral high ground, only because Haskell uses some interesting ideas of Haskell Curry doesn't mean it's "the real lambda calculus".

Lisp was very important historically, without Lisp there wouldn't be "functional programming" as we know it and definitely no Haskell. If you ignore what can do and look at the very fundamentals and bare metal of Lisp, what do we have? Lambda calculus.
You have the parentheses. Originally the Lisp operator was even written with a letter "lambda".


This is Lambda-Calculus:

Y = λf. (λx. f (x x)) (λx. f (x x))


This is Lisp (Scheme):
(define y
(lambda (c)
((lambda (f)
(f f))
(lambda (g)
(c (lambda x
(apply (g g) x)))))))



No similarities at all, huh?
>>
>>62290778
>>It should have used s-expressions.
>http://docs.racket-lang.org/hackett/
Nice. Once again proving Racket kicks ass.
>>
https://youtu.be/iSmkqocn0oQ
>>
>>62290074
it's more like
>Nobody on /g/ cares about Erlang and OCaml because they're not cool enough
erlang is hard, but hello world is easy in erlang. the difficulty comes other places like having to think about how to build a concurrent fault-tolerant system. anons don't care because other anons won't be able to appreciate subtler things like this.
>>
>>62291043

Sorry bad formatting..

To make the similarity clearer, here is it in Racket, where you can still use the lambda symbol:

(define Y (λ(f) ((λ(x)(f (x x))) (λ(x)(f (x x))))))



It's literally the lambda calculus plus some parentheses..
>>
>>62291128
b-but muh monads :(
>>
It's fun to learn. I know facebook uses it internally but for general software development it just lacks high quality libraries and support. You can't realistically use it to do anything ambitious because it takes too much reimplementing the wheel.
>>
File: land_of_the_lisp.jpg (96KB, 550x486px) Image search: [Google]
land_of_the_lisp.jpg
96KB, 550x486px
>>62291054

The thing is, Lisp is in an incredibly great language building material..

>https://gergo.erdi.hu/blog/2013-02-17-write_yourself_a_haskell..._in_lisp/


Not saying Haskell is bad.

>https://upload.wikimedia.org/wikipedia/commons/a/aa/Write_Yourself_a_Scheme_in_48_Hours.pdf
>>
How do I learn what the hell monads are and what makes them special, without going to university to learn it?

All the explanations I've read are either incredibly obtuse, or make it seem so simple that it doesn't seem to be special or interesting.
>>
>>62291392

I want to concat two strings.
But what the hell ARE those string? Fuck that shit.
Oh wait, I can look at strings as a list of chars.
Can I append lists? Fuck yes!
And after I appended them, I can make my (new) list a String again.

Here you go.
>>
>>62291392
>seem to be special or interesting.

They really aren't, that's the mind fuck. I learned by powering through and having to implement instances on my own data types. The "monad tutorial fallacy" is very real.
>>
>>62291476
A prime example of:
>All the explanations I've read are either incredibly obtuse, or make it seem so simple that it doesn't seem to be special or interesting.
>>
>>62289797
The chez scheme compiler truly is great, but not as good as sbcl is for CL. The racket core libraries are great but last I checked there was no good array implementation (one that can be used copy-less from/to C is critical to be able to correctly leverage C stuff in conjunction with scheme facilities, as opposed to reimplementing the useful scheme functions in C so that you can work on the structure to avoid copying massive amounts of data needlessly; that wouldn't be a problem if there were good third-party scheme libraries to replace those C libraries though). The 3rd party libraries are sorely lacking in every domain, though.
>>
>>62289833
Newest version of hotspot has soft-realtime features as I recall (or at least icedtea has those features in Shenandoah).
>>
>>62290778
>Good CL code usually is OO and uses CLOS a lot.
Yes, because CLOS is a very good implementation of its style of OO. Unlike trying to use functional programming in CL, it's also clean and cruft-free.
>unironically linking to wiki.c2.com
Only a cltard would be tarded enough for that.
>>
>>62288014
That's not really right: "purity" in the functional programming sense refers to the fact that functions can't perform side-effects. People call this property referential transparency - a function called with the same argument will always give the same result. This is a property Haskell has, which OCaml/Erlang/"non-pure" languages don't (barring backdoors like unsafePerformIO that are outside of the normal language semantics).

That is, calling a function in OCaml can conceivably read or write to any reference in scope, query a database, etc. The things you use in Haskell to do this stuff are usually referred to as "actions" (things like IO (), ST s (), etc - they are usually monadic, though that's not what makes them important. Monad is just an api). The distinction might seem pedantic, but in practice it earns you a certainty about the properties of the functions you call that makes things like refactoring crazy easy
>>
Not reading replies so probably already been stated.

I love the language. I really enjoy it, learning it helped me implement functional paradigms much easier in other languages without feeling out of place or worse.

Conversely, it seems unable to make good gui apps with it which is my focus most of the time. Which is depressing, I would love to have a native GUI kit that seemed like it belonged when the apps were running.
>>
>>62291392
so this looks complicated but it's easy I assure you
You know how you can compose functions, right? If you have f : a -> b and g : b -> c, you can (using . as composition) write g . f : a -> c

Now imagine that you have an f that, instead of just taking an "a" and returning a "b", takes an "a", does some special stuff, and then returns a "b". We can call the special stuff "m"; m can be printing to the screen, mutating some local state, a possibility of failure, a lot of things really. The best way to get intuition for that part is just to look at a lot of examples, but here we'll just assume it's some special stuff. Then we can say that f : a -> m b

Now imagine you also have a function g that takes a "b", does some special stuff of the same kind, and returns a "c". g : b -> m c

A monad is a special rule associated with the type "m" that tells you how you can compose f : a -> m b and g : b -> m c to get a function h : a -> m c. Implementing this rule usually involves running f, unwrapping the "m a" in some way to get at the "a", then running g on the "a" to get the "m b"

The way monads are actually formulated in the haskell libraries is a little different; they use a function (>>=) :: a -> (a -> m b) -> m b, but this version can express the same operation I explained, which is in the Control.Monad module as (>=>) :: (a -> m b) -> (b -> m c) -> (a -> m c)

What makes monads useful is the same thing that makes it useful to have List in java as opposed to having ArrayList, LinkedList, etc without anything connecting them: put common operations in the List interface, and now you can write a function that takes a List and works on ArrayLists or LinkedLists or whatever. With a monad, you can do things like define functions that repeat the "special stuff" operation a number of times and accumulate the results without caring what actual stuff is being done, and you can change what the "special stuff" is without having to touch the implementation code
>>
>>62291043
Youre mistaken if you even think that Lisp was originally designed to use S-expressions at all. The syntax of Lisp was originally designed to use M-expressions, which is sort of similar to Haskell syntax, that get translated into S-expressions. Many compilers implement their abstract syntax tree using a lisp like syntax, often something like reverse polish notation. The fact that Lisp syntax became implemented in S-expressions was due to Steve Russel implementing the S-expression specification into an interpreter. People found they liked the S-expressions so much that John McCarthy abandoned the idea of translating into M-expressions.
>>
The language itself is really well-designed and it's become pretty much my go-to general-purpose guy. The trade-offs chosen result in a power-to-weight ratio that makes it a joy to use. There are some warts in the standard library like the default string implementation, but there are generally easy alternatives in place to cover things like that.

I like type classes a lot over the comparable interface systems available in a lot of other languages.
>>
>>62286862
Scala in Hadoop shops.
>>
>>62291392
>How do I learn what the hell monads are
1. Learn OCaml and understand how the datatypes work.
2. Look at how monads are defined. It'll click.
>>
>>62292899
>Only a cltard would be tarded enough for that.
It's a fine, factual comparison. Get your mental allergies in check.
>>
>>62294634
Can I ask what you mean by this, as someone who understands monads and OCaml datatypes?
>>
>>62293646
>sort of similar to Haskell syntax
Mathematica more than Haskell
>>
>>62286065
>using a linked list
>ever
>for any reason
>under any circumstances

https://www.youtube.com/watch?v=YQs6IC-vgmo
>>
>>62286065
pretty sure there are mutable vectors for the st monad
>>
OCaml has better real world application.
>>
>>62285906
I wish Python had monads.
>>
>>62295764
https://github.com/dbrattli/OSlash
>>
>>62294852
The only functional languages with real world applications are erlang and scala
>>
>>62297475
https://ocaml.org/learn/companies.html
>>
>>62297710
Haskell has the same shit on their website, nobody uses it either
>>
>>62294652
lmao butthurt. If your IQ was as high as your butthurt, you would be of decent intelligence.
>>
>>62294792
Stop having brain problems anytime. Linked list are the single most useful datatype.
>>
>>62285906
Haskell-chan is cute
Thread posts: 150
Thread images: 10


[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]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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 RandomArchive shows their content, archived.
If you need information for a Poster - contact them.