LOLWUT: a work of art in the team of BD
Author - Salvatore Sanfilippo aka antirez, one of the main DB developers Redis, employee of Redis Labs. The article was published on September 1? 2018
The last few days were very tense. One of the arguments in the dispute about replacing or not replacing the words used in the Redis replication code was: is it worth doing a job that does not give any technological result?
[Речь о замене терминов «хозяин/раб» при репликации — прим. пер.]
In the process of cleaning the Redis source from a certain word, where possible, I thought that I like writing code even without measurable technological effects. Replacing words is too routine work, it's just annoying, even if there are decent technological problems along the way. But there is another kind of code with a special quality, which I would call "hack value". He can not solve any problem, but still it's a worthy task. There are several reasons. Sometimes the process of writing code is useful in itself. Sometimes technically advanced ideas are used to solve not the most important problem. And sometimes the code is written simply for aesthetic reasons.
Schotter from Georg Neiss . The author wrote in ALGOL a program for a plotter that generated works of art using chaos (random numbers).
[Постепенно стройные фигуры на картине становятся всё более хаотичными — и наоборот, хаос планомерно упорядочиваются в организованную структуру, если повернуть картину на 180° — прим. пер.]
. This gravel is magnificent in its simplicity and deep meaning, which the viewer can understand. Under the cover of complete tranquility, deep inside the order lies havoc. If you turn the picture upside down, it looks like the sea during a storm. On the surface raging chaos, but in the depths the sea remains calm.
Is it possible to turn a work of art into a database team? This is quite difficult, because Redis is mostly used from the command line. In our time, the console is more sophisticated than in the past, but it's difficult to display decent graphics. On the other hand, we have a huge advantage of real-time computing - the picture can become dynamic and change with each generation.
Before I continue, I'll show you the final result:
Let and in very low resolution, but the original idea is preserved. Here I applied a trick that uses many programs that show different interesting things in a text console. The first part of the solution is to use the Braille font in Unicode to generate a pixel matrix with a higher resolution than the individual characters of the console. In particular, for each character you can make a grid size of 2 × 8 pixels.
The second part is the parameters for the picture:
You can generate multiple versions of the picture, changing the number of squares and the output resolution. Finally, I wanted to write the source code as an example of literate programming - in a form that more closely resembles a textbook with a detailed description of each step, and not just a generator in the form of a black box. The code lies here .
Starting with Redis ? the LOLWUT command will become standard. In each new major version, its functionality will change completely. Only the set of rules remains unchanged:
She can not do anything useful.
It should work quickly so that it can be safely invoked on servers in production.
The result should be interesting in some way.
The first version I wrote for Redis 5. In the next version, I'll ask someone else from the developers of Redis who wants to, otherwise I'll write myself (I hope I do not have to do it). The LOLWUT team should remind us that our work - programming - exists not only for good. Initially, it was mainly about studying opportunities . I hope that LOLWUT will also remind the Redis community that computers are created for people, and that one can not argue sterilely, only thinking about technological consequences. There are living people who use systems that build systems and so on.
It may be interesting
visit this site
visit this site
visit this site
Pleasant data, significant and magnificent plan, as offer great stuff with smart thoughts and ideas, bunches of incredible data and motivation, the two of which I need, on account of offer such an accommodating data here.