brian

joined 2 years ago
[–] brian@programming.dev 23 points 12 hours ago (2 children)

are they switching to Teams or Teams?

[–] brian@programming.dev 2 points 1 day ago

ones that can run cli tools do great, they just use npm

[–] brian@programming.dev 0 points 6 days ago

because with things that the compiler does, like padding for alignment, it frequently takes up more space than that. that was my argument the whole time. what til are you talking about? I'm talking about an extra layer you've decided doesn't count. ofc sizeof bool will be a byte in all of those languages.

a bool taking up a single byte is a fantasy that those languages use because developers generally don't need to think about all the other stuff going on.

[–] brian@programming.dev 2 points 6 days ago

for some people it's nice to start from nothing and build up config, I'd recommend doom for anyone else. it's nice to be given a file with all the settings you can change instead of having to do it all yourself.

[–] brian@programming.dev 0 points 6 days ago* (last edited 6 days ago) (2 children)

a bool is actually a single bit, the rest is all padding

[–] brian@programming.dev 1 points 6 days ago (4 children)

c++ guarantees that calls to malloc are aligned https://en.cppreference.com/w/cpp/memory/c/malloc .

you can call malloc(1) ofc, but calling malloc_usable_size(malloc(1)) is giving me 24, so it at least allocated 24 bytes for my 1, plus any tracking overhead

yeah, as I said, in a stack frame. not surprised a compiler packed them into single bytes in the same frame (but I wouldn't be that surprised the other way either), but the system v abi guarantees at least 4 byte alignment of a stack frame on entering a fn, so if you stored a single bool it'll get 3+ extra bytes added on the next fn call.

computers align things. you normally don't have to think about it. Consider this a TIL moment.

[–] brian@programming.dev 1 points 1 week ago (6 children)

sure, but if you have a single bool in a stack frame it's probably going to be more than a byte. on the heap definitely more than a byte

[–] brian@programming.dev 1 points 1 week ago (1 children)

I mean, that sounds sorta like JWTs which are used commonly enough for this type of thing

[–] brian@programming.dev 2 points 1 week ago

why would you need to salt long random strings?

also if you salt them you have to have an id too so you can look up who's api key it is. otherwise you can just look up the key hash to get everything

[–] brian@programming.dev 1 points 1 week ago

why would you need to salt long random strings?

also if you salt them you have to have an id too so you can look up who's api key it is. otherwise you can just look up the key hash to get everything

[–] brian@programming.dev 1 points 1 week ago (8 children)

things that store it as word size for alignment purposes (most common afaik), things that pack multiple books into one byte (normally only things like bool sequences/structs), etc

[–] brian@programming.dev 1 points 2 weeks ago

devil's advocate: other sellers would still do it if they didn't, which would make ticketmaster's tickets look more expensive initially. a law makes everyone equal again so they can compete on price/etc directly

view more: next ›