Elektrine lite

← Feed

@simontatham@hachyderm.io

Post #1436819

2026-04-20 09:36 UTC

In computing, one often says that two features (of a program or language or whatever) are 'orthogonal'. Often the implication is just that you can choose the setting of each feature separately – no setting of feature Foo is incompatible with Bar. But in mathematics, that concept sounds more like (linear) _independence_ than orthogonality. It's saying that you can independently choose where you are on the axis for feature Foo, and the one for feature Bar, and every possible pair of choices corresponds to a valid point in the configuration space. Orthogonality, in maths, is a stronger property than mere independence. What does it add? If a set of vectors {e₁,e₂,…} are orthogonal, and v is in their span, then you can find v's coefficient of e₁ by taking the dot product v . e₁. This formula works the same no matter what the other vectors are. In fact, you don't even need to _know_ what they are. Whereas if {e₁,e₂,…} are merely linearly independent, then you have to know _all_ of them before you can determine any component of v's representation. Any feature you don't know about can affect all the ones you do. So, how about this for a more precise pair of definitions in computing: Two features are _independent_ if feature Bar doesn't affect the *legal* settings of Foo. For example, But they're only _orthogonal_ if feature Bar doesn't even affect the *desirable* setting of Foo: a user who's only read about feature Foo and doesn't even know Bar exists should still be able to set Foo appropriately for their needs, and when someone comes along and sets Bar, the Foo setting is still sensible. Compiler optimisation settings are often independent but not orthogonal. Particularly the ones that trade space for time, like loop unrolling or function inlining. You can turn on either or both, or adjust each one's aggressiveness, but you have a finite space budget and must trade it off between the various space-consuming options. The more you unroll, the less you can afford to inline, and vice versa. But in 'grep', matching options like -i and output options like -3 *are* orthogonal. There's a right answer to whether I want 'grep foo' to match FOO as well, which doesn't at all depend on how I want to display the results.

Replies (3)

  • @tuftyindigo@meow.social 2026-04-20 12:53

    @simontatham@hachyderm.io I've always wondered what would constitute orthonormal features or settings of a tool or language, and would orthonormality be a good or a bad thing? I've just never worked out what unit length would mean for -i.

    Open ##3190596

  • @mjd@mathstodon.xyz 2026-04-20 13:45

    @simontatham@hachyderm.io I'm more familiar with orthogonal in connection with *design* rather than configuration: does the decision about whether to build A1 or A2 affect the decision about whether to build B1 or B2? Often it does. Sometimes it doesn't, and then A and B are orthogonal choices.

    Open ##3190599

  • @RobJLow@mathstodon.xyz 2026-04-20 15:25

    @simontatham@hachyderm.io I don't know if this goes anywhere, but in linear algebra, linear (in)dependence is a general notion, while orthogonality requires the additional structure of an inner product. Is there maybe some way of using an inner product to give some kind of quantitative notion of 'desirability'? I don't know if this can be made sane in the software world, but it would be interesting if it could.

    Open ##3190601