JupyterDay

Changing Education with Jupyter

Douglas Blank, Bryn Mawr College

goo.gl/dChuXY

With colleagues, have been working on languages, programming, environments, and education for 20 years.

  • Laura Blankenship, The Baldwin School (K-12)
  • Keith O'Hara, Bard College
  • Jennie Kay, Rowan University
  • Jim Marshall, Sarah Lawrence College
  • Mark Russo, The College of New Jersey
  • Steven Silvester (aka blink1073), Continuum Analytics

1. @dougblank

  • BA, Anthropology; PhD in Cognitive Science and Computer Science (Indiana University)
  • Thesis: Neural Network that learns to make Analogies
  • Developmental Robotics: Grow a Mind
  • Robots + Python + Learning for Undergraduate Research

2. O Jupyter, why do I love thee?

  1. Focus on the narrative, storytelling aspects of computing
    • Connects CS, STEM, Digital Humanities, well, all of humanity
    • Puts Computing on par with Reading, 'Riting, and 'Rithmetic
    • I tell stories (lectures and labs); they tell stories (homework)
  2. Standard interface for all languages
    • One less problem, for students and educators
    • Makes it easy to switch or include
  3. Ability to micro-manage environment (libraries, languages, functionality)
  4. Allows "Zero Day Exploit" - in-class computing on 1st day
    • Lessens anxiety before actual coding
    • No installation... big deal in K-12
  5. Allows students to share work with friends, family, and beyond (ePortfolio)
  6. Allows eaily moving between languages---Pascal, COBOL, Lisp, ...

3. Calico, 2006 - 2014

In 2006, my life took a detour when we (GATech and Bryn Mawr College) received a $2M grant to explore teaching introductory CS with robots.

GATech developed the hardware:

Bryn Mawr College developed the software:

  • Write a library once; use by many languages
  • IDE, languages, and libraries written in Gtk and Mono/.NET
  • Python, Jigsaw, Scheme, Ruby, Basic, Logo, Java, F#, Boo, etc.
    • Jigsaw - Block language in Gtk, reads .DLLs
    • IKVM - use JVM in .NET/Mono (CLR)
    • Java interpreter, written in Java, run in CLR
    • Scheme written in Scheme, translated into C#
    • Robot OS (ROS) built in - drones, humanoids, or Scribblers
    • Used by many schools and groups (such as Girls who Code in NYC)

Similar in spirit to the ideas behind Jupyter: one interface, multiple languages.

4. ICalico, 2014

  • Turned Calico into a IPython kernel (backend), written in C#
  • Implemented widgets before I ever used one
  • Problems:
    • No numpy, matplotlib, nor any of the "included batteries"
    • No "magics" (metacommands); had to re-implement, re-imagine
    • Too hard!

...So we decided to re-implement many of our ideas, but in Python rather than in the CLR.

5. Calysto, 2014 - future

5.1 Jupyter-based Courses

  • Programming Languages, in Scheme (Fall 2014)
  • Intensive Writing (Fall, 2014)
  • Introduction to Computing, in Processing (Fall 2014, Fall 2015)
  • Computational Methods (Physics), in Python (Spring 2015)
  • Computer Organization, in Machine code and Assembly Language (Fall 2015)
  • Computer Science through Biology, in Python (Spring 2016)
  • Data Structures, in Java9/JShell (Spring 2016)

5.2 Development

  • Notebook Extensions
  • Languages
  • Libraries
  • Customizations

6. Notebook Extensions

  • Publish
  • Submit
  • Spelling Checker
  • Move Section Up/Down
  • Number Sections
  • Table of Contents
  • Generate References
  • Tabbed In/Out
  • Two-column In/Out

7. Languages (aka Kernels)

  • Chatbot, Prolog, Skulpt
  • Scheme, converted to Python; with GUI stepper and breakpoints
  • Processing; Java converted to JavaScript, function stepper
  • Assembly Language; Python interpreter
  • Jigsaw (Blockly-based) for Java and Python
  • Java9, via JShell
  • Ladybug, rule-based agent control language

7.1 Processing

  1. Each cell is a sketch
  2. Sent to Java compiler to catch errors
  3. If ok, converted to JavaScript
  4. Runs in browser
  5. Full suite of "magics"

Processing Notebook

  • Introduction to Computing at Bryn Mawr College
  • Students write code within the first 30 minutes of first class

7.2 Scheme

7.3 Four-in-One Demo

This is a Java9 kernel, running a Python magic, demonstrating the Scheme debugger as a Youtube video, as displayed by the calysto library:

In [9]:
%%python

from calysto.display import YouTubeVideo, display
display(YouTubeVideo("2w-iO701g_w"))

7.4 Other languages

8. MetaKernel

Gives other kernels some of the magic that IPython has. Uses "wrapper kernel" Python infrastructure, even for non-Python-based languages. MetaKernel Magics now available for IPython, too!

  • Shell
  • Magics
    • Separated from language; language independent
    • download, run, macro, load, edit,
    • Integration with other languages
    • Parallel processing
  • Widgets, and rich display
  • Completion, Help, etc.

Used with Octave, Matlab, Scheme, Prolog, Processing, Java9, Xonsh, ROOT, Gentoo Science Bash, Cling, etc.

In [11]:
%run hello.java
 System.out.println("Hello, World!");
Hello, World!


8.1 Parallel Computation

Start a cluster:

In [1]:
%parallel javakernel.kernel JavaKernel
In [2]:
%%px 

import java.util.Random;
Random randomGenerator = new Random();
randomGenerator.nextInt(100);
Out[2]:
[20, 22, 13, 85, 99]

8.2 Language Interop

In [12]:
%kernel calysto_scheme.kernel CalystoScheme
Out[12]:
<calysto_scheme.kernel.CalystoScheme object at 0x7f20391e4b00>
In [15]:
%%kx 

(define fib
   (lambda (n)
      (if (< n 3)
          1
          (+ (fib (- n 1))
             (fib (- n 2))))))
 (display (fib 7))
13
In [3]:
%%processing

void draw() {
    rect(mouseX, mouseY, 10, 10);
}

9. Libraries

  • Calysto - for IPython and MetaKernel
    • calytso.graphics - SVG, Processing, with pixel access too
    • calytso.zgraphics - Zelle's "Programming Python" graphical library API
    • calysto.simulation - for Agent Based Modeling
    • calysto.ai - neural networks, genetic algorithms, etc.
  • jyro - robots

10. Customizations

11. Challenges

11.1 Low-hanging fruit

  • "no undo"
  • Make the notebook interface as easy to use as Google Docs
  • Make the GUI configurable
    • Some want it to look like Eclipse; others like a Word Processor
  • an nbviewer/publish (with slide support) needs to be a robost component

11.2 Issues

  • Overheard: "Jupyter is too convenient" for the student
  • Some fellow CS educators hate Jupyter as an IDE
    • Twitter this week: "Ipython4experts, not4students"
    • "within 1 hour later, indecipherable errors and broken notebooks"
    • It is different, I say better. How to migrate educators?