Scala is a strong static language that integrates object-oriented and functional features and can run on JVM. Because it can run on JVM and draw on a large number of Java language features during design, it can interact with Java and call Java-related class libraries, this makes great use of the intellectual investment of programmers who have mastered Java. It also draws on the elang function language and Ruby and other scripting languages to provide efficient, lightweight, and other features, so as to master Ruby, Erlang, and other languages, to learn Scala more quickly.
Scala was designed by Martin odersky of Lausanne Federal Institute of Technology. Its first version was released in 2003, and the latest version is 2.11.2 (official website ). At present, there may be few applications in China, but a large number of foreign countries are using Scala, and there is a tendency to Migrate Java to Scala. So what companies are using Scala for development ?, Let's take a look:
* In April 2009, Twitter announced that they had migrated most of the back-end programs from Ruby to Scala, And the rest planned to be migrated.
* In addition, wattzon has publicly announced that its entire platform has been written based on Scala infrastructure.
* The UBS Group uses Scala for general products.
* Coursera (famous educational video website) uses Scala as a server language.
Main features:
* Object-Oriented Programming: Scala is a pure object-oriented language. Every value is an object. Object Data Type and BehaviorClassAndCharacteristicsDescription. There are two ways to expand the class abstraction mechanism. One way is to subclassInheritanceThe other approach is flexible.Blending Mechanism. These two approaches can avoid the problems of multiple inheritance.
* Functional programming: Scala is also a functional language, and its functions can also be used as values. Scala provides a lightweight syntax for definingAnonymous Functions, SupportedHigh-order functions, Nesting allowedMulti-layer Functions, And supportsKerihua. Scala's case class and its built-in pattern matching are equivalent to the common algebraic types in functional programming languages. Furthermore, programmers can use Scala's pattern matching to write code similar to regular expressions to process XML data.
* Static type: Scala language has a type system and supports many features: generic type, covariant and invert, annotation, and upper and lower limits of type parameters, the class and abstract types are used as object members. The composite type explicitly specifies the type, view, and polymorphism Method When referencing itself.
* Scalability: Scala design acknowledges the fact that in practice, application development in a specific field often requires language extensions specific to this field. Scala provides many unique language mechanisms that can easily and seamlessly add new language structures in the form of libraries: Any method can be used as a prefix or suffix operator; closure can be automatically constructed based on the expected type. These two features allow you to define new statements without the need to extend the syntax or use meta-programming features such as macros.
* Concurrency: Scala uses actor as its concurrency model. actor is a thread-like entity and has a mailbox to send and receive messages. The actor can reuse threads, so millions of actors can be used in the program, and only thousands of threads can be created. In Versions later than 2.10, akka is used as its default actor.
Tutorial:
* Official Website documentation (you can query related APIs)
* Scalatutorial (Official short tutorial)
* Scala school! (The tutorials hosted by Twitter on GitHub are very detailed and practical)
* Scala functional programming principles (it is absolutely authoritative for Scala designers to open classes on Coursera !)
Scala language first recognized