December 21th, 2016
Recently, the FIDE World Chess Champsionship Match 2016 was held in New York City where Magnus Carlsen defeated Sergey Karjakin in a tie-breaker after best-of-12 series with ten draws and one match for each competitor. Indeed, shortly after the ENIAC was built in the 1940s1 people started to use computer to play chess and to optimize strategies. Of course, the FIDE Championship got an online coverage were experts would analyze each move with the help of computer programs.
This combination of chess and computers took me back to 1997, when I managed to install for the very first time GNU/Linux. It was a CD of the German SuSE distribution that came with a magazine, which I got from one of my high-school teachers (I was fourteen years old at that time). Naturally I had lived in a DOS-based world with some incipient passage through Windows 95, God forbids. The kernel in the CD was version 2.0.33 I recall. And it turned up that support for accessing FAT32 systems had been recently added, but in version 2.0.35. So I had to download the kernel source (using an analog modem over a phone line at a blatant speed of 14.4 kbps) and to recompile it from scratch just to get access to my files that were stored in a DOS partition. Note that this was around August 1997, whilst the first announcement of the existence of what would become the Linux kernel was also in August but 1991. Six years is less than the time that has passed since I started to write wasora in 2009, and it does not even have a decent manual yet.
After going through all this trouble, I wanted to see how games were like in my brand-new operating system. I had been using computers since I was eight, and my main subject in life was, of course, playing games. So I saw an icon that looked like a chess knight and launched the program. All I got was a black screen with a cryptic message (this is of course a modern remake):
I used to play chess in DOS using a CGA graphic card adapter, so I was expecting to see at least a checkerboard. Or a greeting menu. Or anything else. Therefore I closed the terminal and moved on to explore other aspects of the combination of GNU and its Linux kernel.
I did not know it back then, but I learned it over the years: people which is good at math is often bad at design. And conversely. They speak different languages, they have different needs and they work in rather different ways. They are better kept off separated. And it is a (very) wise design decision to keep the math of a program on one side and the graphics on the other one, which is what the developers of GNU Chess had done.
This is called separation of policy from mechanism and is a cornerstone rule of the UNIX philosophy, known as the “separation rule.”2 So the black screen with the cryptic message was just the backend: a very complex program—from the computational point of view—that knew how to play chess like a master but knew nothing about graphics. The backend I executed was expecting an instruction like e4
meaning “move the white king pawn two squares ahead.” And it was supposed to reply e5
meaning “I moved the black king pawn two squares ahead.” If I had known that twenty years ago, I would have understood a little more the idea because it turned out GNU Chess did know a little bit about how to draw a board:
White (1) : e4
TimeLimit[0] = 0
TimeLimit[1] = 0
1. e4
black KQkq e3
r n b q k b n r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . P . . .
. . . . . . . .
P P P P . P P P
R N B Q K B N R
Thinking...
white KQkq e6
r n b q k b n r
p p p p . p p p
. . . . . . . .
. . . . p . . .
. . . . P . . .
. . . . . . . .
P P P P . P P P
R N B Q K B N R
My move is : e5
White (2) :
This separation allows—among other things—to leave the development of the interface to developers with a graphic design background, whilst leaving the engine under the control of the mathematically inclined. The frontend will be just a program that shows the board, and when the user moved the pawn, for example by dragging the mouse, the frontend would tell e5
to the backend. And after the computer made a move, the frontend would update the graphic board.
Not only does this way of programming allow to have different interfaces—say one with a 2D board, one with a 3D representation of the pieces, one running in a mobile phone, one running through a web interface, etc.—without having to change the chess engine at all, but it also substantially enhances scalability and extensibility. Say next year a new holographic technology appears in the market. The very same backend can be used to play against the computer by virtually “moving” an holographic representation of the aforementioned pawn. You get the picture, don’t you?
To further illustrate this point, let us consider the game of Blackjack of which I am a big fan. Indeed, I am writing this sentence right from Las Vegas.3
I wanted to study and understand the odds of the game when using different rules and playing strategies. And being myself closer to math than to graphical design, I started to write a free-as-in-freedom blackjack backend inspired in GNU Chess. I named it LibreBlackjack.4
So when a user runs the program, she is again welcomed with a somehow cryptic message just like I was in 1997:
Following GNU Chess again, we might play real-time ASCII-based blackjack from the terminal.
Nevertheless, the main objective of LibreBlackjack is to analyze and to understand the results of different playing and betting strategies, card counting methods and even different sets of rules.5 In order to do that one or more players ought to be coded in a high-level language—for example Perl, Python or even AWK—a couple of million hands to see what the outcome is.
Besides games and gambling, far more serious business such as engineering analysis can greatly benefit from this design basis. Actually, it is this philosophy that revolutionized the Internet in the late 1990s when cheap standard hardware was able to execute UNIX-based systems on servers that beat up the Microsoft approach both in performance and costs.
Back to engineering analysis, we still can find those mathematically inclined engineers on the one hand and the more practical and experience-based on the other one. Separating the backend from the frontend, we can have a complex computation engine with different interfaces for every different audience.
Seamplex’ approach involves the free and open engineering back-end software Fino that uses the finite element method to solve partial differential equations, particularly the mechanical stress analysis problem. Fino runs on top of the wasora framework and can handle
If this list makes no sense to you, that is great! Because CAEplex is a web-based frontend that presents a very simple interface that runs Fino in the cloud and presents the results directly in your browser, without needing to install any extra software.
The backend, Fino, can handle for example arbitrary temperature distributions, spatial dependence of the Young modulus and can compute integral or differential properties. It can even perform parametric and optimization computations. But if you do not need (yet) such complex endeavors, you can use CAEplex to get a result in (literally) less than one minute:
Moreover, using further ideas from the UNIX Philosophy you can obtain an engineering report in PDF—with your name, your logo and your description of the problem—in no time.
Client — How many tons will the crane hook you manufacture withstand?
You — This report says that with a load of 3 tons the material is at 40% of the yield strength.
I believe that many engineering processes—especially those associated with mechanical design–can be substantially improved by forgetting old paradigms we take for granted just like the tale of the five monkeys, the ladder, the banana and the water spray. At Seamplex we want to help engineers to solve problems—which is what we engineers do—in the best possible way.
Seamplex is a startup that wants to shift engineering paradigms by developing products and services based on the principles of free and open programming following the UNIX philosophy. We already have seen how chess and blackjack are tackled this way. Are you ready to tackle your mechanical designs with CAEplex?
Note that ENIAC means Electronic Numerical Integrator and Computer. So computers were definitely designed to compute, in particular to solve differential equations. How we ended using them to watch other people’s pictures on Facebook is an intriguing story.↩︎
UNIX hackers usually are very good at coining funny names using word games and employing jokes, but it seems they were not this time.↩︎
My lovely wife considered I could use three or four days in Vegas all by myself. I am deeply grateful with her for this tender gesture.↩︎
At first I wanted to name it “Free Blackjack” but if you Google (or better DuckDuckGo “Free Blackjack” you will end up in online casinos which refer to “Free” as free-as-in-free-beer. Let alone googling “Free BJ.”↩︎
In this trip a dealer at the Mirage stated that the “dealer must hit soft 17” rule is worse for the player than the “blackjack pays 6 to 5” instead of standing on all 17s and paying 3 to 2. If I had had my laptop with me, I would have proved him wrong.↩︎