Skip to content

Remove redundant wasm interpreter class ? #369

@anutosh491

Description

@anutosh491

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

#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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions