The Game Of Life - Java‘s Siblings and Heirs are populating the Ecosystem

2,018 views

Published on

In the last decade we have seen a very fortunate development. Away from the monoculture of big languages to the realm of polyglotism. We’ve rediscovered the virtue of using the language that is most fitting for the problem at hand. The biggest advantages of the existing language ecosystems are the runtime environments and libraries. Many new and old languages have set out to use those assets add add ways to succinctly write down the solutions for our problems. What is better suited to explore this Game Of Life that the Game of Life itself. I’ll show how you can apply the existing languages to solve this problem very differently.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,018
On SlideShare
0
From Embeds
0
Number of Embeds
23
Actions
Shares
0
Downloads
22
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide


  • Uncle Bob Martin talking to Scott Hanselman
    about finding better abstractions to express our intent
    referred to a video of a APL screencast forthe Game Of Life




















  • old assumptions no longer hold true
    cost of processing power (Moores Law)
    computing infrastructure










  • better suitor for stable language than Java
    domain layer (domain model, DSLs)






  • http://video.google.com/videoplay?docid=8018371269760059556&hl=en#



    6:49




















  • Uncle Bob Martin talking to Scott Hanselman
    about finding better abstractions to express our intent
    referred to a video of a APL screencast forthe Game Of Life










  • The Game Of Life - Java‘s Siblings and Heirs are populating the Ecosystem

    1. 1. The Game Of Life Java‘s Siblings and Heirs are populating the Ecosystem
    2. 2. Inspiration for this talk An APL Version Game Of Life
    3. 3. A Natural View • ecosystem • monoculture • diversity • evolution • forces
    4. 4. Ecosystem? Our working environment can be seen as an ecosystem It should be habitable for humans and efficient for a machine It is evolving and changing
    5. 5. Ecosystem • inhabitants populate • an environment • are exposed to outside • forces and influences • many supporting relationships • robust or sensitive variations • natural and artificial
    6. 6. OUR Ecosystem consists of • virtual machine • tools • languages • libraries
    7. 7. The JVM • abstracts hardware, operating systems • portable • fast and getting faster • runs bytecode • not just one language • but many of them ... and it does
    8. 8. Monoculture • artificial approach • a single species • highly optimized conditions • economy of scale • sensitive to changes • one disruption can destroy whole population • no evolution
    9. 9. We had a Monoculture • one language to rule them all • little knowledge and interest in other languages • in the mainstream • economy of scale • standardization • single point of failure
    10. 10. Natural Diversity • healthy mixture of species • resistant to disruptions • supporting ecosystem • different forces are countered • many possibilities of evolution • distribute responsibility • less artificial conditions needed
    11. 11. A Breeding Ground For Diversity • but it was unnoticed • many languages (400+) running on the JVM • dynamic and static ones • address different problems • many of more expressive than JAVA • what did it take to make us aware of them?
    12. 12. Origin of Languages & Evolution thereof • Darwins 200th birthday • external forces shape development of a species • many different variations are exposed • only the fittest survive • form the base for next generations
    13. 13. What Happens when the Rules Change? • concurrency challenge • ease of development / maintenance • cost of human creativity • competing approaches • complexity of systems Evolutionary Forces
    14. 14. Now There are more Mainstream JVM Languages
    15. 15. Common JVM Languages • Scala • Ioke • JRuby • Fan • Groovy • Jaskell • Clojure • Erjang • Rhino • Jython • JavaFX • Fortress
    16. 16. Adressing Evolutionary Forces - Concurrency • functional paradigms • immutable datastructures • software transactional memory • implicit parallelism • actor model •
    17. 17. Adressing Evolutionary Forces - Expressiveness • dynamic typing • list comprehensions, high order functions • metaprogramming, open types • syntactic sugar, implicit code generation • dynamic execution (scripting) • closures • internal DSLs
    18. 18. Adressing Evolutionary Forces - Competition • other languages with an easier syntax and lifecycle • powerful frameworks (RoR) • .net Runtime evolves quickly (LinQ & Co) • simpler paradigms - functional languages • rich clients - Flash • highly scalable languages - Erlang
    19. 19. Ola Bini • language layers in applications • stable language at core • dynamic layer • domain layer • „end of big languages“ • JVM well suited as polyglot platform • created Ioke ‚most expressive‘ language experiment
    20. 20. Neal Ford • polyglot programming • already a reality • count the languages in your application • explicit focus on „the right language for the job“
    21. 21. the Game of Life
    22. 22. John H. Conway • well known mathematician • invented it 1970 - 40 years ago • emergence - complexity arises from simple rules • slightly modeled on real life • birth, death, survival • let him tell the story himself
    23. 23. Game of Life • a simple game with 3 rules • cell with 2,3 neighbours lives • space surrounded by 3 cells gets alive • emulates atoms, laws, forces and time like our universe • simulates an ecosystem • explore language expressiveness
    24. 24. Explore JVM Languages with game of life implementations instead of 99 bottles of beer
    25. 25. Different Approaches limited or unlimited board array / matrix based sparse matrix (coordinates) mutating or generations optimizations (HashLife) different variations on rules, visualization etc.
    26. 26. Java (1)
    27. 27. Java (2)
    28. 28. Java & Patterns 1300 Lines of Java Source Many Patterns crammed in It is for making a Point But does it make its Point?
    29. 29. Groovy
    30. 30. Scala (Heiko Seeberger)
    31. 31. Clojure
    32. 32. Ioke (Sam Aaron)
    33. 33. Dyalog APL
    34. 34. Scaling Up • partitioning / sharding the data • actors as cells, need supervisors and segmentation • asynchronity / generations problem • map reduce approach, a cell bleeds its life into its neighbours, sum the resulting fragments • use image operations / GPU • hashlife exploits regularities, hash in a quadtree Think Different
    35. 35. Java Image Op
    36. 36. It does not end here • the language is just the first step for better abstractions • create your own languages & vocabulary • DDD, ubiquitous language, domain model • DSLs • libraries, APIs • design principles - KISS, DRY & more • design patterns
    37. 37. Thank You! Questions & Comments? Image Attributions: Wikipedia, SXC.HU

    ×