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

Compiling to WASM from a Bash script? #230

Open
philiprhoades opened this issue Mar 13, 2021 · 4 comments
Open

Compiling to WASM from a Bash script? #230

philiprhoades opened this issue Mar 13, 2021 · 4 comments

Comments

@philiprhoades
Copy link

People,

I am interested in learning about WAT and WASM and eventually Rust but Ruby is more immediately familiar however it is not quite useful enough for compiling to WASM yet.

Has anyone thought about developing a compiler that could convert Bash scripts into WASM?

Thanks,
Phil.

@sbc100
Copy link
Member

sbc100 commented Mar 14, 2021

WebAssembly itself does not define any of the core primitives that are fundamental to shell scripting (e.g. fork / exec / pipe / IO streams) so it seem like a particularly bad fit for compilation to wasm.

Also, as far as I know nobody as every tried compiling bash scripts to anything, they are always interpreted by bash itself.

@philiprhoades
Copy link
Author

so it seem like a particularly bad fit for compilation to wasm.

OK, thanks for that - so what do you think would be the best minimal compiler system to get started with?

@sbc100
Copy link
Member

sbc100 commented Mar 15, 2021

so it seem like a particularly bad fit for compilation to wasm.

OK, thanks for that - so what do you think would be the best minimal compiler system to get started with?

Are you looking to work on a compiler that targets wasm? Or are you looking to experiment to and existing language that already targets wasm? If its the later then any llvm-based compiler such and clang or rustc is a good place to start. llvm's existing support for compiling to wasm is pretty mature at this point.

@philiprhoades
Copy link
Author

Are you looking to work on a compiler that targets wasm?

Yes.

Or are you looking to experiment to and existing language that already targets wasm?

That is also of interest . .

If its the later then any llvm-based compiler such and clang or rustc is a good place to start. llvm's existing support for compiling to wasm is pretty mature at this point.

LIke I said in the OP, I am interested in learning about WAT - ideally, if I had the time, I would learn to code directly in WASM - well at least for some trivial stuff anyway - just as an exercise . .

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

2 participants