• 42 Posts
  • 1.86K Comments
Joined 3 years ago
cake
Cake day: August 4th, 2023

help-circle
  • Well, I don’t like it. Lol.

    Adding something like monads to Go as some first-order kind of thing really feels to me like it would be a big bag on the side. (I mean, I feel like all the functional stuff in Java like lambdas and streams and stuff is a bag on the side in the same way. Java fanboys back in the day touted Java’s proceduralness as a strength. Now I have to wonder whether those fanboys have left Java for other languages and the Java fanboys we have now are a new crop of lambda-positive Java fanboys or whether the old Java fanboys changed their tunes and decided functional programming was a good thing for Java after all.) It’d make Go kindof not Go any more, making it “just another language that adds features willy-nilly”.

    Plus, changing the standard library to use monads instead of multiple return values for errors would be a huge backwards-incompatible thing. Not to say backwards-incompatible changes shouldn’t be made. (I have great respect for Python’s 3.0 rework, for instance. And I think Java is extremely overdue for something similar.) But I don’t see adding monads as a benefit at all, let alone worth the effort of migrating.

    I’m sure part of the reason why most of the previous proposals haven’t been accepted is because it would create tons of interactions with existing Go functionality and/or confusing edge cases, each of which would have to be considered.

    I just googled (DuckDuckGo’d, actually) and ran across this proposal. I’m not sure I hate… something roughly like it (yet). But it’s not as if it doesn’t have any costs.

    My thoughts on it:

    • I will say I strongly oppose creating variables with magically-decided names (for which I’m pretty sure there’s no precedent in Go), so I’d want the “Declaring the err variable” version mentioned in the proposal that would require the variable name to be explicit: count := strconv.Atoi(input) ? err { return err } (rather than count := strconv.Atoi(input) ? { return err }.) (I’d probably be ok with omitting that variable name after the ? rather than requiring an underscore if that value wasn’t used in the body of the block… if I convince myself I’m ok with even the basic premise, that is.)
    • I also don’t think there’s any precedent for any syntactical elements requiring a variable to be “of interface type that implements the built-in error type”, so I’d rather the ? construct assign the positionally-last return value to the more locally-scoped variable (whose name is after the ?) than requiring that variable to be of any particular type.
    • One open question would be “would count be visible within that block”? Usually a variable is not defined until after the statement that declares it, but this new block would be… part of the statement that declares it, which makes it kindof weird for that variable to be visible inside the block. I concede it would be useful to be visible inside the block, but it still makes scoping confusing, which isn’t an insignificant cost.
    • If hypothetically I did convince myself I was ok with a proposal like this, I might want use of the ? expanded to other situations. Like func bob() (int, error) { ... } ; func(i int) { ... }(bob()?) to silently suppress the error that bob returns. But one major cost of that would be that there’s no rule that “if you return an error, the other return values must be the zero value of the associated type”. It’s a common convention, but not so common as to be inviolable. If, say, a library did return something specific rather than the zero value when returning an error, it would probably have to devote a lot of extra documentation to that situation because that’s a pretty confusing corner case. (Like, maybe a function returns a coefficient to be multiplied by something, but does a return 1, fmt.Errorf("...") if something fails because you’re more likely to want a 1 in an error condition where you’re multiplying that value by something than a 0. (Or maybe that case would be better with a 0.))
    • I don’t think I’d ever use such a construct with a block on one line. I’d probably make it look more like the following, which honestly makes it harder to see the benefit relative to the existing if err := bob(); err != nil { ... } convention:
    count := strconv.Atoi(input) ? err {
      return err
    }
    

    Honestly, the more I think about it just while writing out my thoughts above, the more I think it isn’t worth it. There is one poposal for error handling that I can say I “like” without reservations, though. (And it seems the core Go team is, roughly, planning to take that route.)

    If I had to pick a biggest frustration with how Go is, it would probably be nil. I kindof wish it didn’t have that or anything like it. Not to say I’ve thought it through. There may be really good reasons why nil has to exist. But maybe it would be fine for the zero value of a function to be a function that does nothing but panic. And the zero value of a map to be an empty map. And the zero value of a pointer to be a pointer to a zero value of the pointed-to type. Etc. I don’t think it’s worth changing that at this point, though. I’d rather just use Go as it is than have Go embark on such a drastic change.


  • Honestly, I kinda like if err != nil {. It forces me to think more carefully about how I want errors handled than something like throw does.

    I don’t feel like I have experience with that many different languages. Maybe there’s another language that does it in a way I’d like better. But I prefer Go’s model over the way, say, Java, JavaScript, or Python does things.







  • I mean, Wikipedia seems to contradict a lot of what you’re telling me. Not to say Wikipedia can’t be wrong, but it’s not like anything I said about holotropic breathwork came out of nowhere.

    Wikipedia specifically calls out the face and hand cramping thing. It also mentions a potential risk of seizure based on a 1993 report which may well be outdated at this point. Wikipedia also says “it should not be attempted alone” which seems to contradict your take that “A trip sitter seems unnecessary, IMO”. So at very least even if your take is more correct, it doesn’t sound like it’s uncontroversial.

    I’ve never heard Michael Pollan called an “I’ll try anything” author, but also you’ll note from my comment that I didn’t get from him the idea that holotropic breathwork was associated with some risks to your health. I already had that understanding before reading his book. (I read his book not knowing that holotropic breathwork would come up.) And I’m not sure what you mean by “projecting” in that context. Here’s a quote from How to Change Your Mind talking about his experience with holotropic breathwork:

    Then something frightening happened. Fritz had gone up to the house to prepare our dinner, leaving me to make some notes about the experience on my laptop, when all at once I felt my heart surge and then begin to dance madly in my chest. I immediately recognized the sensation of turbulence as AFib, and when I took my pulse, it was chaotic. A panicky bird was trapped in my rib cage, throwing itself against the bars in an attempt to get out. And here I was, a dozen miles off the grid smack in the middle of nowhere.

    It went on like that for two hours, straight through a subdued and anxious dinner. Fritz seemed concerned; in all the hundreds of breathwork sessions he had led or witnessed, he had never seen such a reaction. (He had mentioned earlier a single fatality attributed to holotropic breathwork: a man who had an aneurism.) Now I was worried about tomorrow, and I think he was too. Thought he also wondered if perhaps what I was feeling in my heart might reflect some psychic shift or “heart opening.” I resisted the implied metaphor, holding firm to the plane of physiology: the heart is a pump and this one is malfunctioning.

    And a footnote:

    I subsequently learned that hyperventilation, which plays a role in breathwork, changes the CO2 levels in the blood, which in turn can alter the rhythms of the heart in some people. What I assumed was a physiologically benign alternative to MDMA turns out to be nothing of the kind; even without a drug, it is possible to change one’s blood chemistry in ways that can affect heart rhythms.

    What am I “projecting onto” Michael Pollan exactly?

    Tell you what. I’ll edit “seems dangerous” to “seems potentially dangerous”.

    So, based on this, evidence suggests you might have simply not done it right.

    If your reasoning is that the fact that I didn’t have “some sort of interesting experience” means I wasn’t doing it right, I basically admitted to that in my previous comment. “I might have gotten into more of that territory had I kept going longer”.

    If your reasoning is that the had hand and face cramping is evidence that I was doing it wrong, that’s in fact the usual effect of “doing it right”. I don’t have any reason to think the cramping effect in particular was dangerous, nor did I say it was.

    If he mentions driving a car, do you also groan and think “Don’t do it!”?

    If he’d previously mentioned specific reasons why he couldn’t possibly drive safely, of course I’d have had concerns with him driving. He’d mentioned previously in the book that he had a history of heart issues and so I thought it concerning that he’d do something like holotropic breathwork. (Also, I never said anything about “groaning”.)




  • Breathwork alone can easily get you to a weird, fun place.

    Oh yeah. I’ve heard lots of wild stuff about some of the holotropic kind of breathwork. I even did it once, but I don’t really trust it. Seems potentially dangerous. Plus, I read How to Change Your Mind by Michael Pollan a while ago and he had a real scare of a near-medical-emergency from that. (To be fair, he’s got heart issues, so that definitely contributed.) I remember reading that part of the book hearing the bit leading up to the holotropic breathwork and thinking “oh, god, don’t do it Michael; you’ll regre-… oh god he did it.” Lol. He had a choice between MDMA and breathwork and because his doctor told him to avoid amphetamines because of his heart, he opted for the breathwork, and I knew that might not really be that much safer. It doesn’t seem he had any long-lasting negative effects. Just a spell of irregular heartbeat or something (I don’t remember more specifically than “or something”). But yeah.

    All that happened the time I tried it myself was a bit of tingling and a lot of hand and face… I dunno. Cramping? Spasming? Like, my muscles seized up and I couldn’t relax them. Not enough to be painful. Just enough to be weirded out. No psychedelic-y sort of effects or anything like that for me personally. I might have gotten into more of that territory had I kept going longer, but who knows. I didn’t have any guide or trip sitter or whatever, so I got scared and aborted when something weird happened. I don’t remember how long those effects lasted, really, but it wasn’t all day or anything.


  • Especially in the early days of the recent Kratom “boom”, I definitely heard a lot of people call it “not a drug”. I think kindof in the same way as there are lots of psychoactive substances that people don’t consider “drugs”. (Chamomile that I listed in my OP, for instance. People feed that shit to their little kids and don’t think of it even slightly like they think of alcohol or hard drugs or whatever. But that shit’s a GABA agonist just like alcohol, GHB, and benzos. There’s definitely a sense of the word “drug” in which chamomile is super duper for sure yes a drug.) I think mostly those folks were in deep denial. It’s not just a drug, but a pretty concerning one for its addiction potential if nothing else. But still, I’ve heard people say it’s “not a drug”. So, yeah. I think it counts for purposes of this thread.



  • Oh my gosh. I get violently ill and can’t stay out of the bathroom when I eat sugar. (I’ve told people, “yeah, sugar makes me sick so I don’t eat it”. And they’re like “oh yeah, me too, the sugar crash in the afternoon always makes me feel so blah.” And I’m like “listen…”.) I basically haven’t eaten anything sweeter than a tomato in 20 years because it’s super not worth it. I’d never heard of SIBO, and I don’t have any letters after my name, but this SIBO thing sounds very much like my experience.

    Not that having a name for my symptoms would really change much to speak of. It doesn’t seem like there’s much of a treatment for SIBO aside from eating in ways that don’t trigger it. But hell. At this point, if there was a cure, I don’t think I’d take it. I’ve only had one cavity in the last 20 years (and I suspect that actually wasn’t a cavity but rather a resorption). Keeping my weight in a healthy range is way easier without sugar in my diet. My taste buds have adapted a lot and things that wouldn’t taste remotely sweet to anyone else taste super sweet to me, so I don’t feel deprived in that way. I have a lot more appreciation for more complex and stronger flavors like bitter, sour, spicy, etc. And I appreciate having that “biofeedback mechanism” that tells me (and not subtly) “hey, that’s bad for you; cut it out”.

    (I cut gluten out of my diet the same time I cut sugar out of my diet and my symptoms abated. I’ve had a couple of times when I’ve had sources of sugar – granny smith apples and bing cherries specifically – and my symptoms came back. But I haven’t had occasion to experiment with gluten to see if having gluten would give me symptoms again. I just haven’t tried it, so I don’t know if I’m sensitive to gluten or not. I don’t make restaurants break out the gluten-free deep fryer or anything. I just ask them to leave the bun off my hamburger or whatever. But gluten is another thing that I just don’t feel deprived for lack of and don’t see how my life would improve any by putting gluten back in my diet. Maybe some day I’ll have enough bread to figure out whether it affects me the same way, but I don’t have any plan to do such an experiment any time soon.)

    And, yeah. I can attest to your point that cutting sugar out of your diet is entirely doable. I virtually never miss it, and in the very rare cases when I do, it’s more of a mild nostalgia than anything you might call a “craving”.