Hacker News new | past | comments | ask | show | jobs | submit login
Compiling a Lisp to x86-64: Heap allocation (bernsteinbear.com)
20 points by tekknolagi on Oct 11, 2020 | hide | past | favorite | 3 comments



> The C compiler could hypothetically re-order struct elements, I think.

No, that's one of the things a C compiler can not do, and thank the standard committee. Writing wire data formats in headers is frustrating enough because of implementation-defined padding/alignment already (Pascal had standard PACKED for almost 50 years already, and yet in C __packed and __attribute__((packed)) are still non-standard), imagine how horrible it would be with reordering allowed!


Ah, okay. Thanks! I'll update and thank you in the post. But packing would still be tricky to deal with.


I updated the post. Thanks!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: