
Jupyter C Kernel - brendanrius
https://github.com/brendan-rius/jupyter-c-kernel
======
gh02t
This looks like it doesn't share any context between cells, am I right? So I
can't use functions defined in one cell in another.

~~~
Mic92
There exists a jupyter kernel for cling, which allows this (also this is C++
not C)

~~~
atdt
Yes, and it is quite good: [https://github.com/root-
project/cling#jupyter](https://github.com/root-project/cling#jupyter)

I find it invaluable

------
hossbeast
Huh, a README that doesn't even attempt to explain what the project is.

~~~
avian
This is an extension for the Jupyter Notebook [1]. Jupyter Notebook is a tool
that allows you to combine runnable computer code, Markdown text, TeX
equations and (generated) figures in a single document. It's quite popular in
education and data analysis fields in my experience. Most often it is used
with Python. This extension allows you to embed and run C code in a notebook
document.

[1] [https://jupyter.org](https://jupyter.org)

------
JosephRedfern
Looks like a good way of playing around with ideas. Having context between
cells would make it way more useful again.

One thing I'm not sure about is the advice to 'Create branches named issue-X
where X is the number of the issue'. Doesn't that make it very difficult to,
at a glance, realise which branch implements what feature? I understand the
rational of including the issue number, but it seems a shame not to give any
other description.

~~~
brendanrius
You are right, naming branches this way is not really important and I will
probably remove that part. I do not want to add friction to people who want to
contribute since I know how painful it is to contribute on certain projects.

------
BeetleB
As much as I love Jupyter, for C/C++, I've found using Org Babel in Emacs much
more effective.

~~~
anonacct37
Do you have a way to handle the fact that emacs locks up while evaluating
code?

I love org+babel until my entire emacs session hangs because I kicked off an
operation that takes time.

~~~
BeetleB
>Do you have a way to handle the fact that emacs locks up while evaluating
code?

Nope.

For C++ I use it for "toy" code. Usually experimenting with some syntax or
behavior that is confusing. They tend to be small programs.

------
zeptomu
What is the state of the art concerning security of Jupyter? As it provides in
essence a remote shell it's vulnerable to local privilege escalation.

Some people "sandbox" it in Docker (and this is controversial AFAIK), but
although I like the notebook UI, I don't want to give people a "native" shell
just to do some data exploration.

~~~
blitzd
Most recentlyv they generate a token on startup, which you need to interact
with anything. It's fairly seamless on a client computer as the browser that
is launched will get that token added automatically.

------
tavert
I frequently wish the Jupyter notebook server were a C library instead of
requiring Python. Would make deployment and installation of notebooks for non-
Python languages easier. That's kind of the opposite of this though.

~~~
williamstein
I recently built a complete node.js Jupyter server on top off
[https://github.com/nteract/spawnteract](https://github.com/nteract/spawnteract)
(also used by nteract). There is no Python involved at all unless you connect
to a Python kernel. Some of the code of what I wrote:
[https://github.com/sagemathinc/cocalc/tree/master/src/smc-
pr...](https://github.com/sagemathinc/cocalc/tree/master/src/smc-
project/jupyter)

I'm not suggesting you use what I wrote. I'm just pointing out that there
exist alternatives to the Python-based Jupyter server that accomplish the same
goal. And I strongly agree with you -- it would be great to have even more
implementations of the server part of the Jupyter stack!

------
RickHull
What makes this a kernel? It appears to be not much more than a wrapper around
gcc.

~~~
goatlover
It's a Jupyter kernel, so that you can run C code from a Jupyter Notebook in
your browser, like you can with Python, R, etc.

~~~
zeptomu
Not to nitpick, but "[...] running C code in your browser" is a little bit of
an exaggeration as there is no state-sharing between cells.

It's similar to a webpage that posts C code to a web service and returns the
output of its stdout (so like CGI). Not that this is a bad thing, but when I
read about stuff running in the browser, I suppose the code to be run by the
browser itself, and not just visualizing the output of a program run on some
remote server.

~~~
williamstein
Being generous, there is state sharing between cells via (1) the filesystem
and shared memory (e.g., /dev/shm), and (2) the C code in cells could link in
some common code. Since C starts up quickly, this could still be pretty
useful.

