SlideShare a Scribd company logo
1 of 55
Download to read offline
Welcome to the
              Scalable Language
                        Ahmed Soliman
                         Founder and Chairman
                             noZom NGO




Tuesday, May 24, 2011
AhmedSoliman.com



                               Asoliman@nozom.org




                         @AhmedSoliman
Tuesday, May 24, 2011
Martin Odersky
                             Switzerland




Tuesday, May 24, 2011
✦   52 years old

                        ✦   Pizza Programming
                            language

                        ✦   Generic Java

                        ✦   Scala 2001



                                 @odersky
Tuesday, May 24, 2011
What is Scala?


Tuesday, May 24, 2011
What is Scala?

            ✦      Pronounced ‘skah-lak’
            ✦      Scalable Language
            ✦      Tastefully typed language
            ✦      Blend of object-oriented and functional
                   programming



Tuesday, May 24, 2011
What is Scala?

            ✦      Uses the glorious JVM
            ✦      Can be used as scripting language
            ✦      Compiled!
            ✦      Everything is an expression!




Tuesday, May 24, 2011
Expression vs. Statement



Tuesday, May 24, 2011
Grows on you


            ✦      Looks like modern dynamically typed
                   languages (Python, Ruby, etc.)
            ✦      Unlike Python, maps in scala is not a language
                   syntax! {‘key’: ‘value’}


Tuesday, May 24, 2011
Growing new types

            ✦      BigInt looks like a built-in type, because you
                   can use integer literals and operators such as
                   (*, -, and +) with values of that type




Tuesday, May 24, 2011
What makes Scala scalable?
            ✦      Scala is object oriented in pure form!
                        ✦   Every value is an object and every
                            operation is a method call
            ✦      Scala is full-blown functional programming
                   language



Tuesday, May 24, 2011
Functional?

            ✦      Lisp late 50s
            ✦      Scheme, SML, Erlang, Haskell, OCaml, and
                   F#
            ✦      For long time, popular in academia, but not in
                   industry



Tuesday, May 24, 2011
What’s functional?


            ✦      Functions return a value, given a set of
                   parameters a function has one possible result.




Tuesday, May 24, 2011
Two Main Ideas: I




                         Functions are first-class citizens

Tuesday, May 24, 2011
Citizens?
            ✦      A function is a value of the same status as, say,
                   an integer or a string.
            ✦      You can pass functions as arguments to other
                   functions
            ✦      Return functions as a results from functions
            ✦      Store them in variables


Tuesday, May 24, 2011
Functions, citizens?
            ✦      You can define functions without giving them
                   a name, sprinkling your code with function
                   literals as easy as integer literals, like 25


            ✦      A good example is the pain in writing code for
                   event handling in java



Tuesday, May 24, 2011
This is Java




Tuesday, May 24, 2011
Two Main Ideas: II
            ✦      Operations of a program should map input
                   values to output values rather than change
                   data in place
                        ✦   Consider the difference between Strings in
                            Java and Ruby!
                        ✦   Immutable data structures are the
                            cornerstone of functional programming


Tuesday, May 24, 2011
Referential
                        Transparency


Tuesday, May 24, 2011
State is the evil!
                                     Pun intended

Tuesday, May 24, 2011
Multi-core problems
            ✦      The future!
            ✦      Threading is damn hard to get right
                        ✦   Memory overhead
                        ✦   Dead locks?
                        ✦   Shared state? Monitor? Mutex?
                            Semaphore?
            ✦      Demand for highly concurrent application is
                   increasing
Tuesday, May 24, 2011
Why Scala?


Tuesday, May 24, 2011
Why Scala?
            ✦      The Java Virtual Machine
            ✦      Concise (programs are shorter)




Tuesday, May 24, 2011
Why Scala??
            ✦      A rich static type system that gets out of your
                   way when you don’t need it, is awesome when
                   you do. (Type Inference). Verifiable!


            ✦      Flexible syntax


            ✦      Immutable and mutable variables


Tuesday, May 24, 2011
Why Scala??

            ✦      Functional programming features: mapping,
                   filtering, folding, currying, so much more.
            ✦      FAST! (most of the times as fast as Java)
            ✦      Can call any Java code
            ✦      Can be called by any Java code


Tuesday, May 24, 2011
Mapping




Tuesday, May 24, 2011
Reducing



                          21


Tuesday, May 24, 2011
Pattern Matching




Tuesday, May 24, 2011
Currying




Tuesday, May 24, 2011
Concurrency

            ✦      Actor model! (kinda like erlang)
            ✦      Threads
            ✦      Any other JVM concurrency framework
                   (Netty, Apache Mina, etc.)




Tuesday, May 24, 2011
Concurrency :: Actor
            ✦      Actor Mode: a different way to implement
                   concurrency
                   ✦    Each object is an actor
                   ✦    Each actor has a mailbox
                   ✦    Actors (asynchronously) send messages and
                        receive them in their mailbox
                   ✦    No Shared State
                   ✦    Why?
Tuesday, May 24, 2011
Actors :: Performance
            ✦      Apache (C/Threads) vs. Yaws (Erlang/Actor)




Tuesday, May 24, 2011
Actors :: Simpler

            ✦      Code is design around single-threaded mind
            ✦      No Mutable State
            ✦      No (Dead) lock




Tuesday, May 24, 2011
Language Tour


Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
What for?


Tuesday, May 24, 2011
✦   Scripting
                        ✦   Concurrent Applications
                        ✦   Web Development (Lift)
                        ✦   Backend Components




Tuesday, May 24, 2011
Who uses Scala?


Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Tuesday, May 24, 2011
Summary
            ✦      Fast
            ✦      Reuses the Java Ecosystem
            ✦      Functional
            ✦      Expressive
            ✦      Statically typed
            ✦      Concurrent
            ✦      Has tons of features, complex? Worth it!
Tuesday, May 24, 2011
www.nozom.org
Tuesday, May 24, 2011

More Related Content

Viewers also liked

Introduction to Scala for Java Programmers
Introduction to Scala for Java ProgrammersIntroduction to Scala for Java Programmers
Introduction to Scala for Java Programmerssbjug
 
Rewriting Java In Scala
Rewriting Java In ScalaRewriting Java In Scala
Rewriting Java In ScalaSkills Matter
 
Scala for Java programmers
Scala for Java programmersScala for Java programmers
Scala for Java programmers輝 子安
 
Functional Scala II (in practice)
Functional Scala II (in practice)Functional Scala II (in practice)
Functional Scala II (in practice)Mario Gleichmann
 
Scala - A Scalable Language
Scala - A Scalable LanguageScala - A Scalable Language
Scala - A Scalable LanguageMario Gleichmann
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Martin Odersky
 

Viewers also liked (6)

Introduction to Scala for Java Programmers
Introduction to Scala for Java ProgrammersIntroduction to Scala for Java Programmers
Introduction to Scala for Java Programmers
 
Rewriting Java In Scala
Rewriting Java In ScalaRewriting Java In Scala
Rewriting Java In Scala
 
Scala for Java programmers
Scala for Java programmersScala for Java programmers
Scala for Java programmers
 
Functional Scala II (in practice)
Functional Scala II (in practice)Functional Scala II (in practice)
Functional Scala II (in practice)
 
Scala - A Scalable Language
Scala - A Scalable LanguageScala - A Scalable Language
Scala - A Scalable Language
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
 

More from noZom Information Technology NGO (8)

To infinity and beyond!
To infinity and beyond!To infinity and beyond!
To infinity and beyond!
 
Introduction to Scrum
Introduction to ScrumIntroduction to Scrum
Introduction to Scrum
 
انت و الويب
انت و الويبانت و الويب
انت و الويب
 
اي فون ام اندرويد
اي فون ام اندرويداي فون ام اندرويد
اي فون ام اندرويد
 
Why Entrepreneurship? لماذا ريادة الاعمال؟
Why Entrepreneurship? لماذا ريادة الاعمال؟Why Entrepreneurship? لماذا ريادة الاعمال؟
Why Entrepreneurship? لماذا ريادة الاعمال؟
 
nozom geeks - مهاويس نظم
nozom geeks - مهاويس نظمnozom geeks - مهاويس نظم
nozom geeks - مهاويس نظم
 
Power of REST - قوة الرست
Power of REST - قوة الرستPower of REST - قوة الرست
Power of REST - قوة الرست
 
Learn2 learn - اتعلم تتعلم
Learn2 learn - اتعلم تتعلمLearn2 learn - اتعلم تتعلم
Learn2 learn - اتعلم تتعلم
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

مقدمة عن لغة سكالا

  • 1. Welcome to the Scalable Language Ahmed Soliman Founder and Chairman noZom NGO Tuesday, May 24, 2011
  • 2. AhmedSoliman.com Asoliman@nozom.org @AhmedSoliman Tuesday, May 24, 2011
  • 3. Martin Odersky Switzerland Tuesday, May 24, 2011
  • 4. 52 years old ✦ Pizza Programming language ✦ Generic Java ✦ Scala 2001 @odersky Tuesday, May 24, 2011
  • 5. What is Scala? Tuesday, May 24, 2011
  • 6. What is Scala? ✦ Pronounced ‘skah-lak’ ✦ Scalable Language ✦ Tastefully typed language ✦ Blend of object-oriented and functional programming Tuesday, May 24, 2011
  • 7. What is Scala? ✦ Uses the glorious JVM ✦ Can be used as scripting language ✦ Compiled! ✦ Everything is an expression! Tuesday, May 24, 2011
  • 9. Grows on you ✦ Looks like modern dynamically typed languages (Python, Ruby, etc.) ✦ Unlike Python, maps in scala is not a language syntax! {‘key’: ‘value’} Tuesday, May 24, 2011
  • 10. Growing new types ✦ BigInt looks like a built-in type, because you can use integer literals and operators such as (*, -, and +) with values of that type Tuesday, May 24, 2011
  • 11. What makes Scala scalable? ✦ Scala is object oriented in pure form! ✦ Every value is an object and every operation is a method call ✦ Scala is full-blown functional programming language Tuesday, May 24, 2011
  • 12. Functional? ✦ Lisp late 50s ✦ Scheme, SML, Erlang, Haskell, OCaml, and F# ✦ For long time, popular in academia, but not in industry Tuesday, May 24, 2011
  • 13. What’s functional? ✦ Functions return a value, given a set of parameters a function has one possible result. Tuesday, May 24, 2011
  • 14. Two Main Ideas: I Functions are first-class citizens Tuesday, May 24, 2011
  • 15. Citizens? ✦ A function is a value of the same status as, say, an integer or a string. ✦ You can pass functions as arguments to other functions ✦ Return functions as a results from functions ✦ Store them in variables Tuesday, May 24, 2011
  • 16. Functions, citizens? ✦ You can define functions without giving them a name, sprinkling your code with function literals as easy as integer literals, like 25 ✦ A good example is the pain in writing code for event handling in java Tuesday, May 24, 2011
  • 17. This is Java Tuesday, May 24, 2011
  • 18. Two Main Ideas: II ✦ Operations of a program should map input values to output values rather than change data in place ✦ Consider the difference between Strings in Java and Ruby! ✦ Immutable data structures are the cornerstone of functional programming Tuesday, May 24, 2011
  • 19. Referential Transparency Tuesday, May 24, 2011
  • 20. State is the evil! Pun intended Tuesday, May 24, 2011
  • 21. Multi-core problems ✦ The future! ✦ Threading is damn hard to get right ✦ Memory overhead ✦ Dead locks? ✦ Shared state? Monitor? Mutex? Semaphore? ✦ Demand for highly concurrent application is increasing Tuesday, May 24, 2011
  • 23. Why Scala? ✦ The Java Virtual Machine ✦ Concise (programs are shorter) Tuesday, May 24, 2011
  • 24. Why Scala?? ✦ A rich static type system that gets out of your way when you don’t need it, is awesome when you do. (Type Inference). Verifiable! ✦ Flexible syntax ✦ Immutable and mutable variables Tuesday, May 24, 2011
  • 25. Why Scala?? ✦ Functional programming features: mapping, filtering, folding, currying, so much more. ✦ FAST! (most of the times as fast as Java) ✦ Can call any Java code ✦ Can be called by any Java code Tuesday, May 24, 2011
  • 27. Reducing 21 Tuesday, May 24, 2011
  • 30. Concurrency ✦ Actor model! (kinda like erlang) ✦ Threads ✦ Any other JVM concurrency framework (Netty, Apache Mina, etc.) Tuesday, May 24, 2011
  • 31. Concurrency :: Actor ✦ Actor Mode: a different way to implement concurrency ✦ Each object is an actor ✦ Each actor has a mailbox ✦ Actors (asynchronously) send messages and receive them in their mailbox ✦ No Shared State ✦ Why? Tuesday, May 24, 2011
  • 32. Actors :: Performance ✦ Apache (C/Threads) vs. Yaws (Erlang/Actor) Tuesday, May 24, 2011
  • 33. Actors :: Simpler ✦ Code is design around single-threaded mind ✦ No Mutable State ✦ No (Dead) lock Tuesday, May 24, 2011
  • 46. Scripting ✦ Concurrent Applications ✦ Web Development (Lift) ✦ Backend Components Tuesday, May 24, 2011
  • 47. Who uses Scala? Tuesday, May 24, 2011
  • 54. Summary ✦ Fast ✦ Reuses the Java Ecosystem ✦ Functional ✦ Expressive ✦ Statically typed ✦ Concurrent ✦ Has tons of features, complex? Worth it! Tuesday, May 24, 2011