News for hackers. Stuff that matters.
Re:Show HN: A compiler for a small language into x86-64 asse... by kragen on Thursday April 30, 2020 @01:32PM (#23033520)
Congratulations! It looks like a useful and practical design. How is the performance of the generated code? What are you thinking about doing for memory management? Have you thought about using an intermediate representation to make optimization and retargeting easier?
Re:Show HN: A compiler for a small language into x86-64 asse... by EllipticCurve on Thursday April 30, 2020 @05:04PM (#23036105)
Thanks :) That's where I was trying to get to. I did some smaller performance comparisons against C (with -O0), where I was at about 90% speed. But there is a lot of performance to gain, if I optimize the resulting assembly. There are lots of cases where I push and pop directly afterwards because of the general expression code generation (no real knowledge of broader context). So I expect that to help a lot regarding performance. Also things like jump tables for simple switches are on the table.

Yes, I thought about going for LLVM or another representation but decided to do it once myself (no given performance optimizations or the like) with room for improvement.