PuffinPlot issue tracker

Bug: a88/0df

ID : 0dfc5e78-620d-4e23-820f-ad062997fce2
Short name : a88/0df
Status : fixed
Severity : minor
Assigned :
Reporter : Pontus Lurcock <pont@talvi.net>
Creator : Pontus Lurcock <pont@talvi.net>
Created : Fri, 07 Oct 2016 07:38:44 +0000
Target : 1.4
Summary : Make Jython optional and add Javascript support

Comment: --------- Comment ---------
ID: e25d013b-bd25-4a62-aad0-bff7a0ede9dc
Short name: a88/0df/e25
From: Pontus Lurcock <pont@talvi.net>
Date: Fri, 07 Oct 2016 08:11:51 +0000

The Jython library bundled in PuffinPlot is a 8.3 MB stripped-down
version lacking most of the standard library. It's a poor compromise:
big enough to double the download size (once it's been doubled up
by the necessity of including a separate jar for OS X), but too 
restricted to be really useful. There is another option for scripting:
Java's built-in Javascript engine, nashorn. The following should be
done:

1. Implement support for Javascript scripting within PuffinPlot,
   providing the same interfaces currently in place for Jython
   (i.e. run from GUI and as command-line argument -- integrating
   PuffinPlot from within an external script should already be
   possible using jjs).

2. Make Jython into an optional extra: retain the "run Python script"
   action, but do not bundle Jython. Instead, implement functionality
   within PuffinPlot to download the Jython jar if necessary, and 
   load it dynamically at run-time.

Dropping Jython altogether would be a bad idea: Python is far more
popular than Javascript for scientific programming. However, keeping
Javascript for built-in scripting makes sense since the cost (in terms
of development effort and download size) is minimal. Even if nobody else
uses it, it's a handy way for me to send users experimental features and
workarounds for bugs without doing a new release or having them download
Jython.