this post was submitted on 26 Aug 2023
670 points (91.9% liked)

Programmer Humor

19103 readers
562 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
 
top 50 comments
sorted by: hot top controversial new old
[–] mexicancartel@lemmy.dbzer0.com 120 points 1 year ago (3 children)

Open source ≠ Source availiable

Example of non open source programs with source code https://en.m.wikipedia.org/wiki/List_of_proprietary_source-available_software

[–] lauha@lemmy.one 66 points 1 year ago (2 children)

Open source ≠ free software

[–] KairuByte@lemmy.dbzer0.com 25 points 1 year ago (3 children)

Open source inherently means you can compile the code locally, for free. You can’t necessarily redistribute it, depending on the license, but I’m not aware of a “you can compile this source for testing and code changes only but if you use it as your actual copy you are infringing” license.

I am very much open to correction here.

[–] ono@lemmy.ca 26 points 1 year ago* (last edited 1 year ago)

Open source inherently means you can compile the code locally,

Open Source means more than that. It is defined here:

https://opensource.org/osd/

If you use the phrase "open source" for things that don't meet those criteria, then without some clarifying context, you are misleading people.

for free.

Free Software is not the same as "software for free". It, too, has a specific meaning, defined here:

https://www.gnu.org/philosophy/free-sw.html

When the person to whom you replied wrote "free software", they were not using it in some casual sense to mean free-of-charge.

[–] too_high_for_this@sh.itjust.works 7 points 1 year ago (1 children)

Free as in free speech, not as in free beer

[–] whyNotSquirrel@sh.itjust.works 9 points 1 year ago (1 children)

Where are all those free beer I always hear about?!

[–] MostlyBlindGamer@rblind.com 9 points 1 year ago (2 children)

Have you tried installing homebrew?

load more comments (2 replies)
[–] QuazarOmega@lemy.lol 4 points 1 year ago

Most free software is also open source and vice versa, but not all, the difference usually lies in the licence, this stackexchange answer gets it pretty well

[–] grue@lemmy.ml 8 points 1 year ago* (last edited 1 year ago)

According to the Open Source Initiative (the folks who control whether things can be officially certified as "open source"), it basically is the same thing as Free Software. In fact, their definition was copied and pasted from the Debian Free Software guidelines.

load more comments (2 replies)
[–] cacheson@kbin.social 82 points 1 year ago

In this thread: Programmers disassembling the joke to try and figure out why it's funny.

[–] ono@lemmy.ca 61 points 1 year ago

Cute. It would be funnier if it was correct.

[–] Thorry84@feddit.nl 51 points 1 year ago (2 children)

For people interested in the difference between decompiled machine code and source code I would recommend looking at the Mario 64 Decomp project. They are attempting to turn a Mario 64 rom into source code and then back into that same rom. It's really hard and they've been working on it for a long time. It's come a long way but still isn't done.

https://github.com/n64decomp/sm64

load more comments (2 replies)
[–] SpaceNoodle@lemmy.world 36 points 1 year ago (28 children)

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

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

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

load more comments (27 replies)
[–] NounsAndWords@lemmy.world 20 points 1 year ago (3 children)

It just occurred to me that AI in the nearish future will probably/almost certainly be able to do this.

[–] Psythik@lemm.ee 34 points 1 year ago (1 children)

I can't wait for AI to make a PC port of every console game ever so that we can finally stop using emulators.

[–] amki@feddit.de 11 points 1 year ago (15 children)

This won't happen in our lifetime. Not only because this is more complex than rambling vaguely correlated human speech while hallucinating half the time.

[–] secret301@sh.itjust.works 4 points 1 year ago

I think it'll be in our lifetime just not anytime soon. I feel like AI is gonna boom like the internet did. Didn't happen overnight and not even in a year but over 35ish years

load more comments (13 replies)
[–] perviouslyiner@lemm.ee 7 points 1 year ago* (last edited 1 year ago) (2 children)

It was a staple of Asimov's books that while trying to predict decisions of the robot brain, nobody in that world ever understood how they fundamentally worked.

He said that while the first few generations were programmed by humans, everything since that was programmed by the previous generation of programs.

Obviously this leads us to Asimov's world in which nobody is even remotely capable of creating programs that violate the assumptions built into the first level of those models - are we at that point now with "AI"?

[–] amki@feddit.de 6 points 1 year ago (3 children)

No. Programs cannot reprogram themselves in a useful way and are very very far from it.

load more comments (3 replies)
load more comments (1 replies)
load more comments (1 replies)
[–] southernwolf@pawb.social 17 points 1 year ago

It's honestly remarkable how few people in the comments here seem to get the joke.

Never stop dissecting things, y'all.

[–] oldfart@lemm.ee 11 points 1 year ago

IDA Pro (a disassembler) is closed source but came with a license that allowed disassembly and binary modification. Unfortunately, that's no longer the case.

[–] nfsu2@feddit.cl 9 points 1 year ago

I feel old watching this meme template

[–] menzel@feddit.de 9 points 1 year ago (1 children)

What about server site executed code?

load more comments (1 replies)
[–] Kolanaki@yiffit.net 7 points 1 year ago* (last edited 1 year ago) (8 children)

I've wondered: Can you go deeper than assembly and code in straight binary, or does it even really matter because you'd be writing the assembly in binary anyway or what? In probably a less stupid way of putting it: Can you go deeper than assembly in terms of talking to the hardware and possibly just flip the transistors manually?

Even simpler: How do you one up someone who codes in assembly? Can you?

[–] CaptainBuckleroy@lemm.ee 10 points 1 year ago

Yes, you can code in machine code. I did it as part of my CS Degree. In our textbook was the manual for the particular ARM processor we coded for, that had every processor-specific command. We did that for a few of the early projects in the course, then moved onto Assembly, then C.

[–] ylph@lemmy.world 10 points 1 year ago* (last edited 1 year ago)

The first computer I used was a PDP-8 clone, which was a very primitive machine by today's standards - it only had 4k words of RAM (hand-made magnetic core memory !) - you could actually do simple programming tasks (such as short sequences of code to load software from paper tape) by entering machine code directly into memory by flipping mechanical switches on the front panel of the machine for individual bits (for data and memory addresses)

You could also write assembly code on paper, and then convert it into machine code by hand, and manually punch the resulting code sequence onto paper tape to then load into the machine (we had a manual paper punching device for this purpose)

Even with only 4k words of RAM, there were actually multiple assemblers and even compilers and interpreters available for the PDP-8 (FOCAL, FORTRAN, PASCAL, BASIC) - we only had a teletype interface (that printed output on paper), no monitor/terminal, so editing code on the machine itself was challenging, although there was a line editor which you could use, generally to enter programs you wrote on paper beforehand.

Writing assembly code is not actually the same as writing straight machine code - assemblers actually do provide a very useful layer of abstraction, such as function calls, symbolic addressing, variables, etc. - instead of having to always specify memory locations, you could use names to refer to jump points/loops, variables, functions, etc. - the assembler would then convert those into specific addresses as needed, so a small change of code or data structures wouldn't require huge manual process of recalculating all the memory locations as a result, it's all done automatically by the assembler.

So yeah, writing assembly code is still a lot easier than writing direct machine code - even when assembling by hand, you would generally start with assembly code, and just do the extra work that an assembler would do, but by hand.

[–] doggle@lemmy.dbzer0.com 10 points 1 year ago

Assembly effectively is coding in binary. Been a long time since I've looked at it, but you'd basically just be recreating the basic assembly commands anyway.

I guess you could try flipping individual transistors with a magnet or an electron gun or something if you really want to make things difficult.

If you actually want to one-up assembly coders, then you can try designing your own processor on breadboard and writing your own machine code. Not a lot of easy ways to get into that, but there's a couple of turbo dorks on YouTube. Or you could just try reading the RISC-V specification.

But even then, you're following in someone else's tracks. I've never seen someone try silicon micro-lithography in the home lab, so there's an idea. Or you could always try to beat the big corps to the punch on quantum computing.

[–] gerryflap@feddit.nl 5 points 1 year ago

You can code in binary, but the only thing you'd be doing is frustrating yourself. We did it in the first week of computer science at the university. Assembly is basically just a human readable form of those instructions. Instead of some opcode in binary you can at least write "add", which makes it easier to see what's going on. The binary machine code is not some totally other language than what is written in the assembly code, so writing in binary doesn't really provide any more control or benefit as far as I'm aware.

[–] jadero@programming.dev 4 points 1 year ago

All those assembly language instructions are just mnemonics for the actual opcodes. IIRC, on the 6502 processor family, JSR (Jump to SubRoutine) was hex 20, decimal 32. So going deeper would be really limited to not having access to the various amenities provided by assembler software and writing the memory directly. For example:

I started programming using a VIC-20. It came with BASIC, but you could have larger programs if you used assembly. I couldn't afford the assembler cartridge, so I POKED the decimal values of everything directly to memory. I ended up memorizing some of the more common opcodes. (I don't know why I was working in decimal instead of hex. Maybe the text representation was, on average, smaller because there was no need of a hex symbol. Whatever, it doesn't matter...)

VIC-BASIC had direct memory access via PEEK (retrieve value) and POKE (set value). It also had READ and DATA statements. READ retrieved values from the comma-delimited list of values following the DATA statement (usually just a big blob of values as the last line of your program).

I would write my program as a long comma-delimited list of decimal values in a DATA statement, READ and POKE those values in a loop, then execute the resulting program. For small programs, I just saved everything as that BASIC program. For larger programs, I wrote those decimal values to tape, then read them into memory. That let me do a kind of modular programming by loading common functions from tape instead of retyping them.

I was in the process of writing my own assembler so that I could use the mnemonics directly when I got my Apple //c. More memory and the availability of quite a few high level languages derailed me and I haven't touched assembly since.

[–] mrpants@midwest.social 4 points 1 year ago (4 children)

Re: Coding in binary. It makes no difference. Your assembly is binary, just represented in a more human readable form when writing it in assembly.

Re: Manual interaction. Sure there's plenty of old computers where you can flip switches to input instructions or manipulate registers (memory on the cpu). But this is not much different from using assembly instructions except you're doing it live.

You can also create purpose built processors which might be what you mean? Generally this isn't too useful but sometimes it is. FPGAs are an example of doing this type of thing but using software to do the programming of the processor.

load more comments (4 replies)
load more comments (2 replies)
[–] doom_and_gloom@lemmy.ml 4 points 1 year ago

OS - obfuscated source

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

If you wanna skip a few inconvenient instructions in X86 assembly, throw a few No Operation instructions in the right places.

NOP = 0x90

[–] cyborganism@lemmy.ca 3 points 1 year ago

You can have the code of any software with a decompiler. Especially with Java and C# for example.

load more comments
view more: next ›