Nice TWiki > Doc > LanguageComparisons > NiceVersusScala (r1.4) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Doc . { Changes | Index | Search | Go }

Scala

Scala has many things in common with Nice: "Scala is a modern multi-paradigm programming language designed to express common programming patterns in a consise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages". There are also fundamental differences: Scala uses single dispatch (with traits and mixins).

Classes

  Unified Types Traits Mixins External Methods Inner classes Abstract Interfaces
Nice Yes Yes(1) No Yes No Yes
Scala Yes Yes Yes No Yes No

(1)I don't see any difference between traits in Scala and interfaces with default implementation in Nice

Methods

  Anonymous Functions Higher-Order Functions Currying Dynamic Dispatch Nested Functions
Nice Yes Yes Not yet(at call site) Multiple Dispatch Yes
Scala Yes Yes Yes(at definition) Single Dispatch Yes

Type Parameters

  Generic Classes Generic Methods Variant Class Type Parameters Upper Type Bounds Lower Type Bounds Multiple Bounds
Nice Yes Yes Yes(2) Yes Yes Yes
Scala Yes Yes Yes Yes Yes ?

(2) Although the typechecking isn't completely implemented yet

Java Compatibility

  Use Java classes Subclass Java classes Use in Java Java Statements/Operators
Nice Yes Yes Yes Yes
Scala Yes Yes Maybe No

Other

Methods Pattern Matching Local Type Inference Comprehensions Option Types User Defined Coercions Tuples
Nice Multi Methods Some: Monomorphic Vars No String & ?String No Yes
Scala Case classes Yes(3) Yes Some(String) & None Yes As classes in stdlib

(3) Has Scala no restrictions on local type inference?

-- IsaacGouy - 22 Jan 2004

Made a few additions.

-- ArjanB - 24 Jan 2004

Topic NiceVersusScala . { Edit | Attach | Ref-By | Printable | Diffs | r1.22 | > | r1.21 | > | r1.20 | More }
Revision r1.4 - 24 Jan 2004 - 11:21 GMT - ArjanB
Parents: WebHome > LanguageComparisons
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.