Why have these Unicode smilies never caught on, I wonder? 🤪

𜲦𜲩 𜲨𜲩 𜲦𜲧
𜲪𜲫 𜲮𜲯 𜲰𜲱

#hivf4vq

(#2p27wba) @movq@www.uninformativ.de Yeah, I see. Just crudely checked on my computer, with around 0.013 seconds, Python 2.7 seems a tad faster than Python 3.14’s 0.023 seconds in this little program.

The lazy imports sound not too bad, but I just skimmed over them. There are surprisingly many exceptions, but yeah, no way around them. :-)


#5567spa

mu (µ) now has builtin code formatting and linting tools, making µ far more useful and useable as a general purpose programming language. Mu now includes:

  • An interpreter for quick ā€œscriptinogā€
  • A native code compiler for building native executables (Darwin / macOS only for now)
  • A builtin set of developer tools, currently: fmt (-fmt), check (-check) and test (-test).

#oorss4a

(#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

I just fixed another bug in tt where the language hint in multiline markdown code blocks had not been stripped before rendering. It just looked like it was part of the actual code, which was ugly. I now throw it away. Actually, it’s already extracted into the data model for possible future syntax highlighting.


#f5crctq

(#ys4znqq) @shinyoukai@neko.laidback.moe Because you might not want to commit all changed files in a single commit. I very often make use of this and create several commits. In fact, I like to git add --patch to interactively select which parts of a file go in the next commit. This happens most likely when refactoring during a feature implementation or bug fix. I couldn’t live without that anymore. :-)

If you have a much more organized way of working where this does not come up, you can just git commit --all to include all changed files in the next commit without git adding them first. But new files still have to be git added manually once.


#u5appra

(#3hge2sq) Ok, the standard library implementation is wonky at best, at least in regards to XDG, because it really doesn’t implement it properly. https://github.com/golang/go/issues/62382 I stick to my own code then. It doesn’t properly support anything else than Linux or Unixes that use XDG, but personally, I don’t care about them anyway. And the cross-platform situation is a giant mess. Unsurprisingly.


#5dudhyq

(#iudi6qq) Hmm, mine also resolves a leading tilde in these variables. And if $HOME is not specified it tries to resolve the user’s home directory by user.Current().HomeDir. Maybe that’s overkill, I have to check the XDG spec.

But I’m definitely missing os.UserDataDir(). That’s a bummer.


#3hge2sq

(#f2cdpva) @movq@www.uninformativ.de Thanks! I’ll have a look at SnipMate. Currently, I’m (mis)using the abbreviation mechanism to expand a code snippet inplace, e.g.

autocmd FileType go inoreab <buffer> testfunc func Test(t *testing.T) {<CR>}<ESC>k0wwi

or this monstrosity:

autocmd FileType go inoreab <buffer> tabletest for _, tt := range []struct {<CR>    name string<CR><CR><BS>}{<CR>   {<CR>   name: "",<CR><BS>},<CR><BS>} {<CR>  t.Run(tt.name, func(t *testing.T) {<CR><CR>})<CR><BS>}<ESC>9ki<TAB>

But this of course has the disadvantage that I still have to remove the last space or tab to trigger the expansion by hand again. It’s a bit annoying, but better than typing it out by hand.


#fjhkxza

(#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

(#j5s5khq) @movq@www.uninformativ.de How about ā€œQuongsiā€? I generated the first five letters with pwgen --no-capitalize --no-numerals 5 and since that already showed up in DDG search results, I simply appended the last two, which yielded nothing on DDG and Google).

What kind of project is it? Maybe we can help you find a name or nudge you in the right direction.


#7tsxwnq

The tt URLs View now automatically selects the first URL that I probably are going to open. In decreasing order, the URL types are:

  1. markdown media URLs (images, videos, etc.)
  2. markdown or plaintext URLs
  3. subjects
  4. mentions

I might differentiate between mentions of subscribed and unsubscribed feeds in the future. The odds of opening a new feed over an already existing one are higher.


#sd722yq

Whoo! I fixed one of the hardest bugs in mu (µ) I think I’ve had to figure out. Took me several days in fact to figure it out. The basic problem was, println(1, 2) was bring printed as 1 2 in the bytecode VM and 1 nil when natively compiled to machine code on macOS. In the end it turned out the machine code being generated / emitted meant that the list pointers for the rest... of the variadic arguments was being slot into a register that was being clobbered by the mu_retain and mu_release calls and effectively getting freed up on first use by the RC (reference counting) garbage collector šŸ¤¦ā€ā™‚ļø


#xupmaxa

(#pact6sq) @prologic@twtxt.net In my opinion, the integrity isn’t lost. The same input data always result in the same output hash, no matter when you calculate the hashes. It’s true that a corrupt database contents yields to corrupt hashes, but then you have a whole bigger problem than just receiving different hashes. :-D


#uugltha

(#73l4niq) @zvava@twtxt.net By hashing definition, if you edit your message, it simply becomes a new message. It’s just not the same message anymore. At least from a technical point of view. As a human, personally I disagree, but that’s what I’m stuck with. There’s no reliable way to detect and ā€œcorrectā€ for that.

Storing the hash in your database doesn’t prevent you from switching to another hashing implementation later on. As of now, message creation timestamps earlier than some magical point in time use twt hash v1, messages on or after that magical timestamp use twt hash v2. So, a message either has a v1 or a v2 hash, but not both. At least one of them is never meaningful.

Once you ā€œupgradeā€ your database schema, you can check for stored messages from the future which should have been hashed using v2, but were actually v1-hashed and simply fix them.

If there will ever be another addressing scheme, you could reuse the existing hash column if it supersedes the v1/v2 hashes. Otherwise, a new column might be useful, or perhaps no column at all (looking at location-based addressing or how it was called). The old v1/v2 hashes are still needed for all past conversation trees.

In my opinion, always recalculating the hashes is a big waste of time and energy. But if it serves you well, then go for it.


#qatkviq