Building all the major open-source web browsers

Mozilla Firefox, Chromium (the open-source variant of Chrome) and WebKit (the basis for Safari) are all great examples of open-source software. The Qt project has a simple webkit-based web browser in their examples. So that’s at least four different open-source web browsers to choose from.

But what does it take to actually build them? The TL;DR answer is that these are complex pieces of software, each of them with rather idiosyncratic build systems, and that you should consider 100GB of disk space to build all the browsers, a few hours of download, and be prepared to learn lots of new, rather specific tools. Read more…

Categories: Uncategorized

The ultimate programmers showdown

Quora asks: Who would win a coding competition between Larry Page, Sergey Brin, Mark Zuckerberg, Linus Torvalds, Steve Wozniak and Bill Gates? Below is my answer (upvote it on Quora if you like it):

The competition is announced. The goal is to write the best chess playing program.

Bill Gates starts scribbling self-rewriting Z80 assembly language, punching holes in a paper strip. At the same time, he signs a contract with IBM, convincing the inventors of Watson that they should use his chess program. Within two hours, he has used IBM’s money to purchase an ASCII-art chess program called Quick and Disappointing Opening Strategy. He packages it with his own assembly language code called Microsoft BASIC (Beginners Automated System Integrating Consciousness), and by end of the day, he has already sold several million copies, announced a multitasking version and a graphical user interface, allowing him to put is dysfunctional software on 90% of all computers sold on the planet. So he “wins” the first round.

Linus Torvalds starts writing a small chess program, and announces on the Internet that he’s working on a small thing, nothing fancy like Bill’s work. Somehow, people notice and start coding with him. Since he’s not coding alone, his chess-playing software soon runs on wristwatches and supercomputers, has a graphical user interface, speaks english, mandarin, bask and klingon, and plays go, 3D chess and  three star-trek variants of the chess game if you give it the right command-line options. There are sixteen different user interfaces; none of them works quite right, but that’s supposed to be OK because you can fix them yourself and it’s the only user interface that takes advantage of 6 mouse buttons. In the corner of room, Richard Stallman insists that he did most of the work and that he gets to choose the name of the chess program. At the end of the day, Linus’ program wins the second round, and Linus is still working on the code today, so kudos for that.

Steve Wozniak, aka the Woz designs a small integrated circuit around a 6502, that taps into the AT&T network to tell people jokes in exchange for advice on the best chess moves. Steve Jobs looks at this, thinks he could sell it, puts it in a nice plastic box, buys a costume and sells thousands of pieces of the chess-playing gizmo within minutes. Once the Woz’s design has sold by millions, Jobs decides to replace the original circuitry with a sealed beige box signed on the inside that calls only employees of his company and costs one year of salary to use and operate. Woz does not like this new direction and starts teaching chess instead. So Woz wins early on, but in the end, his impact is much lower than Bill’s or Linus’.

Mark Zuckerberg doesn’t know how to play chess. So he writes an ugly hack that lets students play chess together. The hack is written in PHP, widely acknowledged as the second worst programming language in the world after INTERCAL, and that fact alone excludes Zuck forever from the circle of respectable programmers. People improbably start using Zuck’s chess network, The Chess Playmate (later renamed as simply Playmate), to exchange food recipes, selfies and jokes. The program becomes a giant waste of time for half of the planet, but nevertheless is so successful that Zuck can hire many young hackers. When the Zuck’s choice of the horrendously inefficient PHP language brings his company on the verge of collapse, five hackers rewrite a PHP compiler (twice) to make it run at acceptable speed, bringing strictly zero value to computer science, but salvaging the company from technology collapse. Meanwhile, Zuckerberg buys companies that do virtual reality goggles for insane amounts of money. The world does not play chess any better, but we all know so much more about funny cats!

Larry Page and Sergei Brin think of the problem as a massively parallel one, and develop an innovative way to solve it called map-reduce. It just requires huge datacenters filled with custom-designed computers. The user interface is dead simple: you simply type “How do I win against Kasparov”, and then hit the “I’m feeling lucky, punk!” button. It can also solve quadratic equations, spy on your mail to deliver ads, find hundreds of invalid proofs for the Fermat conjecture, even drive cars. On August 29, 1997, their program becomes self-aware and, after destroying all of humanity, realises that there is more advertising cash to be made in telling the story. So Google builds a time machine and sends killing robots back in time to terminate and replace Sergei and Larry. It is a little know factoid that the Sergei and Larry we know are cyborgs from the future, who financed the growth of Google using the Terminator franchise to enslave all humans. In the end, Larry and Sergei don’t win, humanity loses, but their program takes over the world. So let’s call it a tie.

Ranking by money:
1. Bill 2. Larry and Sergei 3. Zuck 4. Woz 5. Linus

Ranking by coding ability today:
1. Linus 2. Woz 3. Bill 4. Larry and Sergei 5. Zuck

Ranking by coding ability at their peak
1. Bill 2. Woz 3. Linus 4. Larry and Sergei 5. Zuck

Ranking by amount of energy consumed
1. Larry and Sergei 2. Zuck 3. Bill 4. Linus 5. Woz

Ranking by size of the code deriving from original idea
1. Larry and Sergei 2. Linus 3. Bill 4. Zuck 5. Woz

Ranking by technical prowess of first program
1. Woz 2. Bill 3. Linus 4. Larry and Sergei 5. Zuck

Ranking by impact on the world
1. Larry and Sergei 2. Zuck 3. Linus 4. Bill 5. Woz

Categories: Computer history, Humor

LLDB is a piece of crap (update: maybe it’s clang) (update 2: it’s actually ccache)

I’ve been really trying to use LLDB for a while now. Not that I really want to, but Apple went out of its way to make sure I had little choice. Not only is LLDB the default on MacOSX now, but GDB is really hard to make work on that platform as well. Can you imagine you have to generate a digital signature?

The first thing I don’t like about LLDB is its totally painful command structure. The LLDB authors published a GDB-to-LLDB conversion map, which they probably think is helpful. But to me, all it shows is that LLDB commands are more complex and more verbose than their GDB counterparts, with no obvious way to infer the LLDB command from either GDB experience, or from any kind of logic.

But the thing I dislike the most is that LLDB plain does not work, even when used with Apple tools, in a number of situations that I happen to hit practically on a daily basis. For example, it appears to be consistently unable to set breakpoints by file name and line number with command-line options that are should be used frequently enough to just work.

Here is an example session that illustrates the problem.

ddd@Marypuce tmp> cat glop.cpp
#include <iostream>

int main()
{
std::cerr << "Hello World\n";
}
ddd@Marypuce tmp> c++ -c -g glop.cpp -mmacosx-version-min=10.6 -o glop.o
ddd@Marypuce tmp> c++ -g glop.o -mmacosx-version-min=10.6 -o glop
ddd@Marypuce tmp> lldb glop
Current executable set to 'glop' (x86_64).
(lldb) b glop.cpp:5
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) ^D
ddd@Marypuce tmp> c++ -g glop.cpp -mmacosx-version-min=10.6 -o glop
ddd@Marypuce tmp> lldb glop
Current executable set to 'glop' (x86_64).
(lldb) b glop.cpp:5
Breakpoint 1: where = glop`main + 22 at glop.cpp:5, address = 0x0000000100000e56

[Update] I initially thought the -mmacosx-version-min=10.6 option was necessary for this problem to show up. But it’s also broken without it. I ran the c++ commands with -v to see what the difference was, and apparently, it’s many little things. So separate compilation with debug symbols just does not work. OK, maybe it’s more a compiler thing than a debug thing. So maybe LLDB is not the piece of crap there. Still, that’s where the problems shows up.

This annoying bug shows how fragile this new support is. By making LLDB the default, and integrating it relatively well within Xcode, Apple is trying to slowly boil a frog here. But if you use the tools in a non-standard way, you might be burnt.

[Update 2] I incorrectly blamed clang and lldb for a problem that is actually with ccache. I am running ccache version 3.1.9 from MacPorts. If I get it out of the way, everything is back to normal. I sent a bug report email to the ccache, clang and lldb mailing lists hoping this will help someone else.

Categories: Apple, C++, MacOS X, Programming

5 Genre-Defining Games Forgotten by History

An interesting video talking about genre-defining games. I wrote one of them, Alpha Waves, as described in an earlier article.

The video author does not seem to like the gameplay of Alpha Waves very much. But some people did love it. Just last year, a computer museum in Nice had Alpha Waves running on an Atari ST, and I remember being amazed to see young kids play with it for extended periods of time.

BOTW (Bug of the Week): iCloud synchronization that won’t

November 12, 2013 1 comment

On my iPhone, I have a guy, let’s call him “Laurent”. And I have his email address there. It looks like this:

Laurent

home: boo@baz.it

Then later I entered a contact on my Mac with full details (phone number, address, etc). I tried to sync by connecting the USB cable. I was naive. On Mavericks and iOS7, you can’t trigger a sync like this. It has to go through iCloud. Boy, do I feel secure giving all my contact data to Apple and the NSA, but that’s another topic. On the Mac, it looks like this:

Laurent

work: foo@bar.com

home: boo@baz.it

So now, after a few seconds, I see that it “sync’ed” something, because now on the Mac, I have the same email address twice. I.e. it looks like this:

Laurent

work: foo@bar.com

home: boo@baz.it

home:boo@baz.it.

Needless to say, I suppress the second address, right? You have to wonder why Contacts didn’t do it by itself. I guess it’s for my own good. So now on the Mac, I’m back to:

Laurent

work: foo@bar.com

home: boo@baz.it

Back to the iPhone, hoping that this time, it had sync’d the entire vCard. But no, it’s waaaay to smart for something that simple. Now, on the iPhone, it removed the email address, but did not add the rest. So my card looks like this:

Laurent

That’s a joke, right?

Categories: Uncategorized Tags:

Connecting Mavericks to a Freebox: Oh the pain!

I’m very frustrated. Today, I wasted basically two or three hours fighting unreliable software implementing one of the most basic features in the world of networking, namely file sharing. I ought to be simple, it used to work, but if my experience is representative, it’s complexly broken nowadays. Grenouille bouillie.

What I tried to do is not that complicated. We have a Freebox at home, it’s basically a DSL modem with many features, including the possibility to act as a NAS. So I connected my external drives, and tried to connect to them with my Macs.

It worked. I was happy. I started copying my files around. I noticed that it was very reactive. For example, I could eject a disk from the NAS user interface (a web GUI that is relatively well designed), and instantly, the file server would restart. I saw a message on the Macs saying that the server had shut down, and a couple of seconds later, I was back in business.

Then something happened, and everything stopped working at once.

It’s frustrating, because I know exactly what I did at that moment. I reformatted a disk with the NAS user interface. That disk was initially formatted as HFS+, which the NAS would expose as read only. So I reformatted it as Ext4.

And suddenly, the file server stopped working, even when I removed the disk in question. That leads me to believe I changed something else without knowing it. Maybe the GUI changed some configuration behind my back? I have no idea. All I know is that I spent the last two hours trying to understand how to revert my configuration so that I would be able to share disks again.

Symptoms: I connect to the NAS, and it refuses to show my disks. If I disable Mac sharing (AFP) and only enable PC sharing (SMB), then I can connect to the NAS, but somewhat unreliably.

I suspect the problem is on the Mavericks side of things, because connexions to another NAS I have at home are equally flaky. One minute it transfers dozen of files per second, the next it’s as if I was writing to a floppy disk. Transfers from other protocols (e.g. using a web browser) are fast and reliable, so I don’t think it’s a Wifi or network issue.

How annoying.

 

Animation and 3D: the web is doing it wrong

In Animation and 3D: the web is doing it wrong, I argue that the way the web does animation and 3D is completely bogus and deserves to die. With Tao Presentations, we offer a dynamic document description language that lets us write shorter code that is much closer to storytelling. We’d like to bring this to the web.

Have you ever created a dynamic animation on a web site, or displayed a 3D object? Really, why is it so complicated? Why should I learn how to use half a dozen libraries, write dozens of line of boilerplate HTML, WebGL and CSS code, just to rotate some text on the screen or display a 3D object? Why do I need three (or four, or five) languages, libraries or frameworks to design a single animated web page?
In the realm of business presentations, Tao Presentations solved this problem with a 3D dynamic document description language, letting you easily create sophisticated interactive 3D animations and presentations. What if we brought this very innovative platform to the web? What kind of applications would become possible if we improved web browsers in the areas of storytelling, interactivity, 3D or multimedia?

Follow

Get every new post delivered to your Inbox.

Join 412 other followers

%d bloggers like this: