Archive for the ‘Useless Rants’ Category

Tell me how you format output and I tell you what programming language you are

Friday, September 1st, 2023

Since K&R times it’s traditional to make a programming language print “Hello, world!” as the introduction to it. Recently I had a thought that formatting a number in output tells you the essentials of the programming language itself.

So if you want to print not just a constant string but, say, a number expanded to a certain length (e.g. printf("%4d\n", val);), how can you do it?

Essentially there are three major approaches: using WRITE with optional specifiers for each element, using one format string with arguments to follow and having just basic output with utilities to format elements using some pattern and string concatenation. And there’s C++.

The first approach can be found in the old venerable languages like FORTRAN or ALGOL. It is also somewhat funny that in Pascal its writeln() can’t be implemented in the language itself so the compiler has to convert it to a sequence of formatting and writes or string concatenations (exactly the third way). The same is true for Rust as well (which belongs to the second category) but at least println!() outright tells you that it’s not a normal function but rather a macro or a compiler plug-in.

The second approach even if not invented got popularised by C. You have a template string with recognizable percent signs to signal where arguments should be substituted and in what form. Of course this is not the safest approach since you may pass a template with not enough arguments and read garbage from the stack (and that’s not counting the dreaded %n). In the recent years another template format got popular (probably thanks to Python, with an influence from bash or PHP): instead of percent sign and type there are braces with an optional format arguments or variable name inside. Speaking of Python, you can use print with the old printf-style or new f-string formatting and it will put a newline at the end by default (reminding once again that Python is all about whitespaces). As for the implementation, in some languages it’s a built-in function (i.e. you can’t implement it in the language itself but the compiler/interpreter takes care of it), in C it’s implemented by parsing the stack more or less directly, in many modern languages variable-argument function simply passes those arguments as an array of the most generic object types (so you can implement something like printf() yourself). I think I can also mention here the third pattern format mostly used for formatting binary output—the one used in Perl pack() function (and whatever languages borrowed it), its syntax reminds me of the classic languages from the first category.

The third approach is too primitive so usually languages try to use some syntactic sugar to make it easier to use (see Pascal or Rust mentioned above). I should probably mention INTERCAL where outputting a single character might pose a challenge for an uninitiated but that’s part of the charm of the language.

And finally C++. In the original version of the language you were supposed to use cout << setw(4) << val << endl; and while it demonstrates the advantages of the operator overloading, in the same time it suffers from the extreme verbosity and side effects (that width modifier will be applied to all the following argument in all following prints until you change it). In the modern C++ you should use std::cout, std::setw() and std::endl() instead. As the result people mostly use printf() or some third-party formatting library (you may even get it with one of your string class implementations for free).

As you can see, the way you can print a formatted number (both the syntax and the implementation) can tell you a lot about the programming language in a rather short time. Of course there are exceptions but the lack of such functionality tells you at least about the kind of language you're dealing with.

A moral dilemma

Tuesday, August 22nd, 2023

Disclaimer: the question presented in this post does not affect me in any way but it’s still perplexing enough to make it public. Also please note I don’t mention names (neither of people nor software) as this post is not about shaming them.

As any other area of human activity, multimedia has its own share of, ahem, eccentric people that are obsessed a bit too much about their project. For example, there’s a guy who constantly informs the world about even the slightest advancements of his image codec with his own unique image quality metric. Theoretically it should be interesting but the author keeps ignoring the useful advice he gets (like making his code work with a different image size or explaining how his metric is better than the others) in hope that somebody else will get interested enough to fix that for him, as his lack of free time prevents him from doing anything but minor improvements to the code. Maybe it’s not the wisest approach but it does not harm anybody so good luck to him, maybe one day there will be a breakthrough and it will get at least a limited fame. But there’s another example that came to my attention recently, which is significantly more disturbing.

So there’s a certain codec that has niche popularity for its speed and decent compression ratio. Since it was proprietary and somewhat popular, a certain person (not me) has reverse-engineered it and added decoding support for the format to FFmpeg. The reaction from the creator was rather baffling at the time, it was like he felt the control of that codec was wrestled from him. Oh well, enough time has passed with no other issues arising. But last week the same person who REd the decoder announced about that he’s working on an opensource encoder for it, and that’s when the situation exploded. The format creator in a tone that I think is called passive-aggressive told that it’s essentially a stolen work and that it made him stop on a new version of the work. And what is significantly worse and greatly disturbing, his words sound like he got a depression from it or even suicidal thoughts. Even while I have reasons to believe that the encoder in question is going to be an original work (i.e. not a plagiarism; REing format to ensure compatibility is also permitted by the law in many countries) the possible consequences are still deeply disturbing, to say the least.

Thus several questions arise: what should be the best course of action to resolve situations like this one? Was an opensource implementation even for a decoder a mistake and should it be removed entirely? Should the author better communicate his wishes that there should be no alternative implementations whatsoever in the first place and should the others honour it if the product becomes too popular for its own good? Even if the law permits it, what about the morals?

I can only be happy for the fact that I’m not involved in it at all. In either case it would be nice to know the answers—and even nicer is they will never ever be useful.

P.S. Corporations are not people so do not try to project the situation to them. And if they feel offended their lawyers will tell you that (so far I think only N*llym*ser tried it).

P.P.S. If you think I also suffer from similar psychological issues—maybe you’re right, I’m not be eligible to judge. At least I do not try to force my stuff onto others, I don’t even post anything at public places except in this very easy to ignore blog.

On good russians

Monday, August 7th, 2023

As I mentioned in one of my previous posts on this topic, I consider russians to be rather a viral mindset than a nation: they don’t have clearly defined territory (as they consider they whole world to be it), they have no own culture (it’s either stolen or for-display set pieces that get no relation or acceptance with russians; well, you can argue that their widespread prison subculture is their own but how does that make things any better?), they lack human qualities like compassion required in this age (i.e. a millennium or two ago russians would be no different from many other nations but the times have changed), and the worst of all—they try to convert everything they come in contact with into russia (either by conquering the territories and committing cultural and actual genocide or by demanding that the other countries do everything their way because it’s too hard for russians to learn other country language and customs). And yet there are naïve people believing that there are “good” russians even that’s an oxymoron. Usually that comes from a belief that if russian say they’re against war and current government that implies they’re against other things as well. Here I’ll try to stratify russians by their empathy and activity:

  • plankton—like the namesake those russians have almost no will of their own and are merely flowing with the currents. If you ask them about their position, it will be more “for all good and against all bad” and they never take interest in politics. They’re always supporting the government but when it changes they’ll support the new government equally half-heartedly (just remember what happened in Rostov during the laughable coup attempt). The sad thing is that they’ll readily resort to violence if they’re permitted by the authorities. They have no compassion (there’s enough evidence how they’ll cheer to the war crimes their army commits and to the spectacle of the same war criminals dying as long as it’s a good show). Slave-owners and dictators may call them good but since I’m neither I can’t;
  • moths—those are almost the same as the previous category but they can have their own opinion not fully in line with the mainstream one and even—gasp—be against the government. The only problem is that they don’t act on their words, saying that they’re mere moths and can’t do anything. Of course they’ve never tried to find it out if they can actually do anything or not. For those I have only mild despise because they don’t deserve a strong emotion;
  • sell-outs—not originally russians but who became ones usually by being seduced with russian money. You might’ve heard about russian actors like Steven Seagal or Gérard Depardieu. There’s nothing wrong with coming to another country in pursuit of better work opportunities. But there’s a difference between selling your skills and selling your dignity and calling such people good is like calling a native advertisement a good article;
  • chameleons—those russians actually have a position, the problem is that it changes depending on circumstances and who asks about it. To give a concrete example, in the first days of February 24th some propagandists from russian television said to their friends that they wear their half-swastika symbols but mean it as a hidden support for Zelensky. Obviously they may voice support for anything but in reality they’re concerned only about their own well-being. Somebody not familiar with that feature may call them good, not knowing that the words they heard were empty, I call them disgusting;
  • white coats—that is a semi-official term for those who put themselves over the others like in the famous scene from Monty Python and the Holy Grail: —Must be a king. —Why? —He hasn’t got shit all over him (I vaguely remember a russian joke about somebody first spraying shit over others and then appearing in a clean white coat, that must be the origin). Such people pose themselves as morally superior to others, impartial judges and so on—forgetting they have no ground for that or trying to proactively evade the possible blame. As with the previous category, somebody naïve enough to believe their words without checking their background may believe they’re good but they should know better;
  • armchair Napoleons—those do not even try to hide their ambitions. In the “worst” case they want russian army to be better equipped and fighting (forgetting that russian traditions like stealing and corruption prevent it), in the “best” case they want russia to conquer all of the world. Or if it all fails they’re fine with russia nuking the rest of the world. You need to be a psychopath to call them good (again, search elsewhere);
  • and finally russians with human faces. Those pretend to be actual humans and often serve as an example of “good russians” in the West. In reality though sooner or later they show their real russian face. They might be against the current government but what are they going to do? There’s a post by some random russian that sums it up the best: “This regime will fall, Navalny will become a president and restore the country. And then we’ll get back at you, Ukrainians!” You can dismiss it as being just a single deviant voice, but in reality prominent figures from russian “opposition” demonstrated the same behaviour and chauvinism as the officials (like spreading the false claims about blown up Kakhovka HPP or not understanding why not everybody would like to interact with russians in general). To me it seems that they try to maintain the usual russian imperialism by keeping up ties with other countries (so when russia has more strength it can come there “in order to protect oppressed russian-speaking citizens”). So they’re about as good as telemarketers are your friends.

If you think this does not apply to somebody specific, try to get the honest answers for the following questions: are you against the current war? are you against the war just because it inconveniences your life (with sanctions and possible partial mobilisation)? do you think only the russian government is responsible for starting the war? do you think that russia should be held responsible for the war crimes it committed (e.g. paying reparations)? do you think that Crimea belongs to russia? do you think that russia should withdraw its forces from all occupied areas (Abkhazia, Armenia, Belarus, Ossetia, Syria) as well? do you think that something substantial should be done about russia in order not to make this scenario repeat again? do you consider the idea of dissolution of russia in order to make national republics acceptable? do you understand that russian writers often followed imperialistic agenda and thus other nations have reasons to ban their works? and finally, do you agree that russians are not superior to other nations? Hint: not all of those yes-no questions have “yes” as the right answer so you need to think before answering them.

russians usually give themselves away by starting to cry that Crimea is russian, always has been and giving it to Ukraine was a historical mistake as the existence of Ukraine itself. On the other hand, if somebody passes the test perfectly then probably you’re not dealing with a russian at all.

Meanwhile the only real good russians are mentioned in reports like this one:

NihAV: giving up on hardware acceleration

Thursday, August 3rd, 2023

After having several attempts on trying to add hardware-accelerated decoding support for NihAV I’m giving up, the reason being the sorry state of it in general.

I’m aware of two major APIs for hardware-accelerated video decoding for Linux, those are VDPAU and VA-API. Plus there are some specific toolkits e.g. from Intel but from what I remember those are even more complicated.

So, VDPAU has only bare-bone documentation without actual explanation what is expected for each codec in order to decode it. VA-API turned out to be even worse: it points out to 01.org for documentation which no longer exists (and redirects to some Intel’s page blurbing how great they are at open source). And web.archive.org shows that that page essentially contained a link to libva and libva-utils repositories plus some references to the projects that have VA-API support implemented. “…so shut up and go away” was not written but implied.

At least VA-API has three crates implementing its bindings in Rust and not just one not updated in four years like VDPAU but how usable are those? There’s FeV that seems to support JPEG decoding only (and has a strict warning against AMD GPUs), there’s libva-sys that is a pile of auto-generated bindings and there’s cros-libva. The latter seems to be the cleanest one and most actively developed (too actively developed to my taste as it changes base APIs every couple of months). Unfortunately it’s still not exactly clear how to use it for H.264 decoding (and the cros-codecs crate provides equally confusing API). And the final straw is that it seems to be intended for single-thread use only by design, which means it’s not possible to use with my library (e.g. my player uses separate threads for audio and video decoding, so I can’t use the standard decoder interface for hardware-accelerated decoding without some ugly hacks).

Oh well, I’ll work on improving my own H.264 decoder performance—while it’s not much fun either at least it’s clear what I can do with it and how it can be done.

P.S. This reminds me of the situation with ALSA. From what I heard it’s one of the worst documented subsystems in Linux with too flexible interface, to the point that it took help from ALSA developers to make at least MPlayer support ALSA output. The most probable reason is that it’s common to smoke weed in Czechia (where ALSA was developed), but what is the excuse for the other libraries?

Why I work on NihAV

Sunday, July 30th, 2023

I started NihAV as a more or less toy project to play with different concepts and try new stuff like finding out how vector quantisation works or attempting to write an encoder. Having enough experience with libavcodec and libavformat, I did not want to touch them again (and still don’t) and there was a hope that rust-av will provide a viable albeit limited alternative for multimedia playback (it still hasn’t). In theory I’ve achieved my original goals—NihAV supports decoding a lot of exotic formats (some of which are not handled by any other open-source project), it even has some encoders and its own transcoder tool and there’s even two players (one for audio files, another one can also play videos). So I could relax and do something else entirely but yet I’m working on adding new features to NihAV that take a lot of effort and do not bring me joy. Why?

(more…)

Simple things

Thursday, July 20th, 2023

Simple things are usually the hardest to accept and follow. Here I’ll list the things considering the current situation and we’ll see how those will be understood by the world:

  1. There’s currently a world war going on. The definition of world war concerns mostly not the number of countries involved but rather that the goals of war (or its consequences) affect the world order in general. In this case if russia wins it means that the old system built on respecting country sovereignty and resolving international conflicts in peaceful manner via Useless Nations (formerly United Nations) does not work and any country with the nukes can do whatever it likes. And when the temporarily existing despicable mistake known as russia will lose the war, this may lead to its dissolution as well as making entities like UN and NATO reform or perish. And it’ll impact the future of China too;
  2. russia has demonstrated that it is a terrorist state countless times (trying to disrupt the world order by force is the very definition of international terrorism), but in addition to that it demonstrates that it’s not above the economic blackmailing as well. Just look at the recent development of the grain deal—it did not merely stop participating in it until its simple demand of fulfilling its countless demands is met but also started missile strikes at Ukrainian ports (again) and threatening to start a war with the countries that will keep participating in the grain deal without russia. And of course spewing obvious lies instead of saying directly that it’s racketeering;
  3. People who commit such crimes are either arrested and isolated in prisons or executed, so they can bring no harm to the society. Armed people (especially if they’re shooting during the arrest) are often shot on spot to eliminate the immediate danger (that’s not the best outcome but it’s an acceptable one). Countries should have the same treatment, out of self-preservation if not anything else (and stop point at nukes, russia demonstrated that it poses more nuclear threat when nothing is done about it);
  4. Speaking of isolation, it should be maintained airtight instead of trying to earn money while hoping that whatever russia does with your resources won’t be used against you later. I’m not so sure about the business risks of (usually French) companies that still have their russian subsidiaries operating as usual but if they suffer from the reputational losses in Europe and their businesses would be confiscated in russia, that would be a completely foreseen outcome. Also considering the current isolation and slow implosion of russian economy, it’s hard to tell what good the income earned there can bring (as you can’t transfer those money from russia and there’s risk of losing them entirely);
  5. When NATO talks about eliminating corruption as one of the demands for the candidates, it should serve an example and do something about the glaring example of Hungary. EU should take note as well.

Again, those are very simple things to understand but apparently not for the countries or large businesses. For now though, I find it ironic that I could travel with less restrictions and was significantly less ashamed of my country (and even its government) when I had Ukrainian citizenship than now when I’m a German citizen.

What optimisation possibilities I miss in Rust

Friday, June 23rd, 2023

Since a certain friend of mine keeps asking what features I need in Rust and then forgets the answer, here I decided to write it all down. Hopefully it will become outdated sooner than later.

And I’d like to start with some explanations and conditions. I develop a certain multimedia project so I have certain common flows (e.g. processing 16×16 macroblocks in a frame) and I’d like to be able to optimise for them. Also I do not like to use the nightly/unstable version of Rust (as those unstable features may take an extremely long time to hit stable and they change in the process, as it happened to asm!{} support to give one example). And finally I do not accept the answer “there’s a crate X for that”—out of design considerations I prefer to avoid external dependencies (short explanation: those get out of control fast; my encoder and player projects depend only on my own crates for doing everything but the player additionally pulls sdl2 dependency and suddenly it’s 33 crates instead of 19; IIRC with a newer version of sdl2 crate the total number gets to fifty).

Anyway, here are the features I miss with some explanations why that should be relevant probably not just to me.
(more…)

On the origins of ruscism

Wednesday, May 17th, 2023

A couple of weeks ago Ukrainian parliament has finally recognized this term on the official level and listed several telltale signs of it. But in my opinion they can be boiled down to two main actions: disregarding the laws, agreements and traditions (if some suckers believe in those—then it’s just easier to swindle them) and constantly lying, often in an unconvincing way and usually by attributing own deficiencies to somebody else. They’ve been behaving like that throughout their history (which is partly stolen and partly fictitious), the wars just make it more visible. So, why russians behave like that?

Fascism and Nazism grow to power using the support of the second-worst kind of people: people who feel offended or wronged and do not think for themselves. That sort of folks would never blame themselves for their own faults and will gladly follow a leader who has simple answers to questions like who’s guilty and what to do (those answers are usually “that certain group of people” and “unite around me and do what I tell”). In case of ruscism, I believe it’s not merely an ideology that unites the nation but rather the idea that defines this entity (you’ll see why I don’t consider them a nation soon).

One researcher described russians as a dynamic community where everybody can belong to it or fall from it depending on circumstances (or rather benefits it gives: if I need something from you then you’re my brother, if you need something from me then I don’t know you). From this a rather obvious conclusion follows: russians have failed to develop as a nation—even small tribes usually have clear definition of who belongs to them and who are outsiders—and it must be something immaterial uniting them (i.e. an idea). Nations have not merely clearly defined rules of belonging but also clearly defined territory (no matter if it’s the historical settlement are or pieces of land wrestled from somebody else)—russians claim that russia has no borders and that any territory where a russian has been is a part of russia (IIRC just last year some russian dropped a piece of dirt on Dubai beach and claimed that now it’s all russian soil; I’ve encountered many more examples where common russians believed that some place is russian because they’ve been there).

If you look at the real russian history, it starts with the principality of Suzdal, created on the territories inhabited mostly by Finnic and Ugrian people, conquered by the Golden Horde and after its fall proclaiming itself a legitimate successor and capturing other lands (usually not inhabited by Slavic people either) and yet they tried to turn this multi-ethnic mix into “russians”, partially succeeding at that. Last year the russian führer made a speech that he belongs to all nationalities living in russia—what has not been said is that all those nations are russian only as long as they’re going to war, if they try to move to moscow they’ll be greeted with the traditional “go back to your shithole you non-russian hick” (but if they die at war they’ll be called as “true russian heroes” anyway).

It is hard to define the idea that unites them though. It is not a religion since the original pagan beliefs were replaced by the state-controlled Christian church (unlike many countries where the Church was an independent powerful player, in russia it was created by the state—two or three times even—always to serve the state interests). It is not the idea of exclusivity: such ideas are usually created to support the nation while in russia it’s mostly used to sacrifice russians for that very idea. There’s a difference “you’re the best so everything belongs to you, you just need to go and take it” and “you’re the best so keep living in shit until you’re sent to die for defending that belief somewhere abroad”. Sure, a deep spirituality of russian people is usually mentioned in connection to that but no concrete examples are ever given.

You know, there exists such thing as russian nationalists whose ideas can be boiled down to “russians are being offended; and usually it’s Britain that offends them by acting as a puppeteer of russian government since long ago”. Even funnier that until very recently they were prosecuted by the government—I suppose not for the incompatibility of views but rather because they formed those views independently instead of following the official guidelines.

I propose a different explanation: because of the vague dynamic community russians lost incentive to work themselves (a lot like with socialistic system: why bother if everybody around belong to the same community and you can benefit from them working while not benefiting from working hard yourself? See kulak for an example of russian peasants who worked slightly better than the rest and what happened to them; russian national symbol should’ve been a crab bucket instead), in the same time they believed they can take anything because they all belong to the same community. And the refusal offends them. The same story with them believing that whatever they sell or give as a gift still belongs to them (so they can always take it back or tell what you can do or not with it). That may also be the reason behind russians ignoring all kinds of agreements—they’ve been trained only to recognize “might makes right” rule. Yet it does not prevent them from trying to take what belongs to somebody else again and again (like Ukraine). Why don’t they stop attempts? Because they essentially live off selling natural resources (back in the day it was wax, fat and furs, nowadays it’s oil, gas and metals) and they need somebody to actually mine those resources (usually foreigners) and when the old sources get depleted of course they want to capture a new source of income.

Now consider what happens when such creature feels that everything should belong to it and denied those things, feels that others are more developed in many aspects (not just, say, advanced electronics, but having a functioning society too), feels that others have no respect for them (the archetypical question of a drunk russian is “do you respect me?” hints on it)? You’ll get a gamut of emotions, from the desire to present themselves as much better than in reality to drag others down by attributing them all your own bad features. That is how we get claims that Europe will freeze without russian gas (even in summer—they really claimed that), the claims about famous russian culture (it was created by a small strata of elites, often not of russian origin; for the most of russian population their own culture remained alien and forced from above; russians love to present exceptional cases as the general rule), the claims about Western level of quality of life (in moscow—do not look at the rural area that lacks gas, sewer system and roads) and evil godless Westerners want to occupy and destroy them (they’ve looked in the mirror while creating this lie).

And that’s how we get ruscism: psychological complexes of something not deserving to be called a nation, which realizes and resents that. Throw in their sociopathic disregard for honouring agreements (nothing demonstrates it better than the Budapest Memorandum but they’ve been inventing pretexts or outright violated international treaties for centuries) and the lack of thinking (critical or otherwise—there are countless examples that the discussions with common russians fail because those accept ideas selectively and refuse to see connections between different facts) and you get the perfect mix for disaster.

The sad thing is that all russians are infected by it in one form or another. Some may demand nuclear holocaust for all countries that do not ally with them, others merely cheer at the news of russian war criminals killing civilians. Some want russia to conquer the whole world (or at least restore its borders to the times of USSR or russian empire), others simply want russia to end war and not get punished for all its war crimes. Some want to destroy USA, others believe that USA will collapse soon anyway (and they all secretly want to move there regardless). Some hate all other nations, others don’t (but still despise Jews, people from Asia and Caucasus).

I think now it’s more or less clear what the idea unites russians and creates ruscism: russians are those who cast away thinking for a feeling of inferiority. Now, what to do with all that? The realistic way is demonstrated by the Ukrainian Army: over two hundred thousand russians will no longer force their opinions onto others. In theory occupation and re-education might work—it worked for Japan which behaved rather similarly in 20th century—but considering the sheer area of russia and the lack of interest I doubt that even China will attempt it. Meanwhile the best you can do is not to listen to russians at all and check the information you get. Keep thinking, that’s what distinguishes a normal human from russian.

Staying neutral

Friday, March 31st, 2023

I hate these filthy Neutrals, Kif. With enemies, you know where they stand but with Neutrals, who knows? It sickens me.

Back in the day this quote from Futurama could be seen only at its face value: something only a paranoid jingoistic moron would say. Nowadays we see how the organisations and countries with neutral status use it mostly as an excuse to avoid responsibility for their acts.

Let’s start with various international organisations. Various international sports federations and the IOC say they’re outside politics and welcome money participants from all countries. All while forgetting that accepting participants from the countries that violate their principles of fair sportsmanship is going against those principles (“to oppose any political or commercial abuse of sport” from the Olympic Charter sounds especially ironic). And we have the ICRC that is in theory should act as a neutral mediator between fighting parties. In practice it has destroyed its reputation by not willing to organise anything for Ukraine (I can understand that they could not organise green corridors for Ukrainians because russians were against that but not performing their duties by visiting Ukrainian POWs in russia and essentially participating in war crimes by supporting russian deportation centres—that I cannot neither understand nor forgive). I suspect than in both cases corruption is at play: a dictatorship can always offer money or “gifts” that law-abiding democratic countries can’t.

And of course there’s Useless Nations organisation (still officially called United Nations by mistake). Considering how russia ignores its General Assembly decisions without any repercussions one should wonder about its usefulness already. And then they (as well as certain other international organisations “for all good against everything bad”) release reports blaming both parties: russia for aggression and Ukraine for defending itself. Including the latest scandal with russian “orthodox” church (FSB patriarchy)—it does not matter that in every church and monastery in Ukraine they occupy (in both senses) there were found stashes of russian propaganda, weapons and often russian agents in hiding; it does not matter how the church officials and lower clergy still repeat russian propaganda theses and act against Ukraine—the church is obviously a neutral organisation and should be treated as such.

On the same note, even individuals who repeat the same things about how both parties are wrong and you should stay neutral invoke only disgust in me. In the best case they’re idiots who listen to russian propaganda, in the worst case they’re narcissists who believe only they can be right and the rest of the world is stupid and wrong (place the current Pope into a category you see fit).

Now to the countries with neutral or “neutral” status. Often such country stays neutral because it is too small and cannot afford to anger its neighbours. The classic example of that would be Switzerland (just ignore its army regularly invading Liechtenstein during trainings), Sweden or Israel. Finland remained neutral for a sadder reason: it found out how useless were those alliances for defending it against Soviet aggression (similarly there was a joke in the beginning on 2022 that if russia would invade Poland or Estonia then NATO would react by excluding that country from the alliance). And we also see “neutral” Hungary and China. Let’s take a closer look at all those countries.

Switzerland started out as a small poor country that had fears of being invaded by its stronger neighbours—which happened only once, in Napoleon times (and because of their connections Swiss ended up with more territory when the war was over; those who try to mention Austrian invasion should look first who those Habsburgs were). Nevertheless they decided to remain heavily armed neutrals so that they don’t get involved in wars themselves and when an invader comes a good deal of the population will fight those armies in the mountains (having mountains is a good bonus to defence indeed). That’s why they have the law against transferring their weapons and munitions to the countries in the state of war (I can respect that. Update: after reading this article I’m inclined to re-evaluate their neutrality as to “do whatever we want as long as it does not anger powerful countries much”). In the same time they used their neutral status to conduct unscrupulous trade with all countries of the world (especially during WWII) and to get a reputation of a banking safe haven. But thanks to the pressure from the USA and various data leaks from its own banks it is no longer so. Hopefully in the future the country will survive and prosper on its high-tech chocolate industry and other respectable businesses instead of keeping stolen goods and money from dictators all around the world (just see this list to understand why one of their major banks went belly-up and may take another one with it).

And now to Israel. This is somehow an inverted Switzerland—a unitary state created more or less as a safe haven for a certain nation, it has constant tensions with its neighbours but remains neutral because it does not want its citizens (and potential ones) living in other countries to be harmed (a noble goal really). So in the beginning of the war they remained neutral because they did not want russia to get vengeful and supply a neighbouring terrorist state with something that will harm Israel. russia responded to this with various anti-Semitic statements and actions (read about the Sokhnut court case) and went to arm Iran anyway. Also it helps that the current government is very pro-russian and acts in rather russian ways (see their recent laws and the heavily-opposed legal reform; just another case why you should not have politicians serve indefinitely long terms). Here the neutral status is used to evade certain actions and also to evade responsibility for the other actions. Though the way it goes either the current government will be kicked out or they’ll lose international support.

Let’s move to really neutral countries like Sweden. In XX century it let Norway free after it decided to dissolve the union and the only war-like act during WWI was occupation of Åland that was more of a territorial dispute that was settled more or less peacefully (between Sweden and Finland, the other parties involved were not so nice). During WWII Sweden had to yield to pressure from Germany (like letting its troops pass through Northern Sweden—which those troops regretted doing) but in general it remained neutral because of its usefulness (like the iron ore and products from it) that would be lost in case of occupation. The current war made Sweden reconsider their position and it has finally applied for NATO membership.

And now for another NATO applicant, Finland. It has been suffering from the same problem as Ukraine—bordering with russia. In the first half of XX century it had been constantly struggling to keep its territory and sovereignty from Soviet Union (and the League of Nations proved out to be as useful as UN now, only Sweden and Norway helped it at that time plus some political manoeuvring). That’s why after 1945 it remained neutral but the recent events proved that if you border with russia and you’re not large enough then russia will try to occupy you. So Finland reconsidered its status as well.

Temporarily Occupied West Taiwan (or China for short) is a country that declares itself to be neutral while it semi-openly supports russia (and does not do that in the open because of the fear of sanctions). To which russia repays with its usual ingratitude: just three days after Xi Jinping visited it and had his roadmap for peace accepted there there’s a claim that they’ll go against it by threatening the world with their nukes and nuclear proliferation. This is a poster case of neutrality used as an excuse to do whatever they want since they’re not restricted by some political alliance.

And finally there’s a country that conveniently forgets about its treaties and alliances and proclaims itself neutral to do business with sanctioned countries. Of course I’m talking about Hungary. It’s the country that constantly blocks EU and NATO decisions either because it was paid for that (that’s why the amount of EU sanctions against russian oligarchs and entities is much lower than it should be) or because they want to have a bargaining chip (EU sanctions and other unanimous decisions again and blocking NATO membership for Finland, Sweden and Ukraine are good examples of that). And when I said they forget about previous treaties at their convenience I meant their claims about increasing trade with Iran (despite EU sanctions) or not honouring the indictments from the International Criminal Court because the (signed and ratified) Rome Statute “is not integrated into our legal system”. I believe somebody should help them become truly neutral by kicking them out from both EU and NATO. In the recent news though it’s reported that russia has added them to their list of unfriendly countries. Looks like there’s a common pattern in dealing with russia.

I probably should’ve mentioned Austria here as it was made a neutral country after 1945 but considering how it turned into serving russian interests I don’t see it showing any new aspects of “neutrality” and thus contributing to the discussion.

In conclusion I want to say that there are three different kinds of neutrality that different countries (organisations, people) often mix and pass for another kind: “don’t touch me” neutrality, “I can do whatever I want” neutrality and “you can’t make me do it” neutrality. The first kind is essentially a country staying aside and remaining not involved in any wars so that other countries do not have a reason to invade it either; sadly this works well only for countries with good defence (and not for Ukraine). The second kind is when you claim to be neutral in order not to have any restrictions on dealing with all other possible parties (it works only so well as you can withstand sanctions and pressure i.e. China has better chances doing that than Switzerland). The third kind is complementary to the second kind and the same reasoning applies.

So next time you hear claims about somebody or something staying neutral and not wanting to leave anybody or anything behind, ask yourself about the real goal of that neutrality (hint: there are dirty money involved quite often in this case).

The disturbing similarities between France and russia

Saturday, March 11th, 2023

Dedicated to yet another piece of news about French company deciding to increase its business presence in russia instead of leaving the “market”.

In general I enjoy learning a bit about various foreign languages but I never had a desire to learn French language and when asked why I always answered that I know russian language already. But with the time I saw many more common things between France and russia than their language policy. This year of 1939 (will it end already?) brought even more examples of russia behaving like France and the French Empire(s) of old. Which makes me wonder if it is a certain type of country and what makes it such.

To me it looks the root of all problems is that both countries grew too large in territory, incorporating different nations in the process and relying too much on the central power (come to think about it, Temporarily Occupied West Taiwan comes to mind as well). The only way they could keep it going was to create “single nation”, by means of the cultural or physical genocide if required, and stealing the history while at it.

Below I’ll try to group things that are similar in the both countries by category.

History.

Both countries originated as the outskirts of some larger country that were overrun by the invaders. As the result they ended up as something semi-fictional: why do you think territory formerly known as Gallia (and proud of Galls) is called after some Bavarians (and IIRC it even had a war with them over the name, so one ended as France and another one as Franconia)? Similarly why a country in a place originally inhabited by Finno-Ugric people, where only the nobility was of Slavic origin (with their blood heavily diluted by Mongols) would boast their completely Slavic lineage (forgetting about all those Finno-Ugric, Turkic and Caucasian nations living on the majority of its territory)? And of course both countries claimed the title of the One True Heir of Roman Empire. Let’s skip most of the Medieval history, remarking only such details as St. Bartholomew’s Day massacre and the genocide of Novgorod Republic, and move to the more modern days. The French Revolution (the first and most famous one)—and the revolutionary terror of course—set the standard of how to do such things (which russia copied later). It’s worth noting that for the majority of XXth century France and russia remained friends: first the Entente, after WWII France willingly returned to the Soviet Union people who fled russia even before USSR was created (or it was russian territory at all), then (after France decided to leave NATO) Soviet-French friendship prospered (to the point possible by the foundational principles of Soviet Union), even now the French president tries hard to be russian advocate (the same can be said about Germany but despite some common things the countries were not similar throughout the majority of the history).

Country structure.

I notice that both countries occupy a large territory but despite that a significant part of the population lives in the metropolitan area of the capital: about one fifth for France, and one seventh for russia (for comparison, for Germany, Ukraine or Kazakhstan those numbers are below one tenth). Additionally the capitals in both countries are considered to be the only place to live (in case of russia their former capital is regarded in the same way too) and locals (whose ancestors probably lived far away from that capital) sneeze down at all those newcomers who don’t live in the capital and don’t speak the capital dialect either. Then there’s the whole question of the empire…

The main difference here is that russia was never good at maintaining overseas colonies (Fort Ross and Alaska were sold and the pirate nest of Septinsular Republic could not be hold) so it resorted to occupying and controlling neighbouring countries. For example, during Soviet times Mongolia was controlled by the Irkutsk division of The Party. Maybe that’s why they always wanted more oceanic ports.

France, on the other hand, had its colonies all around the world and keeps some of them under the name of overseas departments. For more exquisite things there’s Andorra. And of course there are “military advisors” in various African countries (former French colonies by coincidence). Now that France does not want or can’t maintain its presence, those are withdrawn and are usually replaced by the troops of the infamous russian military company (hopefully it’ll find its end at Bakhmut soon).

And finally, if you think that russia is the only country that tried to create puppet republics in Europe in order to annex them later you’d be wrong. When in 1945 several countries agreed to occupy parts of Germany in order to make it a decent civilised country, USSR almost immediately made its zone of responsibility into a socialistic puppet state that had been the best friends to its end and even after that (see Angela Merkel). France, meanwhile, tried to pull a similar trick with Saarland. They tried to convert Saar Protectorate into a puppet People’s Republic of Saarland but (since they could not falsify elections) the result was unfavourable for them and in 1957 Saarland joined Germany for good. Considering how Saarland plays about the same role as Donetsk and Luhansk regions in Ukraine it’s hard not to see parallels to russia’s actions in 2014 and 2018.

Language and cultural policies.

Here I’m not going to talk about the influence of the for-export version of the country culture (writers, composers, ballet and so on) on other nations but rather what they did inside their own territory.

I observe the same approach: cultural genocide and forcing the One True Language. russia did that to many of its colonised nations, see Ems decree as one of such example (I’ve been there recently BTW and spat and the bust of Alexander II installed in the local park). Nobody talks about France in this aspect but it did rather well to eliminate Occitan and Basque languages from its territory (and if you think what Basques have to do with it—learn about the history of Gascony fist). Similarly it forced French as the first language in the schools—unlike, say, British Empire where people could learn their native language first and English later. As the result many people from “former” French colonies speak perfect French while people from British Commonwealth have all kinds of accents and dialects.

Of course (in both countries) you have language chauvinism extended past beyond that when they refuse to learn and speak the language of any other country (one philologist who emigrated from USSR once said that the purpose of studying foreign languages there was mostly to incite hate to that language). And now both countries have laws for protecting their language purity against foreign influences too.

Another aspect of such language chauvinism is demanding to support their language on the state level (you might’ve heard about the situation in Canada where exists essentially a language police from a certain province that checks that all inscriptions in this predominantly English-speaking country have translations in French next to it in the same size; and of course even the most liberal russians demand the same from any country they take residence in).

And the last thing about the language is its writing complexity. By that I mean the fact that there’s not a very strong connection between the way the words are written and spoken (to the point where sometimes you need to know the context in order to pronounce the word properly). And reforms are often met with hard resistance (see France, 2016 or russia, 1918) probably because they cherish the elite status of the language and do not want to make it more available to the common folk. There are other languages with similar characteristics, but in case of English it was essentially arbitrarily picked from various dialects (of several languages) for printing convenience (i.e. it was not something forced by a government) and people curse William Caxton to this day; in case of Chinese it’s used to hide the fact that different parts of the country speak different languages so if they don’t write in the same way they would be completely disconnected (which goes against the imperial narrative of a single Han nation); in case of Japanese it’s mostly a consequence of adapting Chinese writing system for their language that is built on very different principles (it has a completely different grammar and mostly different lexis even if it has a good share of Chinese loanwords); and Hebrew as a Semitic language has little regard for vowels so they’re omitted where possible and usually indicated in full only in the texts for children and the religious texts. In either case it’s not done just to make scribes feel more important.

I could also mention how they all like to overlook the fact that a good deal of their famous people and inventions have a different origin (starting with that guy from freshly conquered Italian territory by the name of Napoleone Buonaparte or the famous russian explorer from Danemark Vitus Bering) but IMO that’s pretty normal when you’re building a unified empire based on a single culture forced onto everybody as the mean of unification. A certain country in the East comes to mind as well with its Uyghur re-education camps.

And when I talk about cultural genocide I mean not only forcing the master language and culture onto the colonised nations but also destroying (or at least hiding) the remnants of native civilisation so that the nations won’t get wrong ideas. In Soviet Union the representatives of state security always accompanied archaeological expeditions and denied publishing the findings if they were contradicting the state narratives (for example, the real age of Trypillia or Carpathian settlements as they undermined the narrative about russians being the oldest nation). Similarly I read a story over two decades ago that in French Indochina the explorers discovered an impressive city or temple complex (was it Angkor Wat?) that was kept in obscurity so it would not inspire any national liberation movements and it was effectively rediscovered in 1960s or so.

Cruelty.

Here’s a quote from Mark Twain:

Yet even France rose at last — and would have retired to its warren again quite contented with a cuff and a bonbon if the foolish King had offered them, but it was not his style to do the needful thing at the needful time, so the chance went by. Then the nation cast its rabbit skin and put on its other national garment, the tiger skin; being closely pressed by Europe in arms, it went a step further and asserted its manhood, and was doubtless surprised to find how much it had of it. Napoleon, the great foreigner, brought the people’s soldiership up to the last summit of perfection; and when he got ready he dressed the nation in their rabbit skins again and put his foot on their necks, and they glorified him for it. Napoleon III accommodated them in the same way, to their vast satisfaction.

The same largely applies to russians as well: they never had real uprisings against the sovereign, only protests addressed to him (the only real uprisings were started by other nations, like Ukrainians or Bashkorts) but when they were allowed to display their repressed feelings we got East Prussia in 1945 or Yahidne, Mariupol’ or Izyum this year. And if you look at russians they’re meekly going to war if they can’t avoid it and their relatives blame Ukraine for their subsequent deaths (instead of the führer who sent them there to die).

And if you look at what historical figures russians worship and despise, they mostly worship tyrants who oppressed them and wasted them in countless wars and despise rulers who tried to have more peaceful and liberal politics (because it was usually a sign of them being weak). I don’t know much about the French but considering the Penguin Island novel I expect about the same. At least nowadays they have strikes to vent off their negative feelings…

Conclusions

As I mentioned in the beginning, I suspect there’s a reason why both countries have acted similarly throughout the ages. Maybe it was the absolute power of the monarch and the abundance of initial territories, maybe it was something else. For example, British Empire grew up a lot thanks to the private initiative (names like Cecil Rhodes or East India Company come to mind immediately); USA (with such “unincorporated territories” as Puerto Rico or American Samoa) seem to retain its satellites a lot thanks to the fact that it’s better to be part of USA and get involved in its economic processes—and for the rest there’s U.S. Navy (which reminds me a lot of Roman Empire). With russia it was the opposite—the conquered countries tried hard to get independent from it (all of the Baltic states immediately and Ukraine, even if it took it more years after 1991 to realize why). French colonies are known to have been treated some of the worst (not as bad as Belgian king’s and later simply Belgian Congo though)—Haiti is the poorest country of Americas and I urge you to compare how many of the world poorest countries are former French colonies.

So it is no wonder that the countries with similar mindset would keep doing business together as long as the public opinion permits. At least France seems to improve albeit slowly while I see only two realistic ways for russia—balkanisation or turning into another North Korea. In either case maybe the future historians will explain what was wrong with both countries and why they went different ways eventually.