Thread overview
D kernel for Jupyter notebook
Aug 19, 2018
Laeeth Isharc
Aug 19, 2018
Nicholas Wilson
Sep 15, 2018
Peter Alexander
Sep 15, 2018
Nicholas Wilson
Aug 20, 2018
Shigeki Karita
Aug 20, 2018
Martin Nowak
Sep 04, 2018
Shigeki Karita
Sep 06, 2018
Laeeth Isharc
August 19, 2018
Proof of concept works, but it requires some further development to be useful to do work in.

https://github.com/kaleidicassociates/jupyterd

It uses D repl currently - this was written for a console interface and probably you will encounter difficulties running it in a notebook environment.  I guess one would like to treat all functions defined in a single notebook as part of the same session and to execute immediate statements as part of a main specific to that cell.

The kernel is a bit flakey - takes time to come on line and you might need to reconnect to it sometimes.

To Do:

1.    Add HTML and markdown table output to display arrays of structs or of dicts in a useful manner
2.    Integrate with mir and other numeric libraries
3.    Integrate with charting
4.    Consider adding to Dlang tour and run.dlang.io when stable
5.    Integrate with dpp
6.    Integrate with dub


1 and 3 should be quite simple.  One wouldn't want to write a large program in Jupyter, but it's helpful for exploratory data analysis and programming where the code that does the work is already in D.
August 19, 2018
On Sunday, 19 August 2018 at 20:33:45 UTC, Laeeth Isharc wrote:
> Proof of concept works, but it requires some further development to be useful to do work in.
>
> https://github.com/kaleidicassociates/jupyterd
>
> It uses D repl currently - this was written for a console interface and probably you will encounter difficulties running it in a notebook environment.  I guess one would like to treat all functions defined in a single notebook as part of the same session and to execute immediate statements as part of a main specific to that cell.
>
> The kernel is a bit flakey - takes time to come on line and you might need to reconnect to it sometimes.
>
> To Do:
>
> 1.    Add HTML and markdown table output to display arrays of structs or of dicts in a useful manner
> 2.    Integrate with mir and other numeric libraries
> 3.    Integrate with charting
> 4.    Consider adding to Dlang tour and run.dlang.io when stable
> 5.    Integrate with dpp
> 6.    Integrate with dub
>
>
> 1 and 3 should be quite simple.  One wouldn't want to write a large program in Jupyter, but it's helpful for exploratory data analysis and programming where the code that does the work is already in D.

Note that the D repl will only work on platforms where drepl works i.e. platform with shared library support. It will _build_ on OSX due to https://github.com/kaleidicassociates/jupyterd/blob/master/source/jupyterd/kernel.d#L393 but it won't work.
August 20, 2018
On Sunday, 19 August 2018 at 20:33:45 UTC, Laeeth Isharc wrote:
> Proof of concept works, but it requires some further development to be useful to do work in.
>
> [...]

Great. I have tried DUB integration. It seems to work. https://github.com/ShigekiKarita/grain/blob/master/example/repl.d
August 20, 2018
On 08/20/2018 02:14 AM, Shigeki Karita wrote:
> On Sunday, 19 August 2018 at 20:33:45 UTC, Laeeth Isharc wrote:
>> Proof of concept works, but it requires some further development to be useful to do work in.
>>
>> [...]
> 
> Great. I have tried DUB integration. It seems to work. https://github.com/ShigekiKarita/grain/blob/master/example/repl.d

Looks very interesting, though not quite ready for full drepl integration. https://github.com/dlang-community/drepl/issues/4#issuecomment-414331125
September 04, 2018
On Monday, 20 August 2018 at 00:14:03 UTC, Shigeki Karita wrote:
> On Sunday, 19 August 2018 at 20:33:45 UTC, Laeeth Isharc wrote:
>> Proof of concept works, but it requires some further development to be useful to do work in.
>>
>> [...]
>
> Great. I have tried DUB integration. It seems to work. https://github.com/ShigekiKarita/grain/blob/master/example/repl.d

I'm making a jupyter based tutorial for my library. It might be the first example for jupyterd.

https://github.com/ShigekiKarita/grain/blob/master/tutorial.ipynb
September 06, 2018
On Tuesday, 4 September 2018 at 04:58:41 UTC, Shigeki Karita wrote:
> On Monday, 20 August 2018 at 00:14:03 UTC, Shigeki Karita wrote:
>> On Sunday, 19 August 2018 at 20:33:45 UTC, Laeeth Isharc wrote:
>>> Proof of concept works, but it requires some further development to be useful to do work in.
>>>
>>> [...]
>>
>> Great. I have tried DUB integration. It seems to work. https://github.com/ShigekiKarita/grain/blob/master/example/repl.d
>
> I'm making a jupyter based tutorial for my library. It might be the first example for jupyterd.
>
> https://github.com/ShigekiKarita/grain/blob/master/tutorial.ipynb

Very cool.  Thank you.

I was looking into Jupyter widgets. I ported over some of it and had to add the extension to protocol for widgets into the notebook.  It's not that bad and might be pretty useful to be able to access widgets from D.

Half-finished code right now that doesn't even build but I don't have so much time and won't for a couple of months.

September 15, 2018
On Sunday, 19 August 2018 at 23:49:21 UTC, Nicholas Wilson wrote:
> On Sunday, 19 August 2018 at 20:33:45 UTC, Laeeth Isharc wrote:
>> [...]
>
> Note that the D repl will only work on platforms where drepl works i.e. platform with shared library support. It will _build_ on OSX due to https://github.com/kaleidicassociates/jupyterd/blob/master/source/jupyterd/kernel.d#L393 but it won't work.

The drepl README on github says it works for OSX. Is that not correct?

"Works on any OS with full shared library support by DMD (currently linux, OSX, and FreeBSD)."
September 15, 2018
On Saturday, 15 September 2018 at 08:12:37 UTC, Peter Alexander wrote:
> On Sunday, 19 August 2018 at 23:49:21 UTC, Nicholas Wilson wrote:
>> On Sunday, 19 August 2018 at 20:33:45 UTC, Laeeth Isharc wrote:
>>> [...]
>>
>> Note that the D repl will only work on platforms where drepl works i.e. platform with shared library support. It will _build_ on OSX due to https://github.com/kaleidicassociates/jupyterd/blob/master/source/jupyterd/kernel.d#L393 but it won't work.
>
> The drepl README on github says it works for OSX. Is that not correct?
>
> "Works on any OS with full shared library support by DMD (currently linux, OSX, and FreeBSD)."

https://github.com/dlang/druntime/blob/master/src/rt/sections_elf_shared.d#L534

vs.

https://github.com/dlang/druntime/blob/master/src/rt/sections_osx_x86_64.d

^F rt_loadLibrary

> Not found.

As a result it fails to link. Probably not hard to fix, though.