|
|
|
|
|
by tialaramex
61 days ago
|
|
> Anytime you already have the C or C++ code but not the WUFFS. But we literally do already have WebP for WUFFS. > Like what? Take a recent (September) double-free in the C codec, it's easy to write that in C. We have a Thing, we sometimes make an alias to the Thing, and then later we free both the alias and the original Thing. In Rust when you try to write this the compiler is unhappy. We can either have the same realisation which led to that being fixed (we do not need this alias, it should not be created) -- which I'd say is likely for a competent Rust programmer or we can clone the Thing, and then free both the clone and original, which is not a bug unlike the C library but is a waste of performance. |
|
This comes down to how strong your claim is, and what point you're trying to make.
If you're saying that compiling codecs in Fil-C is not a good use of Fil-C in general, then that's wrong, because not all codecs have a WUFFS version.
If you're saying that compiling WebP with Fil-C is not a good use of Fil-C because there's a WUFFS version, then that's also wrong, because I can't use the WUFFS version in a fully memory-safe web browser, since WUFFS doesn't support Fil-ABI and nobody has written a browser where the whole transitive closure of everything that the browser uses is WUFFS or some other safe language.
On the other hand, that is possible with Fil-C. (I'm posting this comment using a memory safe browser built with Fil-C, which has WebP built with Fil-C as well as everything else down to the libc/libc++ layer built with Fil-C.)
> double-free
Double-frees are deterministic panics in Fil-C. So yeah, Fil-C catches that, and any other memroy safety violation that could be used to achieve weird execution