HNHacker News
TopNewBestAskShowJobs

BlackFly

2,043 karma · joined August 8, 2011

Theoretical physicist, theoretically now a software engineer
submissionscomments
BlackFly··on Go has added Valgrind support
This was often a question asked in Java interviews as well.

In Java heap fragmentation is usually considered a separate issue but I understand go has a non-moving garbage collector so you can lose memory due to pathological allocations that overly fragment memory and require constantly allocating new pages. I could be wrong about this since I don't know a lot about go, but heap fragmentation can cause troubles for long running programs with certain types of memory allocation.

Beside that, applications can leak memory by stuffing things into a collection (map or list) and then not cleaning it up despite becoming "stale". The references are live from the perspective of the garbage collector but are dead from the application perspective. Weak references exist to solve this problem when you expose an API that stores something but won't be able to know when something goes out of scope. I wouldn't consider this to be common, but if you are building a framework or any kind of platform code you might need to reach for this at some point. Some crazy folks also intern every string they encounter "for performance reasons" and that can obviously lead to what less crazy folk would consider a memory leak. Other folk stick a cache around every client and might not tune the cache parameters leading to unnecessary memory pressure...

BlackFly··on Uncle Sam shouldn't own Intel stock
> Per your definition, anyone who desires a vacation to a tropical island is greedy. Or eating at restaurants.

It isn't my definition, it's Merriam-Webster dictionary, and I suggest reading the definition more carefully, it really isn't that hard to understand. That is how the word is used.

All of your examples are not selfish or excessive. So not greedy. That it isn't a clear bright line isn't a problem, most judgements in life are not clear cut.

BlackFly··on Uncle Sam shouldn't own Intel stock
Getting more than needed does not imply that something is needed at all. You can live your whole life without needing to eat a Lychee, but if you eat 1000 of those that is clearly more than needed. A person who never ate a lychee maybe cannot put it into perspective and might suggest that wanting a single lychee is greed, but most people wouldn't find it difficult to see that perspective as extreme. Change lychee for cocaine and you suddenly start getting a different balance.

Context and our norms is what determines it.

BlackFly··on Uncle Sam shouldn't own Intel stock
Yes, and altruism doesn't exist, everyone is political, and a whole slew of other nonsense banalizations that pretend that distinctions cannot be made.

> Greed: a selfish and excessive desire for more of something (such as money) than is needed

This definition is quite easy to distinguish ordinary desire from greed. Otherwise you need to render selfish and excessive banal and meaningless as well.

BlackFly··on Busy beaver hunters reach numbers that overwhelm ordinary math
Yes, I understood what the parent suggested. I am pointing out that such a number may have strange properties like the fact that a number larger than it can have a smaller Kolmogorov complexity, then I am questioning whether there is a number such that every number larger than it has such a large Kolmogorov complexity that it cannot be encoded. The question therefore becomes, is there a limit to the size of physically describable numbers? Or is there always going to be some number larger with some trivial kolmogorov complexity?
BlackFly··on Busy beaver hunters reach numbers that overwhelm ordinary math
I think such a number is going to have strange properties like, some number bigger than that unencodable number is encodable because of a special pattern that allows a special non-surjective recursive function to encode it. I am just wondering if there really is smallest number for which no number greater than it is encodable.

It is not obvious to me that the definition of an encodable function has bounded growth: is it true that f(1) - f(0) for encodable f always has a bound given by the amount of data used to encode f? What is that bound?

BlackFly··on Ask HN: Best codebases to study to learn software design?
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··on Data, objects, and how we're railroaded into poor design (2018)
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··on Google admits anti-competitive conduct involving Google Search in Australia
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··on Myths About Floating-Point Numbers (2021)
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··on Myths About Floating-Point Numbers (2021)
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··on Myths About Floating-Point Numbers (2021)
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··on His psychosis was a mystery–until doctors learned about ChatGPT's health advice
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··on We shouldn't have needed lockfiles
> 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··on Electric bikes might just be the healthiest thing to ever happen to teenagers
Thanks for this link! I'm happy to see this spreading.
BlackFly··on Electric bikes might just be the healthiest thing to ever happen to teenagers
> 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.

BlackFly··on Electric bikes might just be the healthiest thing to ever happen to teenagers
Yeah, those fatbikes are just the latest iteration of the old little scooters (bromfiets) with the small win of being more quiet. I feel like the size of them and the seating arrangement should enable them to legislate fat bikes as scooters while only catching a small number of modified pushbikes that the police would likely ignore when the cyclist isn't being a nuisance.

They'll definitely gain weight, it is quite easy to tell that they aren't exerting much effort during pedal assist.

BlackFly··on Python performance myths and fairy tales
It isn't an either or choice. The people interested in optimizing the performance are typically different people than those interested in implementing syntactic sugar. It is certainly true that growing the overall codebase risks introducing tensions for some feature sets but that is just a consideration you take when diligently adding to the language.
BlackFly··on Python performance myths and fairy tales
The secret as stated is the comlexity of a JIT. In practice, that dynamism just isn't used much in practice and in particular in optimization targets. The JIT analyses the code paths, sees that no writes to the target are possible so treats it as a constant.

Java has similar levels of dynamism-with invokedynamic especially, but already with dynamic dispatch-in practice the JIT monomorphises to a single class even though by default classes default to non-final in Java and there may even be multiple implementations known to the JVM when it monomorphises. Such is the strength of the knowledge that a JIT has compared to a local compiler.

BlackFly··on Python performance myths and fairy tales
Latest version officially supports full-threaded mode: https://docs.python.org/3.14/whatsnew/3.14.html#whatsnew314-...
BlackFly··on Shrinking freshwater availability increasing land contribution to sea level rise
This is what I found:

https://ourworldindata.org/grapher/sea-level

I don't see much of an acceleration...

BlackFly··on Playing with more user-friendly methods for multi-factor authentication
That's my preference. For some things I would be willing to have the increased security of a genuinely separate device.
BlackFly··on Playing with more user-friendly methods for multi-factor authentication
The problem with multi-factor authentication is its overuse. I would also hate physical keys if every single door I came across required me to unlock it.

When you already have so many logins that you start using a password manager, your passwords are already high entropy enough that they don't get brute forced and a leak doesn't compromise your other accounts. TOTP adds challenge response to this, so it is actually a bit better than a password since an interception cannot be reused, but they are both still shared secret and in both cases need to be stored in some other device (password manager vs TOTP code manager). For most logins that don't require real security I just use my password manager for both so it is just a disjoint shared secret approach. Nevertheless, TOTP "increases security" for websites (but not my security specifically) because the shared secret is generated by the website owner so is definitely unique and not reused unlike many other user's passwords.

I expect the majority of people are storing their TOTP secrets on the device they are logging in from (their mobile device) and so have single points of vulnerability. So multifactor auth is typically just a disjoint shared secret with a partial challenge. The extra security is just created because the website forces true random shared secret. We could have all this with a single factor.

BlackFly··on Playing with more user-friendly methods for multi-factor authentication
Except for those whose fingerprints don't work (climbing wears away fingerprints). I have even heard of people struggling to renew their passports because of difficulties getting their fingerprints read.
BlackFly··on There is no memory safety without thread safety
No, rust forces you to use a mutex but nothing will prevent you from making the mutex too small and creating tearing in your own data structures by sequentially modifying things covered by mutexes so that in between acquisition of the locks you are violating invariants. The borrow checker certainly helps however, but not without cost that was finally minimized when the scoped threads api came along.

Java has a very specific memory model, so the behavior of variables across threads is quite well defined. Basic variables can tear however (a 64bit long on a 32bit architecture) without the volatile keyword and that is quite different than rust.

BlackFly··on When Is WebAssembly Going to Get DOM Support?
My reading of it is that the people furthering WASM aren't really associated with just browsers anymore and they are building a whole new VM ecosystem that the browser people aren't interested in. This is just my take since I am not internal to those organizations. But you have the whole web assembly component model and browsers just do not seem interested in picking that up at all.

So on the one side you have organizations that definitely don't want to easily give network/filesystem/etc. access to code and on the other side you have people wanting it to be easier to get this access. The browser is the main driving force for WASM, as I see it, because outside of the browser the need for sandboxing is limited to plugins (where LUA often gets used) since otherwise you can run a binary or a docker container. So WASM doesn't really have much impetus to improve beyond compute.

BlackFly··on A 14kb page can load much faster than a 15kb page (2022)
Katex renders to MathML (either server side or client side). Generally people want a slightly more fluent way of describing an equation than is permitted by a soup of html tags. The various tex dialects (generally just referred to as latex) are the preferred methods of doing that.
BlackFly··on Hyatt Hotels are using algorithmic Rest “smoking detectors”
I'd refuse to pay the charge on check out. If they charged my card anyways I would demand a refund and inform the consumer protection agency, wait 30 days and issue the chargeback. Luckily these things work well in my nation.
BlackFly··on Gmail/Google starts disabling features unless you agree to data processing
Its apparently a false dichotomy of "Allow Gemini access to your data" or "Disable display of email events in calendar". Although maybe under the hood they were always using ML and the new ML algorithm is an LLM...
BlackFly··on I was wrong about robots.txt
This is just a problem of sharing information in band instead of out of band. The OpenGraph metadata is in band with the page content that doesn't need to be shared with OpenGraph bots. The way to separate the usage is to separate the content and metadata with some specific query using `content-type` or `HEAD` or something, then bots are free to fetch that (useless for AI bots) and you can freely forbid all bots from the actual content. Then you don't really need much of a legal framework.
← PreviousPage 3 of 22Next →