swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

feat: wasm support

Open 2vg opened this issue 7 months ago • 2 comments

Swiftly currently support JavaScript and Lua to write plugins within Metamod/CS2.

Here, I propose adding new support for wasm to get better performance benefits. JS/TS and lua are easy-to-write scripting languages, but I believe that their performance is generally lower than other languages ​​(I don't know how much they are optimized within Swiftly, so I apologize if I'm wrong). It might be a different story if Swiftly added support for another language like a adding support for Rust or Go, for example, would require a lot of effort and changes, so it's not realistic. Another option would be running JavaScript on the faster v8 engine, but this also would likely require significant changes and wouldn't be as lightweight as QuickJS.(I mean like a memory-size, etc.) Therefore, I thought that wasm support would be more suitable as something that could gain performance with less effort. Wasm should have better performance than js for general workloads, making it suitable for developing plugins that demand higher performance. I'll talk about using Rust as wasm, which means that wasm will run without GC, and I expect it will be as fast as native. Any other language that can be made into wasm should be able to be supported(so we can use Golang, etc.), so I'm sure adding wasm support will open up new possibilities for modding.

I understand that this is not an easy task, but I would appreciate your consideration, Thanks 🙏

2vg avatar Jul 10 '25 03:07 2vg