3 ms·
Wuffs (Programming Language) – Wrangling Untrusted File Formats Safely
- ExcavateGrandMa 6y agoYou gonna post everyday? put some clicking bots maybe for audience?
- peter_d_sherman 6y ago>"Wuffs (Wrangling Untrusted File Formats Safely) is formerly known as Puffs (Parsing Untrusted File Formats Safely). Wuffs is a memory-safe programming language (and a standard library written in that language) for wrangling untrusted file formats safely. Wrangling includes parsing, decoding and encoding. Example file formats include images, audio, video, fonts and compressed archives. It is also fast. On many of its GIF decoding benchmarks, Wuffs measures 2x faster than "giflib" (C), 3x faster than "image/gif" (Go) and 7x faster than "gif" (Rust). Goals and Non-Goals Wuffs' goal is to produce software libraries that are as safe as Go or Rust, roughly speaking, but as fast as C, and that can be used anywhere C libraries are used. This includes very large C/C++ projects, such as popular web browsers and operating systems (using that term to include desktop and mobile user interfaces, not just the kernel). Wuffs the Library is available as transpiled C code. Other C/C++ projects can use that library without requiring the Wuffs the Language toolchain. Those projects can use Wuffs the Library like using any other third party C library. It's just not hand-written C. However, unlike hand-written C, Wuffs the Language is safe with respect to buffer overflows, integer arithmetic overflows and null pointer dereferences. A key difference between Wuffs and other memory-safe languages is that all such checks are done at compile time, not at run time. If it compiles, it is safe, with respect to those three bug classes. The trade-off in aiming for both safety and speed is that Wuffs programs take longer for a programmer to write, as they have to explicitly annotate their programs with proofs of safety. A statement like x += 1 unsurprisingly means to increment the variable x by 1. However, in Wuffs, such a statement is a compile time error unless the compiler can also prove that x is not the maximal value of x's type (e.g. x is not 255 if x is a base.u8), as the increment would otherwise overflow. Similarly, an integer arithmetic expression like x / y is a compile time error unless the compiler can also prove that y is not zero. Wuffs is not a general purpose programming language. It is for writing libraries, not programs. The idea isn't to write your whole program in Wuffs, only the parts that are both performance-conscious and security-conscious. For example, while technically possible, it is unlikely that a Wuffs compiler would be worth writing entirely in Wuffs." PDS: Would like to see a future AV1 / AOM / libaom / FFmpeg -- written/compiled in Wuffs...
- detaro 6y agothis was on the front page yesterday, please check for duplicates before submitting: https://news.ycombinator.com/item?id=26731305 https://news.ycombinator.com/item?id=26731305
- peter_d_sherman 6y agoSorry, didn't see that...
- peter_d_sherman 6y agoHmm, cannot seem to be able to delete this post for some reason -- please delete if you can...
- detaro 6y agoyeah, once somone has commented you can't delete anymore. maybe a mod will see it and manually mark it as duplicate later, otherwise it doesn't really matter