4 ms·
When I was younger, I became a communist - I rejected the notion of a class, in favor of everything having a type. People often misunderstand communism, they th
by js8 5y ago
When I was younger, I became a communist - I rejected the notion of a class, in favor of everything having a type. People often misunderstand communism, they think that abolishing classes means that all objects have to have equal value, and this gives programmer very little freedom. This is wrong; communism just means that we treat the types equally.
However, we failed to build a truly classless programming language. There seem to be, quite naturally, different kinds of types.
And even some of the most ambitious communist languages, like Haskell, have also embraced type classes! Although this compromise is not an entirely bad thing, since a type can select what type class it belongs to, instead of being assigned one at birth.
I also admit that capitalist languages (the ones with classes) have been hugely successful. But communist (classless) programming language proponents claim that lot of the proclaimed productivity of capitalist languages is just an illusion, and also that many programmers lack the awareness that they, in fact, do not need classes. Often, there is nothing to lose than the call chains!
On the other hand, one cannot easily dismiss arguments about totalitarian nature of communist languages - they openly embrace total functions, and they try to very strictly control input and output. Some claim that lazy evaluation by default might be another reason for their low productivity.
- reuben364 5y agoAs all types in Haskell are inhabited by undefined, any type can be made an instance of a typeclass. True type equality. {-# LANGUAGE GADTs, MultiParamTypeClasses, FlexibleInstances #-} data Eq a b = (a ~ b) => Eq class Revolution a b where eq :: Eq a b instance Revolution a b where eq = undefined
- kzrdude 5y agoTalk to your kids before they learn about Rust.