
Iodide: An experimental Mozilla tool for data exploration on the web - pablobaz
https://hacks.mozilla.org/2019/03/iodide-an-experimental-tool-for-scientific-communicatiodide-for-scientific-communication-exploration-on-the-web/
======
simula67
It is funny how the world wide web was invented for the purpose of improving
scientific publishing. It revolutionized everything _but_ scientific
publishing. Scientists still seem to be publishing their research as PDFs with
citations written at the end of the page

~~~
SiempreViernes
I'd say open access journals are a pretty big change to scientific publishing,
and that started with the preprint archives at around 1991 with arxiv.

Beyond that, the web _wasn 't_ created to improve publishing, it just did as a
side effect. It was started for _information exchange_ within collaboration,
and it certainly has done that.

Experimental collaborations at CERN in the 80's were not too large at most
around 50 authors (NA31 < 40 , NA32 < 50 ), by the next generation it was up
to 350 distributed over 32 locations, and the current collaborations are at
around 3000 over 180 locations.

The web is a _crucial_ component of the information systems that allow these
collaborations to function at all.

~~~
ktpsns
Of course it is, science works differently then 30 years ago. But the output,
at the end, is still papers which look not only like 30 years ago, but like
100 years ago!

With Latex, we have a powerful tool at the hand which makes sure every single
student can write himself a perfectly shaped PDF which looks timeless.

It doesn't even matter whether your favourite open access journal renders the
paper as HTML -- they only took the Latex and transformed it.

It also doesn't matter that we have meta search engines for literature
references (for instance [http://inspirehep.net/](http://inspirehep.net/) or
[https://ui.adsabs.harvard.edu/](https://ui.adsabs.harvard.edu/)), or that we
do have archives for uploading scientific data
([https://zenodo.org/](https://zenodo.org/) or in general
[https://www.re3data.org/](https://www.re3data.org/)): The papers are still
non-interactive, still linear (not clickable hypertext).

Science is old fashioned and slowly moving...

~~~
SiempreViernes
The output of science is human knowledge, the printouts is only the transport
layer. For conveying results, the fact is that making graphs with sliders is
usually _not worth the effort_ : you can always make a static figure that
tells the same story, and usually with much less effort spent on making sure
your sliders don't show anything distracting.

You seem to object simply on the basis that an existing system is old, do you
also find it objectionable that some typefaces we use can be traced back
thousands of years?

~~~
ktpsns
Just as much as "a picture is worth a thousand words", I claim a movie _can_
be worth a thousands of pictures. Of course it heavily depends on the research
field. I recently worked in fluid dynamics where it is natural to watch movies
and publications only have still images, which is always worse. Everybody
finds them worse but nevertheless the community sticks to an overtaken way of
sharing results.

------
pablobaz
"Over the next couple months, we added Numpy, Pandas, and Matplotlib"

The python data stack running in web assembly!

~~~
paulgb
And it's also available standalone for other applications!

[https://github.com/iodide-project/pyodide](https://github.com/iodide-
project/pyodide)

Hats off to the team, this is some really neat stuff and I'm happy to see it
coming from Mozilla.

------
mrkstu
Instead of being targeted directly at scientific markets, I'd love to see a
more generalized 'smart document' version of this. The promise of HyperCard,
Glue, OpenDoc and even OLE of compound, programmable documents is something
I've been looking for for decades.

I'd love to see someone come up with a path taking something like this or
Jupyter and have it target a wide market and extend the capabilities in an
accessible way. I think you'd blow half steps like Airtable out of the water.

------
dlukes
It's impressive how streamlined matplotlib plotting is and how well it works
-- you just import matplotlib and start plotting, you can have multiple
interactive plots alongside each other. Especially compared to Jupyter, where
it's unfortunately sort of clunky (interactive plots first have to be enabled
with %matplotlib notebook, and then you can only have one at a time, you have
to manually "freeze" the previous one before you start a new one, or weird
stuff -- overplotting -- happens).

To be clear, I love Jupyter, and I think it's especially great for teaching
beginners (especially because it has "real" cells, as in GUI widgets, though I
do get the appeal of a flat plain text format for advanced users). But
plotting has been a bit of a stumbling block, whereas the way it works in
Iodide blew me away.

------
smackay
This is the future I want: tools so anybody who has the inclination can
publish interesting things for anyone to see.

Imagine if web servers were just standard containers and services which anyone
could upload applications to. That would take us to a decentralised internet
once again. No more centralized, fossilized, web application with stacks that
are impossibly complex that only the original developers could change. All the
power and innovation would be put in the hands of the content creators once
more and the internet would just be infrastructure. Sound familiar? I hope so.

Time to program like it's 1999.

~~~
SiempreViernes
<blink> here we go! </blink>

------
mindcrime
There is a sense in which this is pretty cool... even _very_ cool. And I'm all
for anything that makes scientific / data-oriented analysis and exploration
more accessible.

But on the other hand, I remain unsure that it makes sense to continually try
to push _everything_ into the browser. Take:

 _Iodide documents live in the browser, which means the computation engine is
always available. Whenever you share your work, you share a live interactive
report with running code. Moreover, since the computation happens in the
browser alongside the presentation, there is no need to call a language
backend in another process. This means that interactive documents update in
real-time, opening up the possibility of seamless 3D visualizations, even with
the low-latency and high frame-rate required for VR._

I mean, yeah, OK, there are aspects of this that make sense. But there are
always tradeoffs. Take, for example this point: _" there is no need to call a
language backend in another process"_. This also means that you're limited to
the processing power available on your local machine, which is - BTW, being
shared among everything running on your computer.

I'm not saying that Iodide is bad, mind you. But it - like any other tool -
may not be appropriate for everything. As a corollary to that, I think it
might be a fun experiment to see what it would take to provide an ability to
move the computationally expensive parts between the local computer and a
remote $BEEFY_HOST in a seamless way.

------
kasperset
Interesting to see this tool along with Observablehq.

------
codeisawesome
I like that when scientists don’t like a tool they write a white paper
complaining about it (the HAL paper linked in this article) =D

------
j0e1
> Pyodide: The Python science stack in the browser

You have convinced me to try this now!

------
ZeroCool2u
The SWE in me is very enthusiastic about this. I love the push that Mozilla is
making with WASM in really practical and tangible ways.

That being said, I have a hard time seeing myself moving from Python to JS for
any 'real' data science work when I get a lot of the more advanced viz
features here for free from libraries like plotly without having to touch JS
and with similar or better performance. Not to mention, I don't have any
desire to move away from PyCharm after getting comfortable with and really
taking advantage of of its full feature set.

I think for small projects this could be very useful, especially with GDocs
style real time collaboration, but for now I can't see myself or my teammates
taking advantage of this.

That being said, I vote full steam ahead and lets see where this takes us!

~~~
hckr1292
If I'm reading the near the end of the post correctly, they actually compiled
Numpy, Pandas, SciPy, and scikit-learn to WebAssembly and have one video at
the end of the post showing a python-only visualization running in the
browser.

~~~
callahad
You are reading that correctly.

------
eggy
I want to see APL ported to this, specifically Dyalog APL. APL is such a great
math/data language, and with Co-dfns for GPU computing it would be great. Shen
[1] would also be cool on this.

[1] www.shenlanguage.org

~~~
hamilton
Feel free to reach out to us on Gitter [https://gitter.im/iodide-
project/iodide](https://gitter.im/iodide-project/iodide) if you're interested
in doing this. If you know anything about compilation, it's pretty
straightforward, depending on the language & what's happening under the hood.
Here are our docs on language plugins:

[https://iodide-project.github.io/docs/language_plugins/](https://iodide-
project.github.io/docs/language_plugins/)

~~~
eggy
I know very little about compilation, but I'm going to look at the link later,
and get back to you. Thanks for the links!

------
kbumsik
I just read the documentation of JSMD, which is Iodide's flavor for Markdown
[1].

So they made a Markdown syntax which is capable of running JS and Python, and
they name it JSMD.

Just nitpicking but they probably want to come up with a more suitable name
other than JSMD. I'm genuinely amazed by this project though.

[1]: [https://iodide-project.github.io/docs/jsmd/](https://iodide-
project.github.io/docs/jsmd/)

~~~
hamilton
(iodide dev here) Yeah, that's a good point. We called it JSMD before we even
thought of starting Pyodide, and in hindsight seems a bit constricting.

~~~
kbumsik
Thanks for your comment. It is probably not too late to change the name
because it's alpha yet. It may be misleading for newcomers, when JSMD tries to
support even more languages through plugins.

Other than that I love the design of the syntax, especially raw cell seem so
great to me. I'm often supersized by the fact that both Markdown and Jupyter
don't have the official ways to insert comments. Fetch cell is also a smart
idea.

------
ktpsns
I like how the first comment at the end of the page asks:

> It’s like JupyterHub, but for people who only know javascript?

That also was my feeling. And since Jupyter is language agnostic, why not just
run a JavaScript kernel, such as
[https://github.com/n-riesco/ijavascript](https://github.com/n-riesco/ijavascript)
. It looks somehow as if Iodide is exactly that.

~~~
ropeladder
Isn't a big difference that all of this is running your code on the front end?
(Or am I misunderstanding how these work?)

------
bayesian_horse
I was trying to make coroutines work through the javascript event loop, such
that you could basically "await" any javascript Promise (or wrap a Promise in
an awaitable).

So you'd have things like 'await sleep(1)' which would be implemented with a
Promise and setTimeout. Or 'await fetch("/api/v1/list")'.

Unfortunately I haven't gotten very far yet.

~~~
bijection
I'm pretty sure you can await any javascript Promise!

For example, running `await Promise.resolve(3)` in Chrome's js console prints
`3`.

~~~
alexkavon
Also MDN has a fantastic Promise article with examples about wrapping a
function with a promise.[0]

[0] [https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Promise)

------
kbumsik
After having a quick look, I found that they use Emscripten and it is capable
of compiling it to JS (asm.js) as well as WebAssembly. So the whole Pyodide
stack can be compiled to JS.

I'm wondering how the performance looks like when running Pyodide stack on JS.

~~~
mesaframe
ASM.js is not the JS you use. It's follows a different spec, and it's way
faster than JS but slower than WASM.

~~~
kbumsik
I'm not sure how that matters. It is still JS, it can run on any JS engine
even without transpiling. I just wanted to know the exact performance
difference between the two different compiled outputs.

------
xvilka
What is the difference with Jupyter/JupyterLab?

~~~
eggy
Jupyter follows Mathematica's input and output cell format. JupyterLab uses
split windows, and is closer to Iodide from what I can tell, but Iodide is
running in WebAssembly, they ported Python and associated libraries to
WebAssembly. I am still looking though.

