SlideShare a Scribd company logo
Scala
Scalable Language
Moore’s Law (Scalability)
- Moore’s law
now achieved
by increasing #
of cores, not
clock cycles
- We need
Concurrency
and Parallelism
Data from Kunle Olukoten
Concurrency and Parallelism
- Parallel Programming
- Execute programs faster on parallel hardware
- Concurrent Programming
- Manage concurrent execution threads explicitly.
- Both are too Hard
- The speedup of a program using multiple processors in
parallel computing is limited by the time needed for the
sequential fraction of the program. [Amdahl’s Law]
The Root of The Problem
- Non-determinism caused by
concurrent threads accessing
shared mutable state.
non-determinism = parallel processing + mutable state
- heisenberg problem (bug goes away when we
introduce instrumentation)
var x = 0
async { x = x + 1 }
async { x = x * 2 }
print(x)
// can give 0, 1, 2
The Root of The Problem
- Non-determinism caused by
concurrent threads accessing
shared mutable state.
non-determinism = parallel processing + mutable state
- heisenberg problem (bug goes away when we
introduce instrumentation)
- To get deterministic processing, avoid the mutable
state.
- Avoid mutable state means program functionally.
var x = 0
async { x = x + 1 }
async { x = x * 2 }
print(x)
// can give 0, 1, 2
Why Scala
- Scala is by far the only prominent strongly
typed language that provide functional style
and great concurrency support. [Akka
Essentials: Munish K, Gupta]
How to deal with it in Scala?
Scala FunctionalObject Oriented
Agile with LightWeight Syntax
Safe and Performant with Strong Static Typing
How to deal with it in Scala?
Scala FunctionalObject Oriented
Agile with LightWeight Syntax
Safe and Performant with Strong Static Typing
Parallel
Sequential
Scala Toolbox
- Parallelism
- Collections
- Parallel Collections
- Distributed Collections
- Concurrency
- Akka
- Message passing framework
- Actors
- Futures
Lets see an Example
- Java
- C++
- Scala
What’s Scala
- Pure Object Oriented Language
- Supports both Imperative and functional style.
- Provides Parallelism using collections
- Provides Concurrency using actors
- Statically Typed Language With Type Inference
- Runs on JVM. Intermixes well with Java
- Scala Web Frameworks
- Play
- Spray
- Highly scalable i.e. takes less code to create high
performing applications
Course Contents
1. The Basics (A1)
2. Control Structures and Functions (A1)
3. Arrays (A1)
4. Maps and Tuples (A1)
5. Classes (A1)
6. Objects (A1)
7. Packages and Imports (A1)
8. Inheritance (A1)
9. Files and Regular Expressions (A1)
The Basics
- The Scala Interpreter
- Declaring Values and Variables
- Commonly Used Types
- Arithmetic and Operator overloading
- Calling Functions and Methods
- The apply Method
- Scaladoc
Scala Environment Setup
- Java Setup (JDK)
- sbt Setup (An open source build tool for Scala and Java. Just like
Maven and Ant)
- Intellij (Can also use Eclipse)
- (https://class.coursera.org/progfun-003/wiki/ToolsSetup)
Scala Interpreter
- Read-Evaluate-Print-Loop (REPL)
- Every value is an object
- Tab Completion
- Scala Worksheet
Declaring Values and Variables
● val vs var
● Type Inference
● Multiple values declaration
Commonly Used Types
- Byte, Char, Short, Int, Long, Float, Double,
Boolean
- All types are classes
- No distinction between primitive types and
class types.
- 1.toString()
- 1.to(10)
Arithmetic and Operator Overloading
- Arithmetic operators in Scala work just as in
Java or C++
- However, these operators are actually
methods.
- a + b is a shorthand for a.+(b)
Calling Functions and Methods
- Scala provides functions in addition to
methods
- scala.math library
- sqrt(2)
- pow(2, 4)
- min(2, Pi)
The apply Method
- In Scala, it is common to use a syntax that
looks like a function call.
- s(i) where s is a string. It will return ith character of
string. In C++, it is s[i]. in java it is s.charAt(i)
- s(i) is a shorthand for s.apply(i)
Testing in Scala
- Testing Frameworks
- ScalaTest
- Specs2
- Browser-UI test support
- ScalaTest includes a DSL for writing browser-based
tests using Selenium.
Scaladoc
http://www.scala-lang.org/api/current/#package
Scala is scalable
- What does it mean?
- It means, scala is great for
- scripting stuff
- writing applications
- writing monster "enterprise" (for the want of a
word) applications
- Lets see the code in action
Level of Expertise in Scala
Application Programmer Library Designer Overall Scala Level
Beginning (A1) Beginning
Intermediate (A2) Junior (L1) Intermediate
Expert (A3) Senior (L2) Advanced
Expert (L3) Expert
Control Structure and Functions(A1)
● Conditional Expressions
● Statement Termination
● Block Expressions and Assignments
● Input and Output
● Loops
● Advanced for Loops and for Comprehensions
● Functions
● Default and Named Arguments
● Variable Arguments
● Procedures
● Lazy Values
● Exceptions

More Related Content

What's hot

A Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaA Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to Scala
Derek Chen-Becker
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 Recap
Dave Orme
 
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
CloudxLab
 
Scala Days NYC 2016
Scala Days NYC 2016Scala Days NYC 2016
Scala Days NYC 2016
Martin Odersky
 
Scala basic
Scala basicScala basic
Scala basic
Nguyen Tuan
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
datamantra
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
Martin Odersky
 
Why Scala for Web 2.0?
Why Scala for Web 2.0?Why Scala for Web 2.0?
Why Scala for Web 2.0?
Alex Payne
 
Scalax
ScalaxScalax
Javantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
Javantura v3 - Going Reactive with RxJava – Hrvoje CrnjakJavantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
Javantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Simplicitly
SimplicitlySimplicitly
Simplicitly
Martin Odersky
 
A Scala tutorial
A Scala tutorialA Scala tutorial
A Scala tutorial
Dima Statz
 
Introduction to ScalaZ
Introduction to ScalaZIntroduction to ScalaZ
Introduction to ScalaZ
Knoldus Inc.
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
Viplav Jain
 
Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...
Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...
Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...
CloudxLab
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
Martin Odersky
 
Scala : language of the future
Scala : language of the futureScala : language of the future
Scala : language of the future
AnsviaLab
 
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Taro L. Saito
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
icarter09
 
An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to ScalaBrent Lemons
 

What's hot (20)

A Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaA Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to Scala
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 Recap
 
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
 
Scala Days NYC 2016
Scala Days NYC 2016Scala Days NYC 2016
Scala Days NYC 2016
 
Scala basic
Scala basicScala basic
Scala basic
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
 
Why Scala for Web 2.0?
Why Scala for Web 2.0?Why Scala for Web 2.0?
Why Scala for Web 2.0?
 
Scalax
ScalaxScalax
Scalax
 
Javantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
Javantura v3 - Going Reactive with RxJava – Hrvoje CrnjakJavantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
Javantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
 
Simplicitly
SimplicitlySimplicitly
Simplicitly
 
A Scala tutorial
A Scala tutorialA Scala tutorial
A Scala tutorial
 
Introduction to ScalaZ
Introduction to ScalaZIntroduction to ScalaZ
Introduction to ScalaZ
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
 
Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...
Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...
Machine learning with Apache Spark MLlib | Big Data Hadoop Spark Tutorial | C...
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
 
Scala : language of the future
Scala : language of the futureScala : language of the future
Scala : language of the future
 
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to Scala
 

Viewers also liked

Wygraj stypendium a. szymańska
Wygraj stypendium a. szymańskaWygraj stypendium a. szymańska
Wygraj stypendium a. szymańskagrooszek89
 
Mi plantilla con-normas-icontec (1) (1) (2) (2)
Mi plantilla con-normas-icontec (1) (1) (2) (2)Mi plantilla con-normas-icontec (1) (1) (2) (2)
Mi plantilla con-normas-icontec (1) (1) (2) (2)
Santiago Cortes
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Muhammad Fayyaz
 
Bbn
BbnBbn
부평오피~다솜넷-dasom12.net~마포오피~수유오피
부평오피~다솜넷-dasom12.net~마포오피~수유오피부평오피~다솜넷-dasom12.net~마포오피~수유오피
부평오피~다솜넷-dasom12.net~마포오피~수유오피
dasom63
 
Olas en uruguay
Olas en uruguayOlas en uruguay
Olas en uruguay
Sofia Gerontakis
 
일산오피~다솜넷-dasom12.net~안산오피~일산오피
일산오피~다솜넷-dasom12.net~안산오피~일산오피일산오피~다솜넷-dasom12.net~안산오피~일산오피
일산오피~다솜넷-dasom12.net~안산오피~일산오피
dasom63
 
Beth Asbridge Resume October 2016
Beth Asbridge Resume October 2016Beth Asbridge Resume October 2016
Beth Asbridge Resume October 2016Beth Asbridge
 
Spark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin OderskySpark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin Odersky
Spark Summit
 

Viewers also liked (11)

Wygraj stypendium a. szymańska
Wygraj stypendium a. szymańskaWygraj stypendium a. szymańska
Wygraj stypendium a. szymańska
 
Mi plantilla con-normas-icontec (1) (1) (2) (2)
Mi plantilla con-normas-icontec (1) (1) (2) (2)Mi plantilla con-normas-icontec (1) (1) (2) (2)
Mi plantilla con-normas-icontec (1) (1) (2) (2)
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Bbn
BbnBbn
Bbn
 
부평오피~다솜넷-dasom12.net~마포오피~수유오피
부평오피~다솜넷-dasom12.net~마포오피~수유오피부평오피~다솜넷-dasom12.net~마포오피~수유오피
부평오피~다솜넷-dasom12.net~마포오피~수유오피
 
2324_001
2324_0012324_001
2324_001
 
Olas en uruguay
Olas en uruguayOlas en uruguay
Olas en uruguay
 
Penn State Resume
Penn State ResumePenn State Resume
Penn State Resume
 
일산오피~다솜넷-dasom12.net~안산오피~일산오피
일산오피~다솜넷-dasom12.net~안산오피~일산오피일산오피~다솜넷-dasom12.net~안산오피~일산오피
일산오피~다솜넷-dasom12.net~안산오피~일산오피
 
Beth Asbridge Resume October 2016
Beth Asbridge Resume October 2016Beth Asbridge Resume October 2016
Beth Asbridge Resume October 2016
 
Spark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin OderskySpark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin Odersky
 

Similar to Lecture1

Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
Marakana Inc.
 
Unit 1 notes.pdf
Unit 1 notes.pdfUnit 1 notes.pdf
Unit 1 notes.pdf
Revathiparamanathan
 
Scala overview
Scala overviewScala overview
Scala overviewSteve Min
 
Scala
ScalaScala
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
fanf42
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
Pray Desai
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
pmanvi
 
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuScala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuHavoc Pennington
 
Introduction to Scala language
Introduction to Scala languageIntroduction to Scala language
Introduction to Scala language
Aaqib Pervaiz
 
Introduction to scala for a c programmer
Introduction to scala for a c programmerIntroduction to scala for a c programmer
Introduction to scala for a c programmerGirish Kumar A L
 
Oscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleOscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simple
Martin Odersky
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
Martin Odersky
 
Drilling the Async Library
Drilling the Async LibraryDrilling the Async Library
Drilling the Async Library
Knoldus Inc.
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of Scala
Martin Odersky
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaWO Community
 
Java 8
Java 8Java 8

Similar to Lecture1 (20)

Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
 
Unit 1 notes.pdf
Unit 1 notes.pdfUnit 1 notes.pdf
Unit 1 notes.pdf
 
Scala overview
Scala overviewScala overview
Scala overview
 
Scala
ScalaScala
Scala
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
 
Scala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud FoundryScala, Play 2.0 & Cloud Foundry
Scala, Play 2.0 & Cloud Foundry
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
 
Scala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuScala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on Heroku
 
Introduction to Scala language
Introduction to Scala languageIntroduction to Scala language
Introduction to Scala language
 
Introduction to scala for a c programmer
Introduction to scala for a c programmerIntroduction to scala for a c programmer
Introduction to scala for a c programmer
 
Oscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simpleOscon keynote: Working hard to keep it simple
Oscon keynote: Working hard to keep it simple
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
 
Drilling the Async Library
Drilling the Async LibraryDrilling the Async Library
Drilling the Async Library
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of Scala
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
 
Java 8
Java 8Java 8
Java 8
 

Recently uploaded

2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 

Recently uploaded (20)

2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 

Lecture1

  • 2. Moore’s Law (Scalability) - Moore’s law now achieved by increasing # of cores, not clock cycles - We need Concurrency and Parallelism Data from Kunle Olukoten
  • 3. Concurrency and Parallelism - Parallel Programming - Execute programs faster on parallel hardware - Concurrent Programming - Manage concurrent execution threads explicitly. - Both are too Hard - The speedup of a program using multiple processors in parallel computing is limited by the time needed for the sequential fraction of the program. [Amdahl’s Law]
  • 4. The Root of The Problem - Non-determinism caused by concurrent threads accessing shared mutable state. non-determinism = parallel processing + mutable state - heisenberg problem (bug goes away when we introduce instrumentation) var x = 0 async { x = x + 1 } async { x = x * 2 } print(x) // can give 0, 1, 2
  • 5. The Root of The Problem - Non-determinism caused by concurrent threads accessing shared mutable state. non-determinism = parallel processing + mutable state - heisenberg problem (bug goes away when we introduce instrumentation) - To get deterministic processing, avoid the mutable state. - Avoid mutable state means program functionally. var x = 0 async { x = x + 1 } async { x = x * 2 } print(x) // can give 0, 1, 2
  • 6. Why Scala - Scala is by far the only prominent strongly typed language that provide functional style and great concurrency support. [Akka Essentials: Munish K, Gupta]
  • 7. How to deal with it in Scala? Scala FunctionalObject Oriented Agile with LightWeight Syntax Safe and Performant with Strong Static Typing
  • 8. How to deal with it in Scala? Scala FunctionalObject Oriented Agile with LightWeight Syntax Safe and Performant with Strong Static Typing Parallel Sequential
  • 9. Scala Toolbox - Parallelism - Collections - Parallel Collections - Distributed Collections - Concurrency - Akka - Message passing framework - Actors - Futures
  • 10. Lets see an Example - Java - C++ - Scala
  • 11. What’s Scala - Pure Object Oriented Language - Supports both Imperative and functional style. - Provides Parallelism using collections - Provides Concurrency using actors - Statically Typed Language With Type Inference - Runs on JVM. Intermixes well with Java - Scala Web Frameworks - Play - Spray - Highly scalable i.e. takes less code to create high performing applications
  • 12. Course Contents 1. The Basics (A1) 2. Control Structures and Functions (A1) 3. Arrays (A1) 4. Maps and Tuples (A1) 5. Classes (A1) 6. Objects (A1) 7. Packages and Imports (A1) 8. Inheritance (A1) 9. Files and Regular Expressions (A1)
  • 13. The Basics - The Scala Interpreter - Declaring Values and Variables - Commonly Used Types - Arithmetic and Operator overloading - Calling Functions and Methods - The apply Method - Scaladoc
  • 14. Scala Environment Setup - Java Setup (JDK) - sbt Setup (An open source build tool for Scala and Java. Just like Maven and Ant) - Intellij (Can also use Eclipse) - (https://class.coursera.org/progfun-003/wiki/ToolsSetup)
  • 15. Scala Interpreter - Read-Evaluate-Print-Loop (REPL) - Every value is an object - Tab Completion - Scala Worksheet
  • 16. Declaring Values and Variables ● val vs var ● Type Inference ● Multiple values declaration
  • 17. Commonly Used Types - Byte, Char, Short, Int, Long, Float, Double, Boolean - All types are classes - No distinction between primitive types and class types. - 1.toString() - 1.to(10)
  • 18. Arithmetic and Operator Overloading - Arithmetic operators in Scala work just as in Java or C++ - However, these operators are actually methods. - a + b is a shorthand for a.+(b)
  • 19. Calling Functions and Methods - Scala provides functions in addition to methods - scala.math library - sqrt(2) - pow(2, 4) - min(2, Pi)
  • 20. The apply Method - In Scala, it is common to use a syntax that looks like a function call. - s(i) where s is a string. It will return ith character of string. In C++, it is s[i]. in java it is s.charAt(i) - s(i) is a shorthand for s.apply(i)
  • 21. Testing in Scala - Testing Frameworks - ScalaTest - Specs2 - Browser-UI test support - ScalaTest includes a DSL for writing browser-based tests using Selenium.
  • 23. Scala is scalable - What does it mean? - It means, scala is great for - scripting stuff - writing applications - writing monster "enterprise" (for the want of a word) applications - Lets see the code in action
  • 24. Level of Expertise in Scala Application Programmer Library Designer Overall Scala Level Beginning (A1) Beginning Intermediate (A2) Junior (L1) Intermediate Expert (A3) Senior (L2) Advanced Expert (L3) Expert
  • 25. Control Structure and Functions(A1) ● Conditional Expressions ● Statement Termination ● Block Expressions and Assignments ● Input and Output ● Loops ● Advanced for Loops and for Comprehensions ● Functions ● Default and Named Arguments ● Variable Arguments ● Procedures ● Lazy Values ● Exceptions