原文: https://betterprogramming.pub/fp-toy-7f52ea0a947e
中译: https://www.infoq.cn/article/b6gkx1crp2umu2*jipqb
写的很有意思。
摘一段,品一下这文笔 ……
「企业的技术招聘人员也是要经过严格培训的,这使他们能够正确地区分 Java 和 JavaScript 等技术。
一定要在你的简历中穿插一些词来证明你了解各种严格的企业级抽象技术,比如类、继承、设计模式、依赖注入、实体、抽象工厂和单例等。」
🙃
Okay here go my #langdev thoughts for my #functionalprogamming language.
These thoughts are unfinished and just a brain dump, I haven't thought them to end (yet).
1/7
#langdev #functionalprogamming
Just finished writing a #blog article about my #langdev #functionalprogamming #rust #compiler 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
Common Lisp implementations in 2023
https://www.n16f.net/blog/common-lisp-implementations-in-2023/
#lisp #commonlisp #cl #functionalprogamming
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
https://pca.st/episode/bb60c63e-2277-4509-8da8-d9d5d273e697
Jaret Binford on GitHub - https://github.com/Jaretbinford
Alex Miller on GitHub - https://github.com/puredanger
#podcast #clojure #functionalprogamming
If you use multiple version, pick the most prevalent one.
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
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.
#clojure #functionalprogamming #parens #redemption
#disciple #lisp #replboy
#replboy #lisp #disciple #redemption #parens #functionalprogamming #clojure
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
Here for my #introduction!
I'm a practicing lawyer and data lead working at PwC in Canada. Focus is #python and #databricks at work, but also getting into #functionalprogamming and #categorytheory 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
"Function reuse is just wishful thinking"
A companion article to the talk by Nicolas Rinaudo.
https://nrinaudo.github.io/articles/function_reuse.html
I'm wondering if doubly linked lists could be functional (requiring no mutation in place)
I should start an alt where I shitpost about #haskell, #typetheory and #functionalprogamming
#functionalprogamming #typetheory #haskell
I should start an alt where I shitpost about #haskell, #typetheory and #functionalprogamming
#functionalprogamming #typetheory #haskell
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. https://reactiveconf.com/ #Conference #FunctionalProgamming by @ReactiveConf@twitter.com
#conference #functionalprogamming