Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
purplesyringa
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
purplesyringa
6mo ago
You can still write code without LLMs, much like you can write code without modern IDEs, or use C and assembly instead of higher-level languages. But there are significant differences between the skills you learn in the process, which I bel
32.
▲
by
purplesyringa
6mo ago
The formulas are provided in the supplementary information file, as mentioned in the paper. https://arxiv.org/src/2603.21852v2/anc/SupplementaryInformat... You want page 9.
33.
▲
by
purplesyringa
6mo ago
I must admit I'm surprised to see this -- Lemire offhandedly mentioned in the famous remainder blog post ( https://lemire.me/blog/2019/02/08/faster-remainders-when-the... ) that 64-bit constants can b
34.
▲
by
purplesyringa
6mo ago
The paper doesn't require a bitshift after multiplication -- it directly uses the high half of the product as the quotient, so it saves at least one tick over the solution you mentioned. And on x86, saturating addition can't be do
35.
▲
by
purplesyringa
6mo ago
Honorary mention: byte swapping instructions (originally added to CPUs for endianness conversion) can also be used to redistribute entropy, but they're slightly slower than rotations on Intel, which is why I think they aren't util
36.
▲
by
purplesyringa
6mo ago
I think the reason real-world implementations don't do this is to speed up access when the key is a small integer. Say, if your IDs are spread uniformly between 1 and 1000, taking the bottom 7 bits is a great hash, while the top 7 bits
37.
▲
by
purplesyringa
6mo ago
I work on the machine code level, so the only characteristic I'm interested in is how many ticks it takes to compute the result, not how many transistors it requires or anything like that. All modern CPUs take 1 tick to compute both XO
38.
▲
by
purplesyringa
6mo ago
Yes, that's my point. It's not true that all hash functions have this characteristic, but most fast ones do. (And if you're using a slow-and-high-quality hash function, the distinction doesn't matter, so might as well
39.
▲
by
purplesyringa
6mo ago
Djb2 is hardly a proven good hash :) It's really easy to find collisions for it, and it's not seeded, so you're kind of screwed regardless. It's the odd middle ground between "safely usable in practice" and &qu
40.
▲
An alternative derivation of Shannon entropy
(iczelia.net)
4 points
by
purplesyringa
7mo ago
|
0 comments
41.
▲
by
purplesyringa
7mo ago
"nobody cares about BigInt addition performance" is an odd claim to make when half of the world's cryptography is based on ECC.
42.
▲
by
purplesyringa
7mo ago
I suspect that LLVM is optimized for compiling with `-ftrapv`, perhaps for cheap sanitizing or maybe just due to design decisions like using unsigned integers everywhere (please correct me if I'm wrong). I'm personally interested
43.
▲
by
purplesyringa
10mo ago
I was wondering why, in my Firefox, the image appears saturated when embedded on the website, but opening it in a new tab by a direct URL shows an unsaturated version. The `img` tag on the website seems to be styled with `mix-blend-mode: mu
44.
▲
by
purplesyringa
10mo ago
It's "they" ( https://github.com/jyn514 )
45.
▲
by
purplesyringa
10mo ago
You can: the equation x^2 = x holds for 1, but not for -1, so you can separate them. There is no way to write an equation without mentioning i (excluding cheating with Im, which again can't be defined without knowing i) that holds for
46.
▲
by
purplesyringa
10mo ago
I meeeeean... plenty of functions allocate internally and don't let the user pass in an allocator. So it's not clear to me how to do this at least somewhat universally. You could try to integrate it into the global allocator, I su
47.
▲
by
purplesyringa
10mo ago
"Memory leaks" would be a mischaracterisation. "Memory leak" typically refers to not freeing heap-allocated data, while I'm talking about data being copied to temporary locations, most commonly on the stack or in re
48.
▲
by
purplesyringa
10mo ago
You can try to write it in Rust, doesn't mean you'll succeed. Rust targets the abstract machine, i.e. the wonderful land of optimizing compilers, which can copy your data anywhere they want and optimize out any attempts to scrambl
49.
▲
by
purplesyringa
11mo ago
This feels like a misrepresentation of features that actually matter for memory safety. Automatically freeing locals and bounds checking is unquestionably good, but it's only the very beginning. The real problems start when you need to
50.
▲
by
purplesyringa
11mo ago
Thank you :)
51.
▲
by
purplesyringa
11mo ago
I meant polyfilled coroutines used by other JVM languages, like Kotlin. When you compile a coroutine to a state machine, yielding has to return from the machine; but JVM does not support unbalanced monitors, although it obviously does suppo
52.
▲
by
purplesyringa
1y ago
No it shouldn't. The function you're talking about is typically called T(N), for "time". The problem is that you can't write T(N) = N^(1/3) because it's not exactly N^(1/3) -- for one thing, it'
53.
▲
by
purplesyringa
1y ago
Signals.
54.
▲
by
purplesyringa
1y ago
It's not about static contracts at all, it's about keeping performance of high-level APIs high. It's all just about templates and generics, as far as I'm aware -- the same problem that plagues C++, except that it's
55.
▲
by
purplesyringa
1y ago
> Lifetime parameters aren't necessary, lifetime contracts may be implemented in a different and much easier way. This may be expressed in form of a function attribute, which may be calculated via constexpr code. Wouldn't that
56.
▲
by
purplesyringa
1y ago
How would libc get a FILE* pointer with capabilities back from a FILE* passed by the user?
57.
▲
by
purplesyringa
1y ago
IME, LLMs are completely incapable of reasoning about anything remotely difficult. All you'll get are proofs by assertion, not anything rigid you can trust.
58.
▲
by
purplesyringa
1y ago
It's not hard to formulate why "AI" is bad, at least in its current form. It destroys the education system, is dangerous for environment, things like deepfakes drive us further towards post-truth, it decreases product quality
59.
▲
by
purplesyringa
1y ago
Treat it as meta-discourse. It's not about shifting goals, it's about finding an indirect way to achieve the same goals via other topics.
60.
▲
by
purplesyringa
1y ago
That's absolutely not the case. I can look at code and realize that it's garbage because the architecture sucks, performance degradation is out of the window, and there's lots of special casing and unhandled edge cases. That&
More ›