You can get most of the benefits of not being ridiculously dynamic without switching to a new language. Take a look at http://www.iro.umontreal.ca/~gambit/doc/gambit-c.html#Defini...: Gambit Scheme (a Lisp) has a (declare (block)) form to tell the compiler that all variables defined in the current file will not be overwritten outside the current file, and a (declare (standard-bindings)) form to tell the compiler that the standard Scheme functions are not overwritten. With proper use of these options, Gambit is quite fast.
Javascript could have a "fixate foo bar qux" command that did something similar. Of course, for best results, it would need to fixate the current foo bar qux, as Javascript frameworks seem quite keen on overriding the standard functions. I'm sure it would be a pain to implement, but...
Comments
You can get most of the benefits of not being ridiculously dynamic without switching to a new language. Take a look at http://www.iro.umontreal.ca/~gambit/doc/gambit-c.html#Defini...: Gambit Scheme (a Lisp) has a (declare (block)) form to tell the compiler that all variables defined in the current file will not be overwritten outside the current file, and a (declare (standard-bindings)) form to tell the compiler that the standard Scheme functions are not overwritten. With proper use of these options, Gambit is quite fast.
Javascript could have a "fixate foo bar qux" command that did something similar. Of course, for best results, it would need to fixate the current foo bar qux, as Javascript frameworks seem quite keen on overriding the standard functions. I'm sure it would be a pain to implement, but...