yhm · @yhm
12 followers · 256 posts · Server social.dev-wiki.de

原文: betterprogramming.pub/fp-toy-7

中译: infoq.cn/article/b6gkx1crp2umu

写的很有意思。

摘一段,品一下这文笔 ……

「企业的技术招聘人员也是要经过严格培训的,这使他们能够正确地区分 Java 和 JavaScript 等技术。

一定要在你的简历中穿插一些词来证明你了解各种严格的企业级抽象技术,比如类、继承、设计模式、依赖注入、实体、抽象工厂和单例等。」

🙃

#functionalprogamming

Last updated 2 years ago

musicmatze :rust: :nixos: · @musicmatze
805 followers · 1871 posts · Server social.linux.pizza

Okay here go my thoughts for my language.

These thoughts are unfinished and just a brain dump, I haven't thought them to end (yet).

1/7

#langdev #functionalprogamming

Last updated 2 years ago

musicmatze :rust: :nixos: · @musicmatze
805 followers · 1856 posts · Server social.linux.pizza

Just finished writing a article about my project. Got too long for a toot-chain, so blog it is.

Will be posted later today on @musicmatze@beyermatthias.de and boosted from this account.

That account is a writefreely instance, where I cannot reply to comments because writefreely does not have that feature... So make sure to reply to the boost on this account 😉

#blog #langdev #functionalprogamming #rust #compiler

Last updated 2 years ago

hleb · @hleb
176 followers · 282 posts · Server social.linux.pizza
Stefan · @stefanscheidt
11 followers · 44 posts · Server digitalcourage.social
anarchopunk alexis · @anarchopunk_girl
315 followers · 32 posts · Server kolektiva.social

We all know OOP sucks. Forcing everything to be a noun instead of a verb is awkward and bad, trying to play the Platonic essentialism game to create the ultimate inheritance hierarchy is impossible even on a philosophical level, mutable state everywhere is impossible to keep track of.

So along comes functional programming. And it tells us to eliminate global mutable state as much as possible, try to keep as much of your code referentially transparent and modeled in terms of linear sets of transformations on pipelines of data as possible, keep data dependencies and mutability limited, explicitly listed in parameters, and make immutability the default. All great.

But I think going that last 10% with functional programming and eliminating *all* mutable state entirely isn't worth it. The logic that makes FP better than OOP has significant diminishing returns, because going from reasonably functionalized imperative code to pure FP is a meaningless change semantically, but at the same time adds an extra layer of indirection and abstraction when it comes to reasoning about what the code does.

Here's an example of why.

Let's say you have a function that doesn't modify any of its arguments and doesn't depend on anything outside of its arguments, and so is functionally referentially transparent unless it does some operation like reading something from disk or whatever, but internally it has some local mutable state — let's say the algorithm was most easily described iteratively. Let's say it calculates the next vector an NPC AI should follow based on a state machine and a previous vector, and returns the new vector and state.

Making it as functional as it is has already dealt with the **main point** of eliminating mutable state that FPers cite, which is spooky action at a distance, where any piece of code might modify the behavior of any other piece of code and it's in extremely difficult to predict or reason about because nothing is declaring what it might do or depend on.

The way that you would turn this into a purely functional thing is by transforming it into a tail call recursive function where the variables that change are parameters with default values on the function itself, and when the parameters need to change the function just calls itself with the new values and has a way of jumping to the point in the logic it was at before (an extra state parameter and some more branches should do). It's a simple enough transformation really.

The thing about it though, is that from the perspective of the local mutable state that's the only thing being removed, this is basically doing the exact same thing!

We are STILL having the same names correspond to different values over time and having that change the code's behavior, it's just that the function call is acting as a setter and using the compiler's shadowing binding of arguments behind the scenes as the equals operator instead of just explicitly having equals operator out in the open.

All it's doing is doing a semantically identical thing, that makes your code no easier to reason about, by hiding the ACTUAL OPERATION behind function call syntax and adding extra state and branching to think about, as well as making the code correspond less closely to the natural expression of the problem.

All this really achieves is to hide the fact that you're using up extra memory and CPU cycles cloning the state every time and passing it in again instead of mutating the existing state. So it's literally worse in every way.

And maybe you're thinking "I'm a high level programmer, I don't have to worry about memory and CPU cycles," to which I respond by beating you to death with the plague of Electron apps that makes low cost accessible computers unusable.

So yeah, I don't really see how pure FP adds anything.

#programming #functionalprogamming #fp #oop

Last updated 3 years ago

Wact B. Prot · @wactbprot
61 followers · 146 posts · Server functional.cafe
Jarek Rozanski 📈 · @jrozanski
97 followers · 197 posts · Server mastodon.online

If you use multiple version, pick the most prevalent one.

#functionalprogamming

Last updated 3 years ago

Caleb Fristoe · @gerridad
5 followers · 46 posts · Server mastodon.online

But why JavaScript? Why? I know I’m past my prime, late to the game, and unlikely to contribute anything of great value—but this? The “greatest minds” of our day just accept a monstrosity that was thrown together in a week for a corporate deadline as the basis for the majority of our networked activity. Its madness is the madness of late capitalism. Is undoing this blunder not the great project of the century?


#amateur #cloujure #lisp #replbros #functionalprogamming

Last updated 3 years ago

Caleb Fristoe · @gerridad
5 followers · 44 posts · Server mastodon.online

Why has the world betrayed me—the university deceived me? Why, at 40, has the revelation of functional programming only now been revealed? Failing for so long at OO, with little to show, and now this revelation…I will now spread the Gospel to the lost and hurting of this world with the meager mite I have.


#replboy #lisp #disciple #redemption #parens #functionalprogamming #clojure

Last updated 3 years ago

Caleb Fristoe · @gerridad
5 followers · 44 posts · Server mastodon.online

Why has the world betrayed me—the university deceived me? Why, at 40, has the revelation of functional programming only now been revealed? Failing for so long at OO, with little to show, and now this revelation…I will now spread the Gospel to the lost and hurting of this world with the meager mite I have.


#disciple #redemption #parens #functionalprogamming #clojure

Last updated 3 years ago

ericfeunekes · @ericfeunekes
0 followers · 2 posts · Server hachyderm.io

Here for my !
I'm a practicing lawyer and data lead working at PwC in Canada. Focus is and at work, but also getting into and on my own.
Left the blue bird more than a decade ago because I couldn't find my community through all the spam and bots. Hoping to give this one a try.
I love talking about interesting problems and elegant solutions.

#introduction #python #databricks #functionalprogamming #categorytheory

Last updated 3 years ago

Marcin Szałomski 🥁 · @baldram
147 followers · 78 posts · Server functional.cafe

"Function reuse is just wishful thinking"

A companion article to the talk by Nicolas Rinaudo.
nrinaudo.github.io/articles/fu

#functionalprogamming #scala

Last updated 3 years ago

Abbie Normal · @abbienormal
56 followers · 365 posts · Server functional.cafe

I'm wondering if doubly linked lists could be functional (requiring no mutation in place)

#functionalprogamming

Last updated 3 years ago

Erich Graf Apfel von Waidherr · @turion
304 followers · 9628 posts · Server mastodon.art

I should start an alt where I shitpost about , and

#functionalprogamming #typetheory #haskell

Last updated 4 years ago

Erich Graf Apfel von Herthsen · @turion
315 followers · 10109 posts · Server mastodon.art

I should start an alt where I shitpost about , and

#functionalprogamming #typetheory #haskell

Last updated 4 years ago

The whale · @thewhalecc
284 followers · 1736 posts · Server framapiaf.org

CONF: Reactive Conf Prague, Czech Republic Oct 30th, 2019 -> Nov 1st, 2019 - 3-day functional programming conference based in the Central Europe with top-notch speakers & 1300+ attendees. reactiveconf.com/ by @ReactiveConf@twitter.com

#conference #functionalprogamming

Last updated 6 years ago