Clojure concepts

663 views

Published on

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
663
On SlideShare
0
From Embeds
0
Number of Embeds
74
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Clojure concepts

  1. 1. Clojure Concepts<br />The race against multiprocessing<br />
  2. 2. The Moor’s Law<br />The number of transistors that can be placed inexpensively on an integrated circuit doubles approximately every two years.<br />But, this is not true for single CPU unit anymore<br />More transistors mean more CPU cores, not the higher frequency<br />
  3. 3. Software bugs<br />The most difficult bugs are:<br /><ul><li>Memory corruptions
  4. 4. Multithread bugs</li></li></ul><li>Bugs, most difficult to find and fix<br />Memory corruptions.<br />Multithread bugs.<br />
  5. 5. Memory corruption<br />Nightmare of C and C++ programmers<br />No doubts for Java, C# and many other programmers (thanks to GC  )<br />
  6. 6. Concurrency bugs<br />No one can feel safe<br />
  7. 7. The answer: Clojure<br />Immutability<br />Functional language<br />
  8. 8. What about state?<br />No state in OOP sence<br />
  9. 9. The real world is not a pure function<br />References (identities) point at different values at different points of time<br />
  10. 10. How?<br />Vars – mutable local thread storage (thread isolation)<br />Refs – mutable shared storage called Software Transactional Memory (STM). All the changes are done within transaction<br />
  11. 11. How (part 2)?<br />Agents –mutable shared storage changed asynchronously, but sequentially.<br />Atoms – mutable shared storage changed synchronously and sequentially.<br />
  12. 12. Questions?<br />
  13. 13. Useful links<br />www.clojure.org<br />InfoQ: Are We There Yet?<br />InfoQ: Perception and Action: An Introduction to Clojure's Time Model<br />Time, identity, and transition in Clojure « goodmike blogs here<br />

×