HNHacker News
TopNewBestAskShowJobs

agalunar

638 karma · joined July 28, 2018

submissionscomments
agalunar··on Show HN: Numbat – A programming language with physical dimensions as types
365·243 ought to be 365·2425 exactly:

Per 400 years, there is one leap day every 4 years (100 leap days), except when the year is divisible by 100 (so we overcounted by 4 and there are 100 – 4 = 96 leap days), except when the year is divisible by 400 (so we need to add that day back and arrive at 100 – 4 + 1 = 97). This gives us 97/400 = 0·2425.

The tropical year is about 365·24219 days long, but that's not relevant to timekeeping.

agalunar··on Texture Healing for Monospace Fonts
I've never heard "texture" used this way, although that's not saying much. My personal opinion would be that it's not the right word. I have heard the term “color” used in typography to describe the balance of positive and negative space on the page in phrases like “even (or uneven) color”. But although that feels closer, it also doesn't feel quite right in this case. It reminds me of the subtle changes in tracking and glyph width that some justification engines perform:

“Most of the type set in the past five hundred years is justified type, and most of it has been justified line by line, by the simple expedient of altering the space between the words. There are, however, better ways. Scribes justify text as they write by introducing abbreviations and subtly altering the widths of letters. Gutenberg replicated the feat by cutting and casting a host of abbreviations and ligatures along with multiple versions of certain letters differing modestly in width. In the early 1990s, Peter Karow and Hermann Zapf devised a means of doing much the same in the digital medium[.] [...] Another thing computer software can do – because Karow taught it how – is justify text by making subtle alterations in the spaces within letters as well as those between letters and words.”

The Elements of Typographic Style, fourth edition, by Robert Bringhurst, pp 191–192.

agalunar··on How deep is the brain? The shallow brain hypothesis
Impossible given that number of neurons.

It's perhaps not terribly surprising that it becomes possible with unlimited width or depth (or an arbitrarily complex activation function).

https://en.wikipedia.org/wiki/Universal_approximation_theore...

agalunar··on Numbered block parameters in Ruby
I like to read it as "the featured article".
agalunar··on Calling Rust from Python
Also, I forgot to say: thanks for the submission!
agalunar··on Calling Rust from Python
Small note for the author: I was a bit confused at first by the use of "Nix-based" to mean POSIX-compliant [1] since Nix is the name of a package manager that NixOS is based on. I've only seen "*nix" to refer to Unix-like systems.

[1] Which seems like the right condition here? since I believe Unix domain sockets are required by POSIX.

agalunar··on Why Fennel?
Perhaps they had in mind "bane".
agalunar··on Classical music is for everyone
That's not the only way to interpret that passage (it's not how I interpreted the passage, in any case). There's no contradiction in saying "pop music is also popular and so our station also has programs that play pop music". In fact, I took the author as meaning "there is some classical music that people only play b/c it's avant garde or political, &c, but the subset of classical music that we happen to play is what people request". And I'm not even sure that's a criticism of those other subgenres of classical music – more an observation on the general population's preferences and the influence of funding on the programming decisions of radio stations.

edit: to be clear, I vigorously agree with everything else you wrote in your first comment! I just want to assume good faith for the author of the featured piece.

agalunar··on Classical music is for everyone
> The assumption that music the author doesn't like must be a – likely political – statement is, let's just say, revealing and itself highly political.

Where are you getting this impression from? I just went back through the piece and can't find a place where the author implies that "music they don't like must be a (political) statement" whatsoever.

agalunar··on It’s lambdas all the way down
That's very impressive! I desperately wish more people did their production work like you do.

I genuinely can believe that Rust, Carbon, &c wouldn't make much of a difference for you. But for others who don't exercise the same discipline (for whatever reason, internal or external) I think they can. I agree there are no silver bullets; that's why each little bit helps.

edit: I think our software woes have mostly to do with human nature; solutions (if they exist) will primarily be educational and social, not technical. But universal computers are less than a century old, and we can certainly do better on both fronts. If we've learned something about the way most people write programs and interact with existing tools, we perhaps ought to make of use of that experience to design better languages and tools.

agalunar··on It’s lambdas all the way down
> You are reading way more into his comment than I think was intended or implied.

You're likely correct (I'm unable to find the original context of the comment), but it's rarely employed with its original context. Indeed, I was more trying to say that I disliked the quotation itself (and how it can be used) than whatever Stroustrup meant by it.

> C++ is one of the most successful programming languages in history. There is a reason why.

And I said as much in my comment.

(I would also point out that some of the reasons may not be good reasons. But some certainly are!)

> Stroustrup has spent much of his career working to improve C++.

To improve the current situation, we may want to abandon C++ altogether for new programs rather than stubbornly hold on to it.

(In the back of my mind is Stroustrup's recent reaction to the NSA report on memory safety.)

I'm under no illusion that programmers will begin formally proving properties of their programs, as interested as I am in that. But people seem to rarely avail themselves of the tools that help them write correct C++, and rarely manage to use only modern C++, which suggests we may want to simply let go of it. Or radically change it – making safety features opt-out rather than opt-in.

agalunar··on Why bumblebees love cats and other beautiful relationships (2021)
I immensely enjoyed reading this. Thanks for sharing!
agalunar··on It’s lambdas all the way down
ah, to be clear, I'm not saying I disliked the parent comment by rr808! I was just tangentially ruminating on the quotation.
agalunar··on It’s lambdas all the way down
I've never really liked that quote. It's just a way of saying that nothing's perfect, and of course nothing is perfect, but that doesn't mean you shouldn't try to improve them. The quote has always struck me as defensive in a way that stops discussion. It's okay (in fact, more than okay) to say that a complaint is founded on an unsound premise or that a proposed change is a bad idea, but calling other languages useless or unwanted (or implying something to that effect) in response to criticisms of C++ is a bit of deflection, as if saying "well, at least people are productive in it", and I don't think particularly constructive. I think you can start a constructive comment this way, though: "despite its problems, people are still productive in C++ and I think x, y and z are reasons why, so x, y, and z ought to be kept, &c". And in some other context, I think this observation is meaningful: all the languages that are commonly used are complained about, so a complaint about C++ does not necessarily imply that it's worse than any other commonly used language.
agalunar··on A Guide to Undefined Behavior in C and C++ (2010)
> A block of memory cannot be read as an array of simd types sometimes and scalar types otherwise.

As far as I can tell, it is currently the case that, using raw pointers, this is not actually undefined behavior (but I never entirely trust my conclusions on these matters).

"&mut T and &T follow LLVM’s scoped noalias model" [1][referring to 2 and 3] but I am fairly sure this does not currently apply to raw pointers, and "provenance is implicitly shared with all pointers transitively derived from the original pointer through operations like offset, borrowing, and pointer casts." [4]

[1] https://doc.rust-lang.org/reference/behavior-considered-unde...

[2] https://llvm.org/docs/LangRef.html#pointeraliasing

[3] "noalias" under https://llvm.org/docs/LangRef.html#parameter-attributes

[4] https://doc.rust-lang.org/core/ptr/index.html

Also excellent are

https://faultlore.com/blah/fix-rust-pointers

https://www.ralfj.de/blog/2018/07/24/pointers-and-bytes.html

https://www.ralfj.de/blog/2020/12/14/provenance.html

https://www.ralfj.de/blog/2022/04/11/provenance-exposed.html

It seems likely you'd already be familiar with these; I'm just putting them out there for anyone interested.

agalunar··on How should I read type system notation?
We may simply differ here – for me, types are as real as objects. Or, perhaps more accurately, types are as illusory as objects ^_^
agalunar··on How should I read type system notation?
I think I would completely agree for you if it were a definition and not a type annotation!

That is, "x: 5" instead of "x = 5" (or "x ← 5", &c) looks fine to my eyes. And of course, that's how values for the members of a struct are in fact defined in many languages (such as Rust).

I suppose the underlying point is that has-type is a relation, not a definition. Asymmetrical space around a binary relation violates (my) experience, but it's also a bit confusing to use the same syntax for definition and type annotation.

agalunar··on How should I read type system notation?
To clarify, I'm not arguing for "X x" over "x : X", I'm arguing for "x : X" over "x: X".

If you had to write it in the form "a: b", however, "X: x" would make as much or more sense to me as "x: X".

agalunar··on How should I read type system notation?
That doesn't match my experience with the usage of a labeling or prefatory colon (continuing with my ad hoc terminology). I'd read it as

Here's an x: X.

– which is nonsensical (the type X is not an example of the instance x; indeed, it's the other way round), or as

It's the case that x: more detailed things that explain or follow from x are X.

– which is also backward (since a type is a more general thing than one of many specific instances of the type), or as

Here's a quick premise x: the main point is X.

– which is wrong because x is more relevant (because it's a local variable, whereas X is likely global and shows up in many places; indeed, within a particular scope many variables may simultaneously have the same type, but a name refers unambiguously to a particular variable), or as

Label x: thing X.

– which is wrong because x is not a name for X.

agalunar··on How should I read type system notation?
Ah, I should've been more explicit that I was referring to programming language syntax. For example, this is unfortunately not the convention in Python, Rust, Swift, or TypeScript.
agalunar··on How should I read type system notation?
This seems like maybe a right place to evangelize [1] the only hill I've decided to die on: the formatting of type annotations that use a colon in their syntax. Specifically, there should be an equal amount of space on both sides of the colon. I keep meaning to write a proper essay, but this is the essential argument.

I think of it this way: there are two symbols that by coincidence are written the same (two aligned dots). I mean that genuinely (as in, I actually think of them as separate things), but it also helps as an explanative device.

The first I'll call the prefatory or label(ing) colon. Its usage matches usage in English [2], where the text preceding the colon introduces the text after the colon, or the thing on the left is a label or name for the thing on the right. For example, it is used to start a block (as in Python), or to define a key-value pair, or define a name-value pair in a struct (as in C or Rust).

The second is the type annotation. This syntax is borrowed from mathematics. It is a binary relation, and binary relations are written with equal space on the left and right. Just as you'd never write "x= 1" (another relation), "x> y" (relation), or "x+ z" (operator), you'd never write "x: X". Instead you write "x = 1", "x > y", and "x + z" or "x+z" instead.

Whenever I see "a: b", I immediately think labeling colon. Despite having seen it thousands of times, I always have to perform an additional mental step (however trivial) when it turns out to be a type annotation; it takes a small amount of mental energy to dismiss each instance of syntax that looks wrong.

[Truthfully, I'm somewhat baffled how it would ever even cross anyone's mind when designing a language to write type annotations like "x: X" given the long-established, pre-existing precedent in mathematics and the way its semantics seem backwards (if you had to use a labeling colon, "X: x" would make much more sense to me).]

edit: I should be explicit that I'm referring to programming language syntax, and that I much prefer "x : X" over "X x" (there are good reasons I think for the type to be on the right-hand side, but other people have already written about that).

[1] "Evangelion" is a really lovely word, from εὐαγγέλιον good news = εὐ- good + ἄγγελος messenger, the double gamma pronounced even in ancient Greek as "ŋg" ("ng") rather than "ːg" ("g").

[2] https://en.wikipedia.org/wiki/Colon_(punctuation)#Usage_in_E...

agalunar··on The world in which IPv6 was a good design (2017)
I really like this – thank you for writing it! A related (but not quite the same, I think) idea is that people should not have to bend to technology; technology should bend to people.

It can be difficult to design for people, though. People tend to over- or underestimate the frequency and severity of rare events, are susceptible to the normalization of deviance, and due to their finite nature, fail to consider wider or longer-term implications of their decisions. Going along with the analogy: forest rangers also have a duty to protect the forest (and in fact, I think this ought to take precedent over accommodating hikers) and they also want to guide hikers away from dangerous terrain or wildlife that underprepared hikers may be tempted to visit.

I think the core idea here is "design around the way users actually behave, not the way they ought to behave".

agalunar··on Do Machine Learning Models Memorize or Generalize?
Calling us "pattern recognition machines capable of abstract representation" I think is correct, but is (rather) broad description of what we can do and not really a comment on how our minds work. Sure, from personal observation, it seems like we sometimes overcomplicate self-analysis ("I'm feeling bad – why? oh, there are these other things that happened and related problems I have and maybe they're all manifestations of one or two deeper problems, &c" when in reality I'm just tired or hungry), but that seems like evidence we're both simpler than we think and also more complex than you'd expect (so much mental machinery for such straightforward problems!).

I read Language in Our Brain [1] recently and I was amazed by what we've learned about the neurologicial basis of language, but I was even more astounded at how profoundly little we know.

> But, like all complexity, it is reduceable to component parts.

This is just false, no? Sometimes horrendously complicated systems are made of simple parts that interact in ways that are intractable to predict or that defy reduction.

[1] https://mitpress.mit.edu/9780262036924/language-in-our-brain

agalunar··on Mistakes with Rust smart pointers: when Deref goes wrong
In case the author happens to see this thread – there seems to be a missing less-than sign:

    str::from_utf8( as Deref>::deref(&self.0))
Thanks for the article! ^_^
agalunar··on Never trust a programmer who says they know C++
It looks like it's okay even technically! From a section marked "(since C99)":

> If the member used to access the contents of a union is not the same as the member last used to store a value, the object representation of the value that was stored is reinterpreted as an object representation of the new type (this is known as type punning). [...] Before C99 TC3 (DR 283) this behaviour was undefined, but commonly implemented this way.

https://en.cppreference.com/w/c/language/union

agalunar··on Can you just move into an abandoned house?
But all rights are made up – they're simply things that we think are really important to provide each other. I can only assume that when a person says "housing is a human right", they mean "housing is something important enough that I think we should guarantee access to it".

If someone says something that seems ridiculous, but they're speaking seriously, sincerely, or about a matter they've given some thought, then there might be a chance you're simply misunderstanding them.

Tangentially: "an inalienable right to the property and labor of another person" is not that ridiculous of an idea. You already have a right to the labor of other people in nearly every society on earth. If the people where you live pay taxes, and even if you didn't avail yourself of public roads and whatnot, you still enjoy having a court system and law enforcement to uphold your rights, you enjoy a military to defend your country, you may enjoy the stability of a currency, and so on, and (if you are a native citizen) you get all of this merely for having been born. [And people don't get to opt out – people have to pay taxes even if they want to live alone in the wilderness, and to be relieved of that burden, in the United States we have to pay a fee to renounce our citizenship, even assuming we have the means to emigrate.] If you think at only a slightly larger scale, you might view us all as being stuck on Earth together and all members of a global society, unable to avoid participating to at least some degree.

[To be clear, I personally don't like the idea of owing anyone anything, especially when I presumably didn't choose to be born, but life is inherently unfair to begin with and also very difficult, so I can understand someone arguing that it's worth giving up the fight for a particular fairness in exchange for a better life overall. Also, other people may not have the same notions of fairness as me; I can imagine someone arguing that guaranteed access to housing makes the world more fair.]

I'd agree that it would be ridiculous to claim housing is a "natural right" as opposed to a potential "legal right", since it's a contradiction almost definitionally. Although not everyone agrees that natural rights exist, or what they are precisely.

agalunar··on Can you just move into an abandoned house?
All rights are made up, of course – nature grants us nothing, we grant ourselves rights. That said, it's hard for me to tell if you're not reacting in bad faith. Every person needs a place to live,† but they obviously don't need diet Coke and they usually don't need more than one place to live.

† You'll die without sleep, you'll die from exposure to the cold, you'll catch disease or be unable to hold a job if you don't bathe or clean yourself, you'll suffer from serious mental illness if you've not a space that's reasonably safe and secure some fraction of the time, and so on.

agalunar··on Eastern philosophy says there is no “self” – science agrees
You seem to be using "the hard problem of consciousness" to mean something different than I've always taken it to mean.

I fully believe I am just a machine; the question is why there are qualia happening. Wipe my memory, change my identity, alter my consciousness – regardless, why, when I'm awake, does my mind seem to be the seat where a subjective experience is occurring?

It's a hard problem because the only appeal I can make for its existence is that it's happening for me. I can't prove it to you; it's conceivable there are p-zombies, who also vigorously assert they have qualia. This makes it seem dubious, a religious matter taken on faith, and yet paradoxically for me it is perhaps the only thing I can be truly certain of.

Perhaps qualia (subjective experience) is merely a feature of our universe: wherever structure arises, the universe experiences itself (in some commensurate way).

agalunar··on Deepmind Alphadev: Faster sorting algorithms discovered using deep RL
SPSA, if memory serves.

https://en.m.wikipedia.org/wiki/Simultaneous_perturbation_st...

agalunar··on The Dangerous Ideas of “Longtermism” and “Existential Risk”
Thank you so much for your thoughtful response!

We may disagree from the very start (with the premise you wrote) depending on what you meant,

> Good and bad are judgments based on our evolutionary goal of survival eventually culminating in some idea of society.

but we may also be in heated agreement. [If we disagree, this will continue a nice conversation, and if not, well, it's useful for me to periodically put my thoughts into words so I can see whether they make sense or whether I really believe them ^_^]

So I agree that this is almost certainly why I (or anyone else) has a sense of morality. We've evolved to be social creatures (as a strategy) and our sense of good and bad lines up pretty well with prosocial and antisocial behavior (e.g. a sense of justice or fairness as a means to enable cooperation).

But I don't think this endows use with any obligation to obey the biological imperative. We may agree that we have some social obligations – at the very least to avoid causing harm to each other, perhaps also to actively help each other. (And if not out of altruism, out of self-interest and good sense.) But I don't think building a good society requires that we aim to reproduce (let alone perpetually borrow against future generations, as we've been doing lately).

Consider supernormal stimuli: there are birds that seem to sit on their eggs not because they care for their young, but because they feel a compulsion to sit on large, round, colorful objects. If you present them with a larger, rounder, or more colorful object than their own eggs, they will preferentially sit on the faux egg (abandoning their own). The only thing necessary for the trait to be selected (passed on) is that it ultimately results in viable offspring, even if the mechanism is absurd, and even if having viable offspring is a side effect rather than the goal.

What I'm hoping to establish is that what it feels like to be a certain way – and the underlying values or priorities you actually hold – can be rather divorced from the reason you have those feelings. So we may have a sense of morality because we're social creatures because that's the strategy that let our species survive, but it does not automatically follow that you can reverse the arrows of implication – without more argument, you can only claim that if we want our species to survive, we should be moral (not that we ought to have our species survive). To argue that we ought to have our species survive, you'd need to appeal to some common goal or feeling – either a desire for the survival of species itself or some other goal that the survival of our species enables. But we may not necessarily have this feeling, as the example with the birds and their eggs shows.

[Stepping away from theory for a moment: people obviously are trying to ensure the perpetuation of humanity, but I wonder whether people don't actually desire it directly. Maybe what they actually desire is some preservation of their legacy (as a way to feel remembered or connected), or a sense of victory, or vicariously experiencing in some small part a happier future that they are imagining. And of course, this is only when people do stop to consider the long-term; people may usually reproduce simply because sex can be awesome.]

In any case, I think it's alright to value something even if it doesn't serve the ultimate purpose of reproduction. Because of other values that I hold, I've tried to extrapolate or generalize useful social feelings to a sense of good and bad that considers and gives significant weight to the lives of other species, or that cares more about the eudamonia/suffering of people than about life/death. This thwarts the reproduction of humanity (indeed, I'm evolutionarily a dead end, because as a result of my thoughts and feelings I've taken lengths to ensure I can't create new life with my genes), but it makes me personally feel better to live this way and I think it's also works out to be better for others, too.

In the absence of any (strong evidence for) objective, universal morality – as you pointed out! – we're left to determine it for ourselves, and in a sense there are no right or wrong answers, because we're also left to do our own meaning-making and to determine our own goals (which I suppose would be true even if there were objective, universal morality). Perhaps you could say life on earth has an inherent goal, namely reproduction, but I'd say that's not a goal so much as an observation about what living things on earth do, definitionally.

To wrap up (good lord I wrote more than I meant to), morality is a useful tool, something we have for practical purposes, and I think it can be for social purposes and personal satisfaction.

I do agree having a diversity of life on earth is more interesting, and I'm glad to be alive to witness it. It's also my preference. I just wouldn't want to keep someone or something alive that was suffering, or didn't choose to be alive, just to satisfy my curiosity. Or perhaps I would, but the idea at least makes me uncomfortable.

← PreviousPage 2 of 7Next →