2 ms·
re: dynamism/late-binding; it was seen as very exciting at the time. At least to me. Maybe under the influence of Self and Smalltalk, which were doing interest
by cmrdporcupine 4y ago
re: dynamism/late-binding; it was seen as very exciting at the time. At least to me.
Maybe under the influence of Self and Smalltalk, which were doing interesting things with object behaviour composition using delegation and slots and all sorts of late-bound magic.
It definitely let people experiment. In JavaScript especially a thousand (inelegant) flowers bloomed and then some practices were codified into later revisions of the language and the door shut on that kind of experimentation.
I'm a big fan of static type systems generally. But I do think dynamic scripting languages have their place. In particular as prototyping/scripting languages embedded in larger more robust runtimes. e.g. the original goal of JavaScript (which has now become a full blown application development language).
AutoCAD had/has its lisp dialect. Emacs its own (ok it's more than just embedded scripting in that case). Many FPGA and HW eng tools use Tcl. Various games have Lua etc etc. This is a useful pattern potentially.
- jerf 4y ago"But I do think dynamic scripting languages have their place." My thought isn't actually static/dynamic, but rather the amount of dynamicness. I suspect we could get 99%+ of the benefits of static languages at a fraction of the runtime cost if someone redid a dynamic language from scratch today to be dynamic only in selected ways. You pay a lot of runtime performance in Python to be able to do things like at any time edit a method three levels up the inheritance hierarchy, but you almost never actually do that sort of thing. One idea I cite often is to have a declaration phase versus a runtime phase, because the vast, vast bulk of "dynamicness" is achieved at startup. A JIT could be really aggressive about a lot of optimizations if the language itself guaranteed that after a program (or a module, or a function, or whatever makes sense in the end) declares itself "done being dynamic" that there will be no more changes. In fact I think there's a niche for a high-performance "mostly" dynamic language with threading built in from the beginning in the next 5-10 years. Static languages are getting most of the attention right now, and there's reasons for that, but I think there's a niche here that is not being well explored. Personally I'm having a hard time using dynamically-typed languages right now because the amount of performance I'm throwing away almost makes me nauseous. That's a combination of the problem with being too dynamic, as I said, and multi-decade-old implementations not being able to be multithreaded very easily. I think a language that solved those two things could be very interesting.
- zozbot234 4y agoModern static languages generally support opt-in "dynamic" facilities. For instance, C++ has its RTTI support, Haskell has 'Dynamic' and Rust has the 'Any' trait.
- cmrdporcupine 4y agoThe thing is that behind the scenes it's just all really hashtables, so while all that that pointless dynamism is expensive computationally it's also "free" from an implementation PoV, so that's what people do. And then later optimize with caching dispatch tables, etc. etc. Honestly I'm surprised after all these years that there hasn't been any success getting serious hardware support for the kinds of dynamic dispatch tables used in late bound languages. Like hardware accelerated string hash tables, etc.