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

wasm web/wasi target #142

Closed
giann opened this issue Jul 11, 2023 · 5 comments · Fixed by #267 or #285
Closed

wasm web/wasi target #142

giann opened this issue Jul 11, 2023 · 5 comments · Fixed by #267 or #285
Labels
compiler Issue related to the compiler
Milestone

Comments

@giann
Copy link
Collaborator

giann commented Jul 11, 2023

Probable issues:

  • Disable mimalloc
  • Expose JS regex in place of libpcre
  • Disable JIT and FFI
  • VM tail call not supported: the VM does not uses a big switch to dispatch opcode but tailcalls, this does not seem to be supported by llvm_stage2 for the wasm64-wasi target
  • We can keep 64bit NaN boxing but it might have a performance impact
  • We can't use dynamic library loading but we don't really need it: statically link std libs and import does only buzz definition importing
  • Disable os specific std libs: fs, io, os, ffi

Resources:

@giann giann added the compiler Issue related to the compiler label Jul 11, 2023
@giann giann mentioned this issue Jul 25, 2023
Closed
@giann giann changed the title wasm-wasi target wasm web/wasi target Jul 28, 2023
@giann giann added this to the 0.4.0 milestone Aug 3, 2023
@judah-caruso
Copy link

Are there any plans for compiling buzz to wasm directly? Assuming this ticket is to just allow the buzz interpreter to run within wasm?

@giann
Copy link
Collaborator Author

giann commented Sep 25, 2023

Not sure what you mean? buzz can only run within wasm if built for wasm.

@judah-caruso
Copy link

judah-caruso commented Sep 25, 2023

Ah sorry, I meant creating something like a new RunFlavor that compiles buzz to wasm (similar to assemblyscript).

For example:

// main.buzz
import "std";

fun main([str] _) > void {
	print("hello, world");
}
$ buzz -target=wasi_wasm32 -out=main.wasm main.buzz
$ wasmer main.wasm # hello world

This is most likely out of scope for the project, but I was just curious if this is a plan for the future.

@giann
Copy link
Collaborator Author

giann commented Sep 25, 2023

Yes this is out of scope. That would require buzz to become an AOT compiled language.

@giann giann closed this as completed Sep 25, 2023
@giann giann reopened this Sep 25, 2023
@giann giann modified the milestones: 0.4.0, 0.5.0 Oct 14, 2023
@giann giann mentioned this issue Feb 23, 2024
@giann
Copy link
Collaborator Author

giann commented May 16, 2024

Reopening because of https://ziglang.org/download/0.12.0/release-notes.html#Bring-Your-Own-OS-API-Layer-Regressed which effectively kills this feature

@giann giann reopened this May 16, 2024
@giann giann modified the milestones: 0.5.0, 0.4.0 May 16, 2024
giann added a commit that referenced this issue May 16, 2024
giann added a commit that referenced this issue May 16, 2024
giann added a commit that referenced this issue May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Issue related to the compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants