📜 ⬆️ ⬇️

Course program and materials on Scala

Good day.

My name is Golovach Ivan, I am a Java Tech Lead practitioner with 10+ years of programming experience (Java EE, J2ME, C, C ++, M-language, Delphi), who switched to Scala.

I prepared and read both regular programming courses ( Java Core + Junior Java Developer ) and special courses (Multicore Programming for JVM ( one and two times )).
')
At the moment I am starting a special course on Scala and in this topic I want to share the materials that I found most interesting / informative (the course has been prepared for over a year).

Course program
Materials: "Miscellaneous"
Materials: Object Oriented Programming in Scala
Materials: Functional Programming in Scala
Materials: Higher kinded types
Materials: Parser combinators
Materials: Metaprogramming / Reflection
Materials: Metaprogramming / Macroses
Materials: Scalaz
Materials: Netty
Materials: Akka
Materials: Finagle
Materials: Zookeeper
Materials: Using FP in the financial industry


Course program



The special course on Scala sets its goals
1. Deeply study the language, including such "dark corners" as macroses, path dependent types, generics of higher kind. Learn to create internal and external DSL. find out why functional programming languages ​​are so popular in the financial industry.
2. Understand why when writing code in functional programming languages ​​(and Scala in particular) often use mathematical libraries referring to algebra and category theory.
3. See why modern startups (like Twitter and LinkedIn) often write their infrastructure on Scala.

The special course starts on February 27, 2015 and consists of 16 webinars for 2-2.5 hours each. Duration 3 months (1-2 lessons per week). All lectures are recorded on video and made available to listeners. All necessary literature is provided in electronic form. I answer questions both during the webinar and the rest of the time. You have the opportunity to communicate with 15-20 other students who are learning Scala in parallel.




Materials: "Miscellaneous"



Scala introductory articles


These articles are brief reviews of the language (15-20 pages). They are more likely ideological / historical in nature - as the author himself (Oder) sees his brainchild, which he considers the most important / distinctive / characteristic.


Scala Style Guide




Scala main articles



These articles highlight and clarify the main characteristics of the language.



Courses / Scala



The scope of the material on a small book, but not the book. From the "classics."


Yes, the Coursera itself is written in Scala .

Books



There are a large number of books on the market (about 20) on Scala, but I most liked the following 4



Materials: Object Oriented Programming in Scala





Materials: Functional Programming in Scala


“Functional Programming in Scala” is a powerful book from one of the distributors in Scalaz.


Materials: Higher kinded types





Materials: Parser combinators



Scala includes a package ( scala.util.parsing ), which provides tools for describing External DSL grammar on Scala in a format close to EBNF. Those. This is an “internal DSL” for creating an “external DSL”.

In Scala, the parsers are, therefore, the defining combinators.

In a number of subject areas, you can build an API in the form of some primitive elements (in this case, parsers) and methods of combining these elements in a certain way (combinators). In this case, the very core of the language has everything you need to build external DSLs.




Materials: Metaprogramming / Reflection


Scala's runtime reflection has been used, provided in the package scala.reflect.api. This enables the sharing of generic code between macros and implementations that utilize runtime reflection.

Until 2.10, Scala has not had any reflection. Instead of using one of these APIs, it can be used to identify its members. However, there are many types of scala-specific elements that can be used for Java reflection, which can be used for Java elements (no functions, no traits) and types (no existential, higher-rate, path-dependent and abstract types). In addition, java reflection is not possible. a restriction that is carried through to scala.

In the Scala 2.10, there has been a direct scattering of knowledge and awareness of the Scala. With full-featured runtime reflection for Scala types and generics ...



Materials: Metaprogramming / Macroses


Scala's runtime reflection has been used, provided in the package scala.reflect.api. This enables the sharing of generic code between macros and implementations that utilize runtime reflection.

Our flavor of macros is a reminiscent of Lisp macros, adapted to incorporate safety and rich syntax. Unlike infamous C / C ++ preprocessor macros, Scala macros: 1) are written in full-fledged Scala, 2) work with expression trees, not with raw strings, 3) cannot be changed syntax of Scala. [ here ]

Macros are functions that are called compiler during compilation. Programmer has access to compiler APIs. For example, it is possible to generate, analyze and typecheck code. You can learn more about macros from the documentation. [ here ]

Scala since version 2.10.0 . It is a scant of the scala.

Experimental feature . Do not use either scala.language.experimental.macros per sample or a -language: experimental.macros (providing a compiler switch) on per-compilation basis. You can, however, don’t need to make any changes.



Materials: Scalaz





Materials: Netty


Netty - an asynchronous network event Netty is the de fakto standard for using java.net. *, NIO and NIO.2 (Akka and Finagle use Netty, Zookeeper directly under the hood NIO / NIO.2). Although it is possible to directly implement the asynchronous message processing templates of the Reactor / Proactor / Asynchronous Completion Token / Acceptor-Connector, however, this involves a large number of template code and shading of the domain functional. The advantage of Netty is both the declarativeness of the code and the fact that the library is a protocol constructor (http, ftp, smtp, websockets, ...).




Materials: Akka


Akka is the de facto framework standard for multi-threaded and distributed, artist-based architectures for JVM. Starting with the version of Scala 2.10.0, Akka supplanted the "native" implementation of actors .



Materials: Finagle


Finagle - A Protocol-Agnostic extensible RPC System for the JVM, used to construct high-concurrency servers. Written and used in twitter.com. The basic principle is "We must program locally, communicate globally . " Part of the Twitter stack (along with Ostrich, Zipkin, Mesos, Iago, ZooKeeper, Scalding). Finagle includes load balancing, connection pooling, a call with timeout, monitoring, statistics collection.



Materials: Zookeeper


Zookeeper is a fail-safe centralized service for managing configuration information, naming, distributed synchronization and other group services, an integral part of the Twitter stack . It can be used to create basic data structures (cluster) - queues, locks, barriers. Suitable for distributed algorithms such as two-phase-commit, leader election and others.



Materials: Using FP in the financial industry



For a number of reasons (the ability to describe a subject area in the language of combinators), functional programming languages ​​are used in the financial industry, which creates a demand for "functionalists" in New York and London.



PS We will be happy to answer any questions by
skype: GolovachCourses
email: GolovachCourses@gmail.com

Source: https://habr.com/ru/post/251239/


All Articles