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