HNHacker News
TopNewBestAskShowJobs

unwind

12,407 karma · joined March 23, 2009

Bearded hacker from Sweden. Learned M68k assembly on the Amiga in the late 80s. Compiling C on a 7 MHz CPU was slow. Working as a contracting software developer since almost 10 years, enjoying visiting various parts of the software world.

I hang out a lot on Stack Overflow: http://stackoverflow.com/users/28169/unwind, mainly answering questions about C. I love C.

submissionscomments
unwind··on Patching 68K Software – SimpleText
For people not used to reading MC8k assembly [1], it's helpful to point out the basic fact that the syntax is in general

    opcode  source, destination
which is the other way around from most contemporary ISA:s. So a line like

    move.l d0, -(a7)
will first decrement the value of register a7, then write the contents of register d0 to the resulting address (it's a "push" for a downwards-growing stack).

Edit: added Wiki-linkage.

[1]: https://en.wikipedia.org/wiki/Motorola_68000#Instruction_set...

unwind··on Bluetui – A TUI for managing Bluetooth on Linux
My understanding is T for text-based [1], the term is used about e.g. DOS programs too where the text interface is not historically called a terminal.

[1]: https://en.wikipedia.org/wiki/Text-based_user_interface

unwind··on Rust cross-platform GPUI components
That showcase application (other than Zed) looks awesome, but the very fancy-looking home page [1] fails to have a one-liner explanation of, uh, what the application does. Please consider fixing.

[1]: https://longbridge.com/desktop/

unwind··on Wasp Blower
If you have (young) kids, having active/plentiful wasps nearby might just not work. Wasps can be scary, especially to children who have been stung before, and they are super-impractical around kids eating/snacking, too. "Close your mouth and relax" just doesn't get through to a scared kid, in my experience. :|
unwind··on Binmoji: A 64-bit emoji encoding
Cool!

I've not had enough coffee to deeply understand this, some parts seem like magic and I'm not sure if the hashing is sufficient.

Anyway, I am eminently nerd-snipable when it comes to reviewing C code, so here are a few comments. Do with them as you wish obviously.

1. C89 is an interesting and slightly depressing choice, it would be interesting to hear one platform where this library would be relevant that lacks at least a C99-compliant compiler.

2. On that note, I don't think `uint32_t` and friends are in C89, so that's a bit strange. Many compilers seem to allow it anyway, but then your code is no longer C89-compliant, of course.

3. I think the constant `num_hash_entries` pollutes the global namespace, it's not `static` and has no prefix.

4. In the header there is the `USER_FLAG_MASK` which is static, but will also clobber any application-defined symbol of the same name. Consider prefixing it.

4. In general please consider writing

    memset(binmoji, 0, sizeof(struct binmoji));
as:

    memset(binmoji, 0, sizeof *binmoji);
it's less error-prone (since it "locks" the cleared size to the actual type of the variable used) while being shorter and typographically less involved.

5. The repeated bitwise-OR:ing in `binmoji_encode()` has extra parentheses on each of the lines.

6. Awesome to see use of `bsearch()` to reduce risk of binary-search bugs.

unwind··on VST3 audio plugin format is now MIT
Yeah, I realized that once I finished writing my comment, that it might be about communicating with the UI since UI toolkits are usually not thread-safe enough. Thanks.
unwind··on Rivian's TM-B electric bike
Oh: I was surprised/saddened that the article mentioned Cake's bankruptcy, so I had to check and it seems the company/assets and a lot of staff was acquired by Norwegian company Brages [1] so it kind of still exists, at least. Not sure if that means they no longer sell in the US, though.

[1]: https://ridecake.com/en-SE/the-cake-journey-continues

unwind··on VST3 audio plugin format is now MIT
As a complete audio outsider, my observations are:

1. Great news! VSTs seem to fill an important role in the audio-processing software world, and having them more open must be a good thing.

2. From the things they mention, the SDK seems way larger than I had imagined, but that is normal for (software) things, I guess. "This API also enables the scheduling of tasks on the main thread from any other thread." was not easy to unpack nor see the use of in what was (to me) an audio-generation-centered API.

3. The actual post seems to be somewhat mangled, I see both proper inline links and what looks like naked Markdown links, and also bolded words that also have double asterisks around them. Much confusing.

unwind··on 42,600 ton ship to break the world record for the deepest drill at 7 miles
That science.org article at least manages to show an image of the ship, the OP covered the only (!) image with the headline, and then every time in the article when you thought an image was coming, it was ads.

Anyway, I know absolutely nothing about being on the bridge of such a ship, but can't help to think that it looks/feels "wrong" for a mariner not to be able to see the sky ahead, since there is a helicopter pad jutting out over the bridge. Oh well, I guess they can go to the side.

unwind··on Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
Agree, it was kind of comical that a web page complaining about text rendering performance uses some kind of design that a) only has relevant content on ~half the screen and b) causes me to have to wait every time I move the scroll wheel. :|
unwind··on What went down at WCSB 89.3FM: Cleveland State's axed student radio station
I think that if you want to get your point across since you're upset about what seems to be (from a very long distance away from pretty much everything mentioned in the piece) some kind of corporate/university deal, you should try to get to it faster. The point, that is.
unwind··on Peanut allergies have plummeted in children
The brown paper bag [1] was not connected to the peanut allergy, it was mentioned as an example of another thing that only (to OP) seems to happen/be a thing in the US.

[1]: https://www.uclahealth.org/news/article/breathing-into-a-pap...

unwind··on Subway station study reveals fungal communities
Fungi in the subway is a thing in Stockholm's subway too, discovered in one station in back 2016 [1].

[1]: https://en.wikipedia.org/wiki/Kungstr%C3%A4dg%C3%A5rden_metr...

unwind··on Debugging Humidity: Lessons from deploying software in the physical world
Obi-Wan, is that you? :)
unwind··on Three ways formally verified code can go wrong in practice
This was very nice, well-written and good-looking (to me) content. Thanks!

There was some meta-bug with encoding which almost is like an internal joke but I don't think it's intentional. The Haskell code examples have:

    inc :: Int -> Int
several times, and that `&gt;` entity should very likely just be a `<` in the source code.
unwind··on IKEA Catalogs 1951-2021
It's not super hard to back up (using the "bread crumbs" on the page you linked), to "Dressers & chests of drawers", pop down the "Series" input selector, and pick STORKLINTA. That gets you [1] which I hope shows all the dressers of that name.

[1]: https://www.ikea.com/us/en/cat/chests-of-drawers-10451/?filt...

unwind··on Software essays that shaped me
Seems to be a reference to "The Croods" [1], a 2013 animated movie in which Nicholas Cage (!) voices the caveman Grug.

[1]: https://en.wikipedia.org/wiki/The_Croods

unwind··on Defer: Resource cleanup in C with GCCs magic
That feels like a "citation needed", since that would be very clear violation of the C spec and thus a rather serious bug in the standard library for that platform.
unwind··on Intel's original 64bit extensions for x86
Me, too. Flagged.
unwind··on How I block all 26M of your curl requests
I got exactly this far:

    uint8_t *data = (void *)(long)ctx->data;
before I stopped reading. I had to go look up the struct xdp_md [1], it is declared like this:

    struct xdp_md {
        __u32 data;
        __u32 data_end;
        __u32 data_meta;
        /* ... further fields elided ... */
    };
So clearly the `data` member is already an integer. The sane way to cast it would be to cast to the actual desired destination type, rather than first to some other random integer and then to a `void` pointer.

Like so:

    uint8_t * const data = (uint8_t *) ctx->data;
I added the `const` since the pointer value is not supposed to change, since we got it from the incoming structure. Note that that `const` does not mean we can't write to `data` if we feel like it, it means the base pointer itself can't change, we can't "re-point" the pointer. This is often a nice property, of course.

[1]: https://elixir.bootlin.com/linux/v6.17/source/include/uapi/l...

unwind··on Design of the SCHEME-78 Lisp-based microprocessor (1980)
Meta: This could use a "(1980)" tag in the title. The "-78" is a hint, of course.
unwind··on European Union Public Licence (EUPL)
It is not a bad association, the GPL is of course fantastic.

I was expecting it to be a software license, but it was (to me) confusing and thus annoying that it wasn't made more clear from the beginning of the text. The entire first section did not specify that it was talking about software, and I think that is important context and should be stated very early.

unwind··on European Union Public Licence (EUPL)
It took them the entire first section to not mention that it is a _software license_.

In the context of EU regulating stuff, "a license" (at least to me) is not automatically assumed to be with regards to software distribution rights. I get that the naming makes it look similar to the (L)GPL and so on, but that could just be marketing and/or someone trying to associate with known things.

The first paragraph after the main title would have been better if it had a second sentence:

    What is the EUPL?

    EUPL is an acronym for "European Union Public Licence". It is a software distribution license.
That would (to me) have made it so much more clear, and avoided having to build up confusion while reading until the purpose was revealed.
unwind··on DE25-Nano FPGA Development and Education Board with ARM HPS and 2GB RAM
It's mildly interesting for being the "sequel" to the DE-10 Nano board that has powered the widely appreciated emulation platform MiSTer [1] for number of years. Here [2] is a comment by someone on the MiSTer project.

But of course submitting stuff that's only on preorder (at ~$250 for non-academics, btw) is not super-helpful, agreed.

[1]: https://misterfpga.org/

[2]: https://www.retrorgb.com/de-10-nano-successor.html

unwind··on US airlines are pushing to remove protections for passengers and add more fees
Data point: it worked for me, also in the EU.
unwind··on Processing Strings 109x Faster Than Nvidia on H100
I'm not (at the moment) a potential user of this, but I just wanted to say that it was a fantastic page with a really good presentation of the project and its capabilities.

One micro-question on the editing: why are numbers written with an apostrophe (') as the thousands-separator [1]? I know that is used for this purpose in Switzerland and that many programming languages support it. It just seemed very strange for English text, where typically comma (,) would be used, of course.

[1]: https://en.wikipedia.org/wiki/Decimal_separator#Digit_groupi...

[2]: https://en.wikipedia.org/wiki/Apostrophe#Miscellaneous_uses_...

unwind··on A vibrator helped me debug a motorcycle brake light system
Not all microcontrollers[1]} have FIFOs for stuff like this, but perhaps you meant implementing it in software as a regular queue or something.

Anyway, even easier since the OP seems to be dealing a lot with the time between samples, would be to just make sure that at least 2.5 ms have passed before reading the sensor again. Right?

[1] Not sure if older blog posts detail the hardware, I do remember reading about this product on here before.

unwind··on Themis (European Reusable Rocket) is assembled on launch pad
Yes, on August 20: https://lkab.com/en/press/kiruna-church-has-found-a-new-home....
unwind··on Is a movie prop the ultimate laptop bag?
This passes Betteridge's law [1] just fine, since I guess the answer from those of us who actually have to carry the laptop any distance is a big "no". A backpack or messenger back is way more comfortable, right?

[1]: https://en.wikipedia.org/wiki/Betteridge%27s_law_of_headline...

unwind··on You did this with an AI and you do not understand what you're doing here
Yeah, I know.

It's just confusing for us poor Swedes since "ö" in Swedish is a separate letter with its own pronunciation, and not a somehow-modified "o". Always takes an extra couple of seconds to remember how "Motörhead" is supposed to be said. :)

← PreviousPage 4 of 34Next →