HNHacker News
TopNewBestAskShowJobs

vanderZwan

19,348 karma · joined February 4, 2013

submissionscomments
vanderZwan··on Gaussian Splat of a Strawberry
Well, at certain angles you actually get very noticeable gaps in the strawberry that are visible when rotating it, but almost invisible when static. I think it's mostly due to that.
vanderZwan··on Cost of enum-to-string: C++26 reflection vs. the old ways
Oh nice, thanks for the tip! Don't know if I can justify picking up a copy given that I do not work with C++ at all nor with large-scale systems. But I know a few people who might be interested.
vanderZwan··on Cost of enum-to-string: C++26 reflection vs. the old ways
My point was that TypeScript isn't exactly about to replace JavaScript, which was what you were arguing. I'm honestly not sure what you're trying to argue now.

Like, yeah, what you say about TS and Kotlin is true about TS and Kotlin. But since you're not explaining what cpp2 does or plans to do differently, and why it matters, I'm not sure where you're going with that. It's probably obvious but I'm not getting it.

The metaphor Sutter was going for, as I see it, is that TS and Kotlin both added missing features to their host language. Most importantly reflection and decorators in TS, which are now becoming a standard in JS as well[0]. cpp2 mainly focuses on experimenting with reflection and metaprogramming as well, adding features currently missing in C++ by being a compiles-to-C++ language. Sutter has written C++ proposals what would allow give C++ similar reflection and metaprogramming capabilities based on what he discovered by working on cpp2. That's pretty comparable if you ask me.

[0] https://github.com/microsoft/reflect-metadata

vanderZwan··on Cost of enum-to-string: C++26 reflection vs. the old ways
Thank you for explaining and looking up the link, it's appreciated! :)
vanderZwan··on Cost of enum-to-string: C++26 reflection vs. the old ways
Well, if you mean "as an official C++ syntax" then I agree, and I suspect Sutter would agree as well. He labeled one talk about it a "Towards a Typescript for C++", after all[0].

But I do think it is different than other "compile to C++" languages, because it seems to be more of a personal case study for Sutter to figure out various reflection and metaprogramming features, and then "backport" those worked out ideas to regular C++ via proposals. And the latter don't have to match the CPP2 syntax at all.

In multiple examples he's given in talks the resulting "regular" C++ code is easier to read, mainly because the metaprogramming deals with so much boilerplate.

[0] https://www.youtube.com/watch?v=8U3hl8XMm8c

vanderZwan··on Cost of enum-to-string: C++26 reflection vs. the old ways
Yes, I've heard that before, but comments like this one in your linked issue still make me wonder:

> at least for gcc and Visual Studio using #pragma once has a significant impact. The fact is, the compiler does not need to continue parsing the whole file when reaching a #pragma once. otherwise the compiler always needs to do it even if the include guard afterwards will avoid double processing of the content afterwards.

As written the explanation for these optimizationst suggest that both "pragma once" and include guard optimization still requires opening and closing the file each time an include is encountered, even if you bail after parsing the first line. Is that overhead zero? Or are the optimizations explained poorly and is repeatedly opening/closing the file also avoided?

Either way, do you know what causes the slowdown as a result of including <meta>?

vanderZwan··on Cost of enum-to-string: C++26 reflection vs. the old ways
As a developer who doesn't really write C++ code I'm inclined to agree, but I think Herb Sutter's "syntax 2" project might provide a nice way out of that mess eventually.

I played around with cppfront over Christmas and it was a lot more ergonomic than my distant memories of C++11, which I don't even have negative memories of per se.

[0] https://github.com/hsutter/cppfront

vanderZwan··on Cost of enum-to-string: C++26 reflection vs. the old ways
> The header is the cost. Not the reflection. The reflection algorithm is fast – asymptotically ~0.07 ms per enumerator, essentially the same as the hand-rolled switch in the X-macro version (~0.06 ms). What makes reflection look expensive is <meta>: just including it costs ~155 ms per TU over the baseline.

So speaking of old ways, I'm not a C++ dev, but a while ago saw someone comment that they still organize their C++ projects using tips from John Lakos' Large-scale C++ software design from 1997, and that their compile times are incredibly fast. So I decided to find a digital copy on the high seas and read it out of historical curiosity. While I didn't finish it, one wild thing stood out to me: he advised for using redundant external include guards around every include, e.g.

     #ifndef INCLUDED_MATH
     #include <math>
     #define INCLUDED_MATH
     #endif
The reason for this being that (in 1997) every include required that the pre-processor opened the file just to check for an include guard and reading it all the way to the end to find the closing #endif, causing potentially O(N*2) disk read overhead (if anyone feels like verifying this, it's explained on pages 85 to 87).

Again, that was in 1997. I have no idea what mitigations for this problem exist in compilers by now, but I hope at least a few, right?

This conclusion is making me wonder if following that advice still would have a positive impact on compile times today after all though. Surely not, right? Can anyone more knowledgeable about this comment on that?

vanderZwan··on Kraftwerk's radical 1976 track
One of the things whose non-existence I'm mildly surprised by: a mash-up between Kraftwerk's Radioactivity and Imagine Dragons Radioactive. Sure, they're extremely different songs melody-wise but that never stopped people from successfully mashing up songs before, and the underlying beat is almost the same but reversed, which is kinda interesting[0][1].

Also, has anyone ever compared the cultural context and zeitgeist of both songs? Probably would be a fun high school assignment, haha. Kraftwerk's song came out in the same decade that the Club of Rome published its Limits To Growth report[2], so when fears about humanity's future really started to become A Thing that was impossible to ignore. Later versions of the song turning it into a protest song encapsulate Cold War fears for a nuclear apocalypse of the time (presumably, I wasn't really around yet back then).

The main audience for the Imagine Dragons song was a generation fully born after the fall of the Berlin Wall. One that grew up playing the Fall Out games. It also came out in 2012, right after the 2008 crisis kick-started the "oh the previous generation will leave us with nothing huh?" Doomer mentality among millennials and Gen Z kids. Remember the media going nuts over the "Ok, Boomer" expression for a while? (which still feels like the media intentionally dividing a community to stop it from actually fixing things me, tbh, but let's not get too side-tracked)

In that context, when put side by side the ID song almost feels like a Doomer generation follow-up and implicit critique of how nothing seems to have actually be done about to prevent the impending apocalypse that the Kraftwerk song's generation was supposedly so worried about, turned into a fantasy about living in that post-apocalyptic planet.

It's "vibe" is weirdly hopeful too, especially compared to the Kraftwerk song as well. Instead of fearing an apocalypse, it's set after one and embraces living within it.

At least, that's how the two songs come across to me, which probably says more about me than anything else. Apparently Dan Reynolds, main singer on ID and one of writers of the song, has said that in retrospect after almost a decade, he had realized that it was actually about him "not giving up hope after losing faith in Mormonism."[3]. Which makes sense as a personal experience of going through feeling doomed and figuring out how to survive and embrace living on in a "post-apocalyptic" world on a personal, social level.

I think that's what annoys me about the Kraftwerk song's status as a protest song, and a lot of other music from the same era: it doesn't feel like it's insisting on a better future. It's passive late 70s, early 80s pessimism.

[0] https://www.youtube.com/watch?v=w3viBe2Q0P8

[1] https://www.youtube.com/watch?v=NyXeJZJUFHE

[2] https://en.wikipedia.org/wiki/Club_of_Rome

[3] https://en.wikipedia.org/wiki/Radioactive_%28Imagine_Dragons...

vanderZwan··on First tunnel element of the Fehmarnbelt Tunnel immersed
It's not in an earthquake zone, but isn't the Scandinavian continent still rising at a surprisingly fast rate? I wonder if that could affect the engineering of the Fehmarnbelt tunnel, in an "in x years one end of the tunnel will have risen n centimeters compared to the other end" way. It's probably such a small amount it's well within levels where regular maintance will cover it anyway, but I'm still curious.
vanderZwan··on Google Chrome silently installs a 4 GB AI model on your device without consent
Cory Doctorow had an essay about that years ago, except he didn't artificially limit it to Windows:

"Even if you're paying for the product, you're still the product: Incentives matter, but impunity matters more."

https://pluralistic.net/2022/11/14/luxury-surveillance/#liar...

vanderZwan··on Google Chrome silently installs a 4 GB AI model on your device without consent
We live in a tech world where it has become normalized that perfectly functioning software that you used to buy once and then got to use indefinitely suddenly receives an "update" to put previously existing functionality behind a pain subscription. The reasonable expectation people have is that an update fixes security bugs and maybe includes a few optimizations.

So no, I don't think it's a weird trend at all that people start describing software as "silently" doing things when trust in automatic updates of software (a thing that software silently does) has deservedly gone down the drain in the last few years.

vanderZwan··on Google Chrome silently installs a 4 GB AI model on your device without consent
Then what is your definition of "installing" exactly? Are you going to split hairs about it not being a separate program being installed and running in the background, but weights being used by code that is run inside the browser? Because honestly, I don't think there's any significant difference from the user's perspective here. Other than the fact that doing the latter bypasses the need to get permission to install a new program. Which makes it an even worse violation, in a way, since it undermines the trust that the browser as a platform is just a browser.

A 4 GiB model has nothing to do with the functionality of a web browser. It is something forced on users without their consent.

Of course that's what we get for giving the benefit of doubt to the company that insisted on learning the wrong things from the Google Buzz fiasco.

vanderZwan··on Async Rust never left the MVP state
> It's, probably, not well-suited for things like microcontrollers, where every byte matters, but if you can afford the overhead, it's so much better than Rust async.

There is one hill I'll die on, as far as programming languages go, which is that more people should study Céu's structured synchronous concurrency model. It specifically was designed to run on microcontrollers: it compiles down to a finite state machine with very little memory overhead (a few bytes per event).

It has some limitations in terms of how its "scheduler" scales when there are many trails activated by the same event, but breaking things up into multiple asynchronous modules would likely alleviate that problem.

I'm certain a language that would suppprt the "Globally Asynchronous, Locally Synchronous" (GALS) paradigm could have their cake and eat it too. Meaning something that combines support for a green threading model of choice for async events, with structured local reactivity a la Céu.

F'Santanna, the creator of Céu, actually has been chipping away at a new programming language called Atmos that does support the GALS paradigm. However, it's a research language that compiles to Lua 5.4. So it won't really compete with the low-level programming languages there.

[0] https://ceu-lang.org/

[1] https://github.com/atmos-lang/atmos

vanderZwan··on Ti-84 Evo
It's kind of weirdly comforting to see Kerm is still passionate about calculators after all these years, isn't it?
vanderZwan··on Acetaminophen vs. ibuprofen
I just realized I forgot to reply to this, but just in case you still read it: I'm so sorry that you have to deal with that, I hope that you're currently living in an environment that doesn't cause headaches.

I also really appreciate that you added nuance to the discussion by sharing your experience. My comments were not intended to imply that dealing with pain symptoms without fully understanding the cause is an inappropriate treatment in situations like yours. Hopefully they did not come across that way, and if so my apologies.

vanderZwan··on How to be anti-social – a guide to incoherent and isolating social experiences
Yeah that pretty much lines up with my expectations - I've seen the type of behavior described both in real life and in various online spaces. Luckily never ticking all of the boxes at once, but they don't need to to cause a lot of needless suffering to themselves and collateral damage to the people around them.

The worst situations usually were if someone with this kind of self-sabotaging coping mechanism for some kind of trauma (because that's what it usually seems to be in my experience) ended up in some kind of moderator position in some on-line community, which they tended to seek out to get more control to cope with their fears.

vanderZwan··on Acetaminophen vs. ibuprofen
I'm sincerely sorry for you if you are suggesting that you are completely unable to communicate with your pet cat or observe its behavior and reason about why it makes sense just because it lacks language. I assume you don't actually have that problem but that is what your comment literally implies.

I made my point and you're ignoring it: you imply that all pain is unreasonable because the body is "irrational". By that logic, you are saying that my earlier example of a sprained ankle hurting when I lean on it means my body is "unreasonable" for signalling that I should not lean on a healing sprained ankle. Quite frankly I think anyone ignoring that and harming themselves more in the process is an idiot.

The example of a cat hissing at the veterinarian because it cannot distinguish the situation from a real threat does not mean that cat's never hiss at real threats. If you cannot even be bothered to tell the difference and blame your cat on every occasion, you're being more irrational than the cat.

vanderZwan··on Acetaminophen vs. ibuprofen
I fail to see where anything I said implied that I disagree with that sentiment.

Also, you were arguing we should not listen to pain when it's acting irrational, as in unreasonable. Then you switch to "all minds being irrational", as in actually not rational. That's not the same thing.

vanderZwan··on Acetaminophen vs. ibuprofen
Well, not so much rediscovered it as reasoned that that might be the cause of the pain and then confirmed it. The shocking part is that no doctor advises to use this after a tonsillectomy (or other kind of mouth or throat procedure).

My dad (also a doctor) called it a typical case of "the nurse's wisdom": the kind of quality of life interventions that typiqally get discovered by nurses and passed down orally, but never make it to official medical journals.

vanderZwan··on Acetaminophen vs. ibuprofen
Sure, but how good are you at judging if a human mind is irrational or not without engaging in conversation with it? Why not extend that logic to your body.
vanderZwan··on Acetaminophen vs. ibuprofen
I feel better avoiding the causes of making me grumpy, I end up feeling less tired at the end of the day.
vanderZwan··on Acetaminophen vs. ibuprofen
As the more potent diclophenac? Might have been what was prescribed, I genuinely can't recall. I do know I didn't take it though ;)
vanderZwan··on Acetaminophen vs. ibuprofen
None of this is in disagreement with my argument and comes across as actively ignoring the part where I explain that I am not advocating to "walk it off".

The discussion started in the context of taking painkillers regularly for things like "inconvenient head-aches" without pausing to investigate what causes those headaches. It should be clear from the context that I am not talking about something like people struggling with migraines. I know they try to figure out not to have them in the first place, and if they do have them deserve all the pain relief they can get. I've had migraines myself growing up.

Nobody is saying that people who suffer from chronic pain shouldn't have a relief from their suffering. But as another comment pointed out: the US seems to have a big issue with untreated conditions in general than other countries.Not in the sense of not treating the pain, but in the sense of not treating the conditions leading to pain. You don't even have paid sick leave apparently. Tackle issues like that and there will be fewer chronic pain sufferers to begin with.

vanderZwan··on Acetaminophen vs. ibuprofen
Apologies, I could have clarified that (then again my comment already was a wall of text).

The body does not absorb water passively but actively, and it's been known for a very long time that water with a bit of salt and sugar is absorbed faster. This has been crucial in reducing (especially child) mortality due to acute fluid loss from diarrhea due to, say, cholera[0]. (I personally find amazing that Robert K. Crane figured out the mechanism behind it in the sixties already[1])

Now, "proper" ORS, according to the WHO, is the following:

    Sodium chloride               2.6 gr/l
    Glucose, anhydrous           13.5 gr/l
    Potassium chloride            1.5 gr/l
    Trisodium citrate, dihydrate  2.9 gr/l
However, that is in the context of oral rehydration therapy:

glucose facilitates the absorption of sodium (and hence water) on a 1:1 molar basis in the small intestine; sodium and potassium are needed to replace the body losses of these essential ions during diarrhoea (and vomiting); citrate corrects the acidosis that occurs as a result of diarrhoea and dehydration.

So you can usually get away with not having the potassium and trisodium if the reason for dehydration is neither diarrhoea or vomiting.

This translates to a simple home recipe of:

    1 liter (or 4.25 cups) of water
    1/2 a teaspoon of salt (3 gr)
    2 table spoons of sugar (30 gr) OR 1 table spoon of glucose (15 gr)
The reason for doubling the amount of sugar is that the active absorption of water relies on glucose, while regular sugar is made out of sucrose. Sucrose breaks down into equal parts fructose and glucose (both have identical chemical formulas but a different arrangement of the atoms).

[0] https://en.wikipedia.org/wiki/Oral_rehydration_therapy

[1] https://en.wikipedia.org/wiki/Sodium-glucose_transport_prote...

[2] https://www.who.int/publications/i/item/WHO-FCH-CAH-06.1 page 12 of the linked on that page (labeled as page 3)

vanderZwan··on Acetaminophen vs. ibuprofen
This is so absurd to me. The expression "prevention is better than cure" isn't just folk wisdom, in just about any country with nationalized healthcare the studies also confirm that this costs less money. The only exception I ever heard was a Dutch study in the 2000s suggesting that people growing older due to smoking less was going to increase healthcare costs, because people were getting older putting pressure on the pension system, but let's not peer further into that can of worms.

So by all accounts it should be cheaper for for-profit insurance companies too, unless they have ways to externalize the costs onto the rest of society. Which I guess is more circumstantial evidence for how messed up the system must be.

vanderZwan··on Acetaminophen vs. ibuprofen
Pain is weird. It's extremely subjective, not only between people but also within your own body. Paraphrasing something Paul Rozin mentioned in a paper on so-called benign masochism: people can learn to enjoy eating the most extremely spicy food, but even those people will still scream out in pain you rub the ghost pepper they're eating in their eyes. Pain sensation is therefore localized and contextual.

So we should not be too quick to dismiss the pain of others.

As far as 10/10 pain goes, I've heard cluster headaches can get so bad it has driven people to suicide during an episode.

vanderZwan··on Acetaminophen vs. ibuprofen
> That's also healthier in the long run, no?

Long-winding tangential anecdote (which is why I'm replying to myself in a separate comment), but I have pretty extreme example of this: I managed to avoid nearly all suffering after getting a tonsillectomy in my mid-thirties, while using almost no painkillers.

My ENT surgeons warned that me "I'd hate him for about a month, then I'd love him for never having to deal with [serious medical condition that justified the removal of tonsils] again". He prescribed all kinds of stuff to alleviate the expected suffering, and advised me to try to take the weakest options I was comfortable with, because the heavier ones might have some unpleasant side effects. It's the only time in my life I've been prescribed painkillers at all, actually (this was in Sweden, btw).

I got codeine/paracetamol as a coughing suppressor and mild painkiller, a couple of heavier painkillers for if it got worse (I forgot the name but some kind of heavy-duty variation of diclophenac that you can only get with a prescription), and some kind of nasty solution to gargle with that supposedly would numb my throat if it got really bad. I've been told this is nothing compared to what you can expect in the US.

Then in the evening after the surgery, when I was trying to eat a soup with my mom, I realized soup didn't hurt as much as drinking plain tap water. And then I thought: isn't it odd that drinking plain water feels like a thousand paper-cuts in the open wound in my throat, but whenever the coughing made the wounds open and bleed, the blood doesn't hurt at all? Blood is mostly water, so what is the difference? Could it be the salt? Is this similar to why drinking demineralized water is bad for you? What's the opposite of demineralized water? Oral rehydration solution. Ok, trivial to make, let's try that. I'll drink it luke-warm to be close to body temperature too.

Turns out that that works. Oral rehydration solution is almost painless to drink after a tonsillectomy. I know this is anecdata, but sample size three: I've since shared this information with two friends who got a tonsillectomy, and they've been extremely grateful for this tip.

It even seemed to speed up my recovery, probably due to a lack of irritation triggering inflammation. I was eating solid food within days. DAYS. My mom, a retired family physician herself, couldn't believe her eyes.

I ended up only needing the codeine/paracemtal in the evening to suppress coughing in my sleep, and brought back all the other pain-killers without opening them.

vanderZwan··on Acetaminophen vs. ibuprofen
I feel like this is one of those things where Europe and the US are very different, culturally speaking - I've lived in the Netherlands, Germany and now Sweden, and the amount of painkillers used and prescribed here seems much lower than what Americans tell me is normal in the US.

Pain a warning signal from the body. It's something one should listen to, not just try to ignore and overrule. If I sprain my ankle it only hurts when I lean on it. Because it's healing. So I don't. Why would headaches or other "inconvenient" pains be different?

In my case headaches are usually caused by sleep deprivation causing high sensitivity to external stimuli, muscle tension, dehydration, or some combination of that. So I'll first try to take a nap and/or stick to low-stimuli environments, have a good stretch and/or heated up massage pillow for the neck, and make a quick home-made oral rehydration solution with some salt and sugar. That usually alleviates most if not all of the pain.

And I'm not saying painkillers should always be avoided. If I have insomnia-induced headaches in the morning and a long day ahead with many social interactions, then I know that headaches will make me a grumpy asshole, so I'll obviously will take a painkiller for everyone's sake. And sometimes I can only fall asleep if I take a painkiller to get rid of the headache first, so I need it to break the vicious cycle. I'm not saying people should "walk it off" here, just to focus on trying to figure out the actual cause first before medicating the symptom way. That's also healthier in the long run, no?

vanderZwan··on What game engines know about data that databases forgot
You forgot dynamic property creation/lookup instead of using a constant "shape" that JS engines can actually JIT optimize away.

And then there's the more detailed version of that where people write {x: 0, y: 1} in one spot and {y: 1, x: 0} in another and do not seem to realize that this under the hood they just sabotaged the ability of every JS engine out there to fully optimize any code related to it. Which also extends to situations where functions take objects that happen to share some properties as parameters: if you can put the shared properties first and in the same order in the object creation, it will result in better optimized functions.

(but tbh I think that as long as we don't fix the bloat that is tracking libraries first, all of this is optimizing the wrong thing)

← PreviousPage 5 of 34Next →