compiler-research / xeus-cpp

Jupyter kernel for the C++ programming language
BSD 3-Clause "New" or "Revised" License
18 stars 24 forks source link

Using XPlugin for cell magics #140

Open anutosh491 opened 4 months ago

anutosh491 commented 4 months ago

I think we could introduce a plugin system for cell magics. It would be pretty helpful to the end-users.

Magics in xeus-cpp are registered into a magics_manager class, that inherits from a preamble which is used for detecting special inputs in the cell before deciding to parse the code.

Currently, the scarce available magics are part of the xeus-cpp codebase, and adding a new one means rebuilding and releasing xeus-cpp. A plugin system would avoid that. We could leverage the plugin system here (https://github.com/QuantStack/xplugin) . Xplugin would add the possibility to discover magics at runtime

anutosh491 commented 4 months ago

We would eventually want a generic mechanism to register / fetch magics in xeus. So we could start with a proto in xeus-cpp before going for the generic solution and eventually have xplugin as a dependency in xeus.

anutosh491 commented 4 months ago

A list of magics have been noted down in this issue.