r/AskComputerScience • • Feb 22 '20

Can one code in binary?

Can you code using ONLY 0 and 1's. I'm not talking about dificulty or efficiency, but rather the possibility, like making a "Hello World" program in binary.

39 Upvotes

58 comments sorted by

View all comments

47

u/MikeBenza Feb 22 '20

Yes, it's absolutely possible. But it'd be super difficult and would take an insanely long time with a lot of research.

There's nothing magical that a compiler does that you can't do. It's just smarter and faster than you.

8

u/[deleted] Feb 22 '20

I see. Thanks.

I was discuting with a friend how crazy it would be a "super programmer" that codes directly in binary, without a compiler. Of course it's a joke, but it's cool to think about

6

u/brennahan Feb 22 '20

The closest to that would probably writing in assembly, which is very doable though it still takes awhile to get much of anything worthwhile done.

1

u/[deleted] Feb 22 '20

Yeah, True. But It would be crazy creating a basic program only in binary, haha.

Assembly looks fun, tbh. As a python programmer in my first semester, I never got to see "behind the scenes" of the work I was doing. I guess I'll try to learn C when I have time, and go down from there

And yes, I know assembly is a lot of times harder than python, I'm aware of it, haha.

1

u/roman_fyseek Feb 23 '20

Consider the original question of programming in 1s and 0s. That is *exactly* what the decode in your CPU is doing. And, that stuff is all programmed at the physical layer where things can *only* ever be on or off.

So, can you code in binary? Yes. That's what all your hardware is doing at the transistor level. And, it's all transistors all the way down.