Looking for a language, that can easily compile to WASM
Originally, I was going to use D, but its current WASM guideline is buried under a lot of Discord threads, all while people are lazy to touch the wiki. I need to test stuff with WASM (use for scripting in applications, not browsers).
Please NO RUST!!! While I see why functional programming is useful (I even use wasmtime as my WASM engine, which is developed in Rust), but is horribly counterproductive for game development, especially if it's opt out like in Rust.
EDIT: In the meanwhile, I've found AssemblyScript, which seems to be good for my usecase.
Yeah, rust tends to be more imperitive too, so I definitly wouldn't describe it as functional by default or by neccesity.
There's a good reason to use another, non-gc language though. Rust is a very particular language with many issues. The borrow checker, matching system, etc. while increasingly cool are difficult to learn and I see why someone would prefer c, or another non-memory safe solution. Or even another memory safe solution with a different way of doing things.
I haven't done too much work with WASM myself, but when I did, the only languages I saw recommended were Rust, C++, or TinyGo. From what I've heard, Rust and C++ are smoother than TinyGo. Garbage collected languages usually aren't great choices for compiling to wasm because wasm doesn't have any native garbage collection support. That limits your selection down a lot.
But another option you may want to consider is Nim. As I understand, it compiles to C, so any C->Wasm compiler should theoretically work for you as well. I did a quick search and wasn't able to find any great resources on how to do this, but you might get a bit more lucky. Good luck!
Ive done C++ and C# before. Both work but it still feels very experimental in browser support. Ive put lisp in the browser through wasm with C++. Its was a fun novelty.
Scala-js is working on it - as its compiler design may facilitate this.
I haven't yet tried (on todo list) and am not an expert, but bookmarked in passing:
recent github implementation, some history, following older discussion
Late here, but if you want the easy route then there is always Unity (C#) if it fits for your use case in game dev and the license isn't a problem for you.