What is machine-generated code?
What is machine-generated code?
Code generated by a computer instead of a human, of course. What else would it be?
Also, this question has very little to do with C++ and would be better suited in the Tech or General Discussion forum. I'm moving this thread there, but please create new threads in the appropriate forum.
Yeah I ges your right
Once we approach and reach the technological singularity computers no longer require human intelligence to write and compile their programs, they can do it themselves, thus machine generated code. If humanity will survive (seen as a species to protect) or perish (seen as a threat) is too soon to tell...
Fortuantly we'll all be dead so we don't have to worry about that :)
I'm all for it. I'd rather have a machine tell me what to do, than a human. Al of a sudden I see two advantages:
- Machines have logic circuits. I mean... when was the last time you saw that on a human leader? Precisely.
- There's this things about machines that when they tell you something is THIS way, it is THIS way and there's no manner of complaining that will make it THAT way. They just know what they want.
Machine generated code should free up time to do more "human" things such as fishing, music, and so forth. I'll look forward to it if the ecosystem has survived that long. I'm not sure if I'll ve around to see it or not. I wouldn't mind it, particularly since I'm so slow and methodical: most people probably did a lot with their lives by my age, but not me. I need the longevity.
My hello.exe is machine-generated code. ;)
Machine generated code, can refer to when a compiler takes high level code C and you run it through the compiler to generate assembley. So that the machine can understand this code , hence machine code
That's what I was referring to. :)
[Though, by the way, you don't have it quite right: a C compiler generates assembly, all right, but the computer can't run that directly. The assembly code has to be converted to machine code by an assembler, but this is a very simple process since there is almost a 1:1 correlation between assembler and machine code. Machine code itself is what the computer can actually execute.]
 A more credible example is something like bison, a parser generator: given a grammar definition, bison (or its older cousin, yacc) generates a C program to parse input based on the rules outlined in the grammar. [/edit]
Some seperation needs to be made here between machine generated code, and machine generated applications. I have written short programs whose only purpose was to generate a large tedious sequence of code. The reasons for needing the expanded code rather than using a loop are usually particular to the problem, but the technique comes in handy occasionaly, although not that often. In 30 years of programming I've only needed to use it about 3 times.
This is not exactly rare. The mysql++ library used a perl script to generate code. Tedious repetitive macros with an increasing number of arguments.
However, machine-generated code most often refers to code that is generated from a very different-looking representation. Lex and yacc are examples, but not particularly good ones. UML-to-code translators and GUI editors are more interesting.
Machine generated code happens also every time you use a compiler.
EDIT: Not meaning to ignore your last statement CornedBee. Just addressing the term from yet another angle.
As I said. It's another angle. If you want to get into that kind of detail then the real answer to the initial question is "It doesn't exist. Why you ask?"