News for hackers. Stuff that matters.
Re:The Wake Programming Language by grey-area on Monday February 16, 2015 @04:25AM (#9055986)
More examples of js insanity here (1:20):

https://www.destroyallsoftware.com/talks/wat

How about {} + [], is that deliberately zero, and why is addition not commutative in this case if it is allowed? Or {} + {}?

I think most people would infer type safety to mean that attempts to coerce types which are meaningless result in an error, not meaningless output, like the result of "string" - 1, or {} + "string" or {} + []. Otherwise your type system isn't going to stop you doing something insane by mistake, and is therefore not adding any safety.

{} + "string" or similar just shouldn't be allowed, and in most languages (let alone type safe ones), it is not.

There are no comments on this comment yet.