top | item 23991486

(no title)

hugomg | 5 years ago

I always love reading more about JavaScriptCore internals although I have to confess that much of the time one of the main lessons I get from it is that life would be much easier if we had types and didn't need to speculate so much in the first place.

discuss

order

pizlonator|5 years ago

Not having types is a virtue for the web, where interfaces can change in weird ways. Dynamism leads the engine and the JS code to be less tightly coupled. So, there’s more wiggle room for evolution in the engine and more wiggle room for portability defenses in JS.

So, it just depends on how important the benefits of dynamic types are versus the benefits of static types. I don’t think static types of dynamic types are better; they are just good at different things.

hugomg|5 years ago

It wouldn't be the JS we know and love if it had been burdened with a type system designed by a committee sometime in the 90s. That said, one thing we can say for sure is that the dynamic typing doesn't make your job any easier :)

cztomsik|5 years ago

How about optional typing, even in some limited form (primitive types, primitive-only structs) with gradually adding more over the time?

I think there was some proposal already but it's probably dead now because I haven't heard about it for a while.

jolux|5 years ago

There are still ways to program to unstable interfaces in static languages though, and they tend to be safer overall because they are isolated from the rest of the language.