6 ms·
>In other words, even if we agree that static typing has a positive effect on some metric (like number of bugs) it's not going to move the discussion forward.
by paxcoder 10y ago
>In other words, even if we agree that static typing has a positive effect on some metric (like number of bugs) it's not going to move the discussion forward.
I believe it would. Agreeing on the objective would allow us to understand the situation-dependent trade-offs, and help us to agree to disagree on subjective.
>> Conversely, it is not a matter of opinion that dynamic languages allow patterns that static typing does not (eg. duck typing[sic]).
>Not a very good example, actually there are static type systems which use structural typing to allow for type-safe duck typing. Examples are Opa with its Power Rows, OCaml with its polymorphic variants and others.
As you've said, it's still static typing, whether the types are explicit or not. Duck typing allows things to learn to quack at runtime, structural typing doesn't enable that.
>in the worst case you can write an intepreter
If you create a dynamic language, then you're using a dynamic language. Please no more Turing equivalence.
>Given that, per the paper above, we have no hard data on how exactly static typing (much less on a dynamic typing techniques...) affects the metric we're interested in, the answer to the question is - again - a matter of personal opinion.
I'm sure there is some hard data somewhere. But I like strong indications as well to decide what may be worth investigating.
>> These are objective arguments we can discuss, and weigh against each other. There are even studies that we can throw in here.
>I'm sorry, but I'd like to trouble you to provide such papers; as you can see above my quick search returned somewhat different results.
I thought I could humor you relatively easily, but my results matched yours - conclusive research on the general question seems elusive (see eg https://danluu.com/empirical-pl/ https://danluu.com/empirical-pl/). I cede the point, I'll try to pay more attention from now on.
>The trend of "mainstream" moving to static typing is visible, but it's important to note that the same trend was observed more than once in programming history already. In all the previous cases it reversed (to dynamic typing) after ten to fifteen years.
"Reversal" here seems to imply a return to a default. On the contrary, I can't say definitely that there was a time when dynamic languages ruled the mainstream.
>Your original thesis was that static typing is an overall win over dynamic typing. I already managed to convince you that this is not the case: you admit that there are techniques hard to pull off in a statically typed language. To me, that's enough.
I'm afraid my stance remained the same: I consider any advantages of dynamic languages not worthy the disadvantages. For example, the technique of duck typing counts as one of the things I said I avoided in the hybrid language I use even though it can't do structural typing. What did change is my assumption that my stance is anywhere close to being scientifically proven.
>[My MUD with dynamically reloadable objects is] just an anecdote, but it's an example of a project where dynamic, dynamically typed language is a clear win over a static, statically typed one.
Yay, a use-case! Please provide some concrete examples. Since your case is pretty niche I hope we'll be able to generalize it to say, eg. "Reloading systems is bad, availability is good", and then contrast how what happens behind the scenes to facilitate that in a dynamic language differs from what happens when you use modules or services (other than ease of use, which is a valid argument itself). Thanks.
P.S. I realized I've mangled that medium. I really hope you won't insist I read the whole thing though. It sounds too subjective from what I've read.