this post was submitted on 26 Aug 2023
817 points (91.5% liked)

Programmer Humor

19512 readers
378 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] SpaceNoodle@lemmy.world 45 points 1 year ago (3 children)

No, it is wrong. Machine code is not source code.

[–] olorin99@artemis.camp 16 points 1 year ago

And even if you had the source code it may not necessarily qualify as open source.

[–] vox@sopuli.xyz 0 points 1 year ago* (last edited 1 year ago) (2 children)

well assembly is technically "source code" and can be 1:1 translated to and from binary, excluding "syntactic sugar" stuff like macros and labels added on top.

[–] Malfeasant@lemm.ee 3 points 1 year ago (1 children)

But those things you're excluding are the most important parts of the source code...

[–] 257m@lemmy.ml 3 points 1 year ago* (last edited 1 year ago)

By excluded he means macro assemblers which in my mind do qualify as an actual langauge as they have more complicated syntax than instruction arg1, arg2 ...

[–] 257m@lemmy.ml 3 points 1 year ago

The code is produced by the compiler but they are not the original source. To qualify as source code it needs to be in the original language it was written in and a one for one copy. Calling compiler produced assembly source code is wrong as it isn't what the author wrote and their could be many versions of it depending on architecture.

[–] over_clox@lemmy.world -5 points 1 year ago (4 children)

Never heard of a decompiler I see.

[–] seliaste@lemmy.blahaj.zone 22 points 1 year ago (2 children)

A decompiler doesnt give you access to the comments, variable names, which is an important part of every source code

[–] over_clox@lemmy.world 5 points 1 year ago

Meanwhile, AI is having a heyday with it...

https://arxiv.org/abs/1909.09029

[–] BaroqueInMind@kbin.social 1 points 1 year ago (1 children)

What's cool is that you can interpret the var names yourself and rename them whatever you want.

[–] seliaste@lemmy.blahaj.zone 7 points 1 year ago

But it is extremely time-consuming. Open source code makes it transparent and easy to read, that's what it is about: transparency

[–] newIdentity@sh.itjust.works 14 points 1 year ago (3 children)

A decompiler won't give you the source code. Just some code that might not even necessarily work when compiled back.

[–] amki@feddit.de -1 points 1 year ago

From the point of view of the decompiler machine code is indeed the source code though

[–] over_clox@lemmy.world -2 points 1 year ago

And? Decompilers aren't for noobs. So what if it gives you variable and function names like A000, A001, etc?

It can still lead a seasoned programmer where to go in the raw machine code to mod some things.

[–] tastysnacks@programming.dev 7 points 1 year ago (1 children)

Try converting from English to Japanese and back to English.

[–] over_clox@lemmy.world 1 points 1 year ago* (last edited 1 year ago) (1 children)
[–] amki@feddit.de 2 points 1 year ago* (last edited 1 year ago) (2 children)

A fancy way to say do nothing is not the same as translating back and forth. Example: Show me the intermediate translation.

Also we live in a 64bit world now old man

[–] over_clox@lemmy.world 0 points 1 year ago

Also that instruction does not do nothing, it resets the CPU register to zero without having to access RAM. Far from a NOP instruction.

[–] over_clox@lemmy.world 0 points 1 year ago (1 children)
[–] Karyoplasma@discuss.tchncs.de 1 points 1 year ago* (last edited 1 year ago)
GF2P8AFFINEINVQB xmm1, xmm2, 10
[–] SpaceNoodle@lemmy.world 3 points 1 year ago (1 children)

Still not the actual source code, bucko.

[–] over_clox@lemmy.world -1 points 1 year ago (1 children)

No, it's actually better when you can read the machine code.

Most folks don't care to recompile the whole thing when all they wanna do is bypass the activation and tracker shit.

[–] SpaceNoodle@lemmy.world 2 points 1 year ago (2 children)

Having access to the source code actually makes reading machine code easier, so you're also wrong on this entirely different thing you're going on about.

[–] over_clox@lemmy.world -1 points 1 year ago (1 children)

You've clearly never used a disassembler such as HIEW have you? You get the entire breakdown of the assembly code.

[–] SpaceNoodle@lemmy.world 1 points 1 year ago (1 children)

I disassemble binaries daily for work. It's still not the same as source code.

[–] over_clox@lemmy.world 0 points 1 year ago

I didn't say it was. I just said loosely what the OG meme said, if you know how to read assembly, you know how to read (and write) what some of the code does.

[–] over_clox@lemmy.world -1 points 1 year ago (1 children)

I never said disassembly or decompiling was easier in any way. I'll agree with you on that, it's way more difficult.

Back to the point of the meme though, if you can read assembly, you can read it all.

[–] SpaceNoodle@lemmy.world 2 points 1 year ago* (last edited 1 year ago) (1 children)

You've never actually compared source code to its compiled output, have you.

[–] over_clox@lemmy.world 0 points 1 year ago

I've written drivers in 65 bytes of code. I don't tend to use high level languages that hide what's going on behind the scenes.