Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsjail Versus wasm #3670

Open
gedw99 opened this issue Jan 13, 2023 · 3 comments
Open

nsjail Versus wasm #3670

gedw99 opened this issue Jan 13, 2023 · 3 comments

Comments

@gedw99
Copy link

gedw99 commented Jan 13, 2023

Wazero is a no cgo wasm runner and could replace nsjail

@nono
Copy link
Member

nono commented Jan 13, 2023

Hi @gedw99, I'd like to know more about that. We are using nsjail for running imagemagick and nodejs scripts.

For imagemagick, there is a wasm port (https://github.com/dlemstra/magick-wasm), but it didn't support reading PDF (dlemstra/magick-wasm#51), which is mandatory for us. Same for SVG: dlemstra/magick-wasm#19. Do you have another way to suggest?

For nodejs scripts, do you have any resource or link on how to compile JS to wasm?

@codefromthecrypt
Copy link

apologies for random thoughts but https://github.com/ncruces/dcraw https://github.com/jerbob92/go-pdfium-wasm might be cookie crumbs to find folks in similar situations about images and pdf support for their tools. in most cases there are ports to do. I don't have insight into compiling JS to wasm, but someone else may

@gedw99
Copy link
Author

gedw99 commented Sep 11, 2023

Will chime here …

sometimes it’s useful to step back and see the best path forward ..

Image transforms can be done in pure go compiled to wasm. Sure you might loose some speed but it’s really clean. There are plenty of golang packages that pretty much do what image magic does.

pdf. As @codefromthecrypt suggested. It works great.
There is also pdfcpu which is pure golang .

Wazero is so simple to use and there are sone great golang systems built on top to make it very easy .

capsule is one on GitHub ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants