"Scala is the only language that I know of that marries the world of FP and OO" You can do that in C#/F# too. There's nothing special about Scala from this point of view.
OCaml was doing that before any of them.
Where FP meets OO
21–30 of 64 posts
Re: Where FP meets OO
#22I'm not sure that OO-ness is a desired property. Alexander Stepanov, original creator of the STL: "I find OOP technically unsound. It attempts to decompose the world in terms of interfaces that vary on a single type. To deal with the real problems you need multisorted algebras - families of interfaces that span multiple types. I find OOP philosophically unsound. It claims that everything is an object. Even if it is t…
Um, what? You have no FACTS to do proofs with without axioms; they are the fundamental statements one assumes to be true to define a logical system.
Somebody who insists that they need "multisorted algebras" while misunderstanding a fundamental definition in mathematical logic is exceptionally confused...
Re: Where FP meets OO
#23While I'm reasonably open-minded about using some parts of OO at higher levels of organization (or at least just genuine modules), I'm not sure Akka is the right place to land there. Functions which are just typed as `a -> ()` have lost (or hidden) all their interesting structure.
If type preservation in distributed computing was a trivial engineering problem it would have already been solved and widely used. As it stands Akka is enjoying fairly widespread enterprise adoption in the distributed computing market, untyped-ness notwithstanding.
Interestingly, as saryant points out, Akka 3.0 apparently will be typed, although I was under the impression that the typed actor project was experimental/a long way off/not a sure thing. Guess things have changed for the better...
Re: Where FP meets OO
#24I'm not sure that OO-ness is a desired property. Alexander Stepanov, original creator of the STL: "I find OOP technically unsound. It attempts to decompose the world in terms of interfaces that vary on a single type. To deal with the real problems you need multisorted algebras - families of interfaces that span multiple types. I find OOP philosophically unsound. It claims that everything is an object. Even if it is t…
"You do not start with axioms - you start with proofs. Only when you have found a bunch of related proofs, can you come up with axioms. You end with axioms." Um, what? You have no FACTS to do proofs with without axioms; they are the fundamental statements one assumes to be true to define a logical system. Somebody who insists that they need "multisorted algebras" while misunderstanding a fundamental definition in mat…
In mathematics, we certainly have ZFC as an axiom system now, but mathematics was performed for thousands of years without a "stable" axiomatic base. For example, calculus was developed before the axiomatic delta-epsilon definition for limits was created. The math was developed first, and it was only after the fact that mathematicians went back and set the theory on a stable theoretical footing.
Therefore, I believe Stepanov suggests a bottom up approach: You write an algorithm that performs your work first, and then once you have that, you can refactor the code into classes that encapsulate the various parts of your existing algorithm.
Re: Where FP meets OO
#25While I'm reasonably open-minded about using some parts of OO at higher levels of organization (or at least just genuine modules), I'm not sure Akka is the right place to land there. Functions which are just typed as `a -> ()` have lost (or hidden) all their interesting structure.
Certainly Haskell, for example, is one of the few languages richly endowed with a non-existent module system, but I personally don't know of a distributed computing environment that does preserve types across machine boundaries in any language. I must be missing something, please enlighten. If type preservation in distributed computing was a trivial engineering problem it would have already been solved and widely use…
Re: Where FP meets OO
#26Am I the only one who finds the goalposts gave moved for FP? it used to be lambdas/lexical closures that were the big must-have FP feature, then it was immutability. Now that we're seeing traditionally-OO languages sport a raft of immutable types and good support for lexical closures, now it's all about higher-kinded-types. For a while, the big feature was homoiconicity and tail-call-optimization until lisp fell out…
Immutability and closures are required for that, because mutability may break homoiconicity (which is required for purity), and lack of closures means you can't pass state around.
Higher-kinded types are very useful for helping with lots of functional abstractions, but they are a type system feature and have nothing to do with FP. If someone claims that, this person doesn't understand FP or type systems.
OCaml and Standard ML are two examples of languages without higher kinded types but are just as good as Haskell for FP.
(Although they have a powerful module system to compensate for that).
Re: Where FP meets OO
#27Re: Where FP meets OO
#28I'm not sure that OO-ness is a desired property. Alexander Stepanov, original creator of the STL: "I find OOP technically unsound. It attempts to decompose the world in terms of interfaces that vary on a single type. To deal with the real problems you need multisorted algebras - families of interfaces that span multiple types. I find OOP philosophically unsound. It claims that everything is an object. Even if it is t…
"You do not start with axioms - you start with proofs. Only when you have found a bunch of related proofs, can you come up with axioms. You end with axioms." Um, what? You have no FACTS to do proofs with without axioms; they are the fundamental statements one assumes to be true to define a logical system. Somebody who insists that they need "multisorted algebras" while misunderstanding a fundamental definition in mat…
Re: Where FP meets OO
#29I'm not sure that OO-ness is a desired property. Alexander Stepanov, original creator of the STL: "I find OOP technically unsound. It attempts to decompose the world in terms of interfaces that vary on a single type. To deal with the real problems you need multisorted algebras - families of interfaces that span multiple types. I find OOP philosophically unsound. It claims that everything is an object. Even if it is t…
Re: Where FP meets OO
#30In CLOS.
Why there are so many ignorant idiots in the world? According to Alan Kay, the essence of OO approach (or paradigm if you wish) is a synthesis of a few fundamental concepts (like a Lisp itself) where not a single one can be removed because harmony (or balance) would be destroyed, and an ugly, mediocre construction would emerge instead (Java). The concepts are: * First-class closures - isolated, share-nothing abstract…
Care to explain? Doesn't make any sense to me...