-
Couldn't load subscription status.
- Fork 36
Description
The wasm interpreter class was introduced probably with the intent to specialize for web assembly (maybe override init_preamble or publish_stdout I guess) but our design currently is modular enough to replicate what we do for the native case (through kernel.json)
Hence as can be observed, the wasm_interpreter class isn't doing much or extending the interpreter class
xeus-cpp/src/xinterpreter_wasm.cpp
Lines 10 to 22 in fd6edbd
| #include "xeus/xinterpreter.hpp" | |
| #include "xeus/xsystem.hpp" | |
| #include "xeus-cpp/xinterpreter.hpp" | |
| #include "xeus-cpp/xinterpreter_wasm.hpp" | |
| namespace xcpp | |
| { | |
| wasm_interpreter::wasm_interpreter(int argc, char** argv) | |
| : interpreter(argc, argv) | |
| { | |
| } | |
| } |
Simply using interpreter here instead of wasm_interpreter should do the job for the emscripten kernel
xeus-cpp/src/main_emscripten_kernel.cpp
Lines 42 to 43 in fd6edbd
| using interpreter_type = xcpp::wasm_interpreter; | |
| xeus::export_kernel<interpreter_type, &builder_with_args<interpreter_type>>("xkernel"); |
This tells me we can get possibly get rid of the wasm_interpreter class and simply use the interpreter class for both native and wasm use cases.