1,432 karma · joined May 20, 2011 (15y ago) · 286 submissions
comment 1y ago · link · parent
cast a `struct Foo*` into a `struct Bar*` and access the Foo through it (in practice we teach this as the "strict aliasing" rules, and that's how all(?) compilers implement it, but that's not what §6.5 paragraph 7 of the standard says!)
Use the union type. Abusing it for aliasing violates the standard too, but GCC and Clang implement an extension that permits this. Alternatively, just allocate a char array and cast it as you please. Strict aliasing does not apply to char arrays if I recall. allow a signed integer to overflow
Is this still true? I thought that the reason for this is because C left the implementation to define how signed arithmetic worked, meaning you could not assume two’s complement, but the most recent C standard was supposed to mandate two’s complement.>> pass a NULL pointer to memcpy, even if the length is zero
> There is a reason for this. memcpy is allowed to start reading early as a performance optimization, before it does a branch that checks if reading is only.
Where did you get this idea from? It's not possible, since you can hand an address at the end of an array, and length 0. The array ends at the end of a page.
You can't read extra bytes in this case!
comment 1y ago · link · parent
Other peeve: quote the core of the bug report you're closing, so when GitHub inevitably goes away/turns evil/starts charging, you don't lose half your knowledge. The git tree should always stand alone.
comment 1y ago · link · parent
For most protocols there's only reading and writing, so you can use odd bits to mean "backwards compatible features, you can read even if you don't understand" and even for "stop, we broke compat".
comment 1y ago · link · parent
Employment-at-will takes some cultural adjustment, too. But for tech folks tends to be a net win. You just need to set your expectations accordingly!
comment 2y ago · link · parent
But if you're trying to build something for decades, as you should be for internet infrastructure, there isn't much option.
comment 2y ago · link · parent
Curiously, this energy hunger is driving decentralization despite the otherwise inevitable benefits of scale.
comment 2y ago · link · parent
Heres the inline:
See https://github.com/rustyrussell/runes for a simpler alternative and implementation (this has C and Python, but there's also a Rust implementation because why not?)
However, the "no db access" property has proven to be untenable in practice. Users end up wanting to see what runes are issued, blacklist them, know when they were last used, and have rate limits. The last two are a killer, requiring some state to be kept (unless your system allows you to return a modified rune to the user, which is a different workflow from normal bearer creds).
comment 2y ago · link · parent
Because payments happen been pairs, there's no easy count of activity. The best estimates I know of are things like https://blog.river.com/the-lightning-network-in-2023/ which is almost 12 months old.
As to "no wallets support it", that's a strange thing to say, since lightning wallets support it, obviously.
I'm yet to see any comparable statistics in L2s on Ethereum? Was hoping you'd have something there, too :(
comment 2y ago · link · parent
Having created a micropayment network, you quickly discover that infrastructure does not exist where you want to use it. Web APIs are kind of the obvious use case, but because there was no micropayment system they trended to an account and batch payment method by necessity.
This aims to fill that infrastructure gap. Of course, there's a huge chicken-and-egg bootstrap problem, but you have to start somewhere!
comment 2y ago · link · parent
https://www.theonion.com/the-onion-looks-back-at-the-sound-o...