Archive for the ‘English’ Category

Parliamentary democracy has nothing to do with legitimation

Monday, October 3rd, 2011

I have recently noticed a belief I had been indoctrinated with: western political systems—parliamentary democracies—would be better than other ones because of their democratic legitimation, the reign is legitimate because the government is elected. It had appeared natural to me because it had been repeated again and again: some state or decision is legitimate because there was an election at some time. It had been told at school and everywhere, even spontaneous polls with arbitrary options pretend to do legitimation. But there are several really big flaws in this argumentation:

  • What is our target function? What should a legitimate decision be like? Why should “on-ground-of-election” be a most important value? Politics should be about resolving conflicts while protecting the freedom of everybody, elections do not automatically imply freedom, in fact they can set dictatorships like the Nazi regime up, and do—more often—simply nothing, thus do not eliminate a lot of injustice in the world.
  • Rousseau told us that only democracy is able to ensure freedom inside a society by implementing the volonté générale, but what have results of elections to do with the volonté générale? Nothing, in representative systems the decisions do not even exactly reflet the volonté de tous, in fact it is a very, very bad approximation, thus decisions are far away from being legitimate, they are the result of power games, nothing more.
  • The sample for elections does not strictly correlate with the set of affected persons, elections are part of an random distribution of power, not a legitimate one. Non-human animals, foreigners, children, incapacitated, how could elections legitimate an arbitrary reign over those persons?
  • To be more explicit: There is no intrinsic property of elections ensuring freedom and humanity.
  • External circumstances are ignored when saying “democratic” systems would ensure freedom. Wether freedom is possible is determined by the whole social order, not by single political decisions. Remember companies, employers, customers, teachers, “friends” etc., there are power and herrschaft everywhere, and they are not inherently related to politics. However, do not falsely conclude that it is all about polity to create a state ensuring freedom, polity inherently includes herrschaft, not freedom, instead, it is much more desirable to have external circumstances inherently including freedom and eliminating polity as far as possible. A lack of polity is not a fundamental problem.

You may argue that these are flaws of democracy, but it could approximate legitimation. Maybe, but not within our system. Majority decisions and representative systems can not converge to legitimacy, except of by annulment. But progress in that areas—I cannot even observe—is not the most important aspect of freedom, as I said, it is about the social circumstances, they may ensure personal freedom, but wherever politics get necessary for organisation we should of course try to find the volonté générale, consensus. But parliamentary democracies have nothing to do with that. They are not democracies–i.e. where the volonté générale is the political maxim–they are just chaotic systems of herrschaft, consisting of power games and occasional elections, but politicians call it “democracy” and pretend it would be a most important value–complacent hypocrisy.

But what makes parliamentary democracies good? Why do we prefer them to autocracies? They fulfil a very simple job: politicians can easier lose their power in so called “democracies”, thus they are more careful with doing bad things if the electorate (not the general public!) could care about it. Additionally there is the separation of powers—contemned by Rousseau—providing some limitation of arbitrariness in an undemocratic system. Courts ensure continuity. That are the true colours of parliamentary democracy! We should realise that the world will not get better just because there are parliamentary democracies.

MeeGo finally dead, absolutely dead

Thursday, September 29th, 2011

Some people could not believe it that Nokia’s deal with Microsoft killed MeeGo, a promising Linux distribution for mobile devices, though it had been arguable to drop Maemo and not using Plasma Mobile. I hope they will now believe it: Even Intel is dropping MeeGo, Tizen is coming slowly, probably not providing a full featured GNU/Linux (why should it be like that, if everything is HTML5/JavaScript-focused), providing no more big benefit compared to Android, Necessitas is there, Tizle is not. There is finally obviously no more prospect for MeeGo, forget it. I hope the are chances for Free Software and KDE on Android, although that is not optimal, no full featured GNU/Linux and has an uncertain future because of Chrome OS, I currently do not see any alternative.

EcmaScript is no assembly language

Wednesday, September 28th, 2011


Windows 8, Tizen – there seems to be a HTML 5 + JavaScript hype. The myriads of web developers are expected to write all their stupid apps to make a platform popular. Some may know that I really do not like EcmaScript, however, it is good to allow using it, there may be domains where it is appropriate, there may be cases where it is the best choice to reuse some EcmaScript code. But seriously, that way technical possibilities get wasted. Reusing all the high-quality desktop application code – nearly impossible. Using certain paradigms of great programming languages – nearly impossible. I know, you can translate LLVM IL to EcmaScript, but EcmaScript is really not an assembly language. That it is not its purpose and it is not suitable, do not tell me V8 would be good, it cannot transform EcmaScript to an assembly language, even Google is now propagating Nativ Client (NaCl), really cool technology, to allow any language (great developments of the past!) being ed, by reusing existing languages, suitable as universal low-level representations: x86 machine code and LLVM IL. It had taken long time until there was finally a usable version of Qt for Android (Necessitas), reimplementation of everything and Java got in the way of a quick port, although there has always been the possibility to use native object-files. How long would something usable take for Tizen? And do not forget: Qt is huge an popular, it may be unaffordable for other projects somehow relying on certain OS capabilities. Thus, why not just supplying existing API? Why not just keeping great ecosystem, being open for new innovation and new technology which is compatible with it? Why limiting everything with EcmaScript’s poor capabilities? Web developers can still be attracted, EcmaScript and even HTML 5 can perfectly be combined with Qt. Even Apple failed with its original web-apps-only strategy, why should anybody else succeed with that nonsense now, years later? Microsoft is despaired, Google wants to control everything with Chrome OS, but why the hell should MeeGo be dropped?

New HTML/JavaScript-focused architectures: you suck.

Tizen wants to allow native access, but they “anticipate” that most stuff should be written with EcmaScript. Thus it will certainly not be easier than with Android to reuse existing technology.

GPLv3, LGPLv3, AGPLv3 Discussion

Wednesday, August 24th, 2011


Just a short notice: I have started a discussion about the exclusion of GPLv3, LGPLv3 and AGPLv3 by the current licensing policy at the kde-licensing mailing list—as promised in my previous blog post discussing some arguments. Will be offline for few days, thus do not wonder if I am not answering.


Unexpected Bottle Neck: vector<bool>

Tuesday, August 23rd, 2011

Hi folks!

The last paragraph is actually the interesting one for every C++-programmer, the leading-in might not be understandable.

The new lexer component of KDevelop-PG-Qt is not very fast, it can take several minutes with complex grammars, especially when using UTF-8 as internal encoding for the automata. Of course, first I want to finish the most important features and that for I am writing an example lexer for PHP to check its capabilities to spot bugs and missing features, but now I was curious and asked Valgrind/Callgrind for analysis. I expected a lot of useless copying/assignments because I have not done any optimisation yet and tried to be “defensive” by using too much copying. Indeed: For my first example about 78% of the runtime were spent on copying. But then I tried a full (as far as it is finished) PHP example with UTF-8 and it was a real surprise:

KDevelop-PG-Qt: Callgrind results: a lot of comparisons on vector<bool>

KCacheGrind Overview

It spends most of the time with comparing instances of std::vector<bool>! For the powerset construction I have to maintain following states for subsets of states in the NFA and after that I map those subsets to new unique IDs for the states of the DFA. For both cases I wanted to use a map with vector<bool> (a subset of states) as key_type, I could not decide if I should use map or unordered_map – I used map, but there is also some code to make it possible to use QBitArray with unordered_map, just for the case. However: I expected the minimisation to be a bottle neck (disclaimer: I stopped valgrind after some time, maybe it becomes a bottle neck later), but now the comparisons used in the map-implementation are crucial. I was not very economical with those map-operations – I could have done the mapping while computing the necessary subsets, it has to be optimised and I may use unordered_map and unordered_set (hashes) instead of map and set, but that is not the reason why I am writing this blog post. ;)

The interesting thing about it is the usage of std::_Bit_reference. std::vector<bool> has a specialised implementation, the booleans get packed, thus it will only need size()/8+const Bytes when it is full. There is a special hashing-implementation directly using the integers used to store the bits, but there is only a generic comparison implementation. Thus it will iterate over all the bits, instead of using comparisons of chunks (like 32 or 64 bit, depending on the CPU). Of course it will be much slower, keep in mind that each iteration requires some bit-manipulation. Especially in my case of a red-black-tree the vector will get compared to very similar ones next to it in the tree, and in that case it takes especially long time. Be aware of vector<bool>, it is often awesome (safe a lot of memory), but something like this slow comparison may happen, and always keep in mind that the index-operator might be slower than for vector<char&gt. Unfortunately there seems to be no API for accessing the integer-chunks. Btw. QBitArray does not support comparison at all. I have filed a bug-report to GCC/libstdc++.

The FSF about Free Games

Sunday, July 17th, 2011

I have noticed a new FSF-bulletin-article via The Free Game Lag by Danny Piccarillo.
The article is about the lack of FLOSS games. It neglects the theory that Free Software would be an unsuitable method for game development. Free games will evolve like any other fields of software, but currently it is low-priority, because games are not that important. Seriously, the arguments of that article are null and void, it does not take specific properties of game development into account, I want to explain my thoughts about the issue:

Some time ago I thought it would be impossible for Free Software to conquer game development. It is a lot of work involved with developing a big computer game, but there are no people having a specific commercial interest in the development of them, thus selling licenses seems to be the only possible business model (in comparison many companies are interested in the development of Linux or Apache). There will not be any RedHat or Google or whatever extensively sponsoring development of free games, nothing more than some GSOC Wesnoth projects (that is much less than big game industry). What was wrong about my thought? Game development does not necessarily need such a “business-model” to be successful. First of all we should notice that there are sophisticated Free Software game engines, XNA or similar proprietary software is not needed, there are e.g. Irrlicht, Ogre3D, Blender or Panda3D, sophisticated graphical effects, physics etc. seem not to depend on proprietary software any longer. When looking at the development of major games one may notice that there are seldomly epic new concepts, most of the time it is new content, i.e. new graphics/artwork, new story, new characters, new items, new quests etc. It is a lot of work, but: it can be done by communities. Gamers have already created huge modifications in their free time, once free games have reached a certain level including good graphics etc., there could be entirely new big communities of gamers, and because community and cooperation are integral parts of Free Software, such games would not stop growing. But currently most “serious” gamers are only recognising proprietary major games.

But of course those major 3D-shooter/RPG/strategy/…-games are not the only ones, many people are also playing so called “casual games”, they tend to be very wide spread—and proprietary. One may argue that casual gamers do not want to spend time for contributing, but I think there is enough hope they may be interested in it, too. The Gluon Project, we all know about, seems to have some very nice approaches, it is trying to build such communities for free games, which are currently not present, supported by software (and hardware, but that is not that important). For 2D-realtime games it looks very promising. There are also some innovative approaches for turn-based games, e.g. short time ago I found out about Toss, it is a free research project combining game creation and general game playing (from AI point of view), I am sure it would be awesome if communities could be built around such a software as well (there is Zillions of Games, but it is proprietary).

When people ask you how gaming as we know it can exist in a free software world, you should open with your response with, “It can’t, but it can be better.”

That is definitely right, but there are specific properties which have to be taken into account. There are chances for free games, we should not forsake any hope just because it seems to be impossible with current business, we should hope that all those business (“big game industry”, “app development”, all using DRM etc.) will perish, although currently they seem to strengthen. Free Software and community can succeed when using entirely new methods.

What I have forgotten to write yesterday: crowd funding should be considered, too, why should ordinary gamers not pay for development instead of licenses if there are good chances that there will be some good results? That is often a good alternative to selling copies, especially unknown artists can benefit. Of course it should not be misused (that is often the case at, people receive such funding and have no risks, but then they create DRMed products, sell it in the app store etc., that is strictly against the street performer protocol ;)). Btw. supports donations.

Regarding Dynamic Typing

Sunday, July 10th, 2011

Currenty there seems to be a big hype about EcmaScript (JavaScript). Google probably wants to enslave the world with Chrome OS, where the system is not much more than an EcmaScript virtual machine provider (maybe it will support native applications through NaCl, like Android does not only allow Java…), Microsoft wants to reimplement their Windows interface, Qt invented QML, the EcmaScript extension we all know about, providing cool declarative features. Today I want to talk about a fundamental property of EcmaScript and why it just sucks: dynamic typing.


First let us clarify the meaning of “dynamic typing”. “Dynamic typing” means that the type of expressions gets checked at runtime, expressions which may have any type are possible. It should not be confused with duck typing, e.g. many types using dynamic typing have a lot of built-in functions relying on specific types (“the frog will not get accepted”), e.g. most functions in PHP’s standard library (expecting string, integer, array or what ever). But for example C++ function templates in etc. provide duck typing (they will accept anything looking like an iterator), or the signatures in old g++ versions provided duck typing. Determining types may happen at compile time (type inference) even with dynamic typing, and of course optimising compilers/interpreters are doing that.

Impact on Development

Let us talk about an argument for dynamic typing: it makes life easier. Actually, that can be right, there are domains where you just do not want to care about such stuff, for example when writing a shell script with few lines of code or when quickly doing some calculations with a computer algebra system. But Typo3, MediaWiki, Windows, Plasma etc. are much more than that. Why do I doubt that dynamic typing makes life easier in those contexts? Because it is error-prone. It is always better when errors get detected at compile time. It is good to fulfill contracts when programming, and they should get verified at compile time, such that they can be easily found and will not annoy the user. A type of contract (not the only one, cf. design by contract) which has been used for long time is the type system. The programmer assures that a variable has a certain type. What happens in dynamically typed languages? You do not have to state the contract, the compiler (or code checker) will usually not be able to check it, it is just in your brain, but of course you will still rely on that contract, the type is something you rely on most of the time when programming, I know that x is an integer when using x for some arithmetics. But you will do mistakes and you get buggy software. That is the fundamental disadvantage when programming, but of course I have to compare it to the advantages of dynamic typing: you can write code quickly and efficiently not mentioning the type everywhere. But there are more proper ways to achieve that: use type inference. The type of a variable will be determined by the compiler when initialising it and you will get an error when you are trying to change the type. That is good because in most cases the type of a variable will not change. And you will get informed about undefined variables (a typo should not cause a runtime error, but in dynamically typed languages it does). For the case that you need a structure allowing different types at the same position there are algebraic data types. With algebraic data types you can state a contract with only few tokens (instead of a nested array/dictionary data structure with a layout which is just implicitly given by the manipulation of it, that does often happen in dynamically typed languages), for variable declaration you only need one token, maybe a single character. That minimalistic overhead in code length is definitely worth it once the software has reached a certain complexity. That threshold is probably not very high, annoying mistakes which could have been avoided with static type checking can already occur in small programs just computing some stuff or something like that.


Dynamic typing causes big overhead because instructions have to be choosen at runtime based on type information all the time. Of course it is much more complicated to optimise dynamically typed languages, there might be corner cases where the type is not the expected one, but the runtime has to care about it etc. I often read statements like “the performance critical parts are implemented natively” etc., but regarding the amount of applications running using such languages (JavaScript, PHP, Ruby, Python, Lua) we have to state: it is performance critical, PHP is used for more than a preprocessor, QML is used for more than just representing the UI, JavaScript is used for drawing a lot of complex stuff in the browser, Python gets used for scientific computations, and Ruby is establishing new standards regarding overhead (that is not true, Scheme has been that slow before ;), but Ruby allows modifying a lot of stuff at runtime, too). There is reasonable overhead—for abstraction, generalisation, internationalisation etc., but dynamic typing affects nearly any operation when running the program, that is unreasonable and of course it will sum up to significant overhead, although it is simply not needed (and bad for environment ;)).

Special Issues

Regarding extreme flexibility

First of all: in 95% of applications you do not need it, you do not have to modify types at runtime, adding member functions to classes or objects and all that stuff. Sometimes it may be a good way to establish abstraction etc., but in those cases there are usually alternatives: meta-programming can be done at compile time, when manipulating all the types in Ruby they usually could have been manipulated at compile time, too, but Ruby does not support sophisticated compile time meta programming (ML and Template Haskell do, in C++ and D it is kinda limited). Regarding collection of information, debugging etc. using such features: debugging facilities should not influence the performance and cleanness, I am sure by involvement of meta programming you could implement language features allowing that when debugging without neglecting the type system. And of course a lot of flexibility at runtime can be achieved without allowing any type everywhere: dynamic dispatch (including stuff like inheritance, interfaces, signatures and even multi-dispatch), variant types at few places (e.g. QVariant, although I think it is used too often, signals can be implemented in a type safe way, and there are those type safe plugin factories as alternative to QtScript and Kross), signals and slots, aspects etc.

Regarding EcmaScript

You might say that EcmaScript is becoming fast enough because of good compilers and extensions like type safe arrays (e.g. containing only floating points). But EcmaScript will stay EcmaScript, it will keep the downsides of dynamic typing, those type safe arrays are an ugly hack to make it feasible for some specific applications. It is simply lacking a proper type system and it will not get it.

Regarding QML

Using EcmaScript for QtScript was a pragmatic choice, no awesome innovation: there were many web developers knowing about JavaScript. Unfortunately that caused yet another way to integrate scripts and certainly not the most flexible one (cf. my previous blog post), for some reason they did not want to reuse KDE’s innovation (like QtCreator and KDevelop, but that is really a different topic…). QML is based on EcmaScript because QtScript had been based on it before. Dynamic typing is definitely not an inherent property of such declarative UI, most of it could have looked the same with a native implementation based on C++, but also implementations in Ruby or whatever would be easily possible. I have to admit that C++ is not perfect, it does not provide sophisticated meta programming, algebraic types or one-letter type inference (“auto” has four letters ;)), the last one may be a small problem, but overall it is simply not simple enough ;), languages like Scala, D and OCaml have certain problems, too. Hence some of the non-declarative code in QML would have been disproportionately complicated compared to the declarative code. The general approach of declarative UI is certainly good, and now we probably have to accept that it has been implemented using EcmaScript, we can accept it, as long as it is still possible to write Plasmoids using C++ or whatever etc.—obviously that is the case. Thus QML is generally a good development in my opinion, although implementing program logic in it is often not a good idea and although dynamic typing leaves a bitter aftertaste.

I hope you have got my points about dynamic typing. Any opinions?

Old Regression by Leonardo da Pisa

Saturday, June 11th, 2011

After reading this blog post I thought a bit about endianness (big-endian is just bad), and while having a shower a theory came into my mind: Maybe Arabs had little-endian integers (meaning least-significant bit first) but wrote (and still do) from right to left (meaning least-significant bit/digit at the right). And when Leonardo da Pisa (Fibonacci) brought Arabic numerals to Europe, he wrote in the same style, not flipping the digits, hence establishing big-endian. In fact I could verify that with Wikipedia. But I also noticed that this “bug” has been there before, Indians write from left to right (Wikipedia told me about a coin in Brahmi written from right to left, but that was before there were any numerals), and they have always used big-endian. Thus Arabs fixed that issue (maybe not knowingly), but stupid Europeans did not get why big-endian is stupid. Furthermore, big-endian numerals look more like those stupid Roman numerals, and our usual way of vocalising them is like in Roman times. And because of Leonardo da Pisa there are those stupid architectures using big-endian representation (fortunately not x86, amd64), causing non-portability, byte-order-marks and all that stupid stuff. And left-shifts could actually be left-shifts and right-shifts could be right-shifts.

Short list of arguments for little-endian:

  • Value of a digit d at position i is simply d·b**i (b is the base). That would obviously be the most natural representation if you would implement integers by using bit-arrays. It does not depend on the length, no look-ahead required.
  • You can simply add numbers from left to right (no right-alignment for summation).
  • For radix sort you can begin from left.
  • Simple cast between longer and shorte integers without moving any bits.
  • You do not need words like “hundred”, “ten-million”, “billiard” etc., because you can interprete a sequence online without look-ahead.
  • Repeating modulo and integer division by the base gives little-endian-representation.
  • The least-significant bits carry more interesting number theoretical information.

Well, big-endian is more like lexicographic order, although I am not sure if it is clearly better for natural languages. For division you have to start with the most-significant bit, but—hey—division is obviously not as important as all the other operations where you start with the least-significant bit. Of course sometimes little-endian is not a good notation, for measurements one should use floating point numbers (in a decimal world called “scientific notation”) and the mantissa should start with the most-significant bit/digit, after the exponent to avoid look-ahead (unlike the scientific notation).

If Leonardo da Pisa would have thought a bit about what he is doing, there would not be all those drawbacks! Just my thoughts about that regression. ;)

Skype Reverse Engineered

Thursday, June 2nd, 2011


Good news for Free Software and open protocols: There has been a sucessful attempt to reverse engineer Skype (Magent URI). Nice timing, shortly after Microsoft’s acquisition Skype could finally be broken. :) He is also including modified Skype executables allowing debugging etc., which is usually prevented by really elaborated anti-features (encryption, kills itself if there is a debugger etc.). The sample code is able to send a message via Skype, awesome!

Now there are hopefully soon implementations for Telepathy or libpurple (used by Pidgin and Telepathy Haze). One may say we should not promote such proprietary protocols, but: For many people Skype is important (do not say you do not know anybody, it varies, in some groups everybody is using it, somewhere else it is different, I am not using it). The chances that they will switch to Free Software (KDE/GNU/Linux) are much higher if there is support for Skype without proprietary software. And once they start using Pidgin or Telepathy, it is no problem for them to use open protocols, too, you can simply tell them they have to click those buttons and then they can communicate with you using an open protocol like Jingle or SIP (or XMPP for text messages). Thus it does not only help to spread Free Software, but also to spread open protocols. And all future attempts to commercialise the private data created by Skype can be easily prevented. Even Windows-users may start using Pidgin or something like that against the advertisement. Regarding “it is just a hack”: They cannot simply change their protocol, because there is Skype hardware which cannot be updated and would not work any longer (that would make all non-idealist customers unhappy, too). And for WLM/.NET Messenger/MSN and Oscar/ICQ it has been working well since long time (even with Kopete ;)). Really, really great news!

Unification and Orthogonalisation: Part 3, HTML-Engines and Web Browsing

Thursday, June 2nd, 2011


In this blog-post I want to share some thoughts about HTML-rendering-engines and web browsers in KDE. There seem to be some problems, some may be easier solved with KDE5 (breaking some API may help).

Does there have to be a KDE-browsing-experience?

When looking at browser-statistics for my blog, most people seem to use Firefox or Chrome/Chromium, using Konqueror or Rekonq is kinda exotic, browser statistics may be wrong (I am sometimes using “faked” user agent string if websites do not like Konqueror), but I evena know many KDE-users personally using Konqueror or Chromium. But I think KDE-browsers actually have potantial. Everybody is annoyed about Gtk+-file-selection-dialogues, but there are also real features provided by KDE, in some areas Rekonq provides unique interface, Konqueror can satisfy many wishes for flexibility. I am not that happy with Firefox and Chromium (quoting Martin Gräßlin “it is broken” (client side decoration ;))). KDE-web browsing should not be dropped, and certainly nobody is planning to do that.

Rendering engines

We should be honest about KHTML: We have to admit that the JavaScript support is poor and technically not up-to-date. Many websites are not working, even KDE-related ones, popular sites like Blogspot etc. KHTML is certainly not yet dead because kdewebkit is not yet a working alternative, it is lacking behind regarding KDE-integration (KDE style widgets are a must-have), and it cannot yet be considered to be stable, too. But there is one thing which would be definitely nice: a common interface. KDE is able to attract plugin-developers (see Plasma), it has great technical capabilities (KPluginFactory etc.), but they would have to be used. If there would be a unified way to access both KHTML-KParts and WebKit-KParts, it would make it more reliable for people wanting to write a plugin and of course it would be better for every user if KHTML-plugins could be used with WebKit in Konqueror. API could be unified with KDE 5, but there is still a lot time left, maybe an alternative should be found.

Konqueror and Rekonq

That has to be said: Rekonq started as a “hey, I will try to build a web browser” project, today it is the default web browser in Kubuntu and provides e.g. the awesome address-bar. It is now a more serious project, so why is it not integrated into KDE technology? Konqueror is excessively using KParts and KXmlGui, I think it would have been no problem to implement Rekonq’s user interface elements as plugins and using Konqueror’s infrastructure. Not only Konqueror would benefit, but it would provide built-in plugin system, PDF viewing, split view, synchronously displaying HTML and modifying via FTP etc. I am sure some performance optamisations could be done for KParts/Konqueror, too, without breaking everything. Now we have got two independent web browsers. Even with Dolphin it is a problem, the promised integration did not become true, the useful dockers (e.g. for Nepomuk), address bar etc. are not available in Konqueror, which is using its own sidebar unaffected by Dolphin. But for Rekonq it is even worse because Rekonq does not even try to integrate into KParts.

It would be nice if there would be a single, unified web browser with a reliable rendering/JavaScript engine using all the great technology KDE supplies – especially all the flexibility provided by kdeui.

A loyal Konqueror user