4 ms·
>> So, nothing changes compared to using existing high level language compilers, then? On the contrary, it acts as an additional layer of complexity. Looking
by thesuperbigfrog 5y ago
>> So, nothing changes compared to using existing high level language compilers, then?
On the contrary, it acts as an additional layer of complexity.
Looking at the example generated code snippet from the article:
void listcopy(void \*r) {
void *x2 = *r;
if (x2 == NULL) {
return;
} else {
int vx22 = *(int *)x2;
void *nxtx22 = *((void \*)x2+1);
*r = nxtx22;
listcopy(r);
void *y12 = *(void \*)r;
void *y2 = (void *) malloc(2 * sizeof(void *));
*r = y2;
*((int *)y2) = vx22;
*((void \*)y2+1) = y12;
return;
}
}
If you don't have the specification for listcopy or the code generation tools, but only the code shown and you need to make changes then you have a more difficult situation than normal, human-written code.
- jhgb 5y agoSo, as I said, nothing changes compared to using existing high level language compilers. You wouldn't normally hand-edit .S files from your C compiler either, why would you do it with this intermediate form?
- thesuperbigfrog 5y agoSometimes you don't get to choose the situation: the intermediate form / generated source code might be all that is available. See https://news.ycombinator.com/item?id=27750554 https://news.ycombinator.com/item?id=27750554
- jhgb 5y agoTrue, but this situation has always existed with any higher level languages. Ultimately someone will have to write patches for binaries, even.
- thesuperbigfrog 5y ago>> Ultimately someone will have to write patches for binaries, even. Yes, but it is not as easy to patch binaries compared to patching the source code.