[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/fpg/ - functional programming general
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 32
Thread images: 6
File: haskell-hnreddit-shills.png (248 KB, 600x800) Image search: [Google]
haskell-hnreddit-shills.png
248 KB, 600x800
Resources:

- https://storify.com/realtalktech
- https://twitter.com/realtalkintech

Latest articles:

- https://storify.com/realtalktech/taking-down-haskell
- https://storify.com/realtalktech/haskell-has-no-benefits-is-good-for-nothing
- https://storify.com/realtalktech/why-functional-programming-sucks
>>
oh, you again
>>
>>53769013
Nice, it's the first time I see a functional programming general here.
To get this rolling, look at this stunning implementation of Fibonacci numbers in Haskell:
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

If you want to understand how this works, just remember that Haskell evaluates function arguments lazily (google term: lazy evaluation).
>>
Why would one choose haskell over python?
>>
File: haskell-hnreddit-shills.png (260 KB, 600x800) Image search: [Google]
haskell-hnreddit-shills.png
260 KB, 600x800
>>53770404

Haskell is useful for writing robust, high quality and reliable software. You can write the same stuff in any other language. But Haskell is designed based on solid mathematical principles. It is statically typed which allows the compiler to detect certain classes of bugs which are impossible for compilers for C++, Java, Python etc. to detect. Haskell compiler can also perform optimizations which cannot be performed for other mainstream languages. Haskell focuses on modularity and composability by virtue of pure functions with no state changes. Code with state changes is neatly separated from code without state changes, allowing you to zero in easily, onto the bugs. Haskell emphasizes a different style of programming with an extremely minimalistic and simple syntax( devoid of colons, braces, brackets and other ugly looking special characters) making your code look like a Mozart or Beethoven masterpiece.

Its a truism in the Haskell community that if your code compiles, then it will do what you want it to do.
>>
>>53770404
Speed. Compiled nature. Type safety, if you're into that kind of thing.
Why would you even compare it to Python? Totally different languages with totally different pros and cons. Even if you think that Haskell is a shit language, it must be obvious that it has some advantages over Python (especially CPython) which someone might care about.
>>
What's the best functional language and why is it agda
>>
>>53770568
Python is a comfy language to write in.
>>
>>53771301
I like Python too but recursive functions are shit in Python. It can't handle like 100(?) depth with default values and no TCO.
>>
>>53771475
To be clear, the Python language spec says nothing about TCO, those limitations are from the CPython implementation. Works fine on pypy.
>>
>>53771475
>>53773059

Yes, this is a CPython limitation.

If you ran that code in pypy it'd blow your socks off.
>>
>>53770501
it's fucking nothing, fag

>if your code compiles, then it will do what you want it to do.
delusional as fuck
>>
>>53773059
shitty implementations are part of why python is SHIT
>>
>>53770501
>boilerplate propaganda

Programming a computer != a neat mathematical function. Immutable data = slow as shit. Functional languages move you even further away from the machine then other high level languages, which means "pretty code" that runs like shit.

Into the trash it goes.
>>
>>53773869
it's not even pretty in the slightest imo
>>
File: 1456803091945.gif (65 KB, 540x360) Image search: [Google]
1456803091945.gif
65 KB, 540x360
>>53770201
My 1.19 exercise from SICP

; Fibonacci in Logarithmic Steps

(define (fib n)
(fib-iter 1 0 0 1 n))

(define (fib-iter a b p q count)
(cond ((= count 0) b)
((even? count)
(fib-iter a
b
(+ (* q q) (* p p))
(+ (* q q) (* 2 q p))
(/ count 2)))
(else (fib-iter (+ (* b q) (* a q) (* a p))
(+ (* b p) (* a q))
p
q
(- count 1)))))
(fib 0)
(fib 1)
(fib 2)
(fib 3)
(fib 4)
(fib 5)
(fib 6)
(fib 7)
(fib 8)
(fib 9)
>>
>>53774008
To be quite honest with you guys, my family, I don't think this is a good approach since it requires multiplication and on that level requires many more steps. Depends on the architecture and size of inputs but with Fibonacci you really can't ask for kth number with a really big k because it grows too fast. Felt kinda moot for dubious performance benefit and much less readability.
>>
https://www.reddit.com/r/ProgrammerHumor/comments/4clfzn/deconstructing_the_malicious_autistic_lies_of/
>>
>>53775587
>most of us being in the top 5% of programmers
literally delusional, FPfags are really dumb as fuck and don't program much useful things at all
>>
>>53775743
What i find most pitiful is people thinking they have to use only one programming language for everything. It's a tool, and as a tool it has its pros and cons depending the context it's being used.
>>
>>53775587
>we're in the top 5% of programmers
>because this other guy on the internet said so without any statistical data to back it up

Haskellfags confirmed for being delusional autists.
>>
>>53775882
I will not have this sort of pragmatism on my internet. I learned one tool and one tool only and I don't want to be opened to the possibilities that I will have to learn more tools.
>>
>>53769013
I like this guy. He's really funny. He's real /g/ material.
>>
>>53775743
>most of us being in the top 5% of programmers
To be fair, being anything above a code monkey would probably put you in the top 10%.
>>
>>53777774
well, considering the sheer number of pajeets in the world, I wouldn't be surprised.
>>
>>53777774
the mere fact that you like haskell or some other meme language doesn't automatically make you a good programmer
>>
>>53778054
>fox and the grapes, the post
:^)
>>
>>53769013
no
>>
>>53769013
>Expects your engineering team is going to have no problem forgoing proven development methodologies to ...

>proven development methodologies
>proven

Proven to result in shitty software, that's for sure. Software development as a field as a whole is a massive failure.
>>
File: [tilting increases].png (27 KB, 500x500) Image search: [Google]
[tilting increases].png
27 KB, 500x500
>>53778179
>>
So I'm trying to learn Haskell and I'm finding the syntax a right bitch. Why are all the tutorials so shitty? I just want to write simple UNIX programs, not complex mathematics.

Loving how Haskell does I/O though, it's such a genius idea to be able to generate I/O procedures from functions and to know exactly where side effects are going to be. Definitely a step up from Python.
>>
I personally prefer Scala over Haskell. It's great because it's an all-rounder language

How about this:

Scala doesn't - quite - have the safety and conciseness of Haskell. But it's close.

Scala doesn't - quite - have the enterprise support and tooling infrastructure (monitoring/instrumentation, profiling, debugging, IDEs, library ecosystem) that Java does. But it's close.

Scala doesn't - quite - have the clarity of Python. But it's close.

Scala doesn't - quite - have the performance of C++. But it's close.
Thread replies: 32
Thread images: 6

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.