logoalt Hacker News

kvemkon • yesterday at 6:07 PM • 3 replies • view on HN

Go compiler has an advanced escaping analyzer. Wouldn't it be easier and better to add this noalloc-analyzer feature to golang directly?


Replies

eatonphil • yesterday at 6:56 PM

I agree this isn't the absolute ideal form. I'd rather it be built in as a language directive or something. noalloc does parse compiler escapes emitted by the Go compiler with `-gcflags=-m -S`. One problem is that these are not really a standard format. But I hope that with testing across versions (over time anyway, I only run this on Go 1.27) it'll be stable enough.

➕ show 1 reply
raggi • yesterday at 6:54 PM

Historically that was rejected.

Tides have shifted somewhat, but I suspect this may still be rejected.

Unfortunately a lot of people’s experience with such proposals was also historically getting gaslit by a brigade, so a lot of folks moved on and won’t bother trying again.

➕ show 1 reply
Gibbon1 • yesterday at 8:58 PM

Maybe having a way to enforce that on the compiler. So you can force the compiler to tell you it couldn't eliminate heap allocations.

➕ show 1 reply