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

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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

  • 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