Embedding scripting language (webgl-compatible)

Is there currently any scripting language that can be embedded into Unity, and still work when the project is exported to WebGL?

So far I have tried quite a few, but no luck. Many require the ability to dynamically generate IL code (which isn’t available in WebGL).

The most “promising” one I tried was probably MoonSharp, but no luck either. There seems to be no hard technical limitation, but, scripts always fail to run due to some unknown problems.

(Other languages such as IronPython I haven’t tried because I believe that they just can’t work due to the IL generation issue).

Latest Moonsharp works with webgl (older versions apparently had problems)

Have tested it with Moonsharp 2.0 and Unity 5.5.1p3 webgl
(tested the factorial sample and FungusLuaUtils)

The simplest option for WebGL is to use Javascript itself, executing within the browser. You can load and run scripts dynamically by asking the browser to evaluate them, and with an appropriate jslib you can call arbitrary Javascript functions and - with care - the Javascript can also call your compiled C# methods (e.g. so you can provide entry points for the scripts to interact with your game engine).

I am interested in developing a plugin for this, so if you want to talk about your needs privately then please feel free to message me!

However this would only work in WebGL builds where we can lean on the browser to execute the scirpts. For the editor and other platforms it would require a dedicate Javascript interpreter - I think there are some already on the asset store but compatibility might need some care.

WebGL supports only supports AOT and no threading.

Have you looked at Unity Asset Store - The Best Assets for Game Making or something similar? No idea if that works with WebGL but still might be a good start for you.