9,746 karma · joined May 30, 2021 (5y ago) · 3,149 submissions
comment 1w ago · link · parent
As a non-native speaker, this always felt like a strange complaint. How about a language that doesn’t have genderless adjectives or even verbs, vous tout·e·s (to take a language that would be more familliar to the audience here than my native one)?
comment 1w ago · link · parent
That’s what they mean for example when they say that a finite-dimensional vector space is naturally isomorphic to its double dual, but while it’s also isomorphic to its ordinary dual, it’s not naturally so. Of course, in an introductory course they’ll just say the latter is dependent on an arbitrary choice of basis; but personally I find it quite beautiful that the notion “independent of arbitrary choices” is even formalizable, let alone in such generality as to span from vector spaces to programming languages.
comment 1w ago · link · parent
In a strict language (or with a strict pair in a lazy language), you normally won’t be able to (integer) divide by zero while computing a value, then go on to ignore that, pack that erroneous value into a pair, and extract the other, valid value from it and go on with your life.
Similarly, if your program has hung while computing one half of a pair then (except in lazy languages) it will have hung while computing the pair as a whole as well.
(Haskell’s type algebra is indeed somewhat subtler.)
comment 1w ago · link · parent
- There’s also the notation 0 for the empty (never, noreturn) type. In addition to matching the number of members, the notations 0 and 1 make sense also as units (neutral elements) of addition and multiplication respectively: 0 + A ≅ A + 0 ≅ A, 1 × A ≅ A × 1 ≅ A in a natural way[1]; and also 0 × A ≅ A × 0 ≅ 0.
- That a constant dependent sum is a product, and a constant dependent product is an exponential, is (undeniably confusing at first but) just[2] the naïve schoolbook definition that A × B = B added to itself A times and A^B = A multiplied by itself B times.
- That a constant dependent product is a function type is just the naïve definition that a function is a table of its values at each input (a tuple, with elements numbered by the possible inputs). A dependent function ( = dependent product), then, is the same thing but the allowable values in each cell of the table vary depending on the cell.
- That the function type is the exponential type is also part of common set-theory notation. For instance, 2^ℕ is a not-infrequent name for the set in the Cantor theorem (subsets of the naturals).
[1] As in, those are not literally the same type but are one-to-one in a single natural way. The word “natural” here has a surprisingly deep technical meaning but one that corresponds to the colloquial pretty well.
[2] “Just”, “simply”, etc. are as usual terms of art that mean that the statement feels very simple once you get it, and conversely that if it does not feel simple then you haven’t gotten it and should stop and think until it does. That thinking can take substantial time and effort.
comment 3w ago · link · parent
Cicero, Against Verres 2.5.4 (tr. Yonge, 1903), http://www.perseus.tufts.edu/hopper/text?doc=Perseus%3Atext%...
(strawmanning a hypothetical defence of the person he was accusing)
comment 3w ago · link · parent
The problem was, they had to sell their invention to other guys that had grown up with 8-bit micros and in the meantime had gotten very attached to their specific 8-bit encodings, so they had to make a lot of compromises: first 128 characters match ASCII; first 256 characters match Latin-1; alphabets encoded in order; codepoint-to-codepoint transcoding from any (reasonable) legacy encoding; throw out enough stuff to not need more than 2^16 characters. They were also racing against time, because in the meanwhile ISO was cooking up 10646, the Universal Character Set, built around ISO 2022’s teletype-inspired architecture of charset switching, and that only got killed because software vendors essentially declared a boycott and pointed to Unicode instead.
The result came out rather awkward as well as fairly expensive, and a lot of the promises needed to be broken afterwards anyway. But they’d have no users had they had done things differently. (Meanwhile, the UCS as initially conceived lacked such advanced operations as string equality.)
comment 4w ago · link · parent
On the other side of the fence, WordPad initially came with source code as well, and was essentially a demo app for the rich edit control as well as the criminally underused text converters[1].
comment 1mo ago · link · parent
comment 1mo ago · link · parent
PyPy lacks upstream interest, looked like it could have a shot after many years of development but recently NumPy removed support because they just couldn’t fathom how a non-dead project could be a couple of versions behind CPython.
Now the new JIT is dying because of what seems to be a lack of upstream interest. (The things TFA describes as being required are not unreasonable, but not realistic for a necessarily speculative long-running project without wild amounts of committed funding.)
I’m not optimistic.
comment 1mo ago · link · parent
[1] https://www.iso.org/stages-and-resources-for-standards-devel...
comment 1mo ago · link · parent
comment 2mo ago · link · parent
The only surprising part is how good the results are: there is no leftover color noise that I can see, the window doesn’t have any color fringing, the high-frequency detail of the table setting and the drapes hasn’t been destroyed, the small backlit hairs on the sides of the face of the girl in front haven’t been smeared over oil-painting style. It’s strange how one eyebrow (in the back) got completely obliterated while the other looks completely fine, and it’s even stranger how the texture of the collar (in front) is basically perfect on the left where it’s unobstructed but basically destroyed on the right where some hair escaping from the braids was in front of it, so perhaps there is some image-gen-adjacent stuff going on here.
The skin looks bad, don’t get me wrong. But the degree of badness seems fair for the situation, and as a whole the result has no business looking as good as it does to my 2016-camera-trained eye.
(Also, don’t photograph people with a wide-angle lens from up close, it’s always freaky at best—like here—and ugly at worst. Just don’t.)
comment 2mo ago · link · parent
Partly, though, it’s a bit more interesting than that[1]. Wikipedia has an interesting chart[2] titled “Lifespan of each United States president”, which shows that in modern-ish times, the generation from which US presidents come is sticky: you get three presidents born ca. 1855, then one born ca. 1865, two ca. 1875, three from the late 1880s, four(!) from the 1910s (starting with “young” JFK), Carter/Reagan/Bush Sr. oscillate between the 1910s and 1920s, then again four from the 1940s (starting with “young” Clinton) only interrupted by “young” Obama (born 1961). (I could start my recounting earlier and it would still work.) Trump and Biden appear abnormal if you look at their ages, but if you look at their birth years instead they are simply a backslide, after Obama, to the generation of Clinton and Bush Jr.
What does appear true is that generations hold onto their power for longer and longer before the snap transition to the next eligible generation happens. Longer life expectancy due to better medical care seems like a perfectly satisfactory explanation for that.
[1] I first read about this idea a few years ago and I don’t remember where, so I’ll need to attempt my own explanation. Sorry.
[2] https://en.wikipedia.org/wiki/List_of_presidents_of_the_Unit...
comment 3mo ago · link · parent
comment 3mo ago · link · parent
Rust did not invent this (and I don’t believe Rust’s creators claim it did), see e.g. “Linear regions are all you need”[1] (ESOP 2006) and in general the work around Cyclone[2] in the 2000s. There was also Mezzo[3], which did very similar things but described them in a different style (effects instead of affine types), and a fair bit of work that went beyond what Rust can currently express (e.g. fractional capabilities). What Rust did is succeed at bringing a conservative subset of this academic work to production—which is not a small deal, mind you; others (including the Cyclone team) tried and failed.
[1] https://link.springer.com/chapter/10.1007/11693024_2, https://www.cs.cornell.edu/people/fluet/research/substruct-r...
[2] https://gallium.inria.fr/~fpottier/slides/fpottier-2007-05-l...
comment 3mo ago · link · parent
(Plenty of things sucked, don’t get me wrong, it’s just that a lot of the fallout from the “war on terror” was still in the upper atmosphere.)
comment 3mo ago · link · parent
comment 3mo ago · link · parent
[1] https://int10h.org/oldschool-pc-fonts/fontlist/font?ibm_vga_...
comment 3mo ago · link · parent
And I think you’re being unfair labelling my couple of examples “some arbitrary algorithm[s]”: my choice was indeed arbitrary, but it’s also immaterial. The general setup would be that you’re processing elements in a loop and that your iterations are serialized (as they usually more or less are before you get around to optimization). A loop body of even three lines of C is likely to have a latency of 5–10 cycles or so, and you’re running on a core clocked somewhere from 5 GHz (desktop) to half that (server). So the best you should expect is ~500 MB/s if your elements are bytes, ~2 GB/s if they’re 32-bit integers, etc. For very simple tasks (that are also somehow not susceptible to vectorization), it is possible to not lose this order of magnitude and get down to almost 1 cycle/element in scalar code, but that requires heroic effort[1].
comment 3mo ago · link · parent
Not anymore, no. Your SSD, before any caching, does gigabytes per second of sequential reads. For any bytewise processing, except the most trivial of tasks, you’ll struggle to get above a few hundred megabytes per second with scalar (native) code. To actually keep up with a modern SSD, you’ll virtually always have to hand-write SIMD loops, minimize the number of syscalls with tools like io_uring, or possibly be smart about distributing tasks across cores without ruining the access pattern.
For instance, simdjson is famously fast but I don’t believe it can keep up with say a high-end PCIe Gen 4 SSD like a Samsung 990 PRO, let alone the latest-and-greatest (and, literally, hottest) Gen 5 stuff. And I know of no Unicode normalizer that would be able to do a gigabyte per second on general inputs (not ASCII, not Latin-1) simply because the latency for dependent lookup table accesses is absolute murder.
comment 3mo ago · link · parent
Not exactly the entire process image, no, but essentially all of its data in a single chunk. It’s a peculiar Pascal program because it bypasses basically all of Pascal’s typing, records, etc., and instead builds its own from a set of (WEB) macros on top of a giant untyped array. Quoth Knuth in TeX: The Program §115:
> The dynamic storage requirements of TeX are handled by providing a large array mem in which consecutive blocks of words are used as nodes by the TeX routines. Pointer variables are indices into this array [...].
There are a few more areas designated for specific purposes, but at the end of the day (§1302) it works out about the way you’d expect:
procedure store_fmt_file;
[...] begin ⟨ If dumping is not allowed, abort 1304 ⟩
⟨ Create the format ident, open the format file, and inform the user that dumping has begun 1328 ⟩;
⟨ Dump constants for consistency check 1307 ⟩;
⟨ Dump the string pool 1309 ⟩;
⟨ Dump the dynamic memory 1311 ⟩;
⟨ Dump the table of equivalents 1313 ⟩;
⟨ Dump the font information 1320 ⟩;
⟨ Dump the hyphenation tables 1324 ⟩;
⟨ Dump a couple more things and the closing check word 1326 ⟩;
⟨ Close the format file 1329 ⟩;
end;comment 3mo ago · link · parent
comment 3mo ago · link · parent
comment 3mo ago · link · parent