Your SlideShare is downloading. ×
مقدمة عن لغة سكالا
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

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

4,294
views

Published on

مقدمة عن لغة سكالا من المهندس احمد سليمان

مقدمة عن لغة سكالا من المهندس احمد سليمان

Published in: Technology

1 Comment
4 Likes
Statistics
Notes
No Downloads
Views
Total Views
4,294
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
68
Comments
1
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Welcome to the Scalable Language Ahmed Soliman Founder and Chairman noZom NGOTuesday, May 24, 2011
  • 2. AhmedSoliman.com Asoliman@nozom.org @AhmedSolimanTuesday, May 24, 2011
  • 3. Martin Odersky SwitzerlandTuesday, May 24, 2011
  • 4. ✦ 52 years old ✦ Pizza Programming language ✦ Generic Java ✦ Scala 2001 @oderskyTuesday, 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 programmingTuesday, 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
  • 8. Expression vs. StatementTuesday, 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 typeTuesday, 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 languageTuesday, May 24, 2011
  • 12. Functional? ✦ Lisp late 50s ✦ Scheme, SML, Erlang, Haskell, OCaml, and F# ✦ For long time, popular in academia, but not in industryTuesday, 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 citizensTuesday, 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 variablesTuesday, 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 javaTuesday, May 24, 2011
  • 17. This is JavaTuesday, 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 programmingTuesday, May 24, 2011
  • 19. Referential TransparencyTuesday, May 24, 2011
  • 20. State is the evil! Pun intendedTuesday, 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 increasingTuesday, May 24, 2011
  • 22. Why Scala?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 variablesTuesday, 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 codeTuesday, May 24, 2011
  • 26. MappingTuesday, May 24, 2011
  • 27. Reducing 21Tuesday, May 24, 2011
  • 28. Pattern MatchingTuesday, May 24, 2011
  • 29. CurryingTuesday, 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) lockTuesday, May 24, 2011
  • 34. Language TourTuesday, May 24, 2011
  • 35. Tuesday, May 24, 2011
  • 36. Tuesday, May 24, 2011
  • 37. Tuesday, May 24, 2011
  • 38. Tuesday, May 24, 2011
  • 39. Tuesday, May 24, 2011
  • 40. Tuesday, May 24, 2011
  • 41. Tuesday, May 24, 2011
  • 42. Tuesday, May 24, 2011
  • 43. Tuesday, May 24, 2011
  • 44. Tuesday, May 24, 2011
  • 45. What for?Tuesday, May 24, 2011
  • 46. ✦ Scripting ✦ Concurrent Applications ✦ Web Development (Lift) ✦ Backend ComponentsTuesday, May 24, 2011
  • 47. Who uses Scala?Tuesday, May 24, 2011
  • 48. Tuesday, May 24, 2011
  • 49. Tuesday, May 24, 2011
  • 50. Tuesday, May 24, 2011
  • 51. Tuesday, May 24, 2011
  • 52. Tuesday, May 24, 2011
  • 53. 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
  • 55. www.nozom.orgTuesday, May 24, 2011