www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - D kernel for Jupyter notebook

reply Laeeth Isharc <laeeth kaleidic.io> writes:
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.
Aug 19 2018
next sibling parent reply Nicholas Wilson <iamthewilsonator hotmail.com> writes:
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/ju yterd/kernel.d#L393 but it won't work.
Aug 19 2018
parent reply Peter Alexander <peter.alexander.au gmail.com> writes:
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/ju yterd/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)."
Sep 15 2018
parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
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/ju yterd/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.
Sep 15 2018
prev sibling parent reply Shigeki Karita <shigekikarita gmail.com> writes:
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
Aug 19 2018
next sibling parent Martin Nowak <code+news.digitalmars dawg.eu> writes:
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
Aug 20 2018
prev sibling parent reply Shigeki Karita <shigekikarita gmail.com> writes:
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
Sep 03 2018
parent Laeeth Isharc <Laeeth laeeth.com> writes:
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.
Sep 05 2018