Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is Scala?

Shulou Source: shulou.com Published: 2022-06-02 04:06:08 10月02日 Update

This article mainly explains "what is Scala". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what is Scala?"

1.1.What is Scala

Scala is a multi-paradigm programming language, which is designed to integrate the features of object-oriented programming and functional programming. Scala runs on the Java platform (Java virtual machine) and is compatible with existing Java programs.

Why do you want to learn Scala

1. Elegance: this is the first consideration for framework designers. The users of the framework are application development programmers, and the elegance of API directly affects the user experience.

two。 Speed: the Scala language is expressive, one line of code is worth Java, and the development speed is fast; Scala is statically compiled, so it is much faster than JRuby,Groovy.

3. Can integrate into the Hadoop ecosystem: Hadoop is now the de facto standard of big data, Spark is not to replace Hadoop, but to improve the Hadoop ecology. Most of the JVM language may think of Java, but the API made by Java is too ugly, or it takes too much effort to implement an elegant API.

2. Install Scala compiler 2.1and install JDK

Because Scala runs on the JVM platform, install JDK before installing Scala

2.2. install Scala2.2.1, Windows install Scala compiler

Visit the Scala official website http://www.scala-lang.org/ to download the Scala compiler installation package. The latest version is 2.12.x, but most of the frameworks are written and developed in 2.10.x, so 2.10.x is recommended here. Click next after downloading scala-2.10.6.msi.

2.2.2. Linux installs the Scala compiler

Download the Scala address http://downloads.typesafe.com/scala/2.10.6/scala-2.10.6.tgz and extract the Scala to the specified directory

Tar-zxvf scala-2.10.6.tgz-C / usr/java

Configure environment variables to add scala to PATH

Vi / etc/profile

Export JAVA_HOME=/usr/java/jdk1.7.0_45

Export PATH=$PATH:$JAVA_HOME/bin:/usr/java/scala-2.10.6/bin

At this point, I believe you have a deeper understanding of "what is Scala", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Compilation compiler elegance framework language speed development programming content platform version ecology user program speed learning design running practical deeper Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Microsoft OPPO Reno Redmi NVidia