News for hackers. Stuff that matters.
Re:Why modern software is slow by kragen on Thursday September 29, 2022 @11:40PM (#33030633)
They can totally look at it, but if they copy it into Windows Terminal, they need to relicense Windows Terminal under the GPL. That would be a great outcome for everyone. Microsoft is already shipping Linux under the GPL2 as WSL2 so this shouldn't be unthinkable.

Also, though, it does not require 25+ years of game development experience to figure out that you can write a non-laggy terminal emulator, which should be obvious because people have been building non-laggy terminal emulators since at least 01974 and people routinely watch 1080p videos at 60 fps on modern laptops and even modern hand computers.

We had terminal emulators with acceptable, even snappy, performance on X-Windows when I started using it in 01993. In 01994 I would commonly use an IRIS Indigo, which had a 150 MHz R4400, which was not superscalar, so it was maybe capable of 150 MIPS, or 300 MIPS if you count floating-point too. I preferred using it instead of the X terminals because it was faster. I'm typing this on an obsolete laptop whose CPU averages about 100 times faster than that. It's immediately obvious to the most casual observer that there is no excuse for software on this laptop to flub UI tasks the Indigo handled with ease.

The VT50 https://en.wikipedia.org/wiki/VT50 was released in 01974, and its microprogram emulated a Teletype with added features. (See my comment at https://news.ycombinator.com/item?id=32547666.) A service manual for the 01975 version, the VT52, is at https://news.ycombinator.com/item?id=32547666. It had 60 frames per second (in the US), 240 scan lines per frame, 80 characters per scan line (at 15.36 kHz), and I think 8 pixels per character (in each scan line), one of which was always blank. So its output shift register ("VSR") operated at 9.8 MHz, or actually a little bit faster because of the 10-μs HBI, during which it checked the keyboard. Its microprogram, which had to load the appropriate 7 bits into the VSR 80 times per scan line (as well as processing escape sequences and printable characters during, I think, the VBI), had a 1.3 μs instruction cycle time (770 MHz), divided into 18 72-ns clock cycles (13.824 MHz) during which it did different things.

So I think that in most 72-ns clock cycles about a couple of dozen flip-flops would change state.

This laptop typically executes about 2400 CPU instructions in every 72-ns tick of the VT52's clock, 600 per core. You could compile an RTL-level logic simulation of the VT52 into C and compile it with a C compiler, and it would run faster than the original VT52.

But that would be sort of stupid because you have a framebuffer and a GPU with texture-mapping units; your CPU doesn't actually have to generate pixels one at a time to keep the screen refreshed because you have hardware to do that for you. A 1920×1080 video at 60 frames per second is displaying 124 million new pixels per second, which it has to get by decoding H.264 or H.265 or something. That's a bit over 1.5 million VT52 characters per second. But when you're displaying characters on a terminal that isn't very useful because people can only read about 30 characters per second; even updating a full-page 80×66 display at 60 frames per second is only 0.3 million characters per second.

In most cases the computation required to process a character is to verify that it's a printable plain ASCII character, update the screen image, and update the cursor position. Updating the screen image might involve blitting some texture data or, as in Muratori's refterm, updating a glyph index that gets consulted by a shader to figure out what texture data to draw when the time comes to render a frame. We're talking about an amount of computation that's small compared to a typical C subroutine call and return.

Re:Why modern software is slow by naikrovek on Friday September 30, 2022 @01:03AM (#33031185)
> They can totally look at it, but if they copy it into Windows Terminal, they need to relicense Windows Terminal under the GPL. That would be a great outcome for everyone.

no! it would not! the GPL is a truly awful license. "freedom" my white butt. it's a list of requirements, all of which restrict the freedoms and abilities of those who utilize it.

about rendering:

I'm not trying to say that it's hard. I'm trying to say that they believed they knew how to do it, when in reality they did not.

THAT'S ALL.

Everyone is laser focused on the details of what I am saying and completely missing the point of what I am saying, or trying to say. I am apparently speaking a language that is close to English but not actually English.

Re:Why modern software is slow by salawat on Friday September 30, 2022 @10:07AM (#33035009)
>no! it would not! the GPL is a truly awful license. "freedom" my white butt. it's a list of requirements, all of which restrict the freedoms and abilities of those who utilize it.

The only freedom the GPL restricts is the freedom to maintain a captive audience in a state of information asymmetry guaranteed helplessness.

You're not making a good case for yourself here.

Re:Why modern software is slow by naikrovek on Saturday October 01, 2022 @01:46AM (#33044235)
GPL forces code others write for your project to also be GPL. that is a loss of freedom for that contributor.

if I license something with the MIT license, anyone can use it for any purpose, and they can take my code with their modifications private if they want, meaning those entities are free to do what they want, and the code I released is still freely available just like it was before. I lose nothing, and no freedoms were taken from anyone who uses my code.

Re:Why modern software is slow by kragen on Saturday October 01, 2022 @02:10PM (#33048607)
Windows Terminal isn't licensed under any of the various MIT licenses, though; it's licensed under the Windows EULA. The Windows EULA forces code others write for Windows Terminal to never exist in the first place, and it forces the people on the Windows Terminal team to lose access to their own code if they leave Microsoft. So moving Windows Terminal to the GPL2 would be a gain of freedom for all those people. Only Satya Nadella would suffer a loss of freedom.

That sort of simple numerical counting isn't enough for an ethical argument, of course. If my house is converted to a public park, then everyone gains the freedom to drink beer in it, or at least everyone in Buenos Aires does, and only I lose any freedom, like the freedom to sleep in a dry bed when it's raining without raucous beer-drinkers guffawing all around me. But this is still a net loss because the benefits to everyone else are not as important as the loss to me.

In the Windows Terminal case, the situation is the other way around: Nadella would suffer a loss of freedom that affects him only in a de minimis way, while everyone else would gain substantially.

Re:Why modern software is slow by sophacles on Friday September 30, 2022 @02:36PM (#33038812)
> Everyone is laser focused on the details of what I am saying and completely missing the point of what I am saying, or trying to say. I am apparently speaking a language that is close to English but not actually English.

Have you considered that people are disagreeing with you because you are wrong rather than because they don't understand you?

Re:Why modern software is slow by kragen on Friday September 30, 2022 @04:37PM (#33040477)
Well, it's true that I spent a lot of words attacking the claim that making a terminal emulator snappy (in the usual case, maybe not Zalgo cases) would be difficult, and it is also true that naikrovek didn't actually make that claim. Rather, they claimed that the Windows Terminal team didn't know how to do it. Which, I mean, maybe that's true, but it isn't that hard to figure out. I think it's more accurate that they didn't bother and made up rationalizations for their shitty software after the fact.
Re:Why modern software is slow by kragen on Friday September 30, 2022 @01:06AM (#33031206)
Oh, well, I agree that the Windows Terminal team overestimated their own competence. I just think they had to argue some pretty obviously implausible positions in order to do so. You have to dumb pretty hard to start believing that a 3 GHz 2-core superscalar i7 with AVX256, 24 MB of L3 cache, and a SIMT GPU can't handle the load of emulating a VT100.

And having the Windows Terminal licensed under the GPL instead of a Microsoft EULA would strictly increase the freedoms and abilities of its users: they could still legally do all the things with Windows Terminal they do now, plus lots of new things as well. Opt out of undesired updates, for example. Even the Windows Terminal team would have more freedom that way: they could go work at a different employer and keep hacking on the code they wrote as part of Windows Terminal.