Cross-platform

Mar 7, 2013 at 6:39 AM
Edited Mar 7, 2013 at 9:04 AM
Hey, any plans to support Mono at some point? This will be a need of mine soon. I love that ClearScript supports V8, so the JavaScripting compatibility is there at least. I plan to make my C# classes with Mono in mind as well. It would just make my life easier than having to create my own wrapper for V8 on non-Windows systems. ;)

Honestly though, I'm thinking of creating a C# based wrapper of my own around the V8 libraries so I can much better support Linux and Mac library ports as well ... though I'd much rather not if I can avoid it. LOL. ;)
Coordinator
Mar 8, 2013 at 1:53 PM
We haven't investigated it, but Mono support would be awesome! That said, a significant portion of ClearScript's V8 interface is written in C++/CLI, which doesn't appear to be supported on non-Windows platforms, and its host integration features rely on the C# Runtime Binder, which Mono doesn't appear to support, although it looks like it provides suitable alternative APIs. It might be easier to port a pure reflection-based V8 wrapper and use something like CXXI for the V8 interface.
May 22, 2013 at 3:46 PM
Hi.
Before all, thank you for your product, I like it very much.
I too am very interested about cross platform support.

About C# Runtime binder, I found that only System.ComponentModel.EditorBrowsableAttribute is not implemented in Mono, is it really necessary for ClearScript compilation?

Beside this, using CXXI is not an option, because its development has stopped after summer 2011...
Is it possible to compile V8 interface as Pure MSIL CLR support, or to isolate all non pure MSIL in a dll written in pure C++ (not C++/CLI)?
If I have understood (but correct me if misunderstanding), this could be sufficient to compile the OS dependent part with a different compiler on each desired platform.
Thank you for your work.
Coordinator
May 22, 2013 at 6:07 PM
Hello, and thank you for your kind words!

Regarding the C# Runtime Binder, we looked here. The Microsoft.CSharp.RuntimeBinder namespace is not listed at all. Could the official online API documentation be out of date?

As for ClearScript's V8 interface (ClearScriptV8), it doesn't have any OS-dependent parts. What makes it Windows-specific is that it combines managed and native code in one shared library. The ClearScript-to-ClearScriptV8 interface is managed, and the ClearScriptV8-to-V8 interface is native. V8's API cannot be used from managed code, so the best option is to change ClearScriptV8 into 100% native code and have ClearScript call into it using P/Invoke or something like that.

This work is on our long-range radar, but unfortunately we don't have an ETA at the moment.
May 23, 2013 at 12:17 PM
Edited May 23, 2013 at 12:18 PM
Hi @cet_development ,

V8.NET is finally ready and is designed such that the code can easily be ported to Mono. ;) It's more true to the nature of V8 (as in, it doesn't abstract a lot of the V8 abilities away from the developer). The wrapper uses pure p/invokes to support mono (which doesn't support mixed CLR modes), and has a carefully crafted wrapper to allow for some great speed optimizations. :) I'd recommend reading the Google V8 embedder's guide first as it will aid greatly in understanding it.

-j
Coordinator
May 23, 2013 at 1:26 PM
Hi jamesnw, congratulations on your release!

BTW, cet_development, for another Mono-friendly solution available today, consider VroomJS. Good luck!
May 23, 2013 at 4:46 PM
Thanks both, and also congratulations to jamesnw.
I will give a look to V8.NET asap, it could be what we need.
I looked at VroomJS too, but it does not compile with recent V8 API (3.17), probably it need a bit reworking after last API changes...

Well, thank you and good work to all.
May 23, 2013 at 6:19 PM
VroomJS only seems to compile for mono, and has Linux libraries (links libv8.so). It also doesn't seem to support compiling the V8 source as 64-bit.
May 24, 2013 at 8:34 AM
I did not tried to compile 64 bit version, another problem.
I tried to substitute libvroomjs.cproj project with a libvroomjs.vcxproj using same C++ sources. The .NET project should be linked with v8-xx.dll, but before this I should solve the V8 API change (and some other minor) problem(s).
For the moment I cannot investigate more, perhaps in a next future.