XeTeX Redux

Published at 23:22 on 27 October 2023

It is a known bug. The workaround is to use fontspec to invoke the feature manually, e.g.:

\fontspec{Baskerville}[Renderer=OpenType, RawFeature={+smcp;-liga}]

Ligature substitution should be disabled when using small caps because the two features tend to be incompatible.

Python Set for World Domination?

Published at 18:03 on 22 October 2023

Python is already sitting at the top of the TIOBE Index of most popular programming languages, and has been for some time. And no wonder: it’s one of the best ones out there.

One big thing that stops it from being close to the best is that it has difficulty walking and chewing gum at the same time. In one project, this caused me no small amount of pain. It’s part of the reason I have used the Java virtual machine (usually via Kotlin, which is a more modern language than Java) on some of my projects.

Over the years, there have been numerous proposals to remove the global interpreter lock (GIL) from Python. These have generally gone nowhere, with the exception of the existence of Python versions that target the Java virtual machine and the .NET common language runtime*. There are a number of valid reasons for this.

But now, there is a very serious proposal to remove the GIL from the reference implementation, and the Python Steering Committee has indicated they will almost certainly accept it.

Once this happens, expect Python’s dominance to increase further.

* Alas, these implementations tend to lag (sometimes seriously) behind the reference implementation, plus they are not compatible with many of the third-party Python libraries out there. (The latter issue is also why it has been so difficult to remove the GIL, as doing so in ways that are both a) not ruinously inefficient and b) compatible with existing libraries has proven exceptionally difficult.)

XeTeX (Modern TeX) Disappoints

Published at 15:27 on 21 October 2023

I held considerable hope for XeTeX (the modern-day TeX). Alas, while arguably better than Groff, it still leaves a lot to be desired in the font department.

Namely, while it can indeed load and use the same standard system fonts that all other programs can (a big win over classic TeX), its support for OpenType font features is quite limited and lacking. For instance, small capitals don’t work. I have tried to use them multiple ways, including directly via RawFeature=+smcp, and either nothing happens and I get normal mixed case, or I get a complaint that Font shape `TU/Baskerville(0)/m/sc' undefined and again I get normal mixed case.

I know the smcp (i.e. set lowercase input in small caps) feature is present in the font I am using, because I can use it from Libre Office. Apparently, XeTeX just doesn’t get enough use for this sort of thing to get adequately exercised. At this stage, I’m getting to the point of writing the TeX family of text formatters off as hopelessly yesteryear.

The feature works in some other fonts I have installed, so apparently it’s a bug that only affects certain cases. Unfortunately, one of those cases is in the font I most wish to use for this project.

And yes, I know I could extract the small caps myself and create an .otf file whose lowercase is small caps, and load that font. Well, eff that. Not having to do such awkward hackery was my whole motive for installing XeTeX in the first place. If you say your tool supports standard font files, it should support the standard features in those files directly.

It’s a disappointment, as the well-documented plain-text input of formatters like Groff and LaTeX make them quite useful for formatting automatically-generated output. Modern font support has long been, and apparently continues to be, their Achilles’ heel.

More Bits of Evidence in Favor of My Departure

Published at 09:31 on 19 October 2023

The generally shambolic nature of the organization that is my soon-to-be ex-employer is best exemplified by two of their actions in the 24 hours since I submitted a letter of resignation.

Something They Did Not Do

They did not thank me for my advance notice, announce they were dismissing me immediately with severance pay equal to the amount of time between Tuesday and my stated departure day, relieve me of the building access card they had furnished me, and then proceed to escort me from the building. This is actually standard procedure at many high tech companies, particularly at ones that deal with anything of a sensitive nature. This employer deals largely in archiving the proprietary information of large financial firms, easily the most sensitive data of any employer (save a government contractor involved in plutonium production) that I have worked for!

Look, I am not going to steal or destroy anyone’s data. But they don’t know that for sure. The vast majority of acts of sabotage against businesses happens at the hand of disgruntled insiders. Competent businesses know that, and have policies for acting accordingly.

Something They Did

They asked me what of their property I had been given and to come up with a plan for returning it to them. That points to not having functional inventory control. The latter is Business Administration 101 sort of stuff. The first anecdote was no great surprise when it materialized (see immediately below). This one, however, was.

There is actually an inventory sticker on my laptop. I guess it was merely the self-directed action of a lone, competent systems administrator, who has by now departed the company.

Boy, Was I Ever Right

When I started getting frustrated at what a strange and difficult workplace it was, one of the first rules I arrived at was to never assume any level of competence on their part, since the best explanation at the time for their observed characteristics was a organization-wide lack of basic competence. This has proved to be a very good guide for predicting their actions ever since the time I formulated the theory.

It’s Over

Published at 23:42 on 17 October 2023

They wanted me to agree to another unrealistic “Performance Improvement Plan.” Given that it was unrealistic, it would have been dishonest to agree to it. The main issue is a fundamental mismatch between what they need and what my skills are. So I am on my way out.

Probably the Textbook Example of Why Java Sucks

Published at 00:22 on 14 October 2023

Probably the textbook example of why Java sucks is the Log4Shell Bug in the log4j library.

It’s just a library and not part of the core Java language, but the core Java language really isn’t the problem. The problem is the dysfunctional culture that surrounds the language.

So the stock logging is both bloated and yet surprisingly limited in functionality, because that is the sort of code the Java community tends to produce. That creates the need for an expanded logging system. Since it fills a void, everyone uses it.

Since the community does not appreciate simplicity, what the hey, let’s stick a general-purpose templating language into the thing. The same community wrote that general-purpose templating language, so what the hey, let’s stick a shell escape with command-output substitution into the templating language. Both the general-purpose templating and the shell-escape feature of the templating are of course enabled by default, because what the hey, why not?

And suddenly, we have a logging library with a shell escape in it.

Just how bad this all is, is underscored by how it sat unnoticed for eight years before it started being exploited. That’s right, so few people actually used all this creeping feature-ism that it took nearly a decade for the vulnerability in it to be discovered!

Look, logging and templating are two different domains. Templating and launching commands in a subprocess are two different domains. A logging package has no business containing templating beyond approximately the String.format level. A templating package has no business containing general-purpose subprocess creation.

If you really have a need to generate a super-long, super-complex log message, long enough and complex enough to require a general-purpose templating system, you should probably rethink what you are doing. Log messages should be relatively short. Now, maybe your case is 1-in-1,000 to 1-in-1,000,000 special and there really is a good excuse for a long message. Maybe. Fine. Do it by hand. Pull in a templating library, use it to generate that message, and feed it to the logger. Don’t bloat up and complicate the code base for everyone else just because of your 1-in-1,000 (or more) special case.

Likewise, if you really need to substitute in the output from a system command into your template, use the subprocess-creation features of Java to run the command, collect its output, and feed it into the template. Again, a 1-in-1,000 (or more) special case, no need to clutter up the code base.

In short, it’s potentially dangerous. Make the programmer work a bit in order to do it. Not a whole lot (libraries should and do exist to make it easier), but a bit. Enough to get the programmer hopefully thinking about the consequences of the feature. Don’t just stick it in by default.

But who am I kidding? This is the Java community we are talking about. Too much can never be enough!

There Is a Reason… and It Is Not Antisemitism

Published at 07:21 on 10 October 2023

The criticism of Israel that Sharansky is worrying about is probably coming, there is a good reason for this, and for the most part it is not antisemitism.

It is very similar to the situation between Ukraine and Russia in many respects. When Putin sent troops into Ukraine, he started a war, and now he has one. Attacks against Russia by Ukraine are seen in this context. If Putin wants the war to end, he can order his troops out of Ukraine.

The situation between Hamas and Israel is quite similar. There is very little criticism of Israel’s right to forcibly apprehend or remove the invaders from its territory and re-secure its internationally recognized border. The issue is what happens after that mission is accomplished.

One difference is that in this case, the invaded is significantly more militarily powerful than the invader. Nobody with even half a brain doubts Israel’s ability to accomplish the above. In fact, it has already in large part been accomplished.

Then what? As I opined yesterday, an Israeli occupation of Gaza seems all but inevitable. That is when the real problems will begin for Israel when it comes to international public relations. As they should.

Ukraine has been warned by the West, multiple times, not to turn this into an excuse for occupying Russian territory. It is not antisemitism for the same standard to be applied to Israel.

And No, I Don’t Want False Equivalence

Published at 17:50 on 9 October 2023

It has already been documented by reliable sources that Hamas gunned down unarmed civilians at a music festival, and it appears they might have lit houses on fire at Kibbutz Be’eri, shooting those who escaped. That, and rounding up people kidnapping them en masse are things right out of the Holocaust. Israel’s war crimes — while not justifiable — tend to be more indirect, such as taking risks with Palestinian civilian lives. Directly and deliberately targeting civilians is worse.

Tables Turned: Hamas Invades Israel

Published at 16:58 on 9 October 2023

It’s not that unusual for Israel to invade Gaza. This weekend, when I was away from the Internet, Hamas invaded Israel.

Because that’s what it was: an invasion. That is what it is called when one side’s military forces enter another side’s territory and takes land by force.

The more interesting question is who put Hamas up to it.

Because someone basically had to. The invasion makes no sense from a realpolitik angle.

You’re Palestinian, you want your homeland back. Is it really a practical strategy to try and get it back by invading and occupying Israel, who possesses what is indisputably the most powerful military in the region? Provoke a fighting war with Israel and Hamas loses. There really is no other realistic outcome.

Someone put Hamas up to it, by playing on their hatred for Israel.

That someone does not have the Palestinian (or even the Hamas) best interest at heart, because as I said earlier, the only realistic outcome one can anticipate is that Hamas will lose.

And when Hamas loses, it will be particularly humiliating for the Palestinian side. More than likely, Israel will respond by invading and (re-)occupying Gaza. Because, unlike Hamas, Israel actually has enough military power to occupy and hold enemy territory indefinitely, this occupation will last indefinitely. This is no doubt what the Netanyahu meant when he said the Hamas attack would “change the Middle East.”

So given how badly this is all set to backfire for Hamas, who could have put Hamas up to it, and why did they do it?

The Odds of a Prolonged Shutdown Just Went Way Up

Published at 19:58 on 3 October 2023

McCarthy compromised to avoid a shutdown, and just was punished for it by being the first Speaker of the House in history to get fired. This makes it highly unlikely that whomever his replacement is will be interested in following in his footsteps.

The Republicans could have avoided this fate if they showed continued interest in compromising and cutting deals. The Democrats actually made some overtures in this direction, but McCarthy chose to snub them. So here we are.

Historically, these sort of antics have not turned out well for Republicans. If the Democrats are at least halfway savvy (not a given, sadly), they will now be preparing a messaging campaign painting the other party as irresponsible and incapable of governing.

Also expect a prolonged process for selecting a new permanent speaker. It took McCarthy fifteen votes to secure his speakership in this Congress. There is no reason to believe that his successor will have a significantly easier job of it.