MoI and emscripten

Next
 From:  immortalx
10136.1 
First of all sorry if this is a stupid question :)

I experimented with MoI scripting lately and got quite familiar with it. However I mostly enjoy writing in C/C++ (in particular C and SDL), and I'm not too comfortable with Javascript/HTML, the DOM, etc.
So I was wondering if I could somehow interface with MoI by compiling C code with emscripten.
Is it even possible? I guess the bare minimum would be that MoI's webkit version support's wasm, and even then, how would one have access to classes and functions of MoI's javascript API, from within a C/C++ program?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10136.2 In reply to 10136.1 
Hi immortalx, the version of WebKit currently used by MoI predates wasm, so I don't think that this approach would work.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  immortalx
10136.3 
Thanks again Michael!
Just out of curiosity, if we were in a version of webkit that supported asm would it then be possible to interface with MoI like I think it would?
And do you think there would be any advantages (Speed? Usage of existing C libraries, like how Max Smirnov has integrated litegraph in NodeEditor?), other than just scripting in another language?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10136.4 In reply to 10136.3 
Hi immortalx, sorry I don't really know. I haven't spent any time working with emscripten before. I guess it gets converted into JavaScript essentially so I would guess it could access the same things as JS.

But typically programs have a different interface for a C/C++ API than the script one. The main advantage is that compiled C code is generally faster for intensive number crunching operations and can use other C/C++ libraries (and native OS APIs) directly.

I think that litegraph is made with all JavaScript, it was designed to run inside a web browser. So there wasn't any different language barrier to deal with.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  immortalx
10136.5 
OK Thank you very much.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All