summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2005-10-10 16:05:30 +0000
committerMartin Odersky <odersky@gmail.com>2005-10-10 16:05:30 +0000
commit7af69ba79dff228d3b7e2520e2f7aafec3345d52 (patch)
treec4b25765f66bd64d8ef7ad50a8d429b3a85b86a1 /doc
parent90948bf331de457c83c1c625ade401e79861a1c5 (diff)
downloadscala-7af69ba79dff228d3b7e2520e2f7aafec3345d52.tar.gz
scala-7af69ba79dff228d3b7e2520e2f7aafec3345d52.tar.bz2
scala-7af69ba79dff228d3b7e2520e2f7aafec3345d52.zip
*** empty log message ***
Diffstat (limited to 'doc')
-rw-r--r--doc/reference/RationalePart.tex26
1 files changed, 25 insertions, 1 deletions
diff --git a/doc/reference/RationalePart.tex b/doc/reference/RationalePart.tex
index dd6164a3d0..c14eaef5ef 100644
--- a/doc/reference/RationalePart.tex
+++ b/doc/reference/RationalePart.tex
@@ -60,6 +60,30 @@ tests and type casts are generally not considered good object-oriented
style. They are rarely efficient, nor easy to use.
+By contrast, tree transformation is the natural domain of functional
+languages. Their algebraic data types, pattern matching and
+higher-order functions make these languages ideal for the task. It's
+no wonder, then, that specialized languages for transforming XML data
+such as XSLT are functional.
+
+Another reason why functional language constructs are attractive for
+web-services is that mutable state is problematic in this setting.
+Components with mutable state are harder to replicate or to restore
+after a failure. Data with mutable state is harder to cache than
+immutable data. Functional language constructs make it relatively easy
+to construct components without mutable state.
+
+Many web services are constructed by combining different languages.
+For instance, a service might use XSLT to handle document
+transformation, XQuery for database access, and Java for the
+``business logic''. The downside of this approach is that the
+necessary amount of cross-language glue can make applications
+cumbersome to write, verify, and maintain. A particular problem is
+that cross-language interfaces are usually not statically typed.
+Hence, the benefits of a static type system are missing where they are
+needed most -- at the join points of components written in different
+paradigms.
+
Conceivably, the glue problem could be addressed by a ``multi-paradigm''
language that would express object-oriented, concurrent, as well
as functional aspects of an application. But one needs to be careful
@@ -75,7 +99,7 @@ Scala is both an object-oriented and functional language. It is a
pure object-oriented language in the sense that every value is an
object. Types and behavior of objects are described by
classes. Classes can be composed using mixin composition. Scala is
-designed work seamlessly with mainstream object-oriented languages,
+designed to work seamlessly with mainstream object-oriented languages,
in particular Java and C\#.
Scala is also a functional language in the sense that every function