Since this is Part 1, we merged the comments from the Part 2 thread hither:<p><i>Get in loser. We're rewinding the stack</i> - <a href="https://news.ycombinator.com/item?id=43014070">https://news.ycombinator.com/item?id=43014070</a><p>Readers may want to look at both articles of course!
Oh I'm so interested in this.<p>I've wanted to use wazero to run my Exiftool [1] for quite a while. Just as I use wazero to sandbox dcraw [2].<p>But WASI Perl never materialized.<p>This may just be what I'm missing.<p>[1]: <a href="https://github.com/ncruces/go-exiftool">https://github.com/ncruces/go-exiftool</a><p>[2]: <a href="https://pkg.go.dev/github.com/ncruces/rethinkraw@v0.10.7/pkg/dcraw" rel="nofollow">https://pkg.go.dev/github.com/ncruces/rethinkraw@v0.10.7/pkg...</a>
Subhead is "Sandboxing Perl with WebAssembly - Part 2."<p>The subhead sounds weird, but part 1 makes more sense and is pretty interesting. Perl has many modules to deal with file formats nobody has used since Perl's prime. It isn't totally clear to me if the goal is to compile the Perl interpreter into WASM or interpreter + modules. In any either case the goal is to re-use the original tools within new tooling.<p><i>I’m building a new startup and file metadata plays an important role. There are thousands of file formats, each format may have dozens of versions, and each stores metadata differently.</i><p><i>Our use-case also needs metadata to be present when a file is uploaded - extracting the data on our servers means we add considerable overhead to upload post-processing & we lose data that is useful to customers.</i><p><i>So we need to extract metadata client-side and staple it to the upload. Herein begins a journey of self-inflicted pain and suffering.</i><p><i>ExifTool is written in Perl.</i><p><a href="https://andrews.substack.com/p/zeroperl-sandboxed-perl-with-webassembly" rel="nofollow">https://andrews.substack.com/p/zeroperl-sandboxed-perl-with-...</a>
Not sure if it is useful for your use-case, but at Wasmer we’ve been spending some time adding support for the eh proposal: <a href="https://github.com/wasmerio/wasmer/pull/5383">https://github.com/wasmerio/wasmer/pull/5383</a>
That's really impressive. Like the author I am aware of the advantages/drawbacks of emscripten and wasi-sdk. The author did well to look extensively into both of them. Here's the repo. <a href="https://github.com/uswriting/zeroperl">https://github.com/uswriting/zeroperl</a><p>As increasingly is the case, a good starting point is the CI workflow: <a href="https://github.com/uswriting/zeroperl/blob/main/.github/workflows/zeroperl.yml">https://github.com/uswriting/zeroperl/blob/main/.github/work...</a>
The ongoing ... lively ... discussion about "wasm all the things" may interest this audience, too: <a href="https://news.ycombinator.com/item?id=43020684">https://news.ycombinator.com/item?id=43020684</a>
"percc" just does not work?<p>He obviously he meant my perlcc, it is maintained for compatible perl versions and it works and is used in industry.
This guy is just crazy. <a href="https://github.com/libexif/libexif">https://github.com/libexif/libexif</a> exists and is much easier to use than compiling perl to wasm, just to run the overly slow exiftool.