How fast can you read binary?
Posted by orhunp@reddit | linux | View on Reddit | 57 comments
binbreak - A terminal based binary number guessing game.
Built with Ratatui
Posted by orhunp@reddit | linux | View on Reddit | 57 comments
binbreak - A terminal based binary number guessing game.
Built with Ratatui
TheOneTrueTrench@reddit
I think this is a fun start, but there's an even better game hiding in there, and I want to point out why:
People do all kinds of math in decimal, all day every day, without ever trying to figure out what 5179 is in hex, right? Like my mom does accounting and stuff, and even though she understands how hex works, she never converts anything into hex to do her work.
Similarly, when I'm dealing with hex, I generally never bother figuring out what the decimal representation of anything is, because I'm not working in decimal. What's 0x41 + 0x8A? It's 0xCB. I have no idea off the top of my head what any of them are in decimal, because their decimal representations are meaningless, you know?
Same thing goes for binary, except that it's dead simple to convert between binary and hex. So, a more useful (and easier to learn and get used to) game would be converting between binary and hex, and actually doing simple math, like subtraction, addition, multiplication, etc.
The ability to know that 0xCB is... whatever it is... in decimal? Fun, but ultimately not very useful.
The ability to know that 0xCB is 0b1100_1011? Immensely useful. Subtracting 0b1000_1010 from 0xCB and getting 0b0100_0001/0x41? Incredibly valuable.
Basically, this goes from "fun" to "fun and students should be playing this game all the time when learning programming" by just getting rid of base 10 entirely.
gliese89@reddit
You make a great point. I just want to say that knowing the decimal representation does have the benefit of letting you speak about the numbers in English easily.
TheOneTrueTrench@reddit
You can say it in English that way, but if it's already in hex, it often needs to be (or works just as well) in hex as it would in dec, and 0xDEADBEEF, even if you weren't going to call it "Dead beef", is "Ox Dee Eee Aay Dee Bee Eee Eee Eff", compared to "three trillion, seven hundred and thirty five million, nine hundred and twenty eight thousand, five hundred and fifty nine".
Hex in English is shorter in only having an average of 0.265625 syllables per bit, plus one syllable for saying "Ox", compared to 0.875 syllables per bit when expressed in English as above. And when it comes to much shorter values, like single bytes, decimal requires "one hundred and twenty two", seven syllables for 8 bits, compared to "Ox seven Aay" which is only 3 syllables for 8 bits.
People are used to saying values in decimal, but I think most of that is just being used to it, it can actually be easier to just stay in and work in hex entirely when possible, it's actually easier to just not care what the decimal representation is.
Now, I'm not saying when you're writing code you should use hex values that are naturally values that make sense to humans, like
int maxNumberOfAttendees = 10;, yeah, that should just be in decimal, it makes sense. But if you're working in color, the idea of converting#AE892Bto11,438,379is not only unhelpful, it's actively harmful to understanding data. For instance, if you're familiar with color, you can tell that#AE892Bis a light brownish color, and#AF002Bis a dark-ish red, close to something called "Heritage Red"But
11,438,379and11,468,843look very close to each other, because when expressed in decimal, the decimal representation hides everything after the first few bits.But for an extreme example, 65535 and 65536 are just 1 away from each other, and even for someone who works with hex all the time, I might even miss (at a glance) what kind of difference that is. But in hex, it's
#00ffffcompared to#010000. It's basically bright aqua vs almost perfectly black.gliese89@reddit
My only point is that being able to use decimal does have a purpose. You can write another wall of text, but decimal will still have a use.
TheOneTrueTrench@reddit
A passive-aggressive remark. Cute.
Did you actually have an opinion, or just pointless childish remarks?
martijnonreddit@reddit
9 times F is fleventy-five!
Nyxiereal@reddit
Good idea! That would be really useful since I'm learning bin/hex/dec stuff for school
Brospeh-Stalin@reddit
What terminal?
orhunp@reddit (OP)
Rio with shaders on
Brospeh-Stalin@reddit
which shader and how do you get it to run continuously, not just when you type something?
orhunp@reddit (OP)
Just used this config: https://rioterm.com/docs/features/retroarch-shaders
Zbojnicki@reddit
I don't even see binary. I see brunettes, blondes ...
sdwvit@reddit
A woman in a red dress
allalongthewest@reddit
This should be higher up
Impressive_Change593@reddit
No
NeKon69@reddit
Pls create precompiled version with GLIBC <= 2.33. for some reason yours requires 2.34 and 2.37, sucks
Traditional_Hat3506@reddit
2.33 was released in 2021...
ignacekarnemelk@reddit
What matters is when 2.37 was released.
Until ~3 months ago, Debian stable had 2.36. There's probably a ton of places that haven't updated to the new stable yet.
NeKon69@reddit
Well Linux in my classes uses outdated Linux with GLIBC 2.33 unfortunately
canadajones68@reddit
Then build it yourself! The instructions are right there on the Github page
NeKon69@reddit
I also thought so, turns out my rust compiler (or whatever you set veriosn to 2023 Is) doesn't support it! So I thought I'll lower it to 2021, surely nothing bad happens, then on installing last few packages it just said that my version of rustc is too old to be compatible with 2 packages. Freaking great
ang-p@reddit
Oh, lord...
adenosine-5@reddit
I just love Linux compatibility issues :-D
ZunoJ@reddit
Why don't you just build it yourself then lol
Uristqwerty@reddit
Unfortunately, the one area where Windows still has an indisputable edge: ABI stability of its core userspace libraries. Hopefully that can change over time, though.
imtoowhiteandnerdy@reddit
I can read it super, super fast... now understanding what I've read, that's another matter completely.
A--E@reddit
is this skill required? for real
ResponsibleSock7131@reddit
In some stuff like embedded programming yes.
Valendel@reddit
Can you elaborate? I can read binary (not that fast though), I understand it quite well, but I never had much to do with embedded programming and I'm curious
ResponsibleSock7131@reddit
Mostly for reading register values.
For example this morning i had check if a clock-source was enabled. Reading the register gave informative hex value 0x3. Convert that to decimal and onward to binary gives 0x3 -> 3 -> 0b0011. Then look for the register description from the datasheet, which tells us the first bit from right is 1 if the clock is enable and 0 if disabled, so all was well.
In reality with the help of hex-notation you only ever need to handle conversion in the decimal range 0-15. I don't actually care what 0xA42F is in decimal, I care that 0xA => 10 => 0b1010, 0x4 => 4 => 0b0101 etc. and you can read the contents in binary piece by piece.
lennox671@reddit
Not OP, but my job is firmware engineer, so I think I can elaborate :)
I use binary only when doing driver stuff, either when going through a datasheet and looking at what to configure in registers (or reading the values with a debugger).
I also used to use it a lot when debugging serial drivers with an oscilloscope, but these days the scopes do that for you.
That said binary is used way less than hex to decimal conversions.
monocasa@reddit
There almost everything is in hex which is way easier to convert.
TheOneTrueTrench@reddit
Understanding binary? Oh yes, it's required and very useful. Being able to do math in binary and hex is absolutely mandatory for a programmer.
Being able to know what 0x4A9 is in decimal? Not really useful, except (I assume) some very niche cases.
Programmers (generally) don't care that the decimal representation of 0x4A9 is 1193, anymore than an accountant cares that the hex representation of 1193 is 0x4A9.
For example, we are pretty likely to know and care that 0x0A, 0x0D, and 0x20 are line feed, carriage return, and space, but we don't usually know or care that those values are 10, 14, and 32 in decimal. It just makes far more sense to think and work in hex than try to convert into decimal.
bobj33@reddit
I'm a chip designer so I deal with digital logic like AND / OR gates all the time. Dealing with binary just becomes second nature after a while.
ZunoJ@reddit
If nobody could do it, that would be a problem. I hope we can agree on that. So extrapolating from that position the answer to your question is pretty obviously: yes. If you want to know how to do super simple basic math is up to you. If you are a programmer there are things where you will have to understand this
A--E@reddit
I'm sorry. I was thinking about HEX for some reason when asking, not binary
ZunoJ@reddit
Absolutely! I can't think of a lot real world uses where you need to map hex to something else on they fly. With the exception of my initial take. I can for example still see JNE in the hex code of a program. JNE was one of the main targets of oldschool game cracking which was my entry to programming as a kid
ZunoJ@reddit
It would be cool to map it to hex and then to asm. So you could train to spot specific code segments in a hex editor
darthjoey91@reddit
I just know how to recognize deadbeef.
anugosh@reddit
" Look at me, I'm the compilator now !"
BatemansChainsaw@reddit
I don't even see the code. All I see is blonde, brunette, redhead.
Sodaplayer@reddit
There was a mobile game, Flippy Bit, I saw a while back that had you convert hex to binary. That helped my recognition speed a bit
somniasum@reddit
So cool. But actually howwww?
Valuable-Cod-314@reddit
How about having some logic math like AND, OR, XOR, NAND, NOR, NOT, SHL, SHR, 2s Complement, ect?
Leptokk@reddit
i can`t. wtf
PcChip@reddit
I get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /home/mdawson/Downloads/binbreak-linux)
I'm on ubuntu 22.04 and also somehow running the latest kernel (6.17.7), so my system may just be weird
firey_88@reddit
Recognizing ASCII characters in hex editors becomes second nature after enough reverse engineering work. I used to spot common opcodes quickly during firmware analysis.
_s_maturin_@reddit
Fleventy five.
LesStrater@reddit
Should have been published back in 1980, when people actually knew what "binary" was...
delwar1971@reddit
wow
Bachihani@reddit
They really missed out on calling it rustatui
Vast-Percentage-771@reddit
Rust naming conventions generally don't want you to include 'rust' in the names of crates, it's already obviously in rust so why specify
nicman24@reddit
Bro understood the weakness of his flesh
FedMellow@reddit
woag
Zeikos@reddit
I have stared at hex editors enough that I can recognize ascii characters.
When I was deep in a project I used to be able to read it, but it's a skill I have lost since then.
xmBQWugdxjaA@reddit
This would be way more useful for hexadecimal for when you need to read xxd output for ROMs etc. - gotta spot those opcodes fast.
OkBrilliant8092@reddit
0000001