Creating your first

Dyalog Jupyter Notebook

What is a Dyalog Jupyter Notebook?

Previously:

In [2]:
⍝ You can execute APL code in cells like these
3'WO'
Out[2]:
WOW

You can also use Markdown to present formatted text in cells like these

(double click on a Markdown cell to edit its content)

$\LaTeX$

Look how we can put LaTeX formatted maths right beside equivalent APL:

$e^{i \pi} = -1$

¯1=*○0J1 ⍝ APL in Markdown
In [3]:
*○0J1 ⍝ Executable APL
Out[3]:
¯1

Use cases

How-to style tutorials and documentation

Set assignments to students

...at home or in the classroom

"I have long been struck by the contrast between the success with which the adventurous learn APL by simply using it, and the frequent failure of lecture courses to communicate the simplicity and applicability of the language.

Kenneth E. Iverson | Toronto, Ontario | July, 1981

Also check this out!

Presenting a notebook

Using reveal.js, Jupyter Notebooks can be turned into slideshow presentations with little effort.

$ pip install --user jupyter_contrib_nbextensions
$ jupyter nbconvert Creating\ your\ first\ Dyalog\ Jupyter\ Notebook.ipynb --to slides --ServePostProcessor.port=8888 --ServePostProcessor.ip='*' --post serve --SlidesExporter.reveal_theme=serif
In [1]:
+/100
Out[1]:
done _⍸ ___( ∘)> ∘○O( ⊃∨∧⌊○⊂ 2019-09-12 07:49:35 ) \ ≤_. ) `---´ Rebuilding user command cache... done
Out[1]:
5050

How to get started

https://github.com/Dyalog/dyalog-jupyter-kernel

There are of course instructions on the wiki...

... but the steps are basically the following:

Jupyter Notebook

  • The default
  • sudo apt install jupyter

Jupyter Lab

Jupyter Hub

The easiest way

Can't I quickly type up a notebook for my class or publication?

Funny you should ask...

We've created a Dyalog Jupyter Binder. Simply click the Launch Binder link from https://github.com/Dyalog19/D16 and Binder will spawn a docker container just for you!

TryAPL

TryAPL can execute Dyalog Jupyter notebooks line by line (currently not LaTeX, HTML or SharpPlot). Simply go to the "Learn" tab and paste the notebook's URL in the bar at the bottom.

Installing Jupyter Locally

More details about installing these environments on Windows, MacOS and Linux can be found in another notebook in this repository.

Linux

  • Use apt and pip

Windows

There is a blog post that gives three ways to get Jupyter running on Windows.

  • 'Pure python'
  • Anaconda
  • Docker

MacOS

To use Dyalog with Jupyter notebooks, you will need to install the Dyalog Jupyter kernel

Jupyter Hub Demo

Dyalog Jupyter Binder

Use it!

Dyalog Jupyter Binder

Use it!

Materials from this presentation:

https://github.com/Dyalog19/D16

  • Binder link
  • More details on installing Jupyer environments with the Dyalog kernel
  • View and download this presentation

Want to share? Send notebooks to notebooks@dyalog.com