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 with GC #2521

Open
TheDrawingCoder-Gamer opened this issue Apr 21, 2024 · 2 comments
Open

WASM with GC #2521

TheDrawingCoder-Gamer opened this issue Apr 21, 2024 · 2 comments

Comments

@TheDrawingCoder-Gamer
Copy link
Contributor

this is more of an upstream issue and/or would require swapping out the WASM library used, but would like to see an option to run WASM code that uses GC. Of course this would likely require using a seperate engine (from my cursory research I couldn't really find one as versatile as wasm3) and likely a seperate script mode would be needed.

This is more of a wishlist item, but this could open up languages that aren't on the current list, but can be compiled to WASM with GC. The idea is that it would be seperate and thus would have unbounded memory and also would have the GC handled on the TIC-80 side, thus meaning that more code could be used for actually doing work in the game.

@joshgoebel
Copy link
Collaborator

would have unbounded memory

This is not desirable. The WASM runtime has limited RAM on purpose. (feel free to go back and find the issues around it's development and read them)

run WASM code that uses GC.

This is possible now, just compile a binary that has garbage collection. Garbage collection does not require unbounded RAM.

@TheDrawingCoder-Gamer
Copy link
Contributor Author

TheDrawingCoder-Gamer commented Apr 24, 2024

I know that it has limited RAM on purpose, the idea is that garbage collected languages tend to use more memory. Right now all languages except for WASM have unbounded memory.

The idea of "running WASM code that uses GC" is that it moves the GC from the binary into TIC-80 itself, providing more space in the binary for actual code. GCs can become pretty large so it eats into the already smaller 256Kb limit.

I can see it not having unbounded memory, but it should probably still have more memory than non-GC'd wasm.

As an example, right now Go's minimum file size of WASM files is 2mb. This is because of the bundled garbage collector. Once Go implements WASM with GC their binaries could possibly be small enough to fit into tic80.

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