Light Deployment

Oct 10, 2013 at 2:44 AM
Hi,

I'm using ClearScript to allow extending my C# game engine with Javascript games. Currently, I'm focusing on text-based, such as Interactive Fiction.

The problem I have now is that the two ClearScript DLLs total around 7mb. If I include IronRuby, that's another 1mb; the total reaches around 10mb, which is a lot for a text-based game.

Is there any way to have a "lighter" deployment? I read the docs and they mention v8 support, but don't mention what the implications of V8 support are and how to build without it.
Coordinator
Oct 10, 2013 at 12:53 PM
Edited Oct 10, 2013 at 1:16 PM
Greetings!

Here's a list of the assemblies generated by a full ClearScript+V8 Release build (excluding test assemblies):
Assembly                Size      Platform
--------------------    ------    --------
ClearScript.dll         256 KB    AnyCPU
ClearScriptV8-32.dll    400 KB    32-bit
ClearScriptV8-64.dll    400 KB    64-bit
v8-ia32.dll             3 MB      32-bit
v8-x64.dll              4 MB      64-bit
If you're using V8, you can exclude the 32- or 64-bit assemblies if you're targeting a specific platform. If you're not using V8 (and for a text-based game JScript and/or VBScript may be sufficient), then ClearScript.dll is the only assembly you need.

By the way, you can use the ClearScript.NoV8 solution to build without V8.

Cheers!
Oct 10, 2013 at 3:06 PM
Hi,

Thanks for the tip. I switched over to JScript with only one major hiccup: .constructor.name doesn't exist in JScript (it does in V8).

I need it to detect if I'm getting an array back. My work-around was to inject the code from the start of this answer on Stack Overflow into every invocation.

Once I did that, I was able to call .getName() on all my objects.

Cheers!