Wuffs is great. I use it in Substrata ( https://substrata.info/ ) for loading PNGs. It is both faster and safer than LibPNG. It's something around 2x faster than LibPNG in my tests (depending on the PNG file), see timings here: https://github.com/google/wuffs/issues/13#issuecomment-17325... So generally Wuffs is great and you should use it to decode your PNGs. There are some downsides: not all of the obscure bit dept…
Wuffs: Wrangling Untrusted File Formats Safely
41–50 of 73 posts
Re: Wuffs: Wrangling Untrusted File Formats Safely
#42Earlier quoted context omitted.
I’m responding to this: > that can then be shipped like normal C, so you don't get the ecosystem friction like with ex. Rust. Emitting Rust doesn’t help with this.
it helps in the other direction: less friction to use from rust
Re: Wuffs: Wrangling Untrusted File Formats Safely
#43This is one of my favorite attempts at better programming language safety, because it compiles down to C that can then be shipped like normal C, so you don't get the ecosystem friction like with ex. Rust.
Re: Wuffs: Wrangling Untrusted File Formats Safely
#44Re: Wuffs: Wrangling Untrusted File Formats Safely
#45Earlier quoted context omitted.
Frankly, I wouldn't begrudge a website for not correctly parsing an svg I composed entirely with javascript. It's annoying you can't just "flatten" or "bake" such an svg like yours into one composed entirely of elements (unless one exists?)
Often you can open the SVG in a browser and then use the developer tools to copy out the resulting nodes as "flat" SVG source code. Chrome even includes a --dump-dom flag you can use to do this on the command line, although I haven't tested it with an SVG.
Re: Wuffs: Wrangling Untrusted File Formats Safely
#46Does anyone know of a tool that can do this for PDFs instead?
try to ever read any code for PDFs and see all the horrors.
Google gave up and just bought the code from foxit.
Re: Wuffs: Wrangling Untrusted File Formats Safely
#47Earlier quoted context omitted.
There are PDF readers that do not support the scripting format extensions. Note this does not prevent unscrupulous companies abusing dominant market positions to voluntarily embed machine and serial hash watermarks. To be clear: formats like pdf, ps, webp, svg, and tiff are so badly implemented in some ecosystems... they can't _ever_ be assumed safe input formats. Thus, at some point people need to spin up an actual…
WUFFS is provably safe - that's the whole schtick. If a WUFFS kernel exists, you can assume it is safe. If it's not proven safe, it doesn't compile. The reason everyone doesn't program in WUFFS is that you have to write a proof that your kernel is safe, which takes a very very very long time.
Re: Wuffs: Wrangling Untrusted File Formats Safely
#48Earlier quoted context omitted.
WUFFS is provably safe - that's the whole schtick. If a WUFFS kernel exists, you can assume it is safe. If it's not proven safe, it doesn't compile. The reason everyone doesn't program in WUFFS is that you have to write a proof that your kernel is safe, which takes a very very very long time.
What's the formal verification story for WUFFS?
Hardly a panacea for fundamentally bad designs that go back decades.
Ever seen a web-server written in postscript? Its worth a look just for the laughs.
Good luck out there =)
Re: Wuffs: Wrangling Untrusted File Formats Safely
#49Wuffs is great. I use it in Substrata ( https://substrata.info/ ) for loading PNGs. It is both faster and safer than LibPNG. It's something around 2x faster than LibPNG in my tests (depending on the PNG file), see timings here: https://github.com/google/wuffs/issues/13#issuecomment-17325... So generally Wuffs is great and you should use it to decode your PNGs. There are some downsides: not all of the obscure bit dept…
Re: Wuffs: Wrangling Untrusted File Formats Safely
#50This is one of my favorite attempts at better programming language safety, because it compiles down to C that can then be shipped like normal C, so you don't get the ecosystem friction like with ex. Rust.