dlang / project-ideas

Collection of impactful projects in the D ecosystem
36 stars 12 forks source link

Jupyter notebook D kernel #14

Open burner opened 5 years ago

burner commented 5 years ago

The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more. Jupyter notebooks are extremely popular among data scientist as they allow interactive progress and exploring a solution step by step. With a bit of work, a statically compiled language can be used in an interactive notebook e.g. Cling for C++ and gophernotes for Go. Apart from being useful to data scientist, a Jupyter D kernel would allow an intuitive exploration of the language for newcomers and people starting with new libraries.

Existing works:

Laeeth commented 5 years ago

Jupyterd has been replaced by Jupyter-Wire

Laeeth commented 5 years ago

Main thing left is to add rich media responses and Jupyter widgets

burner commented 5 years ago

https://github.com/kaleidicassociates/jupyter-wire

Laeeth commented 5 years ago

DMD has an interpreter built in, and there is Stefan's CTFE branch. I wonder if we could turn the latter into a full D interpreter!

dkgroot commented 5 years ago

@Laeeth How about updating/extending d-repl

jacob-carlborg commented 5 years ago

DMD has an interpreter built in, and there is Stefan's CTFE branch. I wonder if we could turn the latter into a full D interpreter!

LDC has a built-in JIT.

Laeeth commented 5 years ago

But last I checked the LDC jit was quite limited. Useful for particular optimizations (we were looking at it to address unboxing slowdowns) but I couldn't immediately see usefulness as repl.

Laeeth commented 5 years ago

@dkgroot good idea though maybe a D interpreter would make more sense ?

Laeeth commented 5 years ago

Note cling is not statically compiled IIRC. So you should say a language most commonly used when statically compiled.

jacob-carlborg commented 5 years ago

But last I checked the LDC jit was quite limited. Useful for particular optimizations (we were looking at it to address unboxing slowdowns) but I couldn't immediately see usefulness as repl.

That's unfortunate.

thewilsonator commented 5 years ago

The LDC jit is more like a Just-in-time re optimiser, than a Just-in-time compiler. So its not useful as a repl.

Laeeth commented 5 years ago

So what we have now is a library for writing Jupyter kernels in D, as well as a crude D kernel that implements a D kernel using drepl.

What would be interesting would be implementation of Jupyter widgets and a better repl than the one we have.

Laeeth commented 4 years ago

Sebastian Koppe is adding standard widgets to Jupyter-wire and has already written a proof of concept widget in D compiling to web assembly. And after that we are left with just having a D interpreter or JIT.