I'm trying to get a better handle on what it really means for a language to be "dynamic". I have quite a bit of experience with Lingo, which is the scripting language for the Adobe (formerly Macromedia) Director product line, and I'm just wondering if it would be considered a "dynamic language".
The way variables and lists are handled seems very "dynamic language"-ish to me.
With variables, you would just write foo = 3
or bar = "Hello World"
. You don't declare a variable as an int
or string
--it figures that out as is goes.
With lists, you can just write something like miscCollection = [3, "Hello World", #helloWorld, ["Embedded List", "Goes Here", 3], [#phrase: "Property List goes here", #value: 3]]
. Would this not be similar to a tuple
?
Are these features enough to qualify for "dynamic language" status?
Interestingly, I've been using C# a lot more and Director/Lingo a lot less, but with all the excitement over dynamic languages these days, I wonder if I'm actually going against the grain.
EDIT
Regarding Mark Rushakoff answer, below, here's an attempt to analyze whether Lingo qualifies as "dynamic" using this Wikipedia article:
Eval
- Lingo hasdo
andvalue
keywords.do
will execute an entire command, e.g.,do "foo = 23"
ordo "foo = sum(20, 3)"
.value
attempts to convert a string into a numeric, but it is more than just a parsing operator--it can actually convert a string representation of a variable into its number, e.g., assumingfoo = 23
, the statementvalue("foo")
will evaluate to 23.Higher-Order Functions - If I'm understanding this right, this is basically what I would be called a "delegate" in C#. Lingo doesn't support this directly as far as I know, although you could create a type (called a "parent script") that has a function and pass an instance of the type.
Closures - No support for this as far as I know.
Continuation - No support for this as far as I know.
Reflection - In a sense at least, yes. You actually create new instances of types using a string, e.g.,
fooInstance = script("Foo").new(bar)
. It is also possible to convert an instance of a type into a string that contains the name of the type (so you can sort of mimic c#'sGetType()
functionality). You can also query the properties of a type without knowing the names of the properties (e.g., look up a property by index) and find out the names of the properties by index.Macros - The way the Wikipedia article describes a macro, I don't believe so. It is possible to edit scripts at runtime, however, so maybe that counts.
So, it seems that Lingo scores a 2 to 3 out of 6 on dynamic features, but I'm not clear enough on closures and continuations to know for sure that Lingo doesn't support them. I guess I'm not sure what to conclude. Comments welcome.