Better HN
topnewbestaskshowjobs
Log inSign up

mananaysiempre

9,746 karma · joined May 30, 2021 (5y ago) · 3,149 submissions

all code in comments is CC0-1.0 OR 0BSD unless specified otherwise
Submissions

comment 1w ago · link · parent

> English doesn’t have a good, genderless, third-person pronoun and it’s very awkward to avoid using one.

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

Yeah not those, those are legacy, we don’t speak about them :) The “natural” here is that of “natural isomorphism” and more generally the category-theoretic “natural transformation”, which is the one that is virtually always meant when people that the two things are “naturally” identified and the like.

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

You’re only right for lazy pairs, I think.

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

A couple of notes:

- 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

> He may be a thief, he may be a robber of temples, he may he the very chief man in every sort of vice and criminality; but he is a gallant general and a fortunate one, and he must be preserved for the critical emergencies of the republic.

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

Guys that grew up with the 8-bit micros did write the spec—the first design drafts of the standard started circulating in 1988, version 1.0 came out in 1991. Given IBM’s primary role in the whole thing, even parents of such guys could’ve been involved.

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

> TextEdit [...] was used as kind of a demo application of the text views IIRC. even came with source code, as did Chess by the way.

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].

[1] https://www.malsmith.net/wincvt/

comment 1mo ago · link · parent

A popular refrain in gaming circles when Oblivion Remastered released was “it’s awesome if you have the hardware, but it’s Unreal so of course it runs like shit”. So it’s far from obvious that customer sentiment agrees with you. Having seen what Decima can do, I don’t think I agree that Unreal is the pinnacle of game tech either.

comment 1mo ago · link · parent

Live by the NDA, die (at least wrt education/mindshare) by the NDA. Seems fair.

comment 1mo ago · link · parent

Unladen Swallow died for lack of upstream interest.

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

“Draft International Standard”, but that doesn’t mean much unless you read how the ISO process works[1]. (It’s like writing “Advanced Encryption Standard” instead of “AES”—unhelpful beyond giving the broadest category to which the thing belongs, “a document” resp. “a cipher”.)

[1] https://www.iso.org/stages-and-resources-for-standards-devel...

comment 1mo ago · link · parent

Alternatively, let people cancel easily everywhere. If you think it’s worth the extra revenue to geofence easy cancellations, then—well, you do you, but you are making a business judgment that the additional development cost is justified. This is different from VAT/sales tax etc., where it is in fact impossible to comply everywhere without discriminating by jurisdiction.

comment 2mo ago · link · parent

No need for image gen to get this kind of problem; to me that skin look just reads as really aggressive denoising. And there is no escaping physics, a tiny high-res sensor will need a whole lot of denoising for this really challenging scene (meh lighting, strong backlight; the dark, shiny skin is probably also an issue but I’ve no experience there).

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

It’s partly by design—the word senate shares its root with the word senex “old man” (whence also senile, etc.) because it’s literally a council of elders. That’s what the Roman one was and what the US constitution (among others) was attempting to emulate.

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

An ASCII-friendly way to spell ℞, an R with a crossed right leg, shorthand for the Latin singular imperative recipe! “take (the following)!”, which is the conventional start of a prescription; by extension, something necessitating a prescription to buy.

comment 3mo ago · link · parent

Depending on the effort you’re willing to put in, you don’t have to: gzip has a specific provision for concatenated files and tar is a flat array of (file) records each followed by file data, terminated by a sentinel record, so what you need to do is to trim the sentinel off the first tar.gz and then append the second one as is. I don’t know of a ready-made tool that would be able to chop off a gzip file’s last 512 uncompressed bytes without recompressing it in full, but it ought to be possible.

comment 3mo ago · link · parent

> Rust's critical invention was "what if we modeled heap ownership and borrowing with linear types".

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...

[3] https://protz.github.io/mezzo/

comment 3mo ago · link · parent

None of the sequelae of that have really improved since then, at least as far as the first world is concerned. The foundations of universal surveillance were being laid down, but it wasn’t yet feasible. Police (transport security, border patrol, potato, pot-ah-to) ruffling through your belongings had not yet been normalized. You could transact with cash. People largely still sort of believed that talking to your political opponents would lead to better outcomes than making them comply under threat of government violence or unemployment.

(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

Here’s a larger stash: https://github.com/timvieira/justified-variables (via https://news.ycombinator.com/item?id=31138306).

comment 3mo ago · link · parent

Judging by the lowercase “m” it’s the 8x16 variation[1] and not the 9x16 one you linked, but otherwise yes, looks like the plain old VGA font? (Incorrectly displayed, as the site points out: the VGA didn’t have square pixels in either of those modes.) The site uses (AVIF) images in place of text, but it’s like 15 minutes to write a program that typesets an ASCII file in a given monospace bitmap font and writes out the result as say a PPM (and I’m sure ImageMagick can do it if you’d rather dig through docs than program), so this doesn’t seem to require any further explanation?

[1] https://int10h.org/oldschool-pc-fonts/fontlist/font?ibm_vga_...

comment 3mo ago · link · parent

Muratori et al. like comparing speeds to (single-core) memory bandwidth (dozens of GB/s) and that’s a reasonable upper bound, but generally it seems to me that, unless you operate on huge elements and don’t do very much with them, you won’t get within an order of magnitude of it. Even if you think about RAM exclusively, the headline numbers are for sequential reads and things will slow down dramatically if you actually perform random accesses (IIRC, DDR5 is about as slow as DDR4 there in terms of physical time units, so much slower in terms of bus cycles). Meanwhile, in a real situation, you’re going to be bound by compute long before that.

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].

[1] https://github.com/powturbo/Turbo-Histogram

comment 3mo ago · link · parent

> I/O is inherently very slow compared to computation.

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

> Don’t think TeX ever did that, that was a “simple” Pascal program.

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

Related: previous article in the series, https://news.ycombinator.com/item?id=49308685 (103 points, 47 comments)

comment 3mo ago · link · parent

Some time ago, I’ve come across an Asahi patch to I think Pipewire that tied system volume to a Macbook-specific loudness compensation filter, but I couldn’t figure out how to actually make use of it outside of their environment.

comment 3mo ago · link · parent

Not Black Mirror, 2013 vintage 4chan.

comment 3mo ago · link · parent

Kinda. There are also the 32-bit bits on top, not (AFAIU) that different from their NT4 counterparts, such as the shell, COM/OLE2, TrueType, OpenGL, etc.; the core Win16 stuff (KERNEL/USER), which the Win32 layer thunks down to and which in turn invokes DOS routines; and the VxDs that intercept various pieces of DOS/BIOS and replace them with 32-bit code (“32-bit disk access”, “32-bit file access”, etc.). Only the first of those is new to Win95.

comment 3mo ago · link · parent

I mean, a plain JPEG can tolerate up to I think 2^16 × 2^16 pixels, and already that you don’t really want to decode from a single unseekable bitstream with no index and no effort to improve locality of data required to fill a rectangular viewport. [ImageMagick’s display(1) is the best at tolerating huge JPEGs and even it, IIRC, conks out after 2^15 × 2^15.] You can allocate however many bits you want for the size, but beyond a few dozen megapixels you really need to do indexed independently-decodable tiles, and when the image is dozens of gigabytes after compression, you need a pyramid of pre-downscaled versions as well (1/4 + 1/16 + ... ≈ 33% overhead which is completely acceptable). Thus my question.
12345
105