HNHacker News
TopNewBestAskShowJobs

cmyr

1,086 karma · joined September 1, 2013

submissionscomments
cmyr··on Text rendering hates you (2019)
A technical note: OpenType Layout does have a way of representing the appropriate _cursor positions_ to use for components of a ligature[1], which is a good proxy for where the individual glyph boundaries are in the trivial case (fi and fl, say) but these tables are not reliably included in all fonts, and they are not actually used by much client software (last I checked they were used by CoreText but not by HarfBuzz or DirectWrite.)

[1]: https://learn.microsoft.com/en-us/typography/opentype/spec/g...

cmyr··on The dual nature of Japanese Knotweed
This is definitely true, but there is a useful distinction between the usual evolutionary competition between species in an ecosystem and the very sharp situation of an ecologically novel species being introduced into that ecosystem and out-competing the incumbents, and 'invasive species' is the best term we currently have for this second case.
cmyr··on Canada's maple syrup reserve hits 16-year low
It is significantly more than that. One major example: quebec has a separate legal system for civil matters, based on french civil law. (https://en.wikipedia.org/wiki/Quebec_law)
cmyr··on Why are there so many methane satellites?
If you're going to post quite sensationalist speculation please at least provide some attempt at a source or rationale. It doesn't really pass the sniff test that any goverment would bother with this banal subterfuge when they are more than capable of putting secret payloads into orbit, and have done so many times[1].

e.g. this, just the first relevant thing I could find https://spaceflightnow.com/2021/04/26/spy-satellite-successf...

cmyr··on Too much serendipity
I don't think there's some huge point beyond exploring an interesting question, and raising it in a forum where it's possible some people with more specific domain knowledge might offer some insight.
cmyr··on Ancient Stars Made Extraordinarily Heavy Elements (2023)
I remember reading in one of John McPhee's geology books (collected as [1], and one of the best things I've ever read) about a particular way that diamonds can form; it had a name (like a diamond jet or a diamond burst or something) but the basic idea is mesmerizing: super-heated water containing dissolved carbon would find some fissure in the surrounding rock and explosively expand into it, and in the process it would cool rapidly and diamonds would crystallize out of the solution. I'm stuck with the visual of a seam of diamonds popping into existence in an instant, which is not what we normally think of as a geological timescale.

[1] https://en.wikipedia.org/wiki/Annals_of_the_Former_World

cmyr··on GitHub: Can no longer search code without being logged in
In reality, how many people are regularly using github search without having a github account? Can this change really be expected to bring in a meaningful number of users?

Trying to think this through, my own best guess for what is going on is that there is some amount of traffic coming from bots/scripts and github would like to have all queries associated with an account so that they can block accounts? I'm not sure if this makes sense, but I think it's a reasonable possibility.

cmyr··on One sleepless night can rapidly reverse depression for several days in mice
I’ve smoked weed before bed most nights for at least a decade, and if I happen to skip a night I… still sleep fine, unless I’ve had no exercise that day.
cmyr··on The Web Assembly Shaper
Hinting might be a red herring here: these font formats are unsafe almost by design, since they consistently rely on a pattern of reading a value out of a chunk of memory and then treating that value as a pointer offset where additional values are read.

The proposed WASM shaping implementation would be a replacement for traditional OpenType layout[1] which is already turing complete[2]), and in this sense using WASM is significantly safer than the alternative. Your comment suggests that "execution of arbitrary WASM code" is something that we should be scared of, but the entire point of WASM is that it allows for safe/isolated compilation of arbitrary code.

[1] https://simoncozens.github.io/fonts-and-layout/features.html

[2] https://litherum.blogspot.com/2019/03/addition-font.html

cmyr··on How Lee Valley built a cult-like following
I… don’t really follow this take? I agree that Lee Valley occupies a position at the top of the market, but I don’t think it’s about luxury, at all. My father was a cabinet maker, my mother a school teacher. They built their own home in the countryside, grew much of their own food, and could not have been less interested in “luxury” in any familiar sense of the word; but the shop and house is full of stuff from Lee Valley, because it is consistently high quality, and they don’t like buying stuff that gets thrown away.

I think your comment maybe conflates quality with luxury?

cmyr··on French workers protest plan to increase retirement age
'insidious authoritarianism' is a curious way of describing two not-unreasonable proposals that are presumably aimed at making american democracy more representative and accessible...
cmyr··on Show HN: Can You Hold Your Breath for 40 Seconds?
Does holding your breath mean “don’t exhale” or “don’t inhale”?
cmyr··on Fentanyl vaccine tested in rats
Thank you for sharing. I'm sorry.
cmyr··on Fentanyl vaccine tested in rats
> - The black market is always cheaper.

anecdata: I'm in canada, which has legalized marijuana recently. The black market is cheaper, but all but the most die-hard stoners I know like to buy government weed, because the product is consistent and you know what you're getting.

> - Even in a legal market how many people are always buying their own?

Maybe I'm misunderstanding, but in a legal market even if I don't buy something directly at least I have vastly increased faith that i know what something is.

> - If everything is legal then it's even easier for people to spike drinks and the like.

Who knows, but I strongly doubt that there is a large pool of potential rapists at large who are currently stymied primarily due to the difficulty in acquiring GHB.

> - Purdue Pharma marketing issue writ large. > - Patients pressuring their doctors to prescribe, or alternatively feeling pressured by their doctors to use a particular drug.

There are definitely a bunch of social and policy questions that would need to be addressed when considering legalization, sure.

> - If it's legal it's easier to purposefully or accidentally overdose (e.g. alcohol today). Especially if it's also cheaper.

Almost certainly not, as the majority of overdoses are the consequence of people not knowing what they're taking, or not knowing how to take it.

cmyr··on Fentanyl vaccine tested in rats
'illegal drugs' is a pretty broad brush, and treating opiods and psychedelics equivalently is silly. Surely treatment, education and research would all be far easier alongside decriminalization?
cmyr··on Google to reduce workforce by 12k
This post refers to full-time employees. You don't really need to fire TVCs; they're generally on shorter term contracts, which you can choose not to renew.
cmyr··on Riff, automatically provide external dependencies for Rust projects
I mean, it is expressed pretty clearly in the article; it uses Nix to manage external dependencies, and manages setting link paths and other build bookkeeping.
cmyr··on Type-checked keypaths in Rust
I hope I cover this somewhat in the 'motivations' section. Keypaths are used heavily in SwiftUI, and my interest in them came from working on trying to find ergonomic patterns for GUI libraries in Rust.
cmyr··on Russian tanks in Ukraine are sprouting cages
Really enjoyed this article on « statistical armor » (of which this is presumably an example)

https://www.tanknology.co.uk/post/statistical-armour

cmyr··on Starship is threatening NASA’s moon contractors
As a body increases in size, the surface area increases as a square but volume increases as a cube. The more volume, the more heat, and after a certain point your available surface area is no longer adequate to vent that heat.

Another example of a similar principle applies to insects: they don’t have lungs, and absorb oxygen directly through their skin. In earlier eras of earth’s history, there was much more oxygen in the air, and so insects could be much larger, because the same amount of surface area could absorb enough oxygen to fuel a larger number of cells.

cmyr··on Why can't you reverse a string with a flag emoji?
Something I haven't seen mentioned yet is one of the most annoying things about regional indicator symbols, which is that interpreting them correctly requires arbitrary backtracking, and handling this correctly is very annoying for things like text fields.

Basically: A single, unpaired RIS counts as a single grapheme. Similarly, a pair of RIS count as a single grapheme. Now imagine if your cursor position is after an RTS, and you arrow backwards (assuming LTR text, imagine your cursor is to the right of an RIS, and you press the left arrow.) Your textbox should now move the cursor to the left by one grapheme. How do you figure out where this is, in code units? You basically have to scan backwards until you find the first non-RIS codepoint, and then you have to match them up into pairs to figure out if your left-arrow movement should correspond to a movement of one or two codepoints.

This is a longstanding source of bugs, and if you're bored you can play around with pasting a huge sequence of flags into a textfield and then trying to navigate around it with the arrow keys/mouse. There are some broken implementations out there.

edit: while I'm thinking about this I will point out that an alternative design, which would have solved this problem (and which was first pointed out to me by @raphlinus) would have been to have two separate sets of RI symbols, one for 'first position' and one for 'second position'; then you could always determine the appropriate cursor position without needing context. Isn't hindsight a wonderful thing?

cmyr··on Dear sir, you have built a compiler
I agree completely. Anytime I’m looking at a parser library I just shake my head and close that browser tab. I’m invariably going to want a hand-rolled recursive descent parser two weeks later, so let’s just get on it.
cmyr··on IQ decline and Piaget: Does the rot start at the top? [pdf]
Ignoring the other blatant problems with this interpretation (e.g. that social class was highly correlated with fitness) I suspect that the nobility were intermixing their genes quit successfully via coercion & violence.

I am not a geneticist or a historian or even more than barely literate

cmyr··on Ask HN: What's the best book you read in 2021?
seconding this, it is an absolutely wonderful book.
cmyr··on So you want to write a GUI framework
I’m not dismissive of embedded, it’s just a totally different problem set and is not the focus of this article. This article is about the pain points of integrating with the current major desktop platforms, period.

I agree we’re in a funny local minima. I agree there’s room for experimentation. But also… for a general purpose GUI toolkit, text editing is not optional. Modal windows (alerts, file open/save, as well as just drop-down/selection lists) are really not optional.

I’m also not arguing that everyone needs to do all these things from scratch. Very few people should be trying to reimplement IME. But you do need to support IME, or you are only making a toy.

cmyr··on So you want to write a GUI framework
There are some big challenges, here. One is IME, which requires storing intermediate state and information on the editing session, and communicating that with the platform; another is accessibility, which requires keeping a tree of elements that the user can currently navigate to, and which may include elements which are not currently on screen.

So yes, maybe okay for games, but I’m unconvinced about imgui for GUI applications of the sort described in this post.

cmyr··on So you want to write a GUI framework
This article is very much focused on infrastructural stuff, and doesn’t talk at all about layout, widgets, design, theming, etc; these are all totally challenging areas that are out of scope for this post. Maybe one day…
cmyr··on Linux Rust Support
I presume it's mostly that the kernel ships so many drivers.
cmyr··on Tough Turban: an open-source design for turban-wearing motorcyclists
In Canada that would be the state, which might explain the state using available tools to discourage this behaviour?
cmyr··on Circling–or cycling–the track at F1’s famous Circuit of the Americas
Yea the track in Montréal is open to cyclists for most of the season; along with the mountain itself it is one of the two main places in the city where cyclists tend to train.
Page 1 of 7Next →