4 ms·
If you would like to run csv-to-usv from 15+ languages (not only rust!) then check out this demo I made, converting the library to an Extism plugin function: ht
by nilslice 3y ago
If you would like to run csv-to-usv from 15+ languages (not only rust!) then check out this demo I made, converting the library to an Extism plugin function: https://github.com/extism/extism-csv-to-usv https://github.com/extism/extism-csv-to-usv
Here's a snippet that runs it in your browser:
// Simple example to run this in your browser! But will work in Go, PHP, Ruby, Java, Python, etc...
const extism = await import("https://esm.sh/@extism/extism");
const plugin = await extism.createPlugin("https://cdn.modsurfer.dylibso.com/api/v1/module/a28e7322a6fde92cc27344584b5e86c211dbd5a345fe6ec95f1389733c325541.wasm",
{ useWasi: false }
);
let out = await plugin.call("csv_to_usv", "a,b,c");
console.log(out.text());
- greenshackle2 3y agoI'm sorry but.. why? The library is a single function consisting of 10 lines of Rust code. And would be about 10 LOCs to re-implement in any language that has native csv libs. It seems a little bit unnecessary to load a WASM runtime for that.
- theamk 3y agoBut without WASM, how are you are going to get 500ms+ startup time and an 3rd party server dependency in your critical path?
- philipwhiuk 3y agoAnd two domains you're blindly trusting not to be hijacked.
- nilslice 3y agoSorry do you know what “demo” means?
- nilslice 3y agofor sure — do it!
- greenshackle2 3y agoI'm good I'm just here to chat, not to promote anything ;)
- nilslice 3y agoI can certainly appreciate that! Would encourage you to try sometime. Creating and sharing more than your opinion is a lot of fun.
- philipwhiuk 3y ago> esm.sh > cdn.modsurfer.dylibso.com Do people routinely do this - just run random code from arbitrary endpoints. Yikes