HN user

jihiggins

91 karma

hi

Posts0
Comments40
View on HN
No posts found.

For going from C to Rust, I think you'd just use CString::to_str instead of CString::to_string. I'm pretty sure this just calls std::transmute behind the scenes and doesn't cause an allocation. (In the same way that you generally don't clone vanilla strings and instead pass references around.) iirc, it's still tricky to go the other way. I think if I was working with super C-FFI heavy code, I'd just end up using CString as my default for that code. Custom allocators would also help there, since you could just create the strings on the stack or whatever, but I don't remember if the string version of those is even finished in nightly yet.

Sorry, didn't see your reply till now.

It's not literally everyone.

Immunocompromised people who have managed to survive are often still afraid of catching Covid. How little most people care means that those who are worried have a difficult time existing in public spaces. Especially with the constant social pressure to act like Covid is over. You're not going to see people who are worried about Covid as often, because... they are worried about Covid.

This was the case early on, too, though! Covid is _much_ more likely to kill people in marginalized groups. And while marginalized deaths still show up statistically, they are going to be more hidden in the day to day.

New Covid variants still cause severe long-term effects. From what I’ve read, the consensus seems to be “we have no idea what all of the long-term consequences will be, but they’re looking worrisome.” Covid is not reported on as much now, but this information isn't from like, fringe sources or anything. There is less news about Covid now because nobody wants to think or read about Covid anymore.

e.g. a quick search gives me: https://www.cbc.ca/news/health/researchers-are-still-untangl...

So, while most people may have moved on, I think the RTO movement is still hostile and coercive. Honestly, imo most people having moved on is also largely due to coercive forces.

Python with Braces 2 years ago

this is what those end up being, it's pretty straightforward?

    fn five() -> i32 {
        return 5;
    }

    fn five() -> i32 {
        5;
        return ();
    }
semicolon changes the expression from returning the result of the expression to running the expression and returning the unit type. if you accidentally do that and specified a non-unit-return-type in the function signature, the type checker tells you about it:
    error[E0308]: mismatched types
     --> src/main.rs:1:14
      |
    1 | fn test() -> i32 {
      |    ----      ^^^ expected `i32`, found `()`
      |    |
      |    implicitly returns `()` as its body has no tail or `return` expression
    2 |     5;
      |      - help: remove this semicolon to return this value
which is also pretty clear about the solution
Python with Braces 2 years ago

idk there are a lot of uses for it

    let dx = {
        let prev_x = x;
        x = get_x();
        x - prev_x
    };
often, it's slightly better cpp style scoping blocks if nothing else? there are tons of other little QoL things it enables though, but they're all going to be little ergonomics things that only seem worth it if you've used the language for awhile
Python with Braces 2 years ago
    let x = {
        3
    };
    let y = {
        3;
    };
    assert_eq!(x, 3);
    assert_eq!(y, ());
i think it'd also mean having to parse whitespace or newlines without something like that?

i think you might lose people in the transition from the turing tape machine style bootstrapping to using full "words" for operations. it might help to compare it to something like regexes? (obviously they're not similar in the way that forth / stack langs are, but they're more commonly known and more commonly thought of as useful)

i think it'd also help a lot to have some gifs of the state machine operating on stuff

or maybe you could have something with "syntax" highlighting. a navigable timeline that changes the highlighting based on the current ignore lists and / or stack contents as you step through the code could be neat

"insultingly dumb, i listen to metal" "check this out, this top 100 musician isn't mainstream so you probably haven't heard of them"

this thread's turning into a decent example of why i hate talking to people about music. no matter how polite or reasonable someone is otherwise, there's like a 90% chance they have all these weird value judgements tied up in what people are listening to. it's incredibly tedious.

this is sort of what modern ides (e.g. jetbrains stuff) already do in the bg. when im working on stuff, i almost never navigate via text or the file explorer, i use things like "goto usages or definition" and navigate via what is essentially data tracing. this only works well with statically typed languages ime, though.

the indexing step is basically building this db in the background, it's just kept out of view / hidden unless you're building ide plugins or whatever.

it feels like there are two main categories of reaction to big societal issues: one starts with "this is unacceptable, so we will find an alternative," the other says "everything else sounds iffy so we shouldn't even try"

our current system is so broken and evil that i wonder if just getting rid of it entirely wouldn't actually be better and more ethical. even with the problem of releasing however many violent offenders back in the wild. "it might be even more beaurocratic" isn't really going to convince me of anything.

i dont know what the best alternative solution is, im a software engineer. i just know that the current solution is depraved and should be torn down and replaced.

^ exactly the type of person i was talking about. how is this considered anything other than troll behaviour?

also, there are no spelling mistakes in my comment. perhaps consider learning about how words are spelled in british english vs american english? :)

i didn't even notice there was no capitalisation when i read the article

idk about the author, but when i was younger, some people's pedantry and pettiness over grammar / capitalisation / more casual chatting got me to switch sides and deliberately stop using it as much. now it's also an aesthetic preference

i think there's potentially a valid point about accessibility concerns, but blog posts, chatrooms, and internet comments are also very informal modes of discourse

code that uses coroutines is often a lot more straightforward than callbacks. with callbacks, it can also be non-trivial to even find out where / when some delegate was set. it's also often difficult to even navigate / read a single chain of actions without having to jump back and forth across several files, while also needing to follow around a trail of random variables. i'd still make the trade over to coroutines every single time. i'm definitely biased, though. i really really hate working with callback heavy code

(what i've usually done for hunting down coroutine errors is use a tracing profiler, or i guess just printf debugging. it is probably the worst part still, tho)

it's partly because of the engine code. there's even bigger stuff, especially especially if it's a company with any legacy codebase that's 10-20 years old or whatever (e.g. EA / Frostbite.) one i worked on took hours to compile the first time on a machine with 128gb of ram and a threadripper. the onboarding doc suggests getting some coffee at that point haha

a big part of working on them as a generalist ends up being the ability to know how to even navigate something like that (especially since they're often haphazardly documented)

(part of it is that most of the games "fork" the engine rather than using it as a standalone thing)

it's probably not everyone on the team building that whole thing each time, but yea. hundreds of solutions and millions of LOC isn't unusual

*i just did a quick check with unreal's source, it's ~20 million LoC (assuming I didn't mess up the filtering somehow)

every time rates come up on this website, people come out of the woodwork claiming "most" developers in every north american country make half a million or more a year. it's hard to not feel like this is just a few people using this as an opportunity to brag about their rates in niche industries (or people are just lying)

i have been a contract developer, and have worked at technical companies in canada, and have never seen rates that are even close (and im not a jr / have never used java for work outside of small amounts for mobile.) there's no way these rates are as common as you are all making them out to be, unless it's some niche, or you're talking about extremely short contracts, or there's some other missing piece of context

where are you finding these rates at? i have rarely seen anything even passing $100/hr in canada, contract or not

it ended up being a confluence of personal life stuff plus how pointless the jobs felt (especially after what a slog university was, i was basically already burnt out going into my first job.) i think boring meant adrenaline didn't kick in as much, and my first few jobs didn't really try to incentivize caring about work in ways that weren't blatantly exploitative or "on trust."

honestly, idk that it was really anything specific, so much as a bunch of different things finally catching up to me mixed with some bad luck

i did that all throughout university and graduated with honors in an engineering program. it really depends on your coping strategies / personality / luck / etc. i definitely have adhd, it just took a few boring jobs for it to blow up my life in any real way. (i completely burned out, turns out relying on adrenaline as an adhd medication is not a great long term coping strategy.) some people will hit that wall earlier or later than others.

once, i accidentally dragged a lab partner into doing work the way i did. we turned in the assignment with less than a minute on the clock, and he nearly had an anxiety attack (i was feeling pretty great about things)

Nicotine (2016) 3 years ago

cigarette smoke also has a bunch of other stuff, including MAOIs. it's definitely not _just_ the nicotine. iirc, cigarettes also have additives to make the nicotine hit harder / cross the blood brain barrier faster, which probably doesn't help