| Unified Types | Traits | Mixins | External Methods | Inner classes | Abstract Interfaces | |
|---|---|---|---|---|---|---|
| Nice | Yes | NA | NA | Yes | No | Yes |
| Scala | Yes | Yes | Yes | No | Yes | No |
| 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 |
| Generic Classes | Generic Methods | Variant Class Type Parameters | Upper Type Bounds | Lower Type Bounds | Multiple Bounds | |
|---|---|---|---|---|---|---|
| Nice | Yes | Yes | Not yet completed | Yes | Yes | Yes |
| Scala | Yes | Yes | Yes | Yes | Yes | Yes |
| Use Java classes | Parameterize Java classes | Subclass Java classes | Subclass in Java | Java Statements/Operators | |
|---|---|---|---|---|---|
| Nice | Yes | Yes | Yes | Yes | Yes |
| Scala | Yes | No | Yes | Yes | No |
sequence comprehension; in Nice an extended for statement, or a Java for statement.
| Scala | Nice |
|---|---|
|
|
| Methods | Pattern Matching | Local Type Inference | Comprehensions | Option Types | User Defined Coercions | Tuples |
|---|---|---|---|---|---|---|
| Nice | Enum Classes & Multi Methods | Monomorphic (at present) | No | String & ?String | No | Yes |
| Scala | Case classes | Monomorphic, Polymorphic, Non-Recursive Functions | Yes | Some(String) & None | Yes | Library |
def square(x: Int) = { var y=x; y*y } which can be shortened to def square(x: Int) = x*x; whereas in Nice it is int square(int x){ var y=x; return y*y; } and the shorthand form is int square(int x) = x*x;
Paradoxically, Nice's syntax is closer to Java, and Nice more effectively reuses Java libraries, but in a fundamental way Scala is more like Java - it's based around classes.
-- IsaacGouy - 26 Jan 2004 (thanks Arjan)
| Topic NiceVersusScala . { Edit | Attach | Ref-By | Printable | Diffs | r1.22 | > | r1.21 | > | r1.20 | More } |
|
Revision r1.22 - 26 Jul 2005 - 07:21 GMT - TWikiGuest 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. |