19,348 karma · joined February 4, 2013
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.
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.
> 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>?
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.
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?
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...
"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...
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
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.
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.
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.
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?
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)