Readit News logoReadit News
BlackFly commented on Ask HN: Best codebases to study to learn software design?    · Posted by u/pixelworm
BlackFly · 18 hours ago
I can recommend reading about postfix architecture if you want to learn a bit about what would nowadays be called a microservice architecture:

https://www.postfix.org/OVERVIEW.html

You might need to know a bit about how email servers work to appreciate it though.

BlackFly commented on Data, objects, and how we're railroaded into poor design (2018)   tedinski.com/2018/01/23/d... · Posted by u/dvrp
arethuza · 4 days ago
My main complaint with SOAP was how leaky an abstraction it inevitably is/was - it can look seductively easy to use but them something goes wrong or you tried to use it across different tech stacks and then debugging would become a nightmare.

When I first encountered RESTful web services using JSON the ability to easily invoke them using curl was such a relief... (and yes, like lots of people, I went through a phase about being dogmatic about what REST actually is, HATEOAS and all the rest - but I've got over that years ago).

NB I also am puzzled as to the definition of "data" used in the article.

BlackFly · 4 days ago
Yeah, a leaky abstraction with abstraction inversion on top of it! So within the actual payload there was a method identifier so you had sub-resource routing on top of the URL routing just so you could have middleware handling things on the payload instead of in the headers... So you had an application protocol (SOAP) on top of an application protocol (HTTP).
BlackFly commented on Google admits anti-competitive conduct involving Google Search in Australia   accc.gov.au/media-release... · Posted by u/Improvement
bko · 7 days ago
How is it fair? I would think if two parties commit the same crime they should be charged the same. Isn't fairness in law defined as being blind to the perpetrator?

Google doesn't do stuff to be evil. It does so bc it makes economic sense on the margin. It doesn't like paying fines and arbitrary enforcement will just be used politically. You might like this case bc Google bad, but what if NBC gets fined an insane amount by current admin for their interview cropping, to discourage bad behavior, because you know, fairness.

IMO the fairway thing would be to remove as much discretion as possible so not to make things political by either side

BlackFly · 7 days ago
Proportional to income is "the same" under the equivalence of time and money. A fine is some % of your income which is some % of your working time. The fine as a penalty should roughly be equivalent to time spent in prison, so that is some fixed amount of time which automatically translates to some lost amount of salary. Going to prison being an alternative to paying a fine when you aren't solvent.

Otherwise it isn't a penalty and is just the price of being permitted to do a thing which might be out of reach for the poor. That's just fundamentally unfair to permit the rich to do things we consider immoral if they are just able to afford it.

BlackFly commented on Myths About Floating-Point Numbers (2021)   asawicki.info/news_1741_m... · Posted by u/Bogdanp
jcranmer · 11 days ago
Wow, you're crossing a few wires in your zeal to provide information to the point that you're repeating myths.

> The intel processors have a separate math coprocessor that supports 80bit floats

x86 processors have two FPU units, the x87 unit (that you're describing) and the SSE unit. Anyone compiling for x86-64 uses the SSE unit for default, and most x86-32 compilers still default to SSE anyways.

> Moving a float from a register in this coprocessor to memory truncates the float.

No it doesn't. The x87 unit has load and store instructions for 32-bit, 64-bit, and 80-bit floats. If you want to spill 80-bit values as 80-bit values, you can do so.

> Repeated math can be done inside this coprocessor to achieve higher precision so hot loops generally don't move floats outside of these registers.

Hot loops these days use the SSE stuff because they're so much faster than x87. Friends don't let friends use long double without good reason!

> Non-determinism occurs in programs running on intel with floats when threads are interrupted and the math coprocessor flushed.

Lol, nope. You'll spill the x87 register stack on thread context switch with FSAVE or FXSAVE or XSAVE, all of which will store the registers as 80-bit values without loss of precision.

That said, there was a problem with programs that use the x87 unit, but it has absolutely nothing to do with what you're describing. The x87 unit doesn't have arithmetic for 32-bit and 64-bit values, only 80-bit values. Many compilers, though, just pretended that the x87 unit supported arithmetic on 32-bit and 64-bit values, so that FADD would simultaneously be a 32-bit addition, a 64-bit addition, and a 80-bit addition. If the compiler needed to spill a floating-point register, they would spill the value as a 32-bit value (if float) or 64-bit value (if double), and register spills are pretty unpredictable for user code. That's the nondeterminism you're referring to, and it's considered a bug in every compiler I'm aware of. (See https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p37... for a more thorough description of the problem).

BlackFly · 11 days ago
It isn't zeal, it's 15 years past hazy memory of getting different results on different executions in the same supercomputer. The story that went around was the one I relayed, but certainly your link does a better job explaining things that happen in the user perspective section:

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p37...

Summarized as,

> Most users cannot be expected to know all of the ways that their floating-point code is not reproducible.

Glad to know that the situation is defaulting to SSE2 nowadays though.

BlackFly commented on Myths About Floating-Point Numbers (2021)   asawicki.info/news_1741_m... · Posted by u/Bogdanp
nyeah · 11 days ago
NaN is not necessarily an error. It might be fine. It depends on what you're doing with it.

If NaN is invalid input for the next step, then sure why not treat it as an error? But that's a design decision not an imperative that everybody must follow. (I picture Mel Brooks' 15 commandments, #11-15, that fell and broke. This is not like that.)

BlackFly · 11 days ago
Sure, not every runtime type error needs to panic your application, nor even panic a request handler, nor even result in a failed handling. That doesn't mean you didn't encounter an error though. Error doesn't mean fatal.

The design decision isn't, "Was this a type error?" but, "What do I need to do about this type error?"

BlackFly commented on Myths About Floating-Point Numbers (2021)   asawicki.info/news_1741_m... · Posted by u/Bogdanp
BlackFly · 11 days ago
You can exploit the exactness of (specific) floating point operations in test data by using sums of powers of 2. Polynomials with such coefficients produce exact results so long as the overall powers are within ~53 powers of 2 (don't quote me exactly on that, I generally don't push the range very high!). You can find exact polynomial solutions to linear PDEs with such powers using high enough order finite difference methods for example.

However, the story about non-determinism is no myth. The intel processors have a separate math coprocessor that supports 80bit floats (https://en.wikipedia.org/wiki/Extended_precision#x86_extende...). Moving a float from a register in this coprocessor to memory truncates the float. Repeated math can be done inside this coprocessor to achieve higher precision so hot loops generally don't move floats outside of these registers. Non-determinism occurs in programs running on intel with floats when threads are interrupted and the math coprocessor flushed. The non-determinism isn't intrinsic to the floating point arithmetic but to the non-determinism of when this truncation may occur. This is more relevant for fields where chaotic dynamics occur. So the same program with the same inputs can produce different results.

NaN is an error. If you take the square root of a negative number you get a NaN. This is just a type error, use complex numbers to overcome this one. But then you get 0. / 0. and that's a NaN or Inf - Inf and a whole slew of other things that produce out of bounds results. Whether it is expected or not is another story, but it does mean that you are unable to represent the value with a float and that is a type error.

BlackFly commented on His psychosis was a mystery–until doctors learned about ChatGPT's health advice   psypost.org/his-psychosis... · Posted by u/01-_-
infecto · 11 days ago
Have a large part of the population always been susceptible to insane conspiracies and psychosis or is this recent phenomenon? The feels less of a ChatGPT problem and something more is at play.
BlackFly · 11 days ago
The psychosis was due to bromism (bloodstream bromine buildup to toxic levels) due to health advice to replace sodium chloride with sodium bromide in an attempt to eliminate chloride from his diet. The bromide suggestion is stated as coming from ChatGPT.

The doctors actually noticed the bromine levels first and then inquired about how it got to be like that and got the story about the individual asking for chloride elimination ideas.

Before there was ChatGPT the internet had trolls trying to convince strangers to follow a recipe to make beautiful crystals. The recipe would produce mustard gas. Credulous individuals often have such accidents.

BlackFly commented on We shouldn't have needed lockfiles   tonsky.me/blog/lockfiles/... · Posted by u/tobr
epage · 18 days ago
Let's play this out in a compiled language like Cargo.

If every dependency was a `=` and cargo allowed multiple versions of SemVer compatible packages.

The first impact will be that your build will fail. Say you are using `regex` and you are interacting with two libraries that take a `regex::Regex`. All of the versions need to align to pass `Regex` between yourself and your dependencies.

The second impact will be that your builds will be slow. People are already annoyed when there are multiple SemVer incompatible versions of their dependencies in their dependency tree, now it can happen to any of your dependencies and you are working across your dependency tree to get everything aligned.

The third impact is if you, as the application developer, need a security fix in a transitive dependency. You now need to work through the entire bubble up process before it becomes available to you.

Ultimately, lockfiles are about giving the top-level application control over their dependency tree balanced with build times and cross-package interoperability. Similarly, SemVer is a tool any library with transitive dependencies [0]

[0] https://matklad.github.io/2024/11/23/semver-is-not-about-you...

BlackFly · 17 days ago
> All of the versions need to align to pass `Regex` between yourself and your dependencies.

In nominally typed languages, all types have to be nominally the same, yes, but it does not follow that semver compatible packages will not permit passing different versions of each around: https://github.com/dtolnay/semver-trick (the trick is to ensure that different versions have nominally the same type by forward dependency).

Anyways, even with this, cargo has a lock file because you want to run in CI what you ran when you developed the feature instead of getting non-deterministic executions in an automated build + verification. That's what a deterministic build is aiming for. Then next feature you develop you can ignore the lockfile, pull in the new dependencies and move on with life because you don't necessarily care for determinism there: you are willing to fix issues. Or you aren't and you use the lockfile.

BlackFly commented on Electric bikes might just be the healthiest thing to ever happen to teenagers   electrek.co/2025/08/05/el... · Posted by u/harambae
nicktelford · 18 days ago
The UK Highway Code was revised a few years ago to explicitly allow and even recommend cycling two-abreast[1].

1: https://www.gov.uk/guidance/the-highway-code/rules-for-cycli...

BlackFly · 18 days ago
Thanks for this link! I'm happy to see this spreading.
BlackFly commented on Electric bikes might just be the healthiest thing to ever happen to teenagers   electrek.co/2025/08/05/el... · Posted by u/harambae
j_w · 18 days ago
Four comments and only one seems to be related to the article.

The article is about "touching on independence, mental health, social behavior, and even environmental awareness" just as much as not sitting on your butt inside.

It talks about car culture and social challenges. It recommends class 1 e-bikes so you still have to pedal (no throttle). Yes e-bikes are "cheating" the exercise of cycling, but teens aren't getting e-bikes to go cycling they are getting them to travel without asking somebody to drive them.

Throttle e-bikes are a bit of a menace in my area, but that's whatever. If more people can get outside and enjoy life that's a huge win.

BlackFly · 18 days ago
> This type of group riding brings back real-world socialization, which is especially crucial right now.

> many teens haven’t yet learned the road rules,

There are few nations in the world that respect cycling as a mode of transportation enough to legislate that cyclists are permitted to ride two abreast (I am only aware of the Netherlands). Instead, in most nations two cyclists out for a "convivial" trip together are forced to ride single file while two seat wide vehicles operated typically by a single driver in a vehicle wider than two bicycles riding abreast speed merrily by.

Let the teens ride side by side.

u/BlackFly

KarmaCake day1881August 8, 2011
About
Theoretical physicist, theoretically now a software engineer
View Original