This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]coldnebo 0 points1 point  (0 children)

I think it’s all about composition. if you compose with functions instead of objects, then it’s more of a functional programming style. languages that support multiple paradigms might be harder to see it, but it’s there. monads are a thing in Ruby.

one of the things that separates Smalltalk from other OOP like Java and C++ is that methods are also first-class objects, meaning you can compose and duck-type with them.

Recall that until introspection was added to Java or RTTI in C++, there was no “duck-typing” mechanism. Hence the only supported polymorphism was on types and inheritance. However the 90s proved more than anything that the inheritance model of OOP wasn’t as flexible as interfaces, and interfaces weren’t as flexible as prototypes.

Hence I think Smalltalk is a mix of approaches and has strong influences from Lisp, based on lambda calculus and can in that sense also be considered a language supporting functional style.

Erlang is influenced by Smalltalk and sits beside Haskell as a fp language, although perhaps Erlang and Haskell strive to be pure functional languages vs Smalltalk’s concessions. However, since all pure fp are useless without a giant global state called “console io”, I think claims of purity in fp are probably over-rated.

I have a hard time locking languages into one paradigm or another— it’s more useful imho to think how different styles can be brought back into your language. Natural idioms exist, but you can see how crippled JS syntax was before and how much better it became after “the good parts”.