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

give me one good reason why I should go back to writing

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: 21
Thread images: 3

File: lam.png (6KB, 219x297px) Image search: [Google]
lam.png
6KB, 219x297px
give me one good reason why I should go back to writing code imperatively
>>
Do you want us to give you a reason to imperatively write code or do you want us to use the imperative clause when giving you a reason?
>>
>>60321802
the former
>>
>>60321774
Someone has to write imperative code at some point because reality is stateful and our Turing machine based computers are stateful.

Abstractions leak and the nice pretty abstraction of functions and monads has to be compiled down to stateful machine code at some point.

For example, Haskell is a huge pain to optimize, it would be better to use C/assembly at that point.
>>
>>60322844

/thread

If you use functional programming for anything more than map/reduce parallelism and throwaway lambdas you're basically a hipster faggot
>>
>>60322844
> For example, Haskell is a huge pain to optimize, it would be better to use C/assembly at that point.
This is why you use Rust, the best of both worlds.
>>
scheme is for cool people
>>
employment
>>
File: pikachu_1715.png (56KB, 256x256px) Image search: [Google]
pikachu_1715.png
56KB, 256x256px
>>60321774
It is imperative that you do so.
>>
>>60321774
You can actually do something useful without jumping through hoops.
>>
>>60321774
>give me one good reason why I should go back to writing code imperatively

We currently lack functional programming languages that throughly exploit linear type system to be able to do updates in place in an ergonomic, automatic, transparent manner.

So if you want to use space efficiently you have to do it more o less manually, in an imperative style. And while tree data structures are cool the reality of cache memory means that arrays trump them in practical problems, even if you have to copy them occasionally.


Someday we'll have them. There was a time, not long ago, when you had to use the 'register' keyword in C to, but now we don't, because the compiler knows better when to reuse them.
>>
>So if you want to use space efficiently you have to do it more o less manually
Kind of, but whats so negative about this? Not really different from imperative languages.
>in an imperative style
Not really. There are lots of functional ways to do it.
>>
>>60321774
a lot of use cases aren't well served by a purely functional language, I think gayming might be one of those things, maybe scientific simulations too, but I don't know enough about functional langs to be sure
>>
File: 1200px-Haskell-Logo.svg.png (24KB, 1200x847px) Image search: [Google]
1200px-Haskell-Logo.svg.png
24KB, 1200x847px
>>60325842
>We currently lack functional programming languages that throughly exploit linear type system to be able to do updates in place in an ergonomic, automatic, transparent manner.
rust. unless you mean purely functional?
>>
>>60321774
But you do that in haskell thanks to do notation
>>
>>60322844
That's literally not the reason, haskell is only a pain because of it being lazy evaluated. Which proper linear types solve, as SPJ paper proved.

FP languages like F# are actually inline with C#
>>
>>60325842
>We currently lack functional programming languages that throughly exploit linear type system
https://github.com/tweag/linear-types/releases/download/v1.0/hlt.pdf
https://github.com/tweag/ghc/tree/linear-types

expected release by ghc 8.4
>>
>>60327311
>haskell is only a pain because of it being lazy evaluated
and the ecosystem
>>
>>60321774
bait
>>
>>60327311
>haskell is only a pain because of it being a pure functional language
Yeah, that's kind of the point
>>
>>60321774
To make programs that are actually useful instead of coding shitty hello worlds.
Thread posts: 21
Thread images: 3


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