HNHacker News
TopNewBestAskShowJobs

flohofwoe

23,650 karma · joined October 15, 2013

submissionscomments
flohofwoe··on German court calls Google aerial imagery 'spying'
> Germany is full of coal mines that people protest

Note that "full of coal mines" means a total count of 9 in 3 regions with a total area of around 500 km^2, and the protests were pretty much concentrated in one place (the Garzweiler forest), mostly because it is "tradition" there since the early 1980s. The protesters don't seem to care much about any of the other 8 lignite mines that are still in operation ;)

Also interestingly, the area used for open lignite pits for in Germany is about the same as the current area of 'ground installed' solar panels (not really relevant for the discussion but a nice little detail IMHO) :)

flohofwoe··on German court calls Google aerial imagery 'spying'
I'm pretty sure that at least 99.99% of property owners won't care about having their garden shown in full detail on Google maps, and the remaining 0.01% of missing data won't move the needle for statistics (assuming that Google will be required to blur the property on explicit request, as it happens now with house facades).
flohofwoe··on German court calls Google aerial imagery 'spying'
Nice overgeneralization. There is no law which requires to put your name on the door bell, and people are just as mindful about their privacy (or not) as anywhere else in the world.

In Germany it's probably just more likely that your privacy is actually upheld by the law when push comes to shove (especially against privacy-invading companies).

flohofwoe··on German court calls Google aerial imagery 'spying'
The cases where houses are blurred in Germany are on explicit request by the owner and that owner has privacy rights. Also, why should a company (from the other end of the world no less) have more rights over the property than the owner?
flohofwoe··on Local Wikipedia: Wikipedia, but only for things a half hour walk from you
Maybe because Wikipedia has it as a builtin feature ;) (tbf I wasn't aware of that either):

https://en.wikipedia.org/wiki/Special:Nearby

flohofwoe··on Local Wikipedia: Wikipedia, but only for things a half hour walk from you
Could that be a UK thing? I wouldn't know tbh, because between mixing yards and miles versus sticking to imperial units in the 21st century, the latter is definitely crazier ;)
flohofwoe··on Local Wikipedia: Wikipedia, but only for things a half hour walk from you
Hmm, I see metric distances (kilometers). Accessing from Germany. It's still using the English Wikipedia though, not the German one (which I think would have more local content).

PS: there's a side bar link to switch between miles and km, I might have pressed that (was expecting to see some sort of distance map though instead of switching between 'imperial' and 'modern' ;)

flohofwoe··on Local Wikipedia: Wikipedia, but only for things a half hour walk from you
Neat! A whole 25 articles for my neck of the wood :D

(although I guess the German Wikipedia would have a bit more content than the English Wikipedia used here)

flohofwoe··on OpenShell – A safe, private runtime for fleets of autonomous AI agents
So a similar shibboleth as "You are a highly experienced software engineer..."? I really wonder if that ever made a difference (or even degrades quality, because people who advertise themselves on the internet as 'highly experienced' are quite often snake oil salesmen ;)
flohofwoe··on OpenShell – A safe, private runtime for fleets of autonomous AI agents
From the top of AGENTS.md:

> We design systems and use agents to implement them — this is not vibe coding.

Lol, what is even the point of such a statement, and who are they to define what vibe codig is or isn't :D

flohofwoe··on No more icons in every menu by default
It's just another turn of the wheel of reincarnation. In ten years or so, another generation of UI designers will go through the same stupid trial-and-error cycle instead of doing some miminal research what was tried before but didn't work.
flohofwoe··on C# now beats Rust on WASM size
Not necessarily true (especially with the new Zig Io interface), a vanilla Rust Hello World compiles to a 40 KBytes WASI blob, while a vanilla Zig Hello World compiles to 45 KBytes. Both are in the same ballpark. The vanilla C Hello World on the other hand comes out at around 4 KBytes (with the caveat that the compiler is free to replace a non-formatting printf with a direct puts call).
flohofwoe··on Alibaba hikes DeepSeek V4 Flash 0731 output prices by 230%
The only problem is that now you can be banned for being cruel to your AI slaves too, the outrage! /s
flohofwoe··on The Future of CSS
OTH all the complexity ends up baked into the browser where it will be frozen forever (even the shitty/overengineered ideas, like WebAudio). At least frameworks can be discarded and replaced when something better comes along.

IMHO even HTML+CSS should be completely implemented outside the browser in the 'framework layer', but I guess that's not a very popular opinion among the more 'conservative' web devs ;)

flohofwoe··on Flatpak – An Insecurity Nightmare (2023)
Installing an application that advertises your credit card number to the rest of the world probably wasn't a great idea in the first place then.
flohofwoe··on Flatpak – An Insecurity Nightmare (2023)
> We have Android, macOS, and iOS, all with limited access to the system, requiring end-user intervention to access certain resources. But what about the Linux desktop?

The author forgot Windows Vista which started this whole shitshow of granular permission popups ;)

But am I the only one who fundamentally does not want this permission popup crap on a desktop operating system? I explicitly want applications to access the data of other applications or even remote-control other apps, that's the base for building automated workflows where the result is more than the sum of its parts.

Let me define sandbox boundaries for whole groups of applications and special safe locations for actually sensitive data, not require each application to live in its own isolated sandbox.

flohofwoe··on macOS 15.8.2 Breaks OpenGL
> The decision not to support Vulkan however is most likely a political decision.

The only platform where running WebGL on top of Vulkan would make sense is Linux, and on Linux both the GL and Vulkan drivers are in good shape via the MESA project (e.g. there's little incentive to switch from a perfectly fine OpenGL driver to Vulkan for implementing WebGL), especially since the only outlier (NVIDIA) doesn't have all that great 'native' Vulkan support either (IME at least).

flohofwoe··on macOS 15.8.2 Breaks OpenGL
> WebGL2 already has a compatibility layer to make it work on macOS

...and also on Windows (where WebGL runs on top of D3D). AFAIK Linux is the only platform where browsers actually use OpenGL to implement WebGL.

flohofwoe··on macOS 15.8.2 Breaks OpenGL
> The point of OpenGL was to have an API universally supported everywhere

That was always more like a dream than reality. OpenGL implementations between GPU vendors and platforms all have significant "implementation defined behaviour", interesting bugs and different performance "hot paths". And as soon as you need to start using extensions, portability is out the window anyway. Even setting up a GL context across different operating systems (e.g. the very first thing every GL application needs to do) is a royal PITA unless bringing in additional helper libraries like GLFW or SDL.

Arguably the only actually portable GL flavour is WebGL.

flohofwoe··on macOS 15.8.2 Breaks OpenGL
Random audio crackling in Spotify since macOS 27 on my M1 MBP is one example. I can imagine that's there's a lot of fingerpointing going on though (e.g. whether it's a macOS, Chromium or Spotify client issue). Only thing I know is that it only started with the macOS 27 betas and hadn't been fixed in the final release).

I haven't heard the crackling for a couple of days though, so maybe it has finally been fixed in the latest 27.x beta or a recent Spotify client update, or maybe I'm just on a lucky streak.

flohofwoe··on macOS 15.8.2 Breaks OpenGL
It's destroying and creating Vulkan objects (which then in turn destroy and create Metal objects) when changing some random GL state (aka "hash-and-cache") which is the critical problem when trying to emulate GL on a modern 3D API.

Modern 3D APIs have moved all expensive operations into the creation of immutable state-group objects, while OpenGL is the opposite (every single state can be changed at any time).

E.g. mapping any modern 3D API to any other modern 3D API is mostly fine since the expensive operations happen outside the hot path, but mapping OpenGL to any modern 3D API is problematic.

flohofwoe··on macOS 15.8.2 Breaks OpenGL
For Vulkan-on-Metal it shouldn't matter much because in the modern 3D APIs most of the expensive work happens upfront in the 'init path' (e.g. when creating objects, not when using them).

OpenGL on a modern API is another issue though because OpenGL is highly dynamic and really isn't a great match for translating to Vulkan, Metal or D3D12 (e.g. changing OpenGL state may involve throwing away and creating underlying Vk, Metal or D3D state objects on the fly, which is expensive).

flohofwoe··on macOS 15.8.2 Breaks OpenGL
Bitrot in the Apple OpenGL shim or (especially) window system glue really isn't unusual unfortunately.

E.g. the most recent actual bug in the Apple GL shim I stumbled over is that when copying data from the pixel unpack buffer bindpoint, the two ways to provide an offset into the source data are both broken.

I suspect that any feature that's not on the beaten path (e.g. used by a handful legacy but popular GL applications) simply isn't tested, assuming any testing even happens at all.

PS: also personal opinion, and not related to the Apple mess: just let GL go, it's really not a great API to work with (at least not since version 2). Vulkan isn't all that great either, but at least it has slowly started to change into the right direction in the last couple of years, while GL will remain a mess forever since Khronos has dropped the API too - and on Apple devices, Metal is clearly the better (and much nicer to work with) choice compared to both GL and Vulkan.

flohofwoe··on The Commodore 64 hardware simulator: break chips and pins, see the results
> Just glancing at the source you could do easy 100x performance improvements with simple fixes.

Now that you said this you really are expected to do a proof-of-concept implementation that is 100x faster, but with the same low-level concepts ;)

I think 2..3x might be achievable assuming the vibe-coded code quality is really badly optimized, but definitely not 100x.

As far as I understand the simulation, it does the entire address decoding and memory accesses as a transistor-level simulation (which is the whole point!), e.g. everything that happens outside the CPU, CIAs, SID and VIC-II. That means every single memory access has significant overhead because it is essentially simulated from a transitor netlist similar to how visual6502.org simulates the CPU (which even in an optimized C simulation like https://github.com/mist64/perfect6502 is still about 30x slower than a real 6502 at 1 MHz).

PS: Let's do some simple napkin math: the Antirez simulator is 3x slower than a real C64, 100x faster would mean around 30x faster than a real C64, e.g. like a C64 clocked at 30 MHz. That means on a 3 GHz host CPU you would have 100 host clock cycles to emulate a (30Mhz) C64 system clock cycle, and that's for 5 complex chips (CPU + 2xCIA + VICII + SID), so around 20 host clock cycles per emulated cycle for each chip, and that doesn't include address decoding and memory access (which is the expensive part in Antirez's simulator). And moving the chip emulators into threads won't help you much here, because you'd need to synchronise at least once per emulated clock cycle (maybe even twice per emulated clock cycle because of the C64's phi-1 and phi-2 'half cycles').

Good luck with that :) (e.g. squeezing a complete VIC-II clock cycle which renders 8 pixels and may have up to 8 active sprites into 20 host system clock cycles, even with perfect pipelining, SIMD, and no cache misses this isn't a lot of host CPU instructions compared to what a VIC-II needs to do each cycle).

(disclaimer: I'm the author of the pin-based chip emulators used in this experiment)

flohofwoe··on Arena Allocators in C
[[nodiscard]] is new, but returning structs worked before of course (at least since C99).

You can even integrate the struct declaration right into the return type:

https://www.godbolt.org/z/GGraK61M6

(which tbf though has limited usability)

flohofwoe··on Arena Allocators in C
> Because C is fundamentally defined for an abstract machine.

This is more like a guideline than actual rule ;) (e.g. the C standard is also full of implementation defined behaviour, and that's fine).

Instead of obsessing over theoretical C standard details, people should build their code with "-Wall -Wextra" (that's the absolute minimum), maybe -pedantic (which however disables a lot of useful non-standard extensions that are accepted by most popular compilers), run the code through a static analyzer, and test with ASAN, UBSAN and TSAN (and nowadays, also let an LLM do a bug scan over the code).

When all those things are clean, the code is in pretty good shape and will most likely survive porting to a new target platform or compiler.

UBSAN is also pragmatic enough to focus on the 'important' UB, and ignore the 'irrelevant' types of UB.

flohofwoe··on Arena Allocators in C
It is totally fine for C code to make "assumptions about the platform".

I'm not sure where this obsession with non-existing or irrelevant target platforms is coming from that might be theoretically supported by the C standard, but are not relevant in the real world except for niche use cases which the library author might not care about (like some extremely limited embedded CPUs). E.g. not every C library needs to support every target platform just because that target platform has a C compiler, and all code (not just C code) should be considered broken anyway until it is actually tested on a specific platform (and in that case any problems that show up are trivial to fix).

You're right about the macro thing of course.

The typedef-thing is arguable, I would at least try to not let such custom typedefs over basic types leak into the public API of the library where they could collide with typedefs of other libraries (e.g. all public types of a library should have at least a prefix which makes name collisions with other libraries unlikely).

flohofwoe··on Arena Allocators in C
There's really no other way for a general allocation function that doesn't know the target type. I would expand the default alignment from 8 to 16 bytes though, because this is what you typically get from malloc on 64-bit targets, and a bigger 'natural alignment' should be extremely rare (maybe needed for some SIMD types, but those are outside the C standard anyway).

> It's not just an issue of unaligned accesses being slow; in practice, your program might also crash or access unexpected data on real platforms with real compiler implementations.

Unaligned accesses are fast (unless they straddle a cache line or involve SIMD registers) and work perfectly well on current mainstream CPUs (and have been working fine for a long time).

E.g. I'm really not a fan of taking every piece of C code apart because it might not work on an experimental CPU design from the 1960s which the C standard theoretically supports but no current C compiler ;) (exaggerating of course, but there's no way around testing on all expected target compilers and platforms, any target config that's not explicitly tested should be considered unsupported, and that's not even a programming language specific thing).

flohofwoe··on Arena Allocators in C
It's ok as long as the types don't leak into the public API when the code is distributed as a library. But yeah, it looks like a leftover bad habit from pre-C99 times (I suspect the author is on Windows where MSVC was very late to the C99 party), and Microsoft also recommened for a while to build C code via the C++ compiler, which is where the "cast result of malloc" habit might come from.
flohofwoe··on Arena Allocators in C
> The code assumes that int and i32 are the same size.

Tbf this is extreme nitpicking. It's very unlikely that the code will ever be built on a compiler where int is not 32 bits. Replacing the sizeof(int) with sizeof(i32) is better of course, and tbh it looks like an oversight, not intentional.

> Don't cast the return value of malloc(). Please Google this.

This is required when the code should also build in C++ mode (which some weirdos seem to prefer for "improved type safety") - in any case, the explicit cast is also entirely valid C code, so not wrong just redundant.

> The macros doing arithmetic (KiB, MIN etc) don't put their arguments in parentheses, that is very dangerous.

Agreed.

I would add though:

> Don't typedef C primitive types to your own shortcuts (like int32_t => i32), at least not when those typedefs leak into the public API, because then your i32 may collide with another library's i32.

← PreviousPage 3 of 34Next →