I can see that. I’m coming in from the other extreme that is Python, where even the meta-programming is done in plain Python.
- 3 Posts
- 12 Comments
C++ was my first programming language. I remember the nightmare of dealing with dependencies and avoiding boost because it felt wrong to need a third part library for basic features. The toolchain for Rust is very nice (not just compared to C++, but all other languages I’ve worked with) and has so far been a huge joy to work with. The language itself too. I’m just curious about why the language likes to expose more of its features through meta-programming rather than directly in the language itself. Things like
println!andformat!being macros instead of functions, or needing a bunch of#[derive(Debug,Default,Eq,PartialEq)]everywhere for things that other language provide through regular code.
I’m not talking about what features are in the standard libraries vs third party libraries. I mean meta-programming as in the stuff that generates Rust code. Take console printing for example, we use a macro
println!in Rust. Other languages provide an actual function (e.g.printfin C,System.out.printlnin Java,printin Python, etc). The code for my first project is also full of things like#[derive(Debug,Default,Eq,PartialEq)]to get features that I normally achieve through regular code in other languages. These things are still in the Rust standard library as I understand it.
cx40@programming.devto
Programmer Humor@programming.dev•AI will replace programmersEnglish
2·9 months agoThat’s also to make programming easier. Different programmers have different needs.
cx40@programming.devto
Programmer Humor@programming.dev•AI will replace programmersEnglish
1·9 months agoBut the main benefits of static typing is in making the programming part easier. What do you gain from translating dynamically typed languages into a statically typed language?
cx40@programming.devto
Programmer Humor@programming.dev•AI will replace programmersEnglish
81·9 months agoA trick I’ve employed is to pretend to believe in something completely different. If it says “no, you’re wrong” and goes on to tell me what I actually believe, then it’s a good indicator that I might be on the right path.
Tabs get in the way and force you to actually address them instead of ignoring them. In theory.
cx40@programming.devtoHacker News@lemmy.bestiver.se•A cheat sheet for why using ChatGPT is not bad for the environmentEnglish
3·10 months ago- Specific heat capacity of water: 4.184J/(gC)
- Average shower temperature: 37C
- Cold tap water temperature: T
- Shower head output: 2gallon/min = 7.57L/60s = 126ml/s = 126g/s
1s * (126g/s) * (4.184J/(gC)) * (37C - T) = 524J/C * (37C - T)
120Wh = 432000J
T = -787C
So I guess the math checks out if your city’s water supply temperature is way below absolute zero.
Scratch that, let’s assume the water actually flows, so T=0C. What water throughout do we need to achieve this level of power consumption?
1s * (X g/s) * (4.184J/(gC)) * (37C) = 432000J
X = 2791g/s = 44gpm
You would have to be showering with 17 showerheads simultaneously using showerheads that are rated at the highest legal flow rates in the US (2.5gpm).
Autism presents very differently from one person to the next. Most of the literature so far has been on young boys, so there’s a very poor understanding among most mental health professionals and the general population on how it looks in adult men, let alone women. On top of that, women tend to be much better at hiding it.
As for coping mechanisms, I can’t give specific examples since, as you say, everyone is different. This is especially true for autism since there’s such a wide range of special interests, sensory sensitivities/preferences, etc. that you can easily find two people where the good and bad categories are complete opposites. You’ll often hear advice such as “engage in your special interest” (assuming one exists), “stick to your comfort foods”, or “minimize masking”. These are very broad suggestions, but it’s the best we can give. There’s a lot of work involved in figuring out what that means for you. For sensory preferences, there are resources online that list different things to consider. Look up “sensory preferences checklist” to find them. For masking, you’ll have to learn what is and isn’t masking. That involves understanding how non-autistic people think, what they’re capable of doing without thinking, then comparing it against the amount of effort you put into doing the same thing. For example, neurotypicals don’t need to think about what facial expressions to make because their faces just naturally do the thing in accordance to their emotional state. If you find that you need to consciously think about what face to make based on how you feel, then that’s masking and would be a contributing factor to the constant exhaustion.
As someone who’s been going through what I believe to be autistic burnout for many years now, this third hand description of her behaviour feels very similar that what my own experience probably looks like from the outside.
Needing a lot of extra sleep is one of the symptoms. Depression, anxiety and being generally in a bad mood often also comes with burnout. She’s putting no effort into events or activities, possibly because she doesn’t want those activities or events in the first place due to the energy drain. Not knowing how you feel (and just bad interoception in general) is a very common trait of autism. You mentioned in a comment that she’s “quiet and shy”, which is another point towards the autism hypothesis.
Keep in mind that this is based on my own experience only. There isn’t enough information to know if your friend is going through the same thing or not. Assuming she is, the solution is probably to work on that interoception and figuring out how different activities/events affect your energy levels. There’s a good chance that if you had all your coping mechanisms figured out before entering the relationship, they don’t work anymore after because some things clash with the expectations of the relationship. For many of them, you probably wouldn’t even know they were coping mechanisms to begin with. They were things you just did because you prefer it that way and had no idea how bad things can get if you didn’t. So part of the work is in figuring out which of your habits are coping mechanisms.
cx40@programming.devto
Python@programming.dev•Why can't I use the '|' bitwise operator in this statement?English
3·11 months agoThey use the same symbols, but they’re not bitwise operators anymore.



I’m not saying that there’s a problem with doing things one way or another. Rather, I’m asking whether there’s a problem with doing things differently that then led to this design decision to be made with Rust. I want to better understand how this language came to be.