3 ms·
> Try thinking of some combination that will possibly give [the word, dynamic] a pejorative meaning. It’s impossible*. > *This Haskell fan’s contender is “dyna
by ygritte 1y ago
> Try thinking of some combination that will possibly give [the word, dynamic] a pejorative meaning. It’s impossible*.
> *This Haskell fan’s contender is “dynamic typing” :P
Nothing is impossible!
- zoky 1y agoIt’s certainly possible to use it as a euphemism, if not an outright pejorative. “Dynamic truthfulness”, “dynamic sense of morality”, etc.
- eru 1y agoThere's also dynamic scoping; as opposed to lexical scoping a.k.a. static scoping. You can find defenders of dynamic typing, but dynamic scope is now widely seen as a mistake. Or at least dynamic scope by default; it has specialised uses--and in Haskell the Reader Monad is basically isomorphic to dynamic scoping and no one complains about it.
- ygritte 1y ago> dynamic scoping Right you are. Even more horrible. The tcl language still has it!
- School-Cotton 1y agoSo does emacs lisp, by default, although you can set it to lexical scope per-file (and it’s recommended to always do so).
- eru 1y agoI think EmacsLisp also does dynamic scoping. Or at least they used to about ten years ago. Not sure, if they fixed it?
- jrapdx3 1y agoWell, Tcl is kind of a mixture of scope rules. In some respects, e.g., within a proc, it's mainly a lexical environment, but of course dynamic scoping is introduced by commands like upvar/uplevel. FWIW Tcl programmers don't concern themselves very much with sorting out dynamic vs. lexical. In any case, Tcl programmers are careful to maximize static scoping. No doubt that's necessary to create reliable larger programs many of which have been written in Tcl.
- geocar 1y agoDynamic scope/binding is super useful, but I do not agree tcl does it or does it well, because it's not just shadowing the closure environment (ha), or changing globals in a dynamic-wind. Perl's the only non-lisp I'm aware of that does dynamic binding well-enough to get the idea, but too many things just don't work: local *int = sub { return 69 }; print int("42"); is a particularly annoying one: You just can't do it. Other names might have better chances, e.g. package foo; sub int { 42 }; package main; sub a{local *foo::int = sub { return 69 };&b(@_);} sub b{goto \&foo::int}; print b("x"), a("x"), b("x"), a("x"); but this is a little unsatisfying.
- eru 1y ago> Perl's the only non-lisp I'm aware of that does dynamic binding well-enough to get the idea, [...] Well, Haskell does dynamic binding in the form of the Reader Monad. It's well received there.
- geocar 1y agoErm no. The point is I want to have the ability to make any variable dynamic, not just work with a global variable that is really a getter.
- eru 1y agoThe reader monad doesn't need to be global. But yeah, by that standard, Haskell implements both dynamic scoping and mutable state via getters and setters. (Though, of course, you can go all out on these via lenses.)
- rat87 1y agoIsnt dynamic scoping a bit similar to Dependency Injection? Maybe there's a form of it that could be useful. Like explicit dynamic scopes?
- eru 1y agoWell, isn't dependency injection just a more cumbersome way to say 'function arguments'? Dynamic scoping is exactly the same, it's basically equivalent to extra implicit function arguments that are passed through everywhere. And yes, dynamic scopes can be useful in specific cases. What's wrong is having your variables scoped dynamically by default.
- marcosdumay 1y agoThose are not pejorative names. They are descriptive names for (arguably) bad things. And they are all much more enticing than the things deserve.
- eru 1y agoCompare and contrast https://en.wiktionary.org/wiki/euphemism_treadmill https://en.wiktionary.org/wiki/euphemism_treadmill 'Idiot' and 'retard' didn't start out as pejorative either.