HNHacker News
TopNewBestAskShowJobs

branko_d

2,241 karma · joined May 2, 2017

submissionscomments
branko_d··on Accepting US car standards would risk European lives
Tragedy of commons.
branko_d··on Java Decompiler
Is there anything especially hard about decompiling (to) Java?

.NET/C# decompilers are widespread and generally work well (there is one built into Visual Studio nowdays, JetBrains have their own, there were a bunch of stand-alone tools too back in the the day).

branko_d··on China reaches energy milestone by "breeding" uranium from thorium
China imports substantially all of its uranium from Kazakhstan and Namibia, and a tiny bit from US. Russia is insignificant.

https://wits.worldbank.org/trade/comtrade/en/country/CHN/yea...

branko_d··on The lost cause of the Lisp machines
Probably because must “emulation” is more like “transpilation” these days - there is a hit up front to translate into native instructions, but they are then cached and repeatedly executed like any other native instructions.
branko_d··on Cloudflare outage on November 18, 2025 post mortem
I would respectfully disagree with most of what you said. I guess individual perspective depends a lot on the kinds of code you work on.

The point about being explicitly part of the API stands, though.

branko_d··on Cloudflare outage on November 18, 2025 post mortem
Sure, but the same is true of any error handling strategy.

When you work with exceptions, the key is to assume that every line can throw unless proven otherwise, which in practice means almost all lines of code can throw. Once you adopt that mental model, things get easier.

branko_d··on Nearly all UK drivers say headlights are too bright
According to Project Farm, Sylvania is the best headlight restoration kit:

https://www.youtube.com/watch?v=kyVCEbfrU-c

branko_d··on Cloudflare outage on November 18, 2025 post mortem
Safe things should be easy, dangerous things should be hard.

This .unwrap() sounds too easy for what it does, certainly much easier than having an entire try..catch block with an explicit panic. Full disclosure: I don't actually know Rust.

branko_d··on Cloudflare outage on November 18, 2025 post mortem
> Exceptions force a panic on all errors

What do you mean?

Exceptions do not force panic at all. In most practical situations, an exception unhandled close to where it was thrown will eventually get logged. It's kind of a "local" panic, if you will, that will terminate the specific function, but the rest of the program will remain unaffected. For example, a web server might throw an exception while processing a specific HTTP request, but other HTTP requests are unaffected.

Throwing an exception does not necessarily mean that your program is suddenly in an unsupported state, and therefore does not require terminating the entire program.

branko_d··on Microsoft's lack of quality control is out of control
Did you try No Country Redirect?

http://www.google.com/ncr

branko_d··on Asus Announces October Availability of ProArt Display 8K PA32KCX
This is not even a regression - it has always been there, unnoticed!
branko_d··on Carmack on Operating Systems (1997)
> Windows still rules the roost, though it wouldn’t be referred to as Win32 today for various reasons.

Win32 is stable, supported and will stay supported forever, as various technologies built on top of it come and go. It is the API for the OS.

> Linux is even more important today, given the Steam Deck and Proton

Which uses Win32 under the hood!

There is a running joke that Win32 is the Linux's most stable API.

branko_d··on Under the hood: Vec<T>
Why? It's just a property of type transformation.

Assuming Parent <- Child ("<-" denotes inheritance):

- If Generic<Parent> <- Generic<Child>: it's covariant.

- If Generic<Parent> -> Generic<Child>: it's contravariant.

- Otherwise: it's invariant.

Or at least it's that straightforward in C#. Are there complications in Rust?

branko_d··on What .NET 10 GC changes mean for developers
> But I haven't used source generators in C# in at least 10 years

Source generators didn't exist in C# 10 years ago. You probably had something else in mind?

branko_d··on What .NET 10 GC changes mean for developers
Some examples:

- Attributes can do a lot of magic that is not always obvious or well documented.

- ASP.NET pipeline.

- Source generators.

I love C#, but I have to admit we could have done with less “magic” in cases like these.

branko_d··on Quicksort explained IKEA-style
I was disappointed that men in the video were sorted by their numbers, but not their height! ;)
branko_d··on Cap'n Web: a new RPC system for browsers and web servers
> would happen the same in a single-threaded event loop

Well...if you implemented a relational DBMS server without using threads. To my knowledge, no such DBMS exists, so the distinction seems rather academic.

> Btw if you really want consistent multi reads, some DBMSes support setting a read timestamp, but the common ones don't.

Could you elaborate? I can't say I heard of that mechanism. Perhaps you are referring to something like Oracle flashback queries or SQL Server temporal tables?

Normally, I'd use MVCC-based "snapshot" transaction isolation for consistency between multiple queries, though they would need to be executed serially.

branko_d··on Cap'n Web: a new RPC system for browsers and web servers
“Running 4 SQL queries in parallel” is not thread-safe if done in separate transactions, and on data that is not read-only.

If some other transaction commits at just the wrong time, it could change the result of some of these queries but not all. The results would not be consistent with each other.

branko_d··on I'm spoiled by Apple Silicon but still love Framework
That’s my experience too. It’s so infuriating!

The solution is to disable Wake Timers.

branko_d··on South Korea's President says US investment demands would spark financial crisis
> businesses should stop quarterly reporting

That might actually not be such a bad thing, if it removes some of the pressure to think overly short-term from the company management.

branko_d··on The Sagrada Família takes its final shape
Hram Svetog Save (Church of Saint Sava) in Belgrade/Serbia started construction in 1935 and the exterior was finished in 2017. I haven’t been there in several years, but my understanding is that the interior is still being worked on and will continue for some years to come…

So not quite “over a century” but getting close. :)

branko_d··on The Asus gaming laptop ACPI firmware bug
> have you not even had any issues with sleep mode on the laptop?

Now that I think of it, I did disable sleep and just use hibernate instead. I no longer remember why - perhaps I too had some issues. Maybe I was just annoyed by Windows restarting in the middle of a night and (c)losing my open applications whenever it wishes to update? Or did I disable Wake Timers for that? Sorry, my memory is a bit fuzzy.

As it is, hibernate works perfectly for me, is fast enough, and it never closes my applications behind my back.

OTOH, I had sleep issues with pretty much all PCs that I ever had (be it laptop or desktop), so maybe it was just inertia to always use hibernation instead. :)

branko_d··on The Asus gaming laptop ACPI firmware bug
Curious, my experience could not have been more different. I still use Asus Zephyrus G15 (GA503QR from 2021) as my main development machine, and also game occasionally on it. It's AMD Zen 3 CPU with GeForce 3070.

As I write this, the fans are either completely stopped or so slow that I cannot hear them. The fans can get a little "whooshy" under load, but nothing out of line with other Windows laptops, as far as I can tell.

I'm running under Windows profile (not one of the ASUS-specific ones in Armory Crate). I also limit the battery to 60%, since I'm mostly using it plugged-in, with external monitor and keyboard. A month ago, I upgraded RAM to 40 GB and added another 4 TB SSD (and cleaned the fans in the process, so it's even quieter). I think I'll keep this machine for a few more years...

That being said, I did experience occasional cursor stuttering, but mostly when the machine is under load (typically during Visual Studio build).

branko_d··on React is winning by default and slowing innovation
> app-runtime version of NAND

In the last 10 years, 3D NAND memory has scaled 10x (in bits per unit area). So… maybe not the best analogy?

branko_d··on React is winning by default and slowing innovation
I think React can be approached a little like JavaScript at this point: just use the good parts!

In my case that means using it as a rendering library and component composer, but not for managing state or side-effects.

branko_d··on Adding OR logic forced us to confront why users preferred raw SQL
> That's part of .NET Framework and therefore legacy, right? Do the database libraries from recent versions of .NET do this?

ADO.NET is available both in the legacy Windows-only .NET Framework and in the new cross-platform .NET (previously known as .NET Core).

> In any case, it's just one framework; previous comment said "all major languages".

Well, you are not implementing a piece of code in "all major languages" - you can pick the one that fits the problem best.

> And it's useful to be able to abstract and compose over expressions and predicates and such, not just data values, which this still doesn't help with.

You can do that via LINQ - there is even special query-like syntax built right into C# for that that looks like this:

    var companyNameQuery =
        from cust in nw.Customers
        where cust.City == "London"
        select cust.CompanyName;
This does NOT load the entire table in memory just to filter on City. It actually transpiles to SQL which does the filtering on the server.

But anything non-trivial is much better done in SQL proper, IMO. Most of the time, at least for OLTP, you'll be using static SQL - that is you will not need to change the text of the SQL query, just parameters. But dynamic SQL is a thing and can be very useful on occasion - which is string concatenation with all the problems that might bring.

branko_d··on Adding OR logic forced us to confront why users preferred raw SQL
> when a particular build of your app executes a query that calls out to a user-defined function, it uses the SQL function code from the same commit that the app itself was built from

I don't really see a "problem" here. Having everything in the same repo is probably the easiest way to ensure that the client cannot go out of sync with the database. When making a release, create a Git tag and deploy both client and database from there.

But you must make sure you know which tag is deployed at each customer. We use naming conventions for that (the name of the customer is part of the Git tag name), or you could hold that mapping externally if necessary.

Once you have that, making a client-level hotfix for a specific customer is (relatively) easy - just branch from the customer's release tag, do the changes you need, run the tests, and there is high probability everything will work properly. Once you release the hotfix, you create another tag and remember that this tag is now installed at the customer, and so on...

If you make changes to the database, then of course you still need to have an upgrade procedure from one version of the database to another, but you can be confident that the client will never query the "wrong" database version. And since both old and new database structure are just SQL files under different Git tags, you can discover exactly what changed by just by diffing.

> What does Visual Studio do?

Visual Studio has a special SQL project type, where you can keep you base table definitions, as well as all the SQL code (stored procedures, functions, views, user-defined types, indexes etc.). You can group the SQL project together with client projects, tools, automated tests and benchmarks in the same "solution" (kind of a project-of-projects). When working on the product, you load that solution, and you have all dependencies in one place, right in the Solution Explorer. This eases navigation and minimizes dependencies whose source code you cannot (easily) see.

After you make your changes, you deploy to the local database (we use the free SQL Server Developer Edition, other databases have their own free editions), run/debug tests, run/debug clients as needed. You can even start debugging a C# test or client application and step into T-SQL stored procedure seamlessly, which can be a very powerful tool for ferreting-out difficult bugs. When you are done with your changes, commit to Git, let the CI double-check the tests and make the build for the the last-row-of-defense manual QA testing. Then deploy, associate the new Git tag to the customer, rinse-and-repeat...

Basically, we treat SQL like every other code, and manage SQL dependencies not fundamentally unlike any other dependencies.

branko_d··on Adding OR logic forced us to confront why users preferred raw SQL
> You want all of your query logic to be versioned with your application code.

SQL can be stored in version control just as well as any other code. This can include application-level queries as well as the DDL SQL which defines the actual structure of your database.

It's sad that tooling for this kind of workflow doesn't seem to be particularly good across the board, Visual Studio being somewhat of an exception.

branko_d··on Adding OR logic forced us to confront why users preferred raw SQL
> Only for parameterization over scalar values.

ADO.NET has full support for table-valued parameters.

branko_d··on Things you can do with a debugger but not with print debugging
I think you have a specific class of race conditions in mind where tight control of the hardware is desirable or even possible.

But what to do if you have a race condition in a database stored procedure? Or in a GUI rendering code? Even web applications can experience race conditions in spite of being "single-threaded", thanks to fetches and other asynchronous operations. I never heard of somebody using ICE in these cases, nor can I imagine how it could be used - please enlighten me if I'm missing something...

> You're changing the conditions that prevent accurate measurement without modification.

Yes, but if the race condition is course-enough, like it often is in above cases, adding print/logging may not change the timings enough to hide the race.

← PreviousPage 2 of 13Next →