[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
OOP is dying FP is the future Why haven't you learned
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: 51
Thread images: 3
File: Haskell.sh-600x600.png (54 KB, 600x600) Image search: [Google]
Haskell.sh-600x600.png
54 KB, 600x600
OOP is dying

FP is the future

Why haven't you learned Haskell yet?
>>
>>52650004
sticking to one paradigm is nonsense.
Use what is best in each situation.
Document your choices.
>>
>>52650004
Explain FP and why it's the future, please
>>
>>52650032
This desu senpai. There's good stuff and bad stuff in all the modern paradigms, and they all have their ideal use case. FP is great, but it's not the silver bullet people make it out to be.

>>52650345
Not OP, but FP is often regarded as the future because our hardware is now multicore and often distributed because muh cloud. In OOP and most other paradigms, the state of the program changes as it runs, and depending on when you run a part of the program, it might do something completely different from what you expected. This is bad when you've got multiple processes happening at once.

FP is a stateless paradigm for code reuse, thus lending itself very well to multicore and distributed systems. You don't have to worry about when a given piece of code is going to run because in FP, it will work the same no matter when you run it.
>>
>>52650004
doing rxjs atm, cool stuff going on.

fp is not for everything tho.. so stop the shill
>>
Haskell was the first language I learned :^)
>>
>>52650636
sounds great, finally humans have gotten rid of nasty callbacks
>>
>>52650636
I'm a first year CS student, would you mind giving an example? I can't think of a way to write a program that would allow for any part of it to be executed in any order. It would be nonsense.
>>
>>52650926
Different anon. Order matters, but time does not.

Since it's stateless by definition, thread A can't change a value thread B depends on.

On the other hand, if thread A could modify a value thread B depends on, then what time you call a function in thread B is essential.
>>
>>52650926
You return new lists when "changing" a list.
Which is why it's very important to have a GC for FP.
>>
>>52650004
>2016
>STILL using a meme language.

Come on anon, you're better than this.
>>
>>52650004
I have.
>>
>>52650985
>>52651054
Maybe I'm just an idiot, but I'm still not seeing a distinction. How would using a language designed for it, say Haskell, differ from using an object-oriented language like C++?
>>
>>52651242
You don't have any mutable state in Haskell at all.
It's possible to mutate data in Haskell but it's really controlled and rarely used.
C++ lets you mutate a variable unless you use const.
>>
>>52651274
That actually makes a lot of sense, thanks. So is it impossible to have an incrementing loop in Haskell?
>>
>>52651412
You'd use a recursive function. All in all, the same things are done in a different, and more mathematical/clean way.
>>
>>52651412
you can, but it's ugly and unidiomatic
>>
>>52651412
>>52651451
You'd actually generally use a function like map where you pass in a list and another function, and then the function is applied to each item in the list. It's much more readable when you get used to it and gives you fewer chances to shoot yourself in the foot than a regular loop or recursion.
>>
>>52650004
>Why haven't you learned Haskell yet?
Because I wait for an actually industry-safe good implementation for a functional language instead choosing an academia-based, half-assed thing that does a lot of things the wrong way, like Haskell, Scala and ((O)Ca)ML or Ur/Web.

See for example Elm, it was created for a need and works pretty good in it's niche and is nice and has good tooling. Not from academia.
>>
>>52650004
>Why haven't you learned Haskell yet?
There doesn't seem to be many jobs except in finances and academia, and I'm not yet in the position to strike it out on my own and, say, start building webservices in Haskell.
>>
>>52650004
Because I'm learning Elixir.
>>
What's FP stand for?
>>
>>52651680
Fapping to Porn
>>
>>52651680
Feminine Penis
>>
>>52650670
wow, how old are you
>>
>>52651680
...or Functional Programming. Sometimes.
>>
File: index.png (222 KB, 1179x737) Image search: [Google]
index.png
222 KB, 1179x737
>>52650004
But OP... I did
>>
>>52650004
mono paradigms are fucking cancer. Multiparadigm is the only way. Right tool for the right job.

There's a reason nothing useful has ever been written in Haskell.
>>
>>52650004
Cause I'd starve to death if I were to rely on Haskell to find a job.
>>
>>52651754

https://wiki.haskell.org/Haskell_in_industry

Literally nothing useful. Right...
>>
>>52651631
What about Erlang? I dislike functional languages but out of those Erlang seems to be the one used the most in the "industry"
>>
>>52651612
Yeah, the only experience I have with FP is from my time with Scheme a while back.

>>52651754
Wasn't pandoc written in Haskell? And anyway, Haskell isn't the only functional programming language.
>>
>>52651631
Has there ever been an academic language that wasn't a jack-of-all-trades clusterfuck?
>>
>>52651722
Sometimes. But usually it's feminine penis.
>>
>>52651865
Not your pre-poster, but most of those are either dead (see Linspire), hipster web-shops or at best academic endeavors from unimportant staff divisions from those companies, so that is nothing useful.

Arguably the most actually useful applications written in Haskell are pandoc, the shell checker and the Elm compiler.

>>52651870
With Elixir/Erlang it's the same as Elm: It has it one or two niches it fullfills very well, but that's about it. It wasn't designed as a general programming language and is lacking things I would need for that, therefore I won't consider it for everyday programming.
>>
File: KXt0rvm.jpg (34 KB, 500x334) Image search: [Google]
KXt0rvm.jpg
34 KB, 500x334
>>52651704
>>52651947
>Feminine Penis is the the future
That's exactly what I would expect from 4chan
>>
>>52651932
Probably a lot, but those are mostly jack-of-one-trade clusterfucks, like Ur.
>>
>>52651981
I know, right? It's not that such a thing even exists...
>>
>>52650636
How do you even save data in FP? Seriously asking, do you compute everything once?
How do you code publish/subscribe patterns? How do you make UIs?
>>
>>52652408
In Haskell you would use the IO monad for that.
They implemented an abstraction layer so the user wouldn't need to use unsafe code themselves.
>>
>>52652631
>That
Which of the 3?
>>
>>52650004
Because OCaml is superior in every single conceivable way.
>>
>>52651054
No, you can just use linear types (see ATS or Mezzo).
>>
What's the paradigm used for AI programming?
>>
>>52653171
python + theano.
>>
>>52652671
GUIs suck in Haskell, I don't know of a single good library

It's definitely possible, and there are many (really) different ways to do them (most of them through the FFI and IO)
>>
>>52653171
the "glue and spaghetti code" paradigm
>>
>>52654508
Elm is good for GUIs. It's not Haskell per se, but it's syntactically and philosophically almost the same.
>>
>>52651711
Haskell appeared in 1990.

1990 was over 25 years ago.
>>
Is lisp considered functional?
>>
>>52655626
No. It's multi-paradigm.
Thread replies: 51
Thread images: 3

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.