ES8 Proposal: Optional Static Typing

Brandon Andrews warcraftthreeft at
Mon Jul 20 00:48:48 UTC 2015

> I heard Gilad Bracha in ECOOP to say [paraphrase] "optional typing is great to help with documentation, and to help the tools; but it should not touch the runtime". This is what I take for my own as well, nicely said. Your overload proposition, though, changes the language so that this would need to touch the runtime. It seems there are two distinct view on bringing static typing in to dynamically-typed languages: one of them in line with the aformentioned, the other taking over the semantic and runtime as well. There are also two terms: "optional typing" and "gradual typing". I really don't know if those are defined precisely, but there seemed to be a sentiment that "optional typing" is the Gilad-Brachaish Strongtalk-like view, and "gradual typing" is the view that actually changes the semantics of the language and the runtime. What I wanted to say, is, that maybe this thread should be called "ES8 Proposal: Gradual Static Typing".

I'm definitely advocating run-time changes. Adding static typing that does nothing other than help with code-hinting or documentation would be pointless. I don't think anyone would seriously consider changing the language just for that. While having cleaner documentation, code-hinting, and more readable code would be useful a bigger change is performance. Giving programmers the ability to write clear code that also gives them finer control over allocation and data structures is key in the continued and expanding usage of Javascript. It's with these changes I'm hoping Javascript can be used more as a scripting language to further fill gaps where other languages are used. I think that's also the view many hold when they proposed SIMD integration. SIMD alone though is a targeted fix for a few applications. Types on a whole solve many small performance issues across numerous applications.

More information about the es-discuss mailing list