• 5 Posts
  • 183 Comments
Joined 2 years ago
cake
Cake day: July 2nd, 2023

help-circle






  • C, C++, C#, to name the main ones. And quite a lot of languages are compiled similarly to these.

    To be clear, there’s a lot of caveats to the statement, and it depends on architecture as well, but at the end of the day, it’s rare for a byte or bool to be mapped directly to a single byte in memory.

    Say, for example, you have this function…

    public void Foo()
    {
        bool someFlag = false;
        int counter = 0;
    
        ...
    }
    

    The someFlag and counter variables are getting allocated on the stack, and (depending on architecture) that probably means each one is aligned to a 32-bit or 64-bit word boundary, since many CPUs require that for whole-word load and store instructions, or only support a stack pointer that increments in whole words. If the function were to have multiple byte or bool variables allocated, it might be able to pack them together, if the CPU supports single-byte load and store instructions, but the next int variable that follows might still need some padding space in front of it, so that it aligns on a word boundary.

    A very similar concept applies to most struct and object implementations. A single byte or bool field within a struct or object will likely result in a whole word being allocated, so that other variables and be word-aligned, or so that the whole object meets some optimal word-aligned size. But if you have multiple less-than-a-word fields, they can be packed together. C# does this, for sure, and has some mechanisms by which you can customize field packing.




  • Don’t get too excited, the argument here is basically “you need more signage, to make sure people are aware of the law they’re violating, before you can arrest them for it.” Like, it’s nice to hear a judge actually considering and following the law But this doesn’t really invalidate the administration’s end-run around the laws on who they can and can’t deport. If anything, it gives them a better roadmap for implementing it.

    On the other hand, when we talk about people within the system leveraging beauracracy for resistance, “nah, you need to build more signage first” does kinda fit that model.









  • The REAL problem is that the industry collectively uses JS almost exclusively for shit it was never meant to do. Like you say, it’s intended for it to not throw errors and kill your whole web page, because it was only ever intended to be used for minor scripts inside mostly-static HTML and CSS web pages. Then we all turned it into the most-popular language in the world for building GUI applications.


  • Honestly, if you’re having trouble finding stuff for vanilla JS, I’d recommend looking at jQuery. Not that you should USE jQuery, necessarily, but the library is basically a giant wrapper around all the native JS APIs, so the approach to building stuff is essentially the same: it all focuses on tracking and manipulation of DOM elements.

    I do vanilla JS (actually TypeScript) dev at work, daily, and that was my big takeaway from spearheding our team’s migration from jQuery to vanilla TypeScript: I honestly don’t know what benefit jQuery provides, over vanilla, because all the most-common jQuery APIs that we were using have a 1:1 native equivalent.

    We do also use 2 third-party libraries alongside vanilla, so I’l mention those: require.js and rx.js. Require you probably don’t need, with modern JS having bundling and module support built-in but we still use it for legacy reasons. But rx.js is a huge recommend, for me. Reactive programming is the IDEAL way to build GUIs, in my opinion.


  • My wife runs a large online D&D guild, with games 4-5 nights a week (not that you play in all of them, they just have that many people). They’re no strangers to kicking people that cause drama, and they have several trans and non-binary members already.

    I will say that they might not be able to bring their character in, as-is, if it’s heavily based on “official” D&D lore and sourcebooks. The group has spent 8 years building all their own lore and tuning some homebrew rules and classes. It’s mostly built on the 5e foundation, though.

    I believe this is where they’d go to apply.