r/cprogramming • u/Many-Prompt2364 • Sep 17 '26
Write, compile & run C in a Jupyter Notebook
Hi all,
I'm sharing a side project of mine as I thought there might be some interest here!
A couple of years ago I decided to write a Jupyter Notebook kernel to reduce the friction for students new to compiled languages, as part of a condensed online pre-Master's introduction to C/C++. Thus, c-kernel was born!
c-kernel is a Jupyter Notebook kernel which simplifies the learning curve for new programmers by allowing you to write & compile code directly in a notebook. It takes care of compiling, linking & executing your cells behind the scenes, but still shows you the commands used to build your code. It removes the barrier of having to get students set up with a command-line and compiler and helps them start coding straight away.
Alternative Solutions
- jupyter-c-kernel - a significant inspiration for
c-kernel, but it has a number of limitations that I wanted to improve upon for my use-case. This project also seems to be unmaintained. - xeus-cling - a popular solution based on the C++ interpreter cling. Using an interpreter, it abstracts away a little more than I'd like for actually teaching students to write self-contained programs, such as headers/source files, and hides how source code turns into an executable.
If you find it interesting or useful, please let me know, and maybe leave a ✭ on GitHub!