HNHacker News
TopNewBestAskShowJobs

nickelpro

2,445 karma · joined December 21, 2019

https://vito.nyc
submissionscomments
nickelpro··on Supreme Court upholds TikTok ban, but Trump might offer lifeline
There weren't any laws passed banning Soviet associated agencies from publishing based on chain of ownership. Nothing to do with SCOTUS.

Read the opinion, the law was upheld on intermediate scrutiny. It doesn't ban based on content, it bans based on the designation of the foreign parent as an adversary. Since it's not a content ban, or rather because it's a content-neutral ban, strict scrutiny does not apply.

Without strict scrutiny, the law merely needs to fulfill a compelling government interest.

nickelpro··on Visualizing All ISBNs
This is a separate problem, but a notable one.

Lighting up the entire grid is still the goal, you're describing the problem of ensuring the right set of squares is illuminated for each piece of archived content. One is a problem of archiving the content, the other is a problem of bookkeeping.

nickelpro··on Visualizing All ISBNs
You said:

> From a strict point of view, they've released new editions of these books.

And this is clearly a semantically worthless distinction from the point of view of the archive.

When different editions have different content, archiving those differences in that content may matter (arguably not for simple typographical corrections, printing errors, etc). When different ISBNs have identical content, it is totally irrelevant to the goals of the archive.

nickelpro··on Visualizing All ISBNs
> Steven King wrote two books named The Stand, and one isn't anything like the other

Then those two texts would map to different ISBNS, or perhaps each maps to multiple different ISBNs, it doesn't matter. That some texts exist with the same title but different content is similarly irrelevant.

The content is all that matters. Two different bodies of content, two different entries in the archive. Each entry may map to one or more ISBN numbers.

> the differences actually matter to the rest of us

The only differences that matter are what matters to the archive that made the blog post. Your concerns are for entirely different things, which is fine, but don't say the OP's concerns or initiatives are impossible or ill-suited based on a criteria you're projecting onto them.

nickelpro··on Visualizing All ISBNs
Worthless semantics in the context of the mission of the project.

What you've described is that the archived content can be mapped to multiple ISBNs. It's clear the only element of concern here is the content itself. The failure to preserve a particular binding or printer's choice of typeface is irrelevant.

Failing to recognize this requires an almost malicious level of pedantry

nickelpro··on You don't have to pay the Microsoft 365 price increase
Everyone uses Google Docs, everyone, even people who don't use Google Docs have some interaction with Google Docs.

You use Google docs.

nickelpro··on You don't have to pay the Microsoft 365 price increase
I cannot think of a single non-business oriented user who needs MS365

Trivial personal users moved to free alternatives ages ago, business users are either using organizational licenses or are small-business users who aren't using family plans to begin with.

I'm mystified by who the affected audience is of this.

nickelpro··on Botan: Crypto and TLS for Modern C++
This only makes sense if you're doing greenfield development. The second you need to support existing protocols and devices where those decisions were chiseled in stone years or decades before, you'll be happy for a long list of hashes and algorithms all contained inside a single package with a single API to learn.
nickelpro··on The two factions of C++
> Don't see what prevents the solution from the language side.

The standard has nothing to say about calling convention. Calling conventions are defined by the ABI standards. unique_ptr is a class template, how a class is passed between routines is defined by ABI standards, ergo how unique_ptr is passed between routines is defined by the ABI standards. I don't know what else you're implying here. Unless you're saying we should have language-level smart pointers, not class templates, in which case yes that's an awful idea.

> That's not C++...

If you're arguing about some abstract, Platonic ideal of C++ that is divorced from the actual implementations that exist in the world, I don't know what your point is. We write code to be compiled by compilers that exist, not printed out and contemplated in a museum. The compilers support __restrict, people use it all the time, so its not a problem.

> Even the compilers...

Where else do you want it? What would its meaning even be to something like a member variable?

Restrict is pointless in any scenario that doesn't involve a potentially aliasing ABI boundary, ie, function parameters. In every other scenario it is ignored.

nickelpro··on The two factions of C++
For unique_ptr: This is not a problem that can be solved by the standards committee, they don't control the SysV / Itanium / Win64 standards. You can still use raw pointers if you want to, nothing has been lost from C.

For restrict: Universally supported as `__restrict`, thus not a priority for anyone to "officially" solve. Most major performance complaints fall into this category. Eg, std::regex is bad, sure, but nobody uses std::regex so fixing it doesn't matter.

nickelpro··on The two factions of C++
This isn't about language ABI, which is the realm of the various implementations which have their own stability guarantees.

ABI stability in the context of the standards committee is about library ABI, specifically the standard library. When the committee updated the wording about C++'s std::string in C++11, it meant implementers needed to change the layout of a std::string, making this "new" std::string incompatible with the "old" std::string. Any libraries passing std::string across API boundaries needed to be recompiled with the "new" std::string.

This has no effect on FFIs for interop with other languages, which are not passing STL types across language boundaries to begin with (a std::string has no meaning in Python).

ABI stability for the standard library is motivated by large, old, coroporate codebases which had poor API practices, passed STL types across ABI boundaries, and subsequently lost access to the source code of those libraries and applications or otherwise cannot recompile them for some reason. Many people question the wisdom of catering to such users.

nickelpro··on The two factions of C++
Specifications for package interchange are absolutely essential, which is distinct from language endorsed package managers.

Python doesn't have a language package manager, you're free to use pip or poetry or uv or whatever, but it does have PEP 517/518, which allow all Python package managers to interact with a common package ecosystem which encompasses polyglot codebases.

C++ is only starting to address this problem with efforts like CPS. We have a plethora of packaging formats, Debian, pkg-config, conan, CMake configs, but they cannot speak fluently to one another so the package ecosystem is fractured, presenting an immense obstacle to any integration effort.

nickelpro··on Language is not essential for the cognitive processes that underlie thought
As always, barely anyone reads the actual claims in the article and we're left with people opining on the title.

The claims here are exceptionally limited. You don't need spoken language to do well on cognitive tests, but that has never been a subject of debate. Obviously the deaf get on fine without spoken language. People suffering from aphasia, but still capable of communication via other mechanisms, still do well on cognitive tests. Brain scans show you can do sudoku without increasing bloodflow to language regions.

This kind of stuff has never really been in debate. You can teach plenty of animals to do fine on all sorts of cognitive tasks. There's never been a claim that language holds dominion over all forms of cognition in totality.

But if you want to discuss the themes present in Proust, you're going to be hard pressed to do so without something resembling language. This is self-evident. You cannot ask questions or give answers for subjects you lack the facilities to describe.

tl;dr: Language's purpose is thought, not all thoughts require language

nickelpro··on The C23 edition of Modern C
> what is wrong with NULL?

One of the few advantages of ISO standardization is you can just read the associated papers to answer questions like this: https://wg21.link/p2312

The quick bullet points:

* Surprises when invoking a type-generic macro with a NULL argument.

* Conditional expressions such as (1 ? 0 : NULL) and (1 ? 1 : NULL) have different status depending how NULL is defined

* A NULL argument that is passed to a va_arg function that expects a pointer can have severe consequences. On many architectures nowadays int and void* have different size, and so if NULL is just 0, a wrongly sized argument is passed to the function.

nickelpro··on The Problem with the "Hard Problem"
Bakker's concepts, insomuch as they can be defined and I have an understanding of what he tried to define, represent the conclusions of Daniel Dennett's "user illusion" via the mechanisms of Hofstadter's strange loop.

Both ideas are better discussed by their original authors than Bakker's strange bootleg. This post's philosophical soup is somehow even less convincing and coherent than Bakker.

nickelpro··on The Problem with the "Hard Problem"
I got as much from his sidebar, but even without it's obvious from the way he writes about the hard problem.

Only the faithful bring up Descartes and dualism with a straight face (not so much as a knowingly raised eyebrow for the audience), or make arguments like "this is how things are naturally phrased in English, therefore that must be how they literally, ontologically, are."

nickelpro··on The Problem with the "Hard Problem"
Total claptrap

There are various intelligible rejections of the hard problem; Anil Seth's "Beast Machines", Colin McGinn's "Mysternianism", and Giulio Tononi's "Integrated Information Theory", all come to mind. None are completely satisfying or widely held, all are try to strike a balance between the problems of effective materialism and the more woo-woo frames of idealism and panpsychism (or, commonly, go hard to one end of the scale).

None, not a single one, not from the people who think a billet of 304 stainless steel has feelings or the ones who think the human mind isn't meaningfully differentiated from that billet in its cold unfeeling nature, tries to so fully reject our materialist knowledge of the physical world and regress into this literally medieval understanding.

The author may be experiencing an unbalancing of the humours.

nickelpro··on Undefined behavior in C is a reading error (2021)
> Are brainfuck[1] or malbolge[2] sane?

In that they are sound and consistent, yes, any esoteric language is sane. Merely esoteric.

> I'm not sure, that it is possible to be a good C programmer and to not have any clue of what the compiler will produce...

The compiler is under no requirement to pack structures in a specific way, or under any requirement to produce accesses in a cache pattern that mirrors your intent in the code. The compiler is required to produce a very specific set of observable behaviors, specifically:

> Volatile accesses to objects are evaluated strictly according to the rules of the abstract machine.

> At program termination, all data written into files shall be identical to the result that execution of the program according to the abstract semantics would have produced.

> The input and output dynamics of interactive devices shall take place as specified in 7.23.3. The intent of these requirements is that unbuffered or line-buffered output appear as soon as possible, to ensure that prompting messages appear prior to a program waiting for input.

And that's it. When thinking about the correctness of one's code, things like layout and cache access patterns are irrelevant because the abstract machine does not provide for such things. Thinking in that frame can only lead to errors.

Now, as a fully separate and apart lens to view one's code, of course performance matters. Of course struct layout (as guaranteed by ABI standards like SysV and Windows) matters, of course you should make the optimizer's job easier by doing sequential rather than scattered accesses. That's true of any programming language.

It's true for COBOL and Go and Ada, and yet when using those languages one does not try to reason about accessing objects via incompatible lvalues like C programmers often try to do. This machine-optimization frame of thinking is not a frame you can use to think about the behavior of the program with, behavior needs to be conceived in the frame of the abstract machine.

nickelpro··on Undefined behavior in C is a reading error (2021)
No, C is totally sane for the machine it describes. If you want to describe a different machine, one in which objects can alias, where signed overflow has a specific meaning, etc, you can choose to describe that machine instead using compiler flags. In that case it is on you to understand what new, unstandardized machine you are describing. This is fine and good, nothing wrong with it, and often very useful.

The problem is with ever believing what you are describing with C has some 1-to-1 relationship with what the compiler is producing for a given real world hardware implementation. This delusion is unique to C. Fortran, Python, Java, Go, etc, programmers don't ever think about what the underlying hardware is doing with their code. They're writing code for an abstract machine defined by the language in implementation or standard.

nickelpro··on Undefined behavior in C is a reading error (2021)
The compiler does sane things. I also fundamentally disagree with the OP that the situations that invoke UB are surprising.

This largely derives from C developers believing they understand the language by thinking of it as a loose wrapper around assembly, instead of an abstract machine with specific rules and requirements.

Within the bounds of the abstract machine described by the standard, things like signed integer overflow, pointer aliasing, etc, don't make any sense. They are intuitively undefined. If C developers actually read the standard instead of pretending C describes the 8086 they learned in undergrad, they wouldn't be worried about the compiler doing "sane" things with their unsound code because they wouldn't gravitate towards that code in the first place. No one thinks that dereferencing an integer makes sense, no one accidentally writes that code, because it intuitively doesn't work even in misguided internal models.

This doesn't solve problems like buffer overflows of course, which are much more about the logical structure of the program than its language rules. For that style of logical error there's no hope for C in the general case, although static analyzers help.

nickelpro··on Undefined behavior in C is a reading error (2021)
If you want slow code that behaves exactly the way you expect, turn off optimizations. Congrats, you have the loose assembly wrapper language you always wanted C to be.

For the rest of us, we're going to keep getting every last drop out of performance that we can wring out of the compiler. I do not want my compiler to produce an "obvious" or "reasonable" interpretation of my code, I want it to produce the fastest possible "as if" behavior for what I described within the bounds of the standard.

If I went outside the bounds of the standard, that's my problem, not the compiler's.

nickelpro··on Extreme Pi Boot Optimization
Literally any ESP32 would be better suited. There is zero reason to be booting an entire OS to take a picture and blip it over WiFi.
nickelpro··on Twenty Years of Valgrind (2022)
perf does not provide me with the complete callstack, it's a sampling profiler.

In effectively all latency-sensitive contexts, sampling is worthless. 99.999999% of the time the program is waiting for IO, and then for a handful of microseconds there's a flurry of activity. That activity is the only part I care about and perf will effectively always miss it and never record it to completion.

I need to know the exact chain of events that leads to an object cache miss causing an allocation to occur, or exactly the conditions which led to a slow path branch, or which request handler is consistently forcing buffer resizes, etc.

I never need a profiler to tell me "memory allocation is slow" (which is what perf will give me). I know memory allocation is slow, I need to know why we're allocating memory.

nickelpro··on Twenty Years of Valgrind (2022)
Callgrind is indispensable for performance profiling and has no compiler-based equivalents
nickelpro··on Judge dismisses majority of GitHub Copilot copyright claims
Read the decision, the breach of contract claim simply survived dismissal, but the surrounding discussion makes it clear it doesn't have much of a prayer (which is the same as the "open-source license violation", the OP article is trash).
nickelpro··on How I Program in 2024
Insanity-grade takes end-to-end, not a single word of this should be taken seriously
nickelpro··on C++ patterns for low-latency applications including high-frequency trading
I said "or even", if you're regularly using PGO they're irrelevant, but not everyone regularly uses PGO in a way that covers all their workloads.

The hinting attributes are exceptional for lone conditionals (not if/else trees) without obvious context to the compiler if it will frequently follow or skip the branch. Compilers are frequently conservative with such things and keep the code in the hot path.

The [[likely]] attribute then doesn't matter so much, but [[unlikely]] is absolutely respected and gets the code out of the hot path, especially with inlined into a large section. Godbolt is useful to verify this but obviously there's no substitute for benchmarking the performance impact.

nickelpro··on C++ patterns for low-latency applications including high-frequency trading
Whatever is relevant to the domain you're tackling. How you structurally approach latency in a web server is different than a 3D renderer, which is different than an audio stack, etc. All of those domains have great open source or source available code to learn from, but it wouldn't be useful for me to say "go read HAProxy" if you're never going to touch an HTTP packet. When I'm tackling a problem the first thing I do is research everything everyone else has done on the problem and read their code, benchmark it if possible, and steal all the good ideas.

The basic principles never change. Avoid copies, never allocate, keep the hot path local, and really, good codebases should be doing these things anyway. I don't code any differently when I'm writing a command line argument parser vs low-latency RPC servers. It's just a matter of how long I spend tweaking and trying to improve a specific section of code, how willing I am to throw out an entire abstraction I've been working on for perf.

In the domain of web stuff, effectively all the major load balancers are good to study. HAProxy, nginx, Envoy. Also anything antirez has ever touched.

Application servers are also interesting to study because there's many tricks to learn from a piece of software that needs to interface with something very slow but otherwise wants to be completely transparent in the call graph. FastWSGI is a good example.

nickelpro··on C++ patterns for low-latency applications including high-frequency trading
The work I do is all in the single-to-low-double-digit microsecond range to give you an idea of timing constraints. I'm peripheral to HFT as a field though.

> First, split the load in to simple asset-specific data streams with a front-end FPGA for raw speed. Resist the temptation to actually execute here as the friction is too high for iteration, people, supply chain, etc.

This is largely incorrect, or more generously out-of-date, and it influences everything downstream of your explanation. Think of FPGAs as far more flexible GPUs and you're in the right arena. Input parsing and filtering are the obvious applications, but this is by no means the end state.

A wide variety of sanity checks and monitoring features are pushed to the FPGAs, fixed calculation tasks, and output generation. It is possible for the entire stack for some (or most, or all) transactions to be implemented at the FPGA layer. For such transactions the time magnitudes are mid-to-high triple digit nanoseconds. The stacks I've seen with my own two eyeballs talked to supervision algorithms over PCIe (which themselves must be not-slow, but not in the same realm as <10us work), but otherwise nothing crazy fancy. This is well covered in the older academic work on the subject [1], which is why I'm fairly certain its long out of date by now.

HRT has some public information on the pipeline they use for testing and verifying trading components implemented in HDL.[2] With the modern tooling, namely Verilator, development isn't significantly different than modern software development. If anything, SystemVerilog components are much easier to unit test than typical C++ code.

Beyond that it gets way too firm-specific to really comment on anything, and I'm certainly not the one to comment. There's maybe three dozen HFT firms in the entire United States? It's not a huge field with widely acknowledged industry norms.

[1]: https://ieeexplore.ieee.org/document/6299067

[2]: https://www.hudsonrivertrading.com/hrtbeat/verify-custom-har...

nickelpro··on C++ patterns for low-latency applications including high-frequency trading
Casey's a fundamentalist, in the religious extremist sense. Just as a theologian might have something to learn from the most extremely devout, so it is that there is valuable information in Casey's proselytizing.

But you should no more follow Casey in form and function than you would any other fundamentalist.

← PreviousPage 6 of 21Next →