Leonardo would have used Clojure: Mona Lisa 2.0
| Description |
Clojure is a functional language for the JVM. During this presentation we develop a smart algorithm to solve an interesting problem: the Mona Lisa challenge. The Mona Lisa challenge aims to recreate the famous Mona Lisa painting by Leonardo Da Vinci by generating a computer program that renders the painting.
The Mona Lisa challenge is a known NP Complete problem. This implies the problem is not computable in linear time. This class of problems can be solved using genetic programming, using biological evolution techniques on program code. A genetic programming algorithm “grows” a family of programs and selects the best fit. This best fit is used as the seed for the next generation. The algorithm injects random disturbances to create new programs. These programs are again evaluated against the fitness criteria. This process continues until the programs have evolved into a suitable program for the problem. Using the power of randomness, we can often solve difficult problems within acceptable time.
As Clojure is a dialect of Lisp, it shares with Lisp the code-as-data philosophy and a powerful macro system. Clojure is therefore especially suited to solve the Mona Lisa challenge using genetic programming techniques. In Clojure, code is data and data is code. This makes it very easy to generate program code. We will show that Clojure is elegant, powerful, practical and fun to use.
In this presentation we develop the Mona Lisa solving algorithm step-by-step, mimicking Uncle Bob’s Code Kata style. During this journey, we gradually introduce new Clojure concepts and ideas. Among these concepts are Java interoperability, using UI’s, meta-programming and the concept of code-as-data.
At the end of the presentation, we have developed a complete solution to the Mona Lisa problem, and we have shown a demo of the algorithm in action.
|
| Outline |
Duo-presentation: -introduction (5 min.)
-step-wise implementation of Mona Lisa algorithm in Clojure (40 min.) #Clojure basics #Java Interop #meta-programming
-demo and questions (5 min.)
|
| Prerequisite knowledge |
Basic knowledge of functional programming recommended. |
| Language |
DUTCH |
| Level |
INTERMEDIATE |
| Track |
NEW_AND_COOL |
| Type |
TECHNICAL |
Download de presentatie
|
|
Maurits Rijk Xebia Maurits has experience in the IT industry starting in 1991. Since that time he has worked for several multinationals in many different roles before he made the move to Xebia in 2007. Within Xebia he works as an Agile consultant. He would love to have lived in Leonardo da Vinci’s era, so he could have been a polymath (a person whose expertise spans a significant number of different subject areas) but within his limited time he tries to combine a family live, a strong passion for software metrics and toying with cool new and sometimes obscure programming languages. His favorite language at the moment is Clojure.
|

|
Sander van den Berg Xebia Sander van den Berg has been active in IT since 1999. He has worked as a software developer for several defense related companies, where he mainly worked on MDA/MDD solutions. Sander van den Berg joined Xebia in 2010 as a Senior Consultant for the unit IT Architects, where he is responsible for the Xebia Lean Architecture approach. Besides architecture, Sander is very interested in language design. He is active in several functional programming communities. He likes elegant solutions to hard problems, preferring Haskell as a means to express them. Being an advocate for DSL’s, he also has a keen interest in Clojure.
|
|
| |