Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic typing and programming distributed systems

Coming from Scala (and Akka), I recently began looking at other languages that were designed with distributed computing in mind, namely Erlang (and a tiny bit of Oz and Bloom). Both Erlang and Oz are dynamically typed, and if I remember correctly (will try to find link) people have tried to add types to Erlang and managed to type a good portion of it, but could not successfully coerce the system to make it fit the last bit?

Oz, while a research language, is certainly interesting to me, but that is dynamically typed as well.

Bloom's current implementation is in Ruby, and is consequently dynamically typed.

To my knowledge, Scala (and I suppose Haskell, though I believe that was built initially more as an exploration into pure lazy functional languages as opposed to distributed systems) is the only language that is statically typed and offer language-level abstractions (for lack of a better term) in distributed computing.

I am just wondering if there are inherent advantages of dynamic typing over static typing, specifically in the context of providing language level abstractions for programming distributed systems.

like image 304
adelbertc Avatar asked Apr 11 '13 15:04

adelbertc


People also ask

What is dynamic typing in programming?

Dynamically-typed languages are those (like JavaScript) where the interpreter assigns variables a type at runtime based on the variable's value at the time.

What is dynamic typing explain with example?

Dynamic typing means that the type of the variable is determined only during runtime. Due to strong typing, types need to be compatible with respect to the operand when performing operations. For example Python allows one to add an integer and a floating point number, but adding an integer to a string produces error.

What programming language is used in distributed systems?

While there's literally thousands of languages that are specifically designed for distributed programming, Erlang is by far the most mainstream (and in fact pretty much the only one).

What is the difference between dynamic typing and static typing?

There are two main differences between dynamic typing and static typing that you should be aware of when writing transformation scripts. First, dynamically-typed languages perform type checking at runtime, while statically typed languages perform type checking at compile time.


1 Answers

Not really. For example, the same group that invented Oz later did some work on Alice ML, a project whose mission statement was to rethink Oz as a typed, functional language. And although it remained a research project, I'd argue that it was enough proof of concept to demonstrate that the same basic functionality can be supported in such a setting.

(Full disclosure: I was a PhD student in that group at the time, and the type system of Alice ML was my thesis.)

Edit: The problem with adding types to Erlang isn't distribution, it simply is an instance of the general problem that adding types to a language after the fact never works out well. On the other hand, there still is Dialyzer for Erlang.

Edit 2: I should mention that there were other interesting research projects for typed distributed languages, e.g. Acute, which had a scope similar to Alice ML, or ML5, which used modal types to enable stronger checking of mobility characteristics. But they have only survived in the form of papers.

like image 53
Andreas Rossberg Avatar answered Oct 18 '22 14:10

Andreas Rossberg