vain @www.uninformativ.de

Follow

Block / Report User

If this user/feed is violating this Pod's (yarn.meff.me) community guidelines as set out in the Abuse Policy, please report them immediately!

You are also free to Unfollow or Mute this user or feed. Muting will also remove that user/feed's content from your view and you will no longer see content from that user/feed anywhere.

@vain does not follow you (they may not see your replies!)

Recent Twts

Recent twts from vain

Vacation: Doing crazy things like C on DOS, lots of Rust, bare-metal assembly code, everything is fine.

Back at work: How the fuck do I move an email in this web mail program? Am I stupid? 😮‍💨


#ubuezaa

I think this is finally a good metaphor to talk about “simple” software:

https://oldbytes.space/@psf/115846939202097661

Distilled software.

I quote in full:

principles of software distillation:

Old software is usually small and new software is usually large. A distilled program can be old or new, but is always small, and is powerful by its choice of ideas, not its implementation size.

A distilled program has the conciseness of an initial version and the refinement of a final version.

A distilled program is a finished work, but remains hackable due to its small size, allowing it to serve as the starting point for new works.

Many people write programs, but few stick with a program long enough to distill it.

I often tried to tell people about “simple” or “minimalistic” software, “KISS”, stuff like that, but they never understand – because everybody has a different idea of “simple”. The term “simple” is too abstract.

This is worth thinking about some more. 🤔


#533m7aa

(#xtkev6q) And now the event loop is not a simple loop around curses’ getch() anymore but it can wait for events on any file descriptor. Here’s a simple test program that waits for connections on a TCP socket, accepts it, reads a line, sends back a line:

https://movq.de/v/93fa46a030/vid-1767547942.mp4

And the scrollbar indicators are working now.

I’ll probably implement timer callbacks using timerfd (even though that’s Linux-only). 🤔


#czkzdta

(#voi7gxa) @eldersnake@we.loveprivacy.club

Steps to world domination:

  1. “Invent” “AI” (by using other people’s data).
  2. Get people hyped about it and ideally hooked on it.
  3. Only provide it as a cloud service. But hey, if you want to, you can run it locally!
  4. Buy all hardware available on the market, so that nobody but you can build more systems.
  5. All PCs of consumers and competitors are too weak now and can’t be upgraded anymore.
  6. Everybody depends on your cloud service! Win!

All of that is possible because corporations don’t have a “conscience” in capitalism. Nobody forces the RAM manufacturers to sell all their stuff to just one or two buyers, but since the only goal of that manufacturer is to make money, they do it.


#w3qxekq

(#ex5vwtq) At around 19 seconds in the video, you can see some minor graphical glitches.

Text mode applications in Unix terminals are such a mess. It’s a miracle that this works at all.

In the old DOS days, you could get text (and colors) on the screen just by writing to memory, because the VGA memory was mapped to a fixed address. We don’t have that model anymore. To write a character to a certain position, you have to send an escape sequence to move the cursor to that position, then more escape sequences to set the color/attributes, then more escape sequences to get the cursor to where you actually want it. And then of course UTF-8 on top, i.e. you have no idea what the terminal will actually do when you send it a “🙂”.

Mouse events work by the terminal sending escape sequences to you (https://www.xfree86.org/current/ctlseqs.html#Mouse%20Tracking).

ncurses does an amazing job here. It’s fast (by having off-screen buffers and tracking changes, so it rarely has to actually send full screen updates to the terminal) and reliable and works across terminals. Without the terminfo database that keeps track of which terminal supports/requires which escape sequences, we’d be lost.

But gosh, what a mess this is under the hood … Makes you really miss memory mapped VGA and mouse drivers.


#eyfftcq

(#wap76wa) @lyse@lyse.isobeef.org I haven’t spoken to a single person yet who was a fan of all this. Not even the more conservative family members.

Some people have detonated several really loud bombs yesterday. This wasn’t a “Böller”. It shook my walls, doors, windows. Family members in other parts of the country reported the same … Is this a new trend?


#tcz2koq

(#2p27wba) @lyse@lyse.isobeef.org

I assume you made the thing load quickly, didn’t you?

That’s the problem with Python. If you have a couple of files to import, it will take time.

I want this to be reasonably fast on my old Intel NUC from 2016 (Celeron N3050 @ 1.60GHz) and I already notice that the program startup takes about 95 ms (or 125 ms when there are no .pyc files yet). That’s still fine, but it shows that I’ll have to be careful and keep this thing very small …

Python 3.14 will bring lazy imports, maybe that can help in some cases.


#ukhs3rq

Well, you girls and guys are making cool things, and I have some progress to show as well. 😅

https://movq.de/v/c0408a80b1/movwin.mp4

Scrolling widgets appears to work now. This is (mostly) Unicode-aware: Note how emojis like “😅” are double-width “characters” and the widget system knows this. It doesn’t try to place a “😅” in a location where there’s only one cell available.

Same goes for that weird “ä” thingie, which is actually “a” followed by U+0308 (a combining diacritic). Python itself thinks of this as two “characters”, but they only occupy one cell on the screen. (Assuming your terminal supports this …)

This library does the heavy Unicode lifting: https://github.com/jquast/wcwidth (Take a look at its implementation to learn how horrible Unicode and human languages are.)

The program itself looks like this, it’s a proper widget hierarchy:

https://movq.de/v/1d155106e2/s.png

(There is no input handling yet, hence some things are hardwired for the moment.)


#yiihgta

(#xwn45gq) @lyse@lyse.isobeef.org Well, I used SnipMate years ago (until 2012). IIRC, it’s more than just “insert a bit of text here”, it can also jump to the correct next location(s) and stuff like that. Don’t remember why I stopped using it.

Then I used nothing for a long time. Just before Christmas, I made my own plugin (… of course …), which does everything I need at the moment (and nothing more).

It can insert simple templates and then jump to the next location:

https://movq.de/v/67cdf7c827/sisni%2Dpython.mp4

And replace a string after insertion:

https://movq.de/v/67cdf7c827/sisni%2Dheader.mp4

(It’s not public (yet?) and it also uses vim9script, so I guess it wouldn’t work on your system.)


#f2cdpva

(#j5s5khq) @lyse@lyse.isobeef.org I’m toying with the idea of making a widget/window system on top of Python’s ncurses. I’ve never really been happy with the existing ones (like urwid, textual, pytermgui, …). I mean, they’re not horrible, it’s mostly the performance that’s bugging me – I don’t want to wait an entire second for a terminal program to start up.

Not sure if I’ll actually see it through, though. Unicode makes this kind of thing extremely hard. 🫤


#fazzzcq