~mango

The Hague, The Netherlands

https://thomasvoss.com

C-, Shell Script-, and Emacs enjoyer. The whole trifecta!

~mango/public-inbox

Last active 6 months ago
View more

Recent activity

Re: Dynamic arrays w/ custom allocators 5 months ago

From Thomas Voss to ~skeeto/public-inbox

On Thu May 9, 2024 at 5:56 AM CEST, Christopher Wellons wrote:
> Worse, at least on hosted systems these checks are usually for naught. If 
> the allocator waits for the operating system to push back before failing 
> to allocate, then when pushback happens, if it happens at all (e.g. Linux 
> OOM killer), it's likely too late to recover. Even if recovers without 
> bumping into another allocation failure, the system is has probably been 
> unstable for some time: thrashing, or other processes are now experiencing 
> allocation failure (no commit charge available).
>
> As for programs that genuinely believe they can recover: Is this actually 
> tested? At least with a custom allocator, like the one here, it's feasible 
> to test. Outside of C, recovery from OOM is typically not expected, even 
> if there's theoretically an exception to catch.
The thing with a custom allocator though is that failing to allocate

Dynamic arrays w/ custom allocators 5 months ago

From Thomas Voss to ~skeeto/public-inbox

Hi Chris,

I recently read your post on an arena-backed dynamic array implementation
in C¹.  I thought it was pretty cool; I rarely see APIs where one
dereferences a function invocation.

For some context I am currently working on a C library full of routines I
commonly use in my various projects (such as UTF-8 string handling,
Unicode normalization, etc.), and I have added custom allocator support
for many functions which has proven extremely helpful.  I do so in the
following manner:

    /* An allocator function.  It works in the same way as the Lua
       allocator that you coincidentally also mentioned before² */

Re: Panic when used from xdg-open 10 months ago

From Thomas Voss to ~rjarry/aerc-devel

On Tue Nov 14, 2023 at 11:16 AM CET, Robin Jarry wrote:
> Thomas Voss, Nov 14, 2023 at 11:03:
> > Just a quick something I noticed by the way.  Aerc is listed on the Arch
> > repos as being v1.16:
> >
> >     $ pacman -Q Aerc
> >     Aerc 0.16.0-1
>
> Ah that makes more sense now :)
>
> I assume that you don't already have an Aerc instance running and that 
> you are clicking on a mailto: link.

You’re right in that I don’t have an existing instance running, but wrong

Re: Panic when used from xdg-open 10 months ago

From Thomas Voss to ~rjarry/aerc-devel

Just a quick something I noticed by the way.  Aerc is listed on the Arch
repos as being v1.16:

    $ pacman -Q aerc
    aerc 0.16.0-1

However despite having it ‘up-to-date’, Aerc claims I am running 1.15.2:

    $ aerc -v
    aerc 0.15.2 +notmuch (go1.21.1 amd64 linux)

Not sure if this is something you handle, or something that the Arch repo
maintainers need to handle, but just letting you know.

Re: Panic when used from xdg-open 10 months ago

From Thomas Voss to ~rjarry/aerc-devel

Hi Robin,

> next time, it will be simpler if you include the panic trace directly 
> inline:
No worries, I’ll do that next time.

> I have checked in detail and I don't see how there could by any crash at 
> line 256 of main.go for version 0.15.2. Are you using a patched version? 
> What distro are you on?
Arch Linux.  I got Aerc straight from the ‘extra’ repositories, so it
shouldn’t have any weird patches or anything enabled.

> PS: your message has trailing white space on *all* lines until column 
> 84. This is very weird, you should check your editor.

Panic when used from xdg-open 11 months ago

From Thomas Voss to ~rjarry/aerc-devel

Hi,                                                                                       
                                                                                          
In an attempt to set aerc as my main email-client when clicking on                        
‘mailto’ links, I added the following line to my ~/.config/mimeapps.list:                 
                                                                                          
  [Default Applications]                                                                  
  …                                                                                       
  x-scheme-handler/mailto=aerc.desktop                                                    
                                                                                          
When I attempt to run the ‘xdg-open mailto:…’ however, aerc panics.  I’ve                 
pasted the generated log file here: https://paste.thomasvoss.com/358.                     
                                                                                          
--                                                                                        
— Thomas

[PATCH] Sleep until the next minute 11 months ago

From Thomas Voss to ~martanne/devel

Instead of always sleeping for a full minute, this patch will ensure
that the loop sleeps until the end of the current minute.  This means
that if you start the script at 00:00:30, it will print the current time
at 00:01:00 instead of at 00:01:30.
---
 dvtm-status | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dvtm-status b/dvtm-status
index f841e3f..837d1dd 100755
--- a/dvtm-status
+++ b/dvtm-status
@@ -6,7 +6,7 @@ FIFO="/tmp/dvtm-status.$$"

[message trimmed]

Potential removal of ‘>’ from GSP 11 months ago

From Thomas Voss to ~mango/public-inbox

Hi all,

As the subject suggests, I am toying around with the idea of removing ‘>’
from GSP.  For those unaware, you can use it like so:

    outer {
      >inner{}
    }

It then instructs the transpiler to insert a newline after the prefixed
tag.  Normally the transpiler would produce the following HTML as a
result of it’s auto-minification:

    <outer><inner></outer>

New GSP Major Release 11 months ago

From Thomas Voss to ~mango/public-inbox

Hi all,

I just released a v2 of GSP.  Nothing *major* was changed, but it does
break compatibility, so I felt a v2 was a better way to communicate that.
I also pushed v1.0.1 of tree-sitter-gsp which is up-to-date with the new
syntax tweaks.

You can find all the new information in the release notes[1], and the
gsp(5) manual has also been updated accordingly with a few new examples.

The codebase also has some tests now, so the likelyhood of weird breakage
in the future is a lot smaller I hope.

[1]: https://git.sr.ht/~mango/gsp/refs/v2.0.0

Re: [PATCH gsp] Fix printing classes and attrs 11 months ago

From Thomas Voss to ~mango/public-inbox

> Well well well, here we are again.
> Iterate over the `nClasses` list instead of every attr after printing
> the classes.
>
> With all due respect, you should consider writing a test suite to catch
> silly errors like this.
Here we are again indeed.

I do actually have tests, I just haven’t pushed them yet, I’ll get around
to that in the coming days.  I haven’t pushed them because they aren’t
really automated pass/fail checks, but just hacky shell scripts that give
me some diffs and I can visually compare.  The fact that I tested this
and it failed and still went under my radar is a bit embarrasing to be
honest, and I’ll definitely go ahead and make a proper test suite.