Home > Articles > Programming

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

1.6 Related Work and Influences

The design of Dart has been influenced by earlier languages, in particular Smalltalk[1], Java and Javascript. Dart’s syntax follows in the C tradition, via Java and Javascript. Dart’s semantics are in some ways closer to Smalltalk - in particular, the insistence on a pure object model.

However, there are crucial differences. Dart introduces its own library-based encapsulation model. This differs from all three of the languages mentioned above. Smalltalk supports object-based encapsulation for fields, with methods and classes universally available. Java has a mix of class-based encapsulation and package privacy, and Javascript relies exclusively on closures for encapsulation.

Like Smalltalk and Java, Dart is class based and supports single inheritance, but it augments this with mixin-based inheritance, very similar to the model first implemented in the Strongtalk dialect of Smalltalk[2]. Because class methods in Dart are not true instance methods as in Smalltalk, but instead Java-style static methods, the models are not exactly the same.

Dart’s constructors have a syntactic similarity to those of Java, but in fact differ in critical ways. All of the above topics are discussed in the next chapter.

Dart’s approach to type checking is also very close to the one developed for Strongtalk. Types are explored exhaustively in Chapter 5.

Dart’s view of concurrency is close to the original actor model (albeit, imperative), again very different from any of the languages cited above. The success of Erlang has been a factor in the adoption of an actor model, yet unlike Erlang, Dart has a non-blocking concurrency model. Dart also has built-in support for asynchrony heavily influenced by C#. See Chapter 8 for details.

  • + Share This
  • 🔖 Save To Your Account