> YJIT is a relatively simple JIT compiler that totals about 11,000 lines of C code.
> YJIT is a relatively simple JIT compiler that totals about 11,000 lines of C code.
You can make it verbose by adding a ton of patterns that you don't need, like the gobject code in gnome. But you don't need to.
Sounds to me like you already decided what your conclusion was and are just looking for data to back it up without actually analyzing it.
Example: In C you're obliged to write a lot of counter loops, because the language does not have iterators, the idiomatic Rust is both smaller and easier to read because the counters weren't really for anything, they're just implementation details:
for (k=0; k< size(geese); ++k) // We need this k counter in C to index geese
for goose in geese // In Rust we can just have the geese themselves
But if you do a non idiomatic port, you carry across that loop as it was written, plus you gain the extra conversion noise. So this is a much less useful metric.The C line is more complex and less abstract, but that doesn't affect the lines-of-code metric that was being used in the discussion.
I did also think about switch versus match, but in that case you're more or less obliged to do the extra lifting when translating to Rust and so I expect the breaks (which are extraneous in match) would be elided rather than translated.