Python is DOOMED! Again!
Paul Rubin
no.email at nospam.invalid
Sun Feb 1 01:12:10 EST 2015
Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:
> Some degree of weakness in a type system is not necessarily bad. Even the
> strongest of languages usually allow a few exceptions, such as numeric
> coercions.
Haskell doesn't have automatic coercions of any sort. You have to call
a conversion function if you want to turn an Int into an Integer.
> I've never come across a language that has pointers which insists on
> having a separate Nil pointer for ever pointer type
Haskell's idiomatic substitute for a null pointer is a Nothing value
(like Python's None) and there's a separate one for every type. The FFI
offers actual pointers (Foreign.Ptr) and there is a separate nullPtr
for every type.
> the compiler will allow Nil to be used for any pointer type. Anything
> else would be impractical.
It's completely practical: polymorphism and type inference get you the
value you want with usually no effort on your part.
> What if you add two empty objects?
> js> {} + {}
OMG, javascript is worse than I thought
> https://www.destroyallsoftware.com/talks/wat
Can't view, needs flash. :(
Try this instead (NFSW): https://www.youtube.com/watch?v=FJ7QsEytQq4
More information about the Python-list
mailing list