Skip to content

fakeGenuis/wolframForJupyter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wolfram language kernel for jupyter notebook

Installation

sed -i "s|init_file|"$(realpath init.wl)"|g" wolframforjupyter/kernel.json
jupyter kernelspec install wolframforjupyter/ --user

No explicit version implied, it depends on wolfram execute version in your $PATH.

For code completion of user defined symbols. (change Wolfram to Mathematica if version under v14.0)

ln -s $(realpath stream.wl) ~/.Wolfram/Applications/stream.wl
  • [ ] If not, system symbols completion still work.?

Kernel

Jupyter Client 8.3 — jupyter_client 8.3.1 documentation

Language for kernel

Obviously we should choose option 2 (code execute done in WTSP)

Debug

colored debug message

Examples

Test

GitHub - jupyter/jupyter_kernel_test: A tool for testing Jupyter kernels

ZeroMQ Socket

ZeroMQ | Get started

zmq identity

UTF-8 encode string

Evaluation

WSTP Wolfram Language Functions—Wolfram Language Documentation

currently, interrupt in jupyter is implemented by LinkInterrupt. For signal interrupt see Linux Signals Help

Notation:

client
jupyter front end (i.e. browser tab / vscode / emacs-jupyter)
kernel
the monitor process client communicate with
link
the wolfram language evaluation take place, monitored by kernel

Code input

Currently, codes are input as EnterTextPacket to link. That makes output render easily, since output being wrapped inside ReturnTextPacket. But have following downside:

  1. unicode garbled
  2. further handler difficult (e.g. Short)
  3. code completion hard implement (see below)

Asynchronous Execution

LocalSubmit failed inside WSTP link, then there’s no “caveat for asynchronous output” (mentioned in jupyter client documentation). Anyway, why not launch a new link (jupyter session)?

Completion

Where should completion occurs, in kernel or link? Jupyter’s answer is surely the later, since the complete_request being send from shell channel. And the symbols in link is non-awareable to kernel. (for simple, currently front)

Then, the problem emerge when completion request arrive at link busy status. But like in jupyter-python, is ok for link to ignore those requests (check it’s the case). And for completion inside link, we need ReturnPacket or ReturnExpressionPacket to store matches in List (not string of lengthy list), which is not implemented.

Other problem is that execute_count get increase when handle completion request, see $Line variable for maintain it.

Features [3/8]

Similar

WolframLanguageForJupyter

wolfram-language-notebook

IWolfram

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published