5 ms·
About the proper quine the author says > While both these programs take care not to read the same memory region that is being executed by the CPU, the data byt
by nickcw 3y ago
About the proper quine the author says
> While both these programs take care not to read the same memory region that is being executed by the CPU, the data bytes they read look exactly like the executable bytes. This is what I meant when I mentioned earlier that the lines between code and data are blurred in an exercise like this. This is why I don't really see a point in keeping the executable bytes separate from the data bytes while writing machine code quines.
Which I though was an interesting philosophical point. There is no difference at all between the embedded data and the code. They are the same bytes in the same memory. What is the point of duplicating the code? Why not just read the first copy as the first quine does.
- tromp 3y ago> They are the same bytes in the same memory The difference is whether you rely on some form of introspection to get read access to all of the executing code, or whether you use embedded data like regular string literals.
- repeatrepeater 3y agoI think the point is that you are reiterating the same distinction without a difference.
- 48864w6ui 3y agoYou all may collapse the difference, but I agree with John that it is meaningful.
- repeatrepeater 3y agoIt’s definitely meaningful in that we can talk about it! But what if I put the code in the data section, but left the data section executable and jumped there? The very idea of a data section in some sense presupposes a higher level understanding of the program. In any event quines are only interesting because of the rules we place around them so I agree in general with arguing the rules!
- bmacho 3y ago> It’s definitely meaningful in that we can talk about it! No, it's much more meaningful. Different languages or computation models allow different levels of introspection. In some models quines are trivial: just ask for your source code and print it out. In some models it's non trivial that quines exist at all (but it turns out they exist).
- tromp 3y ago> But what if I put the code in the data section, but left the data section executable and jumped there? Data sections are usually not executable. Even if it were, that still leaves some code (the jump) outside of the data section.