HNHacker News
TopNewBestAskShowJobs

agalunar

638 karma · joined July 28, 2018

submissionscomments
agalunar··on MIT faculty adopts “Statement on Freedom of Expression and Academic Freedom”
Agreed!

Your comment has made me realize that I could have written my original comment more clearly; my dissatisfaction in re the MIT Free Speech Alliance (if my impression was accurate) isn't about political agendas, but about deception – promoting free speech for the moment as a tactic rather than out of a dedication to the ideal, while claiming the latter.

Indeed, when people say "let's keep politics out of it", they're in effect trying to quell any challenge to the status quo, which arguably is inherently political, and this should probably be called out more often.

agalunar··on MIT faculty adopts “Statement on Freedom of Expression and Academic Freedom”
True! I was just pointing out that this is different from defending free speech; it's simply wanting people to listen to you. (And so it may be deceptive to claim your goal is free speech when, in reality, you will only fight for free speech while your opinion is the unpopular one.)
agalunar··on MIT faculty adopts “Statement on Freedom of Expression and Academic Freedom”
I've seen instances of wealthy or powerful individuals publicly calling for private platforms to deregulate speech not because of a dedication to the ideals of free speech (the ostensible reason) but as a tactic to achieve some political goal, e.g. in order to promote confusion about anthropogenic climate change to benefit the fossil fuel industry.

I've also seen instances of individuals defending free speech because they hold unpopular (or sometimes even hurtful) opinions and want to be taken seriously, or want a megaphone – both of which they are free to demand but which no one is obligated to give them.

I signed the MIT Free Speech Alliance's petition and signed up for its newsletter because I agree with the aims of the movement, but I had the impression that some of the alumni leading the alliance have political motives, or are less angry about the loss of freedom at universities [1] than they are about the social opinions of the rising generation, which worries me somewhat.

[1] which IMO ought to be the paragons of free speech.

agalunar··on The Mathematical Hacker (2012)
This is not the divide I see, but it's the divide I hear many people say they see, and so I've always wondered if the majority of people actually fall into these two camps. From where I happen to stand, I see four camps or so:

1 · those who see mathematics as a particular subject area, body of knowledge, or set of topics, with limited applicability to programming (which, given that definition of mathematics, I think is true)

2 · those who also see mathematics as a particular subject, but with almost unlimited applicability (which I think is false, except maybe on a technicality)

3 · those who see mathematics as all-encompassing and including every kind of careful thinking or precise action (which I don't think really matches serious use of the term, nor is a useful definition)

4 · those who see mathematics as a particular set of skills which are most commonly applied to the topics that people we call "mathematicians" study but are also applicable to many other problems (this is the camp I happen to be in)

So for me, at least, mathematics is primarily a way of thinking and playing. (More specifically, a collection of methods for problem-posing and problem-solving that are rooted in formal logic and equivalences / transformations of representation.) Mathematical training and experience with proofs helped me cultivate that, but studying at university isn't the only way.

I once asked my first mathematics professor whether I could call myself a mathematician even though I was just a first-year student; they replied that anybody who does mathematics is a mathematician. That idea has really stuck with me. Although it's helpful to have jargon and wonderful to have mathematical tradition, anyone can do mathematics and be a mathematician, regardless of age and background – the capacity is the common heritage of humankind, like the capacity for art or language. And like art, it can be directed toward any goal or be an end unto itself.

[I've never agreed with the opinion that mathematics exists for the sake of physics or real-world problem solving, but enough people I respect hold that opinion that I'm wary of dismissing it.]

Now to the matter at hand – does mathematics (sense 4) help with programming? For me, absolutely and without question. It's perhaps the most important set of skills I use while programming (but not the only one).

edit: I distinguish computer science (a branch of mathematics that professional mathematicians study) from programming (designing correct programs) from coding (communicating programs to a computer so that they can be run), and I assume that programming and (to a lesser degree) coding are mostly what people are talking about here.

agalunar··on What we can learn from vintage computing
> the Computer History Museum has an IBM 1401

And a working PDP-1, which I'd highly recommend visiting. You can listen to some of the earliest computer music and play Spacewar!, the first video game to share or sell more than a single copy (as it were).

agalunar··on “A damn stupid thing to do” – The origins of CPL, BCPL, and C (2020)
Or obsessive-compusive personality disorder, which is what I have.

I tend to either care entirely about something or not at all, and the only standard is "perfect" (there are no visible ways something can be improved) – "good enough" doesn't really make sense emotionally. And even though I'm completely self-aware and I recognize this as it's happening, it's difficult to control what I feel.

It's very frustrating. I sometimes wonder at how much more I'd enjoy things and how much more progress I'd make at work and with my hobbies if there weren't these... unbidden demands that take time to satisfy, the stress that the demands cause, and the constant internal battle between what I want to do or know I ought to do and the arbitrary need for something to be a certain way.

agalunar··on The Right to Be Lazy (1883)
> What's the point of "being focused, exerting mental effort, being creative, having long-term goals or engaging in long-term endeavours, &c." if it's not beneficial to society in some way?

PG's statement [1] seemed to be about individuals, so the point is that doing x, y, z is beneficial to the individual.

I may have misunderstood, but the only other interpretation of his statement I can think of (besides "we were designed to work, and somone will feel bad if they don't") is "we were designed to work, and if we don't work enough, something will happen to our society or our environment, and then that something will cause most of us to feel bad", and that's a bit of a leap.

[1] i.e. "I think we were designed to work, ..., and we feel bad if we don't."

———

> Also, PG is explicitly talking about people doing things that they enjoy at least to some extent.

I think it's somewhat beside the point, or at least it's not enough, to find some amount of enjoyment in one's work. Is it how you would choose to spend your time? Are there ways you can spend your time that would be better for you? Those are more important questions, I think.

And notably, PG is implying that we wouldn't choose to work enough, that the motivation we have is insufficient to get us to work as much as we'd need to not feel bad. After all, if we enjoyed working enough, we'd work as much as we needed, and there wouldn't any reason for PG to suggest that people need to be forced to work (by making an analogy with the claim that "the healthiest diet is the one our ancestors were forced to eat").

It's possible that for us to feel good, we need to be forced to do things, and that left to our own devices, as individuals, we'd never muster the cleverness to overcome our ill-serving desires or aversions. In fact, if we evolved in the constant presence of scarcities and abundances that our desires and aversions precisely counteract, it seems likely! [2] But why should we trust the business owners, who control their workers, or the wealthy or politically powerful, who want to maintain the status quo, to be the ones to force us? Why can't each of us pick who it is we want to help us by imposing structure in our lives?

[2] I actually don't believe this in the case of "not feeling bad", although I believe it for health. There is natural selection for behaviors promote healthiness, almost definitionally, but I can't think of any compelling reason for there to be evolutionary pressure for us not to suffer or not have contradicting desires that can't be simultaneously satisfied. In fact, designing intelligent life to be perpetually dissatisfied and wanting improvement seems like an excellent strategy for ensuring its perpetuation.

agalunar··on The Right to Be Lazy (1883)
> Like rich food, idleness only seems desirable when you don't get enough of it. I think we were designed to work, just as we were designed to eat a certain amount of fiber, and we feel bad if we don't.

This is certainly not a new perspective; it's what I was taught growing up.

It sounds profound, but I take some umbrage with it, because it stops short. What kind of work? How much? For whom? It's a terribly convenient thing to promulgate the idea that "we were designed to work" without further clarification when you own capital and reap the value of others' labor, and it's an easy thing to say when you derive healthfulness from the work that you personally happen to do. By "work" do you mean activity that's deemed productive to modern society? Otherwise, why not say people need to spend some time being focused, exerting mental effort, being creative, having long-term goals or engaging in long-term endeavours, &c, if that's what you really mean?

I don't mean to sound suspicious or to insinuate some dark motivation on PG's part, but it (ironically) seems lazy to not bother to scrutinize the modern conception of work – to take something for granted because it's all that most of us living have ever known.

We need exercise, but we can get that running for our lives or playing a sport, and the latter is less dangerous (and preferable unless you're a thrill seeker). We need work, but do we need to get that by doing the things that we call "work" today?

(As a total aside: this reminded me of [1], shared some time ago on HN, which tenuously suggests that we were also designed to be idle. I took "designed" in PG's comment to mean "evolved", and my assumption is that small, pre-industrial societies are more representative of the conditions of the past few hundred thousand years in which modern humans evolved.)

Edit: @kergonath also replied to the idea of too much idleness elsewhere in this thread [2].

[1] https://twitter.com/mnvrsngh/status/1510978995269029888 [2] https://news.ycombinator.com/item?id=33931427

agalunar··on Mathematical Existence and the Axiom of Choice
It's interesting that although you can't prove "forall P, P or not P" in intuitionistic logic, you can prove "forall P, not (not (P or not P))". In other words, it can't possibly be the case that P is not either true or false.

This is particularly easy to do in Coq:

  Theorem lem : forall (p : Prop), ~ ~ (p \/ ~p).
  Proof.
    tauto.
  Qed.
I personally like the distinction between "this is true" and "this can't possibly be false". If you have a proof of the second, you know why something must be true; if you have a proof of the first, you know how something is true.

The rejection of double-negation elimination is more or less the (rather intuitive) idea that knowing why something must be true doesn't automatically mean you know how it's true.

agalunar··on Everything I wish I knew when learning C
I believe using reinterpret_cast to reinterpret a float as an int is undefined behavior, because I don't believe that follows the type aliasing rules [1]. However, you could reinterpret a pointer to a float as a pointer to char, unsigned char, or std::byte and examine it that way.

As far as I'm aware, it's safe to use std::memcpy for this, and I believe compilers recognize the idiom (and will not actually emit code to perform a useless copy).

[1] https://en.cppreference.com/w/cpp/language/reinterpret_cast

agalunar··on Overfitting and the strong version of Goodhart’s law
Ironically, we're not very efficient at all with our land usage today. Nearly 60% of global agricultural land is used for beef (either for pasture or for growing feed) and yet it accounts for only 2% of our calories. And about 50% of all food is wasted – simply thrown away.
agalunar··on Overfitting and the strong version of Goodhart’s law
Here's what I can recall:

The big idea is diminishing marginal returns – increasing societal complexity pays off enormously at first, but eventually the returns level off while the overhead remains high or even continues to increase. Collapse is then seen as a natural (and not necessarily cataclysmic) response to this. It's a process of simplification.

Tainter also points out that collapse may not occur (1) when there are strong, neighboring powers, which simply absorb the foundering society, or (2) when there are strong cultural reasons, such as national identity, for which the members of the society may be willing to put up with the bureaucratic overhead indefinitely (in order to prevent being absorbed); he gives Europe as an example, I believe.

agalunar··on Overfitting and the strong version of Goodhart’s law
I'd second the recommendation.

I personally enjoyed reading it, and from my limited exposure to the topic, my impression was that although some anthropologists disagree and theory has advanced since, The Collapse of Complex Societies was a landmark work and its ideas are still taken seriously.

agalunar··on Wild mammal biomass has declined by 85% since the rise of humans
> I don't know about you but I'm quite happy to be alive and reasonably healthy

I think the important thing to contemplate is that this might be at the expense of other people, living or yet to be born. Not that we've done anything wrong – just that the circumstances that make this possible for us might preclude it for others.

> nihilistic platitudes like "how is there still an ecosystem?" are completely baffling to me

For some people, I think, it's jarring to realize that much of the world, including life for other people and creatures, is very different from anything they've experienced, and that the future could look very different from the present – despite it having not changed much so far in their lives. And the feeling of that realization might be the reason for platitudes like that.

agalunar··on Why is hydroelectricity unfashionable?
I assume that the problem, like global anthropogenic climate change, isn't change in and of itself, it's change faster than biological systems can adapt to or evolve for – resulting in mass extinction events or radical losses of biodiversity.
agalunar··on Write Like You Talk (2015)
Writing and speaking are such different media – for example, you can go back and reread a sentence, but you can't wind back time in a live conversation; you can signal how something should be interpreted,* give parsing hints, and add emotion using inflection and tone while speaking, but you can't do this in writing. So I think we should expect good writing to look different than good speaking.

PG might have in mind then the strange affectations that seem to grip people sometimes when they write, but I can't think of any examples off the top of my head.

*sarcasm, e.g.

agalunar··on San Francisco is spending $1.7M on one public toilet
I assumed by "Republicans" they meant Republican politicans and the wealthy entities that support them, rather than party members (the general populace).
agalunar··on How to check if any word is zero (2021)
> I expected the given example to produce assembly that respects short-circuiting, [...].

> Always assumed this was a requirement of the language, not "up to the compiler".

But the assembly does respect short-circuiting in C++!

The language specification tells you how to figure out the meaning of a program and it tells you which behaviors you are guaranteed to observe or not observe from the program [0]. This is completely abstract – we could ourselves carry out a C++ program in our heads, or with paper and pencil.

A compiler takes a program as input and writes code for some particular machine as output. If the guaranteed behaviors of the program occur when the machine runs the code, the compiler has conformed to the language specification [1]. The language specification says almost nothing about what this code has to look like.

Even if the language specification states that `b == 0` is not evaluated in `a == 0 || b == 0` when `a` is zero (and that this is required, regardless of the right-hand side), the corresponding assembly might always involve executing a `cmp b, 0` instruction, because what it means to "evaluate b == 0" has to do with the meaning of the C++ program, not the assembly.

[0] See the definition of "observable behavior" quoted in https://stackoverflow.com/a/15718279.

[1] See https://en.cppreference.com/w/cpp/language/as_if. This actually detracts somewhat from my point: talking about allowable transformations implies that there's some preferred way of initially compiling a program, some basic version that's then optimized. Even if compilers happen to work this way, the language specification doesn't.

agalunar··on “When are we going to use this in our everyday life?” (2017)
> Obviously that's important, but education also simply enriches your life.

You should read the Aims of Education speech given by Abbott; you might really enjoy it.

https://college.uchicago.edu/student-life/aims-education-add...

agalunar··on How San Francisco makes it insanely hard to build housing
Thank you so much, @ZoomerCretin and @huevosabio!

I think this has left me with only more questions, and I might ask a few of them later when I have a moment, but I wanted to say I appreciate you taking the time to reply.

agalunar··on How San Francisco makes it insanely hard to build housing
I read some time ago an interview with a member of the San Francisco Board of Supervisors and an article about the YIMBY movement:

• https://www.currentaffairs.org/2021/11/san-francisco-sociali...

• https://www.currentaffairs.org/2021/01/the-only-thing-worse-...

I'd be very interested if anyone knows anything further about the topic or knows of any replies to the criticisms levied.

agalunar··on A personal list of Rust grievances
Ah! that's a really good question. No whitespace before the colon in type annotations is my own personal pet peeve – the hill I'd die on – so it seems like my duty to answer.

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

The first I'll call the prefatory colon. Its usage matches usage in English [1], where the text preceding the colon introduces the text after the colon. For example, it is used to start a block (as in Python), or to create a key-value pair (as in Python), or define a member of a struct with a name-value pair (as in C or Rust).

The second is the type annotation. This syntax is borrowed from mathematics (notably, type theory). It is a binary relation, and binary relations are always 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`.

Whenever I see "a: b", I immediately think prefatory colon. Despite having seen it hundreds or thousands of times in other people's code, it always trips me up when it turns out to be a type annotation, which has to be deduced from context or the right-hand side.

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 prefatory colon, `X: x` would make much more sense to me).

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

agalunar··on How does the land use of different electricity sources compare?
I'm firmly in favor of markets, myself, but I think there are other notable caveats.

You mention pricing externalities being important; it's also important that corporations don't have undue influence in their own regulation, or externalities will become chronically underpriced.

I also think "just profitability" isn't quite correct. Profitability is sometimes antithetical to efficiency and sustainability; take artifical scarcity or planned premature obsolescence, for example.

[On that topic: I've wondered before whether corporations are darwinian. They are large, amoral machines that have a life their own, and presumably the corporations that survive (and that are around today) are the corporations that act in the interest of their own self-preservation, not in the interests of people or life on earth. I have no idea whether the time scales involved are sufficient for the evolution of corporate strategy, but it's fun armchair philosophy.]

Fortunately, "markets" is not synonymous with "capitalism" – markets feature in many economic systems, so we have options.

agalunar··on Zig VP of community comments on Rust
I do agree that the term "safe" shouldn't be used as a shorthand for "memory-safe". Memory safety is only a subset of correctness, and "safe" in my ears sounds misleadingly like a stronger promise. (And the "unsafe" keyword does not necessarily mean memory-unsafe, but simply unchecked.) There's no real harm in this, but I'm a fairly sensitive person and can't help but feel slightly shamed even when I have a case that legitimately requires the use of unsafe Rust, which can be mildly frustrating. That's something that I need to get over, though; I don't think Rust should change.

To be clear, I really like Rust (oh, that I could never write C++ again). There are some astonishingly underdeveloped parts here and there [1], and I've a few pet peeves, but it's fun to use and I think it's a great step in the right direction. I'm really grateful to all the people who work on it.

[1] I just ran into https://github.com/rust-lang/rust/issues/55795, for example.

agalunar··on “Logistics”, an 857-hour movie, tracks a pedometer from shop back to factory
This may be a bit pedantic, but I think it's worth discussing.

> The problem isn’t capitalism; it’s the imperfection of humanity. No economic system in history has eliminated waste.

The fact that no economic system yet implemented at scale has eliminated waste does not necessarily imply that waste is unavoidable; we'd need to convincingly show that no such economic system could be possible. Similarly, I don't believe we can conclude that capitalism minimizes waste among all feasible, stable economic systems.

As far as balancing exploration and exploitation goes, it might be argued that we should focus on reaping the benefits of our current economic system and deprioritize the exploration new economic systems, but it's too much at this point (imo) to assert that exploration is futile.

My other thoughts:

• "Capitalism or central planning" is a false dichotomy; there are economic systems besides capitalism that have free markets.

• The goal of capital holders in a capitalist system is not efficiency (in the colloquial sense), but profit – planned obsolescence is perhaps the perfect example of this.

• I agree with you that central planners can be catastrophically wrong, and my current opinion is that incorporating externalities into the pricing system (through taxes) is a good idea. It can be difficult to correctly identify, distinguish, and price externalities; I wonder if a benefit of more local economic systems is that there are fewer externalities (by which I mean, actors experience more of the effects that they cause and impose fewer incidental effects on third parties), which would reduce the number of things we need to manually identify and correct.

agalunar··on Why study functional programming? (2012)
But an immutable data structure will cause data dependencies – the only way it couldn't cause a data dependency would be if it was never read.
agalunar··on Why study functional programming? (2012)
> If a piece of code B loads the contents of memory where a piece of code A writes that's before B, then you can never execute B before or in parallel with A.

This is a description of what a data dependency is; I'm still not sure what your point is regarding mutable data structures specifically.

agalunar··on Why study functional programming? (2012)
> When you use a mutable data structure, and your code is concurrent, you'll force the CPU to put locks everywhere in your code so that several cores won't see stale data in their internal caches.

Do you mean to say the compiler will insert locks? As far as I'm aware, on AMD64/Intel64, the processor won't lock the bus for ordinary loads and stores unless an instruction has the lock prefix. The processor is otherwise perfectly happy to let different cores observe loads and stores to different addresses in different orders (except for stores being reordered past each other).

> Even when you aren't writing concurrent code, mutability will prevent the CPU from using its internal concurrency to execute it faster.

For an out-of-order superscalar machine, mutability has nothing to do with it; register renaming takes care of that. The things to watch out for are tight dependencies chains.

If you're referring to loads and stores, store-forwarding and coalescing can spare you from having to hit the cache repeatedly for reads and writes to the same location.

agalunar··on How to build a chess engine
That's not linear probing, though; that's having a 3-way associative cache.

Maybe that's how I should have phrased my comment: a transposition table is a cache, not a hash map,* because entries can be lost (overwritten). Furthermore, insertions may not succeed.

I know you know this; I mentioned it because I didn't want anyone to read Stockfish's source expecting an implementation of a hash map and then get confused.

Stockfish's source is well-written and incidentally didactic, so I'd definitely second the recommendation to read it.

*Or hash table, or dictionary; these are all synonyms, I just prefer "map" myself.

agalunar··on How to build a chess engine
True, although I'd say transposition tables are much, much easier in a crucial aspect – you deal with hash collisions by simply overwriting the current entry or nop'ing. There's no linear probing, no cuckoo hashing, &c; when you want to update an entry, you check whether you'd rather store the new thing or keep the old, and that's it.
← PreviousPage 5 of 7Next →