]> Matthias Wimmer (溫雅石)

Content tagged book

Learn You a Haskell for Great Good

posted on

This is the first book on Haskell, that really made me want to read it. I had it with me as an e-book on my vacations. I couldn't stop reading it before I finished. It is a very good introduction to the basics of the Haskell programming language. It even contains an understandable explanation of the infamous monads. (Side note: they are a very simple concept, and you shouldn't fear them.)

For me this book was the right amount of introduction to get me started. Everything else I think I will be able to learn while using the language.

The book is available in print at your preferred book shop, or can be read online and free of charge.

Links to resources

Getting Safari Books Online

posted on

I like the books from O'Reilly. For many years I've seen the ad on the backside advertising Safari. Sure, I checked out what this is, but I wasn't really interested to have a digital copy for a limited amount of time. I already had the print version.

I love to read real books made of paper. I use highlighters and add notes, while reading. I make the book mine. And after finishing the book, I can place it on my bookshelf, to show the books I like to others. This doesn't work with my Tolino e-book reader. While I have this device, I still buy most books as a paper copy.

Some days ago, I heard of Safari again on a podcast. I thought, that at least I should check it out. It's not only O'Reilly books anymore and it includes videos and other podcasts as well. There is a free 10 days trial, so I did not have to invest more than some of my time.

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

Reactive Programming with RxJava

posted on

RxJava is an implementation of “Reactive Extensions” (Rx) in Java. But what is this? Originally Rx are an implementation of Microsoft to address the increasing complexity of software. It is a model to build large scale asynchronous service architectures.

Another company that has to be mentioned is Netflix: they implemented the Rx in Java which resulted in RxJava.

On the programming side Rx looks very similar to how streams (java.util.stream.Stream) work. The main difference in my opinion is that streams are pull and lazy. They produce only as much data as someone is reading from them. RxJava on the other side is more push style. The source of data is pushing events through a pipe of operators similar to what you know from streams (filter(), map(), and so on) to the sink. And as I know from this book, Java streams are the wrong tool to parallelize anything that is not CPU bound–like network requests. There reason for this is, that (parallel) streams are executed on a thread pool that is shared with several other features of Java. This thread pools is limited to have only that many workers as the system has CPU cores. Therefore this pool gets exhausted very soon, when threads in it get blocked by I/O operations. Any thread waiting for an I/O operation effectively results in a processor core not used by your program.

RxJava on the other hand is not limited to a fixed thread pool. Any source (Observable) and sink (Subscriber) of data can be bound declaratively to user defined Schedulers. As well as Rx favours a model in which I/O operations are done asynchronously and non-blocking. Therefore resulting in a need for much fewer threads. In a traditional model of using one thread per network connection, threads become very soon the first thing that limits scalability.

What is really great about this book

The best part of this book for me were the reflections on Relational Database Access in chapter 5. While as a developer you might be tempted to convert everything to the reactive model, this part of the book shows where it doesn't make sense to do so.

By converting the access to your relational database to an asynchronous model you won't gain anything. Whatever you are doing on the client side, let's say for example your PostgreSQL will run all of your concurrent requests in different processes. This results in a noticeable limit on the number of parallel queries you're able to run. You cannot lift this limit by becoming asynchronous on the client side.

Links to the book

ZooKeeper, Distributed Process Coordination

posted on

ZooKeeper is a component that facilitates building distributed applications. It is:

The data managed by ZooKeeper is presented in a file system like manner with directories and files whose names get separated by slashes (/). The difference to a file system is, that you can store information in the directories as well. Or seen differently: directories are files at the same time. Based on this simple abstraction, users of ZooKeeper can implement things like leader election in a cluster of software instances.

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

Microservice Architecture, anligning principles, practices, and culture

posted on

To stay on the right track with microservices, I wanted to revisit the philosophy and organizational recomendations on how to do them right. After reading Building Microservices in april this year, I got Microservice Architecture, aligning principles, practices, and culture by Irakli Nadareishvili et al.; O'Reilly Media, Inc., 2016.

The book can be read on one week-end as the content is very well condensed to 118 pages.

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

Developing Web Components, UI from JQuery to Polymer

posted on

It's hard to find sources how to do front-end micro-services in a single page application (SPA). Having a single front-end that faces the user makes it hard to impossible to exploid the full power of going micro-services in the back-end. For every new function you cannot just deploy the corresponding service, but you have the dependency to update and redeploy the service as well.

So I was looking around how to go micro in an SPA. One of the ideas I found on the web was to do so using web components. To evaluate this idea as someone working mainly on the backend I thought I should get some literature and bought the book Developing Web Components by Jarrod Overson and Jason Strimpel, O'Reilly Media, Inc., 2015.

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

„ARM Assembly Language - an Introduction“ von J. R. Gibson

posted on

ARM Assembly Language – an Introduction

Die letzten Tage habe ich das Buch ARM Assembly Language – an Introduction von J. R. Gibson gelesen. Es ist eine Anleitung wie man ARM-Prozessoren in Assembler programmiert. Geschrieben wurde das Buch als Lehrbuch an der Universität Liverpool. Das merkt man, am Ende jeden Kapitels stehen Übungsaufgaben zum Einprägen und Verständnis überprüfen.

Das Buch ist perfekt für Einsteiger in der Assemblerprogrammierung. Der Leser erhält einen ausführlichen Überblick wie er in dieser Sprache programmieren kann. Wird der Einstieg mit einer begleitenden Vorlesung und Übungen unterstützt, so funktioniert das Buch noch besser. Es hilft aber auch, ein paar Grundlagen der Zahldarstellung und der Bit-Manipulation schon zu kennen.

Im Buch wird die ARM-7-Architektur behandelt. Vor allem wird der Prozessor ARM7TDMI betrachtet. Details zu den Prozessoren oder anderer Hardware findet man aber nicht. Dadurch ist das Buch auf für die allgemeine ARM-Programmierung interessant. Wer allerdings die Cortex-M-Prozessoren programmieren möchte, hat mit diesem Buch nicht das richtige. Es behandelt nicht die THUMB-Befehle, die der Cortex-M ausschließlich unterstützt.

Meine Bewertung: 5 von 5 Punkten für den Leser, der Assembler auf einem ARM-Prozessor lernen möchte und motiviert sind auch die Übungsaufgaben zu bearbeiten. Lesen alleine reicht nicht aus.

„C++11“ von Rainer Grimm

posted on

C++11, Der Leitfaden für Programmierer zum neuen Standard

Endlich wissen was in C++11 neu ist, deswegen habe ich „C++11, Der Leitfaden für Programmierer zum neuen Standard” von Rainer Grimm gelesen. Ein dickes Buch mit 500 Seiten beschreibt was sich in der neuen Version seit 1998 geändert hat oder neu ist. – Und das ist eine Menge.

Immer wieder war ich erstaunt über ungewöhnliche neue Konstrukte und neue Syntax. Solch große Änderungen hatte ich einer reifen Sprache nicht zugetraut. Meine Highlights in C++ sind:

Sehr mutig ist die Spezifikation auch weil sie eine neue Syntax für Funktionen einführt. Bisher definieren wir eine Funktion in der Reihenfolge „Rückgabetyp, Funktionsname und Parameterliste“. In C++ können wir den Rückgabetyp auch hinter die Parameterliste schreiben:

auto fac(int n) -> int {
    return n > 0 ? n * fac(n - 1) : 1;
}

Rainer Grimm geht die Änderungen leicht verständlich an: in drei Durchgängen zeigt er zuerst nur was es neues gibt, im zweiten geht er weiter in die Tiefe der Erweiterungen und im dritten geht er ins Detail. Er Leser kann sich so schnell einen Überblick verschaffen und stolpert in den Details nicht darüber, wenn in Beispielen auch eine andere Neuerung als die gerade erklärte schon benutzt wird. Einziges Manko: im dritten Durchgang bei den Details wurde mir etwas langweilig. Trotzdem ein großartiges Buch dem ich vier von fünf Punkten gebe.


Unless otherwise credited all material Creative Commons License by Matthias Wimmer