Hacker News new | past | comments | ask | show | jobs | submit login

> So type inference. You can do type inference. Except that it's lame, because it doesn't handle weird dynamic features like upconverting integers to Doubles when they overflow.

Pretty weak argument against type inference. Yegge has used OCaml so i expected better arguments.

And JavaScript 2 is getting type annotations, so the trend is more likely in the other direction to improve performance.




I think he just brought up the "int overflow into Double" thing so he could pimp out the double-dispatch type inference a little bit later:

> "... and so all this stuff about having a type-tag saying this is an int – which might not actually be technically correct, if you're going to overflow into a Double, right? Or maybe you're using an int but what you're really using is a byte's worth of it, you know. The runtime can actually figure things out around bounds that are undecidable at compile time."

I got the distinct impression that he wasn't arguing against type inference, merely said that the classic way to do it doesn't always work with dynamic languages, and there are better (newer) ideas regarding how to infer types without resorting to type tags.


I suppose you're right. Hopefully he will explain it more in a future blog post.


I suspect that Steve Yegge would agree with me that introducing type annotations into JavaScript is a mistake - a cure for the wrong problem as his presentation strongly argued.


Actually he has explicitly listed it as being necessary to make the language popular in his essay "The Next Big Language" which you can find at http://steve-yegge.blogspot.com/2007/02/next-big-language.ht...

"Rule #2" for what NBL requires is "Dynamic typing with optional static types."




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: