jupyter-xeus / xeus-cling

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

Add #code_native #code_llvm and #code_typed #193

Open wolfv opened 5 years ago

wolfv commented 5 years ago

Borrowing from Julia here. These are pretty cool macros to get the assembly, LLVM bytecode or AST.

We could introduce them as cell magics.

Would just be necessary to find a way to extract that info in a readable way from cling.

SylvainCorlay commented 5 years ago

👍 , especially for LLVM bytecode that can be nicely rendered.

wolfv commented 5 years ago

do you have any idea if the cling guys have tools for this already? Or who to ask?

SylvainCorlay commented 5 years ago

I don't think so. We have the ClingValue for the last returned value handy, but not the whole cell byte code.

wolfv commented 5 years ago

We've got an "official" endorsement from Axel on the cling forums for that: https://root-forum.cern.ch/t/get-assembly-llvm-bytecode-or-clang-ast-output/30800

wolfv commented 5 years ago

I've started an exploratory commit here: https://github.com/root-project/cling/pull/262

Hoping to get some feedback from the cling folks.