Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Joker_vD
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
47 ms
·
811.
▲
by
Joker_vD
1y ago
Do... you refer to the "korenizatsiya" [0] effort during which the Russian language/culture/tradition was heavily penalized and the local ethnic languages/cultures/traditions elevated to the official and mand
812.
▲
by
Joker_vD
1y ago
Yes, it's actually quite easy: +: (int<N>, int<N>) -> int<N+1> // or (int<N>, bit) as the return type *: (int<N>, int<N>) -> int<2*N> etc. Those are the actual
813.
▲
by
Joker_vD
1y ago
> transport errors vs business errors Yes, pretty much. > But the important thing is all errors business or transport eventually need to map to a HTTP status code because that's the protocol you're ultimately speaking. "
814.
▲
by
Joker_vD
1y ago
Which is amazing, you can fine tune the performance of the runtime to your heart's content. Or you can just leave them as-is, the default behaviour is quite reasonable too.
815.
▲
by
Joker_vD
1y ago
On a language semantics note: the semantics of extending/restricting polymorphic records seem to follow Leijen's approach [0] with scoped labels. That is, if you have a record e.g. r1 = { color = "yellow" }, you can ex
816.
▲
by
Joker_vD
1y ago
Oh, but you can just transpile it to WASM using e.g. TeaVM [0]. Just add another build step to your bundler or whatever web dev uses nowadays to build apps. [0] https://github.com/konsoletyper/teavm
817.
▲
by
Joker_vD
1y ago
> The client in most cases does not care about why something failed, only whether it has failed. "...and therefore using different status codes in the responses is mostly pointless. Therefore, use 200 and put "s":"err
818.
▲
by
Joker_vD
1y ago
> - The team constantly bikesheds over correct status codes and at least a few are used contrary to the HTTP spec I really wish people just used 200 status code and put encoded errors in the payloads themselves instead of trying to fuse
819.
▲
by
Joker_vD
1y ago
Yeah, there is a rather strong "downloading and executing arbitrary code from the Internet may lead to execution of arbitrary code" kind of vibe there.
820.
▲
by
Joker_vD
1y ago
> There's no point in a carriage return without a newline. Progress bars. And TUIs in general, CR without LF is still quite handy for them. But even for paper teletypes, it has marginal use of correcting typos: print spaces over the
821.
▲
by
Joker_vD
1y ago
We are not talking about C here. Imagine it was e.g. Java, or C#, or Rust in release mode, or heck, even Lean itself but with fixed-precision integers.
822.
▲
by
Joker_vD
1y ago
> anyone who spends a second thinking about it. Except most programmers don't spend even a second to think about it, and we end up with "int mid = (low + high) / 2;" bugs in standard implementations of binary search i
823.
▲
by
Joker_vD
1y ago
Naturally, this proof only works for arbitrary-precision integers: when you use fixed-precision integers, the algorithm will wrongfully report "false" for arrays like e.g. [INT_MIN, -1] or (if you insist on C semantics) [UINT_MAX,
824.
▲
by
Joker_vD
1y ago
I express my deepest gratitude to the author for not publishing all those "wordle-*" packages to the PyPI. Thank you!
825.
▲
by
Joker_vD
1y ago
Yeah, Macs IIRC just stored the keyboard input instead (the Enter key generates CR, which is also an old and venerable tradition, that's why there is ICRNL flag for the terminal input ). Obviously, in a perfect world we would have a s
826.
▲
by
Joker_vD
1y ago
You do realize that it's the UNIX people who are the strange ones here? The CRLF has been used as line delimiter by everyone (except IBM who always lived in their own special EBCDIC land) since late sixties, but then Thompson decided
827.
▲
by
Joker_vD
1y ago
Well, there is a case for PDFs in a .zip, but it's when you're e.g. downloading some set of documents from your e-government site, and it's like 4 PDFs, all cryptographically signed: so you get a .zip with 4 PDFs in it and 4
828.
▲
by
Joker_vD
1y ago
There is also an important (but often overlooked) detail that you/your application may not be the only user of the cache. At which point caching, indeed, is an optimization via abstraction: when you fetch an X, you are in no position t
829.
▲
by
Joker_vD
1y ago
Well, let's hope nobody drills a hole in the Moon (or blows the Moon up) in the next couple thousands of years, for the sake of those watches' usability.
830.
▲
by
Joker_vD
1y ago
> Invariants are functions that run at the start and end of every public member function, and can be used to ensure that the type is always in a valid state. The ironic thing about this is that it means that the public functions of an
831.
▲
by
Joker_vD
1y ago
> industrial scale abuse of human labor only possible under an authoritarian regime Taylorism definitely originated in the US, and the modern Amazon's worker-related practices (in the US) are direct descendants of it. So while democ
832.
▲
by
Joker_vD
1y ago
Working with function pointers is always finicky. I once had MSVC fold together int f0(int x) { return x; } int f1(int x, int y) { return y; } into a single function, so at runtime, (void(*)())f0 and (void(*)())f1 would compar
833.
▲
by
Joker_vD
1y ago
Can't you just declare anonymous unions whenever? E.g. struct foo { ... }; struct bar { ... }; struct bar check_this_out(struct foo foo) { return ((union { struct foo foo; struct bar bar; }){ .foo = foo}).ba
834.
▲
by
Joker_vD
1y ago
Well, what you actually need is to make the first iteration special — generally, you can detect whether the iteration was last only after you've already finished it, but special-casing the very first iteration can be done. You put th
835.
▲
by
Joker_vD
1y ago
> Here the term "same representation and alignment" covers for example the possibility to look at [...] one would be a structure and the other would be another structure that sits at the beginning of the first. Does it? It is q
836.
▲
by
Joker_vD
1y ago
My language uses Cyrillic and I personally prefer English-based keywords and variable names precisely because they are not words of my (human) language. It introduces an easy and obvious distinction between the machine-oriented and the hu
837.
▲
by
Joker_vD
1y ago
Yeah, it's one of my favourites as well. And it weirds me out that the "premature optimization" bit is the most quoted piece of that paper — arguably, that's the least interesting part of it, compared to the musings on
838.
▲
by
Joker_vD
1y ago
You also need to remember that back when those classic CS papers were written, the CPU/RAM speed ratios were entirely different from what they are today. Take, for instance, a Honeywell 316 from 1969 [0]: "Memory cycle time is 1.6
839.
▲
by
Joker_vD
1y ago
> so you actually need to reserve more than two addresses if you want to distinguish the "past-the-end" pointer for every object from NULL. Well, yes and no. A 4-byte int can not reside at -4, but a char could be; but no object
840.
▲
by
Joker_vD
1y ago
And if you use 0 as the value of NULL pointer, then -1 can't ever point to an object (because adding 1 to it should generate a non-NULL pointer, so that pointer comparisons are not UB). So yeah, C implementations have to reserve at lea
More ›