Thursday, December 23, 2010

Pid ! Message

Some tenets from Joe Armstrong (a.k.a. the philosophy behind Erlang):
  • The world is concurrent.
  • Things in the world don't share data.
  • Things communicate with messages.
  • Things fail.

Sunday, December 5, 2010

The Internet of Things

Now, after Facebook has brought the social network to the web, it's time for the internet of things :-).









I think Google is one of the few companies that are able to start building the internet of things, with all their server farms, smartphones, TVs and some self-driving cars ;-).
Then you no longer need to query Google's search engine for timetables or nearby shops and restaurants. The internet of things just tells you everything you need to know.

It is really interesting which technologies will clear the way for the interconnected mesh of systems. Thereby Erlang will hopefully find its way to more and more backend systems :-).

Wednesday, December 1, 2010

Alan Kay: A powerful idea about teaching ideas





I linked to the video "The Inner Life of a Cell" within my older blog post The Inner Life of a Cell. The mental model that the Harvard guys used to demonstrate the whole stuff is just too simple and therefore the inner life of a cell got very mysterious. At time 06:22 Alan Kay gives a more accurate view for the model of a cell; e.g. he explains how multiple complex shapes are able to match each other at the right place.

Friday, November 19, 2010

Alan Kay on Object-Oriented Programming

Some interesting statements of Alan Kay (one of the Smalltalk creators) about object-oriented programming:
"My original thought was to have something like recursive biological cells. We have about 10 to the 14th power of cells in our body. That is a hell of a lot more cells than there are nodes on the Internet. Those cells spend almost all of their effort keeping themselves normal. They're self-repairing, and you don't have to stop the organism in order to affect repairs. And then there are some interesting mathematical properties of this kind of thing that also occurred to me, and I called those things objects." [1]
"So I thought of objects being like biological cells, only able to communicate with messages (so messaging came at the very beginning - it took a while to see how to do messaging in a programming language efficiently enough to be useful)." [2]
"Object-oriented programming to me means only messaging, encapsulating and hiding state, and extreme late-binding of all things. It could be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them." [3]
"The big idea is "messaging" - that is what the kernel of Smalltalk/Squeak is all about (and it's something that was never quite completed in our Xerox PARC phase). The key in making great and growable systems is much more to design how its modules communicate rather than what their internal properties and behaviors should be." [4]
"Until real software engineering is developed, the next best practice is to develop with a dynamic system that has extreme late binding in all aspects." [5]

I think, Erlang and the QNX Neutrino RTOS definitely belong to those kind of systems. The fact that the above statement also defines QNX Neutrino RTOS as an object-oriented platform shows that particular technologies often do not matter as much as the right architectures and paradigms.
Also Apple's Objective-C platform and Google's Android OS are heavily based on message passing. That's why all this stuff works so great :-)

PS: some thoughts on message passing from the Erlang, Scala and F# creators.

Sunday, October 3, 2010

Androiden lieben lernen

Der Amerikaner Alan N. Shapiro ist Technologe und Zukunftsforscher auf den Grundlagen von Philosophie und Soziologie. Als Programmierer fordert er eine neue soziologische und ästhetische Bewertung von Software, um die Menschheit auf phantastische Weise weiterzubringen: Software sollte lernfähig und autonom sein. Dabei lässt er sich von der TV- und Kinofilmserie "Star Trek" inspirieren, über die er sein Hauptwerk geschrieben hat: "Star Trek: Technologien des Verschwindens".

Thursday, July 8, 2010

The Inner Life of a Cell

The cell is the elementary unit of all living organisms. The following picture shows a typical eukaryotic cell.

(Source: Wikipedia)

(1) Nucleolus (dt. Nukleolus)
(2) Nucleus (dt. Zellkern)
(3) Ribosome (dt. Ribosomen)
(4) Vesicle (dt. Vesikel)
(5) Rough endoplasmic reticulum (ER) (dt. Raues Endoplasmatisches Reticulum)
(6) Golgi Apparatus (dt. Golgi-Apparat)
(7) Cytoskeleton (dt. Mikrotubuli)
(8) Smooth Endoplasmic Reticulum (dt. Glattes ER)
(9) Mitochondria (dt. Mitochondrien)
(10) Vacuole (dt. Lysosom)
(11) Cytoplasm (dt. Zytoplasma)
(12) Lysosome (dt. Mikrobodies)
(13) Centrioles within Centrosome (dt. 
Zentriolen)


One of the cell's tasks is to produce proteins. Proteins give the cells their structure and they are the molecular machines that transport substances, catalyze chemical reactions, act as messengers and recognize molecular cues (work as receptors). Proteins consist of amino acids. The process of building proteins begins within the nucleus where the DNA is transcribed into mRNA (messenger RNA) and tRNA (transfer RNA). Later, the mRNA and tRNA diffuse out of the nucleus into the cytoplasm. The DNA never leaves the nucleus.
Afterwards, the ribosomes translate mRNA and tRNA into proteins.


(Source: Wikipedia)

A ribosome does this by using the mRNA as blueprint for the protein building process. The tRNA acts as input building block with each tRNA having bound one animo acid. The output of this process is a chain of amino acids, the protein. First, the ribosome reads three nucleic acids from the mRNA. Then the complementary nucleic acids of some matching tRNA are bound to that piece of mRNA. At the same time the amino acid of the tRNA connects to the newly synthesized protein. Afterwards the next three nucleic acids of the mRNA are read and so forth.
If proteins leave the cell after being build to act as messengers or to recognize molecular cues they do this with the help of vesicles and motor proteins. Therefore the vesicles and motor proteins carry the proteins to the cell membrane where they merge with it and free their cargo.
Now e.g. the messenger proteins trigger the building process of proteins within neighboring cells and the whole game starts all over again.

The Harvard College did a great video that visualizes the inner life of a cell.



At 4:31 you see some mRNA leaving the nucleus. At 4:49 and 5:22 a ribosome builds a protein out of mRNA and tRNA. 5:43, 6:17 and 3:43 show how a motor protein transports a vesicle (e.g. containing some proteins and other stuff) to the cell membrane. Later at 6:25 the vesicle and the cell membrane merge and the vesicle frees its cargo. Some of the contained proteins act as messengers and some others act as receptors as it is shown at 6:40.

What impresses me most is the massive concurrency present within each of our body cells. And we have many of them :-) (the human body has approximately 100 000 000 000 000 cells).

Saturday, June 5, 2010

Monday, May 24, 2010

Android concurrency

I really like the way Android handles concurrency with its Handler and Looper classes. E.g., it helps you if you want to perform some task as background job and later push back the results to the calling thread via message passing. For convenience, there is also the AsyncTask class which does all the Handler, Looper and thread pool stuff for you. The callback interface of AsyncTask ("onProgressUpdate""onPostExecute", etc.) will be executed within the context of the calling thread (e.g. the UI thread). That's really nice :-).
In this way Android reminds me very much of Erlang or QNX Neutrino RTOS.

I also used this classes in Quickdroid a lot. Quickdroid allows you to quickly search, find and launch apps, contacts, bookmarks, artists, albums and songs on your Android phone. It is just like Quicksilver for Mac OS X, Launchy for Microsoft Windows or GNOME Do for Linux.
The Quickdroid source code is freely available here under the Apache 2 license.

Saturday, April 24, 2010

Hobby projects

  • Concurrency Shootout (Erlang, Scala, Clojure, maybe F#) --> e. g. HHsearch
  • Energy efficiency of highly scalable cloud services (Erlang, Scala, C++) --> e. g. SHOUTcast
    Which language and platform scales best and consumes the fewest energie to get things done. My gut feeling says it is Erlang, but we will see...
  • Take a really deep look into the Erlang VM
  • Do some Google Android and Microsoft .NET stuff
  • Make: Electronics

Sunday, February 14, 2010

Ars Technica Guides and Reviews

Virtualization
Part I - Virtualization basics
Part II - Privilege levels, rings, and fooling the guest OS
Part III - I/O Virtualization

Mac OS X
Mac OS X 10.4 Tiger
The details on the Mac OS X Quartz graphics architecture start on page 13.
Mac OS X 10.5 Leopard
Some details on Quartz GL can be found on page 9.
Mac OS X 10.6 Snow Leopard
The Grand Central Dispatch stuff starts on page 10.

Saturday, February 6, 2010

Android Architecture Patterns

Last week I took a deeper look at Android's core architecture. I was especially interested in how Android sets up its software component containers as runtime systems for activities, services and content providers. So I investigated what the Activity.startActivity method does to start an Activity inside of a newly created Zygote child process.

The Zygote architecture pattern allows Android to set up software component containers (OS processes that contain a Dalvik VM together with the Android framework classes) within milliseconds.
Android‘s Binder runtime helps to make these software component containers interoperable in a very efficient way. This reminds me very much of modern microkernel operating systems like QNX Neutrino RTOS, Miray Symobi or Microsoft Singularity.

For more details check out the following document that takes you on a walk through Android's source code.


Genetic Algorithms with NetLogo

I wrote a GA that evolves WALL-E's waste search capabilities over some generations. The WALL-Es learned fast at the beginning but then stuck at some local maxima. Sadly, also after a few thousand generations (and some days later) no mutations got the WALL-Es out of this local maxima. I have to investigate this further...



The source code is available here and there you can download NetLogo.

Some interesting links:
  • Einfachheit setzt sich durch

    Die natürliche Selektion erzeugt nicht immer die besten Organismen, vermuten US-amerikanische Wissenschaftler. Die Forscher simulierten RNA-Moleküle und deren Evolution durch Mutation und Selektion in Computermodellen. Diese Moleküle spielen eine Schlüsselrolle bei der Übersetzung der Erbinformation in Proteine. Dabei stellten die Forscher fest, dass sich manche vorteilhaften Merkmale nicht entwickeln, weil die notwendige Kombination von Mutationen zunächst Nachteile in sich birgt und daher ausgesondert wird.


  • Die Natur ist nicht perfekt

    Denn die Natur sei mitnichten optimal aufgebaut. In der Evolution sei es schließlich nie darum gegangen, sich einem Lebensraum perfekt anzupassen, sagt Fischer. "Die Tiere mussten nur gut genug sein, um zu überleben." Im Gegenteil ist es für Lebewesen häufig ein Vorteil, nicht optimal auf nur eine ökologische Nische ausgerichtet zu sein. Je besser ein Tier nämlich an eine bestimmte Nische angepasst ist, desto spezialisierter ist es. Umweltveränderungen bereiten ihm dann aber große Schwierigkeiten.


Software Technologies

There are some really nice software technologies that have been invented since Lisp ;-).