Hacker News new | ask | show | jobs
by lerp-io 38 days ago
thats crazy but if u wanted to write js and it be fast and small size wouldnt it be better to write some compiler that compiles it into llvm?
1 comments

llvm is big/slow to compile and doesnt really fit js dynamic execution well in most cases
u mean dynamic execution like when developing as in to reflect ur changes, or running on production hardware? for example if im in dev i def wanna be able ti tweak code in real time and have it instantly reflect changes for fast feedback loop but when in prod i want it packed tight and performant w/ all the flags on etc etc, so ideally i wanna be able to develop in dynamic but deploy to static. for exmaple in game im building rn, i have ts modules that swap in with optimized zig. there are strict api rules such that i can always tweak logic and optimize in ts and have the ai auto translate into native and there is a test that checks output memory to make sure its equivalent w/ bench test tool so it can just run in a loop until its done optimizing...this is beat pattern for me rn to treat ai as like some sort of second order compiler.