HNHacker News
TopNewBestAskShowJobs

slaymaker1907

2,540 karma · joined November 22, 2016

submissionscomments
slaymaker1907··on Higher RAII and the seven arcane uses of linear types
You can sort of work around it by placement new, but it’s still hugely inconvenient in the general case since the thing could have strict alignment requirements.

Oh and not just stack, it also breaks global variables because destructors often get run for those when something gets unloaded or the program stops.

Finally, because C++ gives you tons of control over how assignment works, it’ll probably break being able to use things within other objects unless you give those mark those classes as friend.

slaymaker1907··on Umbra: A Disk-Based System with In-Memory Performance [pdf]
Besides this point, I mostly mentioned it as an example of probably the simplest in-memory yet disk-backed database imaginable. For example, if you want to implement any sort of transactions, you don't want to actually do anything like fsync until you start trying to commit the data.
slaymaker1907··on Umbra: A Disk-Based System with In-Memory Performance [pdf]
It depends on what is meant by in-memory database. The most useful kind IMO is the one which actually saves everything to disk, but is not designed like a traditional RDMS in that it assumes everything, including indices, can be saved in memory. Therefore, you don't need a complicated buffer pool system and you don't need to touch disk at all after startup to service read queries. The most simple approach to such a database is just to MMAP a file.

This kind of workload is probably the most common in all of software development for the past couple of decades given how plentiful RAM is as well as most applications having some need for storing persistent data.

slaymaker1907··on Why SQLite Uses Bytecode
It can also execute a query incrementally. In fact, certain features rely on this behavior. “Watch live data” (in SSMS) for extended events is actually an infinite table-valued function. It’s not exactly rocket science to do in a database, you just need to model data sources and operators as iterators.
slaymaker1907··on Linus Torvalds adds arbitrary tabs to kernel code
Lol, the commit message is just great https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

It's good that Linus is really exercising those 3rd party tools! They should send some money his way for helping them test their code.

slaymaker1907··on If Inheritance is so bad, why does everyone use it?
For a really neat implementation of OOP and inheritance, I would recommend checking out Racket's class system (not to be confused with generics). It mostly solves the multiple inheritance problem by mixins and also has a great interface system.
slaymaker1907··on Autonomous Weapons: The False Promise of Civilian Protection (2022)
150 countries, but missing a lot of key ones like the US, Israel, Russia, and China. (They absolutely should sign this, though).

I’m suspicious that all it will take is one major shock for the house of cards that is international law to come tumbling down just like it did before WW2.

slaymaker1907··on Amazon ditches 'just walk out' checkouts at its grocery stores
So what we thought was automation was really just outsourcing.
slaymaker1907··on Xzbot: Notes, honeypot, and exploit demo for the xz backdoor
Upon further reading, I think you might be correct. I initially thought a good signing process would be sufficient since it sounded like this malicious blob was secretly being included in the tarball by the build server, but it instead seems to be the case that the malicious binary was included in the repo as a test file.

You could probably still protect against this sort of attack using signing, but it would be much more laborious and annoying to get working. The idea is that you would somehow declare that OpenSSH binaries must be signed by a *particular* key/authority, that VS Code is signed by Microsoft, Chrome signed by Google, etc. Additionally, the config declaring all of this obviously needs to be secured so you'd need to lock down access to those files (changing key associations would need to require more permissions than just updating old software or installing new software to be useful).

slaymaker1907··on Xzbot: Notes, honeypot, and exploit demo for the xz backdoor
I think it would help to try and secure signing infrastructure as much as possible. First of all, try to have 3 devs for any given project (this is the most difficult step). Make sure logging into or changing any of the signing stuff requires at least 2 of the devs, one to initiate the JIT and one to monitor.

Additionally, take supply chain steps like requiring independent approval for PRs and requiring the signing process to only work with automated builds. Don't allow for signing bits that were built on a dev machine.

Finally, I think it would help to start implementing signing executables and scripts which get checked at runtime. Windows obviously does executable signing, but it largely doesn't sign stuff like Python scripts. JS in the browser is kind of signed given that the whole site is signed via https. It's not perfect, but it would help in preventing one program from modifying another for very sensitive contexts like web servers.

slaymaker1907··on Why is it so hard to build an airport?
Largescale use of electric planes still seem like sci-fi for the time being, but you did get me thinking that airships would likely produce a lot less noise pollution than planes.
slaymaker1907··on Why Europe is dismantling its dams
Yeah, let's get rid of one of the most effective sources of green energy that works around the clock! The environmental concerns around dams are legitimate, but they need to be balanced against the consequences of how those energy sources will be replaced. There are also mitigation strategies that can be done instead, like the fish ladders that were mentioned in passing, to help mitigate the environmental impact.

Edit: I see climate change isn't even mentioned which is an enormous red flag when talking about hydro power.

slaymaker1907··on What does Alan Kay think about LLMs?
> If we look at human anthropology, we see a species that treats solitary confinement and banishment from society as punishments — we are a society because we can cooperate and trust a little — but when are safely back in society, we start competing like mad (and cheating like mad) as though the society is there to be strip-mined.

I really like this quote. We simultaneously value trust and community, yet so many people also treat it as just another resource to turn into money and power. Alan Kay is a real gem.

slaymaker1907··on Show HN: Open-source, browser-local data exploration using DuckDB-WASM and PRQL
I looked up the limit and as of 2021, tabs seem to have been limited to 16GB which is moderate in size for an in-memory dataset. However, I know WASM has a hard limit of 4GB without Memory64. Data size is all relative.
slaymaker1907··on What's worked in Computer Science: 1999 vs. 2015 (2015)
Sum types have definitely been making a big splash. I'd also look at how C++ has added concepts and Go has added generics. Local type inference is also commonplace too, even Java has it.
slaymaker1907··on New 13- and 15‑inch MacBook Air with M3 chip
I think System76 also has a pretty simple evaluation process. You mostly just select the form factor you want and then configure it. Also, unlike Apple, they make it easy to get a machine exactly tailored to your needs. They don't force you to pay $$$ for an expensive processor when you just want a bit larger SSD and some extra memory...
slaymaker1907··on Enhancing Factorio with SAT solvers
Oh yeah, splitters are the one thing I haven’t tried to build myself because they’re so tricky. I’ve done a ton with circuit networks and trains, but belt balancers are far less intuitive to work with.
slaymaker1907··on Sudo for Windows
There's still the UAC prompt which should help mitigate risk, plus it's locked behind developer settings.
slaymaker1907··on Cannabis use linked to anxiety diagnoses, worsened anxiety disorders
Talking about the ADHD thing, there's a similar problem with some research that claims stimulants cause Parkinson's disease. The study authors didn't seem to account for the fact that people with more severe ADHD would be more likely to be treated with stimulants and that severity of ADHD could instead be the causal factor.
slaymaker1907··on Git commit messages are useless
Non-squash commits are kind of a nightmare to actually implement securely. You need to make certain that all the commits are properly assigned to an actual person (no impersonation) which would involve implementing commit signing infrastructure which a lot of orgs don’t want to do.

It can also get confusing as a reviewer if people do any rebasing after submitting the PR.

slaymaker1907··on Sane C++ Libraries
Why would you implement your own atomics? It seems very similar to std::atomic, except you need to do a bunch of platform specific hacks to get it to work. The only possible reason I could think of why you would do this is if you aren't using at least C++11. If you aren't using C++11, then you probably shouldn't be using threads in the first place.
slaymaker1907··on Sane C++ Libraries
Shared pointers are most definitely not zero overhead. The trouble is that they use atomic operations which can cause tons of problems for highly concurrent systems. You can use non-thread safe smart pointers, but at some point you have to ask whether that is really lower risk than just not using shared pointers at all (Rust gets around this with type checking).
slaymaker1907··on Git commit messages are useless
I think you're missing the point. How a lot of projects operate is that the commits on PR branches are completely pointless since they will be deleted when the PR is merged and the PR description will become the real commit message for the commit on the main branch from the squash-merge.

The trouble is that Git is trying to do two things at once. It's trying to do remote synchronization as well as change tracking all at once.

An alternative is just to do "git commit --amend" every time you want to fix some small bug, but that has downsides in preventing reviewers from seeing what has changed between PR iterations as well as preventing you from going back to an earlier point in time for some branch. When you have less than a dozen commits, it is completely reasonable to just look at diffs and timestamps to determine which commit you want to go back to.

slaymaker1907··on Git commit messages are useless
It's kind of annoying since with squash-merge too if you are trying to develop dependent things since merging gets nasty on the dependees.
slaymaker1907··on The 2023 Hugo nomination statistics have been released and we have questions
I find it really ironic that they disqualified Babel considering that it was pretty anti-imperialistic and pro-China (though pre-CCP). They just hate Kuang because her grandfather fought against the CCP.
slaymaker1907··on Americans are spending billions on stuff they forget to cancel
As someone with ADHD, that's a lot to ask. However, in my opinion what we really need is a common standard for banks to handle recurring payments for subscriptions. Asking me to review every single thing on every account is a ton to ask, but it would be a lot more manageable if recurring stuff had its own section and that I could cancel stuff from my bank app directly.

Sure there are a lot of complexities, but it's not that horrendous as someone who literally worked on recurring payments for a bank. You just simplify things by making it a pull system. A recurring payment is just authorization from the bank to withdraw up to X dollars every Y days/months/year (you want a design like this to avoid dealing with holidays and weekends on the bank side which vary for every country).

slaymaker1907··on Silos are fine, as long as there is an API between them
"We can have that new release deployed in about 6-8 weeks."
slaymaker1907··on JEP Draft: Deprecate memory-access methods in sun.misc.unsafe for removal
There are tricks you can do, but it introduces load on the TLB. You basically restrict accesses to 32 bits of memory and isolate that space in virtual memory with its own prefix.
slaymaker1907··on US developers can offer non-app store purchasing, Apple still collect commission
I don’t think so. This entitlement is something devs have to explicitly opt in for.
slaymaker1907··on JEP Draft: Deprecate memory-access methods in sun.misc.unsafe for removal
I think this is an enormously bad idea. The whole point of using sun.misc.Unsafe is because you need to do something with basically no overhead, regardless of safety. In my opinion, they should just modularize it such that users must enable access to it explicitly. The MemorySegment API is nice, but sometimes you really want to skip bounds checking in a cross platform way.
← PreviousPage 5 of 34Next →