It's not that Rich Hickey doesn't know types, it's that the author is a Haskell-centric programmer who wrongly assumes other programming languages work like Haskell.
A C++ function that purports to have the "a -> a" type can do any number of things with side effects, or have an int specialization that does something different, or even fail to compile when applied to a particular type. It doesn't guarantee that "it won’t send your Bitcoins to China" which is a tired charade popularized by Haskellers who pretend unsafePerformIO or unsafeDupablePerformIO(†) or any number of other dangerous functions don't exist.
(†): A version of unsafePerformIO that, in addition to bypassing the type system, is also not thread safe.
On the other hand, why not take a look at Clojure's spec system, which fulfills a remarkably similar purpose compared with a type system?
> "If you only had a list of A's, where you gonna get something else to return. Obviously you're gonna return list of A's unless you're getting stuff from somewhere else, and if you're functional you're not"
You have to be very explicit about sending bitcoins to China in Haskell though. It is not like you can guarantee that your bios or your routers bios won't send bitcoins to China when a specific piece of some beautiful and pure Haskell code is executed.
4 comments
[ 3.6 ms ] story [ 27.6 ms ] threadA C++ function that purports to have the "a -> a" type can do any number of things with side effects, or have an int specialization that does something different, or even fail to compile when applied to a particular type. It doesn't guarantee that "it won’t send your Bitcoins to China" which is a tired charade popularized by Haskellers who pretend unsafePerformIO or unsafeDupablePerformIO(†) or any number of other dangerous functions don't exist.
(†): A version of unsafePerformIO that, in addition to bypassing the type system, is also not thread safe.
On the other hand, why not take a look at Clojure's spec system, which fulfills a remarkably similar purpose compared with a type system?
> "If you only had a list of A's, where you gonna get something else to return. Obviously you're gonna return list of A's unless you're getting stuff from somewhere else, and if you're functional you're not"