Dynamic languages/dynamic environments

The .NET Languages blog recently pointed me to an SD Times article by Larry O’Brien entitled “Dynamic Do-Over.” Most of the later part of the article talked about IronPython and Jim Hugunin, but the earlier part touched on something that I’ve discussed earlier: the question of language strictness when it comes to typing. The more I think about it, the more I believe that static typing is a good thing and something that should be encouraged wherever possible. But when I say that, I don’t mean to say that there isn’t something of value in all those scripty-like dynamic languages out there. I think Larry hits the nail on the head in his article: what makes dynamic languages so great is not their loose type systems, but their dynamic environments.

In the end, I think anything that helps the average programmer be more productive is a good thing. By and large, static typing satisfies this dictum: static typing enables all kinds of programmer productivity features like Intellisense, better error messages at compile time, etc. (One could argue, I suppose, that you could lose the static typing and use type inferencing instead, but I wonder whether it would be possible to build a complete enough type inferencing ruleset that: a) was implementable, b) made some kind of sense, and c) could compete with just stating the damn type of your variables.) Dynamic environments also do this: edit and continue (pace Franz et al.), continuable exceptions, being able to call functions at design time, etc. So I think marrying the two worlds has some facinating possibilities.

I should add, though, that I don’t believe loose typing has no use. One application for loose typing that I’m particularly interested in is modeling unstructured or semi-structured data such as XML. I think the work that the E4X group has been doing is particularly interesting…

4 thoughts on “Dynamic languages/dynamic environments

  1. verbat

    the truth is that there is no static strong type system as expressive as a dynamic one.

    the they we’ll have that we’ll get language expressivity’s holy graal

    Reply
  2. Isaac Gouy

    "lose the static typing and use type inferencing instead"

    We don’t lose static type checking!

    Type inference infers variable types and they are statically checked.

    Type inference has been implemented in many languages – MLs, Haskells, Clean, Scala, …

    Look at this example on The Great Computer Language Shootout:

    http://shootout.alioth.debian.org/lang/nice/lists.nice.html

    Nice is statically type checked, provides type inference for method variables, re-uses standard Java libraries, and generates JVM bytecode.

    Reply
  3. Pingback: Panopticon Central

Leave a Reply

Your email address will not be published. Required fields are marked *