Skip to content

Comment on Modules Matter Most

Comments

His linked article says of the popularity of dynamic language: "From what I can tell, it’s largely a matter of marketing.", that dynamic means fun, and that they are subversive. http://existentialtype.wordpress.com/2011/03/19/dynamic-lang...

Dynamic languages are popular because you don't need to make decisions about types up-front, nor specify the types, nor change them when you change those decisions. In terms of the act of coding, it's more flexible when you begin, and more flexible when you maintain. He's right of course that static types are more flexible in terms of carving out a particular subset of the space of possible programs (as context free grammars are more flexible that regular expressions).

That is, some simple and well-known facts are unknown to him. I still think he has something interesting to say, it just takes some extra work to get to it, and you have to take it with a grain of salt because although he's supremely confident, he's coming from quite a limited perspective.

EDIT There's some hints in his conclusion and a comment that he does see real benefits to dynamic languages (without articulating them) - so perhaps he was just trolling or being ironic.

It sounds to me like you're coming at the question without understanding all the facts either. Strong static typing doesn't mean you need to specify all your types. That's an orthogonal issue. There was actually a variant of Smalltalk, called Strongtalk, which turned it into a statically typed language but allowed existing Smalltalk programs to run unaltered.

Yes, that's part of static types carving out a subspace - just as context free grammars can represent any regular language.

I was saying that, as a question of fact about the world today, one of the reasons that today's dynamic languages are popular is that you don't need to specify types (within the competitive set of mainstream statically typed languages). Not marketing.

---

But maybe I see where he's coming from now: he's saying that statically typed languages are a superset of dynamic languages. So, therefore, they should be more popular than dynamic languages. But they're not... so, thinks he, it must be for some other reason... like marketing.

This perspective would explain his attitude; but I deeply disagree with it. It's a mistake to expect popularity to measure technical quality. Sometimes they coincide, but not always. I don't agree with the common idea that "marketing" always causes the difference, as in promotion and advertising and advertising a technically inferior product leading to widespread adoption. I do think it is due to marketing, but not that kind. It's that the popularity of a product is due to how well it meets the needs of users, compared with the alternatives; it is not technical quality per se, but technical qualities that are needed.

Needs are often ranked, in that users won't worry much about their second need until their first need is met. And after their first need is fully met, they don't really appreciate getting even more of whatever met it. Like being thirsty - a glass of water is great, two, maybe even a litre... but increase the amount enough, and pretty soon, you're just not that excited about drinking all that water.

In other words, popularity is more about users than products - so it can be misleading to measure products by popularity.

To bring it back to the article: the lack of mainstream popularity of his favourite languages is less to do with static vs. dynamic typing, and more to do with the reasons why lisp is not popular (e.g. libraries, familiarity, community, toolchain, intutiveness, etc).

For example, abstraction is a great thing, but if it's more than a user needs to do the tasks they have in mind, then they start to judge it by other factors, like how easy it is to learn. If they absolutely need that level of abstraction, then they may go to the trouble of learning it - researchers and compiler writers (for example) sometimes need this; the mainstream simply doesn't. Of course, some people just love abstraction for itself, above all else - that's their first need.

---

BTW: I can imagine a static/dynamic combination (like Strongtalk) taking off in the mainstream, provided it didn't get in the way. You just have to ask what needs it meets. One thought I've had is to have dynamic typing within modules, but static typing between modules (think: python with static types in library interfaces). I realize this is a subset in power of optional static typing; but I'm thinking more about the needs of users than the capabilities of technology. Interface documentation gets cleaner, bugs are found more easily; yet within modules, it's still easy to create code quickly and change it. It becomes harder to change interfaces (which are hard to change anyway, when other people depend on them). This is the use of it; the needs it meets.

Yes he does see the benefits to dynamic languages, but wonders why you would use one considering that those benefits are present in "good" static languages.

Good static languages have pattern matching and sum types, which gives you the ability to work with tagged data in a syntactically clean way. Dynamic languages just tag all the data. OP's point: are you aware of this? You could be as dynamic and as static as you want in a language like ML or Haskell.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.