Using Cern Root library with Emscripten

Hello,
i am using a lot root library with g++ compiler from many years. This is a great library.
Recently i am using emscripten that convert easily and efficiently my c++ programs in WASM (or javascript), i.e. the same c++ code, gives a program that can be run in any web browser, hence any platform. This is very good to share applications.
I would like to ask if anybody has tried to compile root library with emscripten (the emcc compiler), or at least if it would be possible to have a light root library essentially with some graphics (TCanvas etc) that could be use with the emcc compiler without change in the c++ code?
This would be very useful…
From the moment i am writing some c++ class that have the same name and members as the root class (TCanvas, TLine etc) and compile with emcc. It helps but this is tedious and i guess it is not a good choice.

Thanks a lot,
Best regards,
Frédéric Faure


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


I suppose you already know JSROOT, right?

Hello Bellenot,
yes jsroot if very interesting, but is for javascript language right? here i wanted to ask for using root in c++ language, that could be compiled with emscripten. Can jsroot be used with emscripten?
Best regards,
Frédéric.

Hi Frederic,

Oh, OK, I see… And I have no idea, I have no experience with emscripten

Cheers, Bertrand…

Hi Frederic,

We never think about usage of JSROOT with emscripten.
Our idea was to keep most of existing C++ code as is and just provide visualisation capability with JavaScript and web-based graphics. In addition to JSROOT we provide THttpServer class which enables remote access to running C++ application.

Regards,
Sergey

1 Like

JSROOT also allows to display the graphics contain of ROOT files “live” in web pages.
Like on the new prototype of the ROOT web site:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.