15 ms·
The best part about Javascript is that because it's a functional language it has amazingly deep capabilities of being improved and modified through libraries. T
by InclinedPlane 16y ago
The best part about Javascript is that because it's a functional language it has amazingly deep capabilities of being improved and modified through libraries. The Javascript that people write today (often reliant on prototype/jQuery, node.js, etc.) is quite different from the code that people were writing 10 years ago. The same is likely to be true in another 10 years, even if the language spec. itself doesn't change one iota.
- spencertipping 16y agoVery true. It's also one of the only languages out there to let you inspect functions' source code, which means you can implement full-blown Lisp macros in it using eval(). Given its popularity and the runtime performance of V8, I think this makes it the ultimate language for the next decade.
- petercooper 16y agoIt's also one of the only languages out there to let you inspect functions' source code Got any pointers on this? I've been searching a little and unable to find this and haven't heard of this level of introspection before.
- spencertipping 16y agoWell actually, I did end up writing Lisp on top of Javascript this way: http://github.com/spencertipping/caterwaul http://github.com/spencertipping/caterwaul. The basic mechanism is to call f.toString() on some function, then construct a new one the way you want it using either eval() (for non-IE browsers), or new Function(code) (for all browsers). Caterwaul leverages this by implementing a JS parser, defining a macro syntax, and letting you determine how the code gets rewritten. (So you can do things like let[x = 5] in x + 1, which is valid JS to begin with but nobody would ever use it :) )