drepl icon indicating copy to clipboard operation
drepl copied to clipboard

DLang Jupyter Kernel

Open wilzbach opened this issue 8 years ago • 8 comments

It would be great to have a D Kernel for the Jupyter project (it's quite huge and basically every language is supported).

Documentation:

http://ipython.readthedocs.io/en/stable/development/index.html

Overview of existing kernels:

https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages

wilzbach avatar May 24 '16 21:05 wilzbach

Yes, interesting indeed. Does that really need a REPL interface or could it be done via batch execution?

MartinNowak avatar May 27 '16 12:05 MartinNowak

Does that really need a REPL interface or could it be done via batch execution?

It's very similar to a REPL (imho it's one), because you need to keep track of the stack / currently available symbols.

wilzbach avatar May 27 '16 12:05 wilzbach

could it be done via batch execution?

Btw if you are unfamiliar with Jupyter, you can try a couple of Notebooks online https://try.jupyter.org/

wilzbach avatar May 27 '16 12:05 wilzbach

A couple of popular kernels for statically typed languages:

https://github.com/gibiansky/IHaskell https://github.com/gophergala2016/gophernotes https://github.com/mattpap/IScala https://github.com/Bachmann1234/java9_kernel https://github.com/robbielynch/ierlang https://github.com/andrewray/iocaml

wilzbach avatar May 27 '16 12:05 wilzbach

I believe there are some that just execute cells as batch, but typically aren't able to share state across cells and are otherwise pretty limited. The ones in interpreted languages, or languages with a REPL seem to work better.

carljv avatar May 27 '16 14:05 carljv

Just to revive this issue a little bit. Since there is now jupyter-wire in D I have done some experiments: dlang-jupyter

I basically just connected the packages drepl and jupyter-wire. Nothing fancy so far. It works (somewhat). Yes it has its limitations. But I spend only 4 hours, 3 of which were just me being stupid.

m3m0ry avatar Jun 28 '20 18:06 m3m0ry

Current limitations: I have a weird behavior with imports. (this is probably due to fact that drepl doesn't expect 2 lines at a time???)

import std.stdio;
import std.algorithm;

The second one won't work,because only the first one is imported as public.

I have also seen some issues with variable declarations/statements as well (which according to unittests here should work).

The general question is: should I try to fix it in my package, or should we make changes/adjustments/improvements to drepl? (I'd say it depends. In this example, i would think that drepl should be able to handle multiple statements at once)

m3m0ry avatar Jul 02 '20 14:07 m3m0ry

The general question is: should I try to fix it in my package, or should we make changes/adjustments/improvements to drepl?

It looks like all your issues could be fixed in drepl, so that's very likely the way to go. The drepl isn't set into stone, so it's definitely possible to improve.

wilzbach avatar Jul 02 '20 18:07 wilzbach