News for hackers. Stuff that matters.
Re:Jupyter Receives the ACM Software System Award by gbrown on Wednesday May 02, 2018 @12:13PM (#16978422)
Am I the only person in the universe who doesn't like Jupyter? I much prefer tools like Rmarkdown and Sweave.
Re:Jupyter Receives the ACM Software System Award by chubot on Wednesday May 02, 2018 @01:14PM (#16979057)
I've been using Python for 15 years, and I also haven't gotten into Jupyter. I worked with some research scientists who used it, but even they ported their programs to plain text files in order to get version control with textual diffs (which is IMO better for collaboration.)

One reason I don't use it is that I started doing data science before the Python ecosystem was viable -- before Pandas existed. I use R for data science (which I generally find superior due to Hadley Wickham's libraries).

I know Jupyter supports R now, but I already had a terminal/web-based workflow by the time that happened.

-----

More importantly, I think this recent blog post finally crystallized why I don't program in REPLs: Because they encourage global variables! I naturally structure my code into functions from the outset.

I don't like the persistence because it can lead to "wrong" programs. I prefer to test my programs with a "clean slate", i.e. by starting a new process.

http://willcrichton.net/notes/programming-in-the-debugger/

Jupyter’s structure of delimited code cells enables a programming style where each can be treated like an atomic unit, where if it completes, then its effects are persisted in memory for other code cells to process.

However, this style of programming with Jupyter has its limits. For example, Jupyter penalizes abstraction by removing this interactive debuggability.

In other words, if you put all your code in functions like I do, then Jupyter doesn't add anything. It doesn't let you "step through" the function like a debugger does.

Though, I think that I should somehow try to get over this because there are a lot of benefits to something like Jupyter, like having graphics inline.

Or maybe Jupyter just needs an integrated debugger? And maybe the ability to clear state or tree-walk definitions? I don't like having unused definitions laying around in my workspace.

Also, does Jupyter have any notion of data flow? I don't think it does, because Python doesn't. I think Observable might address some of my gripes, but I haven't tried it yet:

https://beta.observablehq.com/

Re:Jupyter Receives the ACM Software System Award by breatheoften on Wednesday May 02, 2018 @03:46PM (#16980508)
Your complaints resonant strongly with me.

I'd really love an ideally typed expression-oriented language to take notebook programming to the next level ... This is my dream for what I want from swift notebooks ...

Something that:

- memoized all (non-loop?) values created in the notebook file scope

- automatically invalidated memoized entries after source change using control flow analysis and code coverage data from previous runs

- provides an approximation of the conceptual model of re-running the whole notebook 'from the beginning' when the notebook is executed -- but pulls memoized values from the memoized cache when present to make execution fast and to avoid repeating side-effects

- allowed for easy to issue interactive 'invalidate all memoized entries before/after here' operations in the notebook file ...

- involving editing code normally in a regular source-file in ide (with maybe a different extension to imply the different execution semantics)

- allowed for execution of code in debugger when desired without having to change anything ...

- supported inline graphical representations

- supported wiring custom graphical ui models into the notebook's execution context ...

Re:Jupyter Receives the ACM Software System Award by jashkenas on Wednesday May 02, 2018 @06:34PM (#16981746)
Fantastic list!

I'd encourage you to give https://beta.observablehq.com a try. From all of your points — aside from a statically typed language and editing in your normal IDE — we try to hit that target on the nose.

Every cell is only reevaluated when any of its inputs changes, inline and custom graphical representations can render your live data — and even be used as values to be passed themselves as inputs to other cells. For a very simple example, see: https://beta.observablehq.com/@mbostock/d3-brushable-scatter...

Re:Jupyter Receives the ACM Software System Award by chubot on Wednesday May 02, 2018 @08:55PM (#16982470)
Yes, in short, I think we both want the "dataflow model" and not the "stateful update" model.

If anything should use the dataflow model, it's data analysis!!!

And yes that's why I mentioned Observable, and I'm glad jashkenas also responded. As far as I understand, it's like a spreadsheet, so when you update your inputs, the outputs become consistent automatically.

It's sort of like Make (or perhaps Make in reverse). Dataflow also allows your code to be parallelized. Some scientists don't care about this, but engineers do. It's an eye-opening experience to speed up naive data analysis by 1000x or more with shell scripts and a little C++.

Re:Jupyter Receives the ACM Software System Award by FrojoS on Thursday May 03, 2018 @04:00AM (#16984159)
I agree on the global variables. At least you can define functions in blocks of the same notebook file.

e.g.

[1] a = 2 [2] def square(x): return a 2 print square(a) > 4

[3] b = 5 print square(b) > 25

This is something that you can't do in MATLAB, which I still use primarily. In MATLAB you have to create a new file for each function. Which nulls the readability of the script (notebook) when you publish it, because the source of the functions is not included. So, if I write a MATLAB notebook that I want to publish and share, I end up avoiding to create functions for as long as possible and instead use copy paste ...

Currently, some of the main thing that keeps me with MATLAB regardless is: a) It feels more responsive, probably because its a native app and not running in the browser. b) I don't like to work in the browser. Its distracting. c) I like the profiler, debugger and workspace (constant visual inspection of global variables in a separate window) of MATLAB which comes right out of the box. For python/Jupyter I have to set this up manually.

Note: MATLAB now has an 'interactive script' function that is similar to Jupyter, but it is so slow for > 100 loc, that it's completely useless. Even the Mathworks developers admit this. Instead I use %% to seperate my MATLAB scripts into executable blocks (ctrl + enter) and then use the 'publish' function to create a LaTex file which I can then compile to pdf. This creates vector based math formulas and figures (which 'publish to html / pdf' doesn't).

Re:Jupyter Receives the ACM Software System Award by chubot on Thursday May 03, 2018 @05:08AM (#16984424)
Hm that limitation sounds severe! Functions are essential. I actually don't remember that, but I last used MATLAB like 15 years ago! I've done a lot more data science than linear algebra in the last decade.

It sounds like RStudio might be a better model for what we want:

https://en.wikipedia.org/wiki/RStudio (click on the screenshot)

It only works with R, but a lot of people say great things about it.

I saw another commenter say that Jupyter is more like Mathematica notebooks, and RStudio is more like MATLAB. I think this sounds right.

In the former, the interactive experience is more central. In the latter, you are developing a program, and the IDE helps you do it interactively. But the program is central. (At least this is true for R, it sounds like it might not be as true for MATLAB. But I know that pretty large programs are written in MATLAB.)

For now I'm still sticking with my highly-custom shell-based workflow. But I do want to make interactive graphics less painful. Right now I juggle a web browser, a terminal, a text editor, and an R REPL!

Re:Jupyter Receives the ACM Software System Award by targafarian on Saturday May 05, 2018 @12:49AM (#17000379)
If you compare RStudio to matlab, then is Spyder for python more what you're interested in, an IDE with interactive code execution, variable inspection, and debugging? https://en.wikipedia.org/wiki/Spyder_%28software%29
Re:Jupyter Receives the ACM Software System Award by david_garrison on Monday May 07, 2018 @09:51AM (#17012671)
You can define functions in a MATLAB script. That was added in R2016b (september, 2016)
Re:Jupyter Receives the ACM Software System Award by celias on Thursday May 03, 2018 @03:14AM (#16983962)
Take a look at Cauldron, aka the unnotebook -http://www.unnotebook.com The author discussed it on pocastinit episode 111 - https://www.podcastinit.com/episode-111-cauldron-notebook-wi...
Re:Jupyter Receives the ACM Software System Award by chubot on Thursday May 03, 2018 @05:01AM (#16984389)
Thanks, I hadn't heard of it! Looks interesting.
Re:Jupyter Receives the ACM Software System Award by jasongrout on Wednesday May 02, 2018 @12:24PM (#16978561)
We would love to hear what you like about Rmarkdown and Sweave. Jupyter tooling is always improving, and we are very interested in engaging with users about their needs, and helping grow the ecosystem to be able to address those.
Re:Jupyter Receives the ACM Software System Award by nerdponx on Wednesday May 02, 2018 @12:47PM (#16978814)
My biggest frustrations with Jupyter are (see #4 for comments on Sweave etc):

1. The default front-end is a weak platform for getting work done.

It's a JavaScript code editor. It will never be as good as my personal text editor configuration. It will never be as good as an IDE like RStudio, Spyder, or Pycharm. It's good that there are keyboard shortcuts for doing things like adding cells, and extensions for things like folding cells and adding a table of contents. But it still isn't terribly comfortable to use all day. Also I personally hate doing everything in a browser. Apart from some useful notebook extensions, there are no viable alternative front ends yet.

2. Running a remote kernel is a pain in the ass (cat a config file then manually tunnel 4 ports over SSH), and I can't seem to get it to work on Windows at all.

This is an issue at my company because we do a lot of work on remote servers that can be accessed only through SSH or JupyterHub. Individual users do not have control over the latter, so we are stuck with the inadequate default experience I just described above.

3. No kernel other than Ipython is mature.

IRKernel is getting there. Everything else is at best a beta-quality product.

4. Notebooks are not a plain text file format.

Hand editing a notebook is messy. They do not play well with version control systems and diff tools. RMarkdown and Knitr/Sweave are just preprocessors for established plain text formats (Markdown and Latex with some extra syntax). With those formats you can take advantage of a wealth of existing tooling, as well as having the freedom to edit the file in a normal text editor without having to rely on a special front end. Ironically having everything formatted as JSON should make it easier to write those special front ends, but I have not seen any good ones yet.

Re:Jupyter Receives the ACM Software System Award by chubot on Wednesday May 02, 2018 @01:29PM (#16979190)
Wow this was really useful. I was feeling guilty for not trying Jupyter, after using Python for 15 years and doing data science for much of that time.

I hear so many good things about it. I wrote this comment about it:

https://news.ycombinator.com/item?id=16979057

But ANY of those four is is a dealbreaker for me. I want to use languages other than Python, with remote kernels, and I want version control. And I like my text editor to be really fast.

I think it comes down to a scientific background vs. a software background. I've memorized a boatload of tools and weird shell incantations, but the result is that I have a more solid workflow than Jupyter provides. Solid in the sense that it is likely to produce reliable results, not that it's "easier".

But if you don't have that software engineering background then I understand that Jupyter makes a whole bunch of things easier. It's not optimal in my view, but it's easier.

Re:Jupyter Receives the ACM Software System Award by fundamental on Wednesday May 02, 2018 @01:10PM (#16979020)
Great set of complaints per Jupyter. I think the project is an excellent idea, but it needs to become more mature. I've used it for some prototyping, but it isn't the polished experience you'd like. The web browser is good for looking at the results, but pretty terrible for editing and developing. I'm hoping that with time there will be:

- better front end integration - e.g. a separate vim process connecting/editing cells of a running notebook and updating the browser view on each change

- Fewer bugs and more parity between the python kernel and non-python kernels

Re:Jupyter Receives the ACM Software System Award by goerz on Thursday May 03, 2018 @06:49PM (#16990728)
To address “hand editing” problem I wrote a little vim plugin that wraps around notedown (https://github.com/aaren/notedown) to edit notebooks on the fly in a markdown format. It’s not perfect, but it goes a long way for quickly editing notebooks “as a whole”: https://github.com/goerz/ipynb_notedown.vim

Other than that, I try to put any lengthy code in functions that are in a module alongside the notebook, so that the notebook mostly contains one-line commands to do kick off a calculation or to generate a plot. I also have a shortcut that copies the content of the current browser text field (notebook cell) into MacVim, and pastes it back automatically as soon as I close the editor.

Re:Jupyter Receives the ACM Software System Award by wenc on Wednesday May 02, 2018 @02:36PM (#16979901)
1. Jupyter Lab (note: NOT Jupyter Notebook) is an attempt to make the interface more IDE-like. It's still not Rstudio due to the Jupyter's notebook nature, but it's close enough for me.

I do prefer Rstudio's REPL approach of being able to run code by line or by blocks (likely inspired by MATLAB's IDE), rather than Jupyter's approach of executing code by cell (which was inspired by Mathematica). They both let you try stuff out easily while maintaining state, but the former is far easier to productionize.

2. Remote kernels over SSH aren't that hard -- I do this all the time via SSH tunnels. I start Jupyter Lab in an SSH console (usually on a cloud-based VM), and create a tunnel to port 8888 (the default) using my Windows SSH app (Bitvise). 1 port. That's it.

3. No comment - I only use the Python kernel.

4. Correct. Notebooks do present challenges for version control.

Re:Jupyter Receives the ACM Software System Award by nerdponx on Wednesday May 02, 2018 @08:12PM (#16982262)
Remote kernels over SSH aren't that hard -- I do this all the time via SSH tunnels. I start Jupyter Lab in an SSH console (usually on a cloud-based VM), and create a tunnel to port 8888 (the default) using my Windows SSH app (Bitvise). 1 port. That's it.

I want the opposite. I want to use a remote kernel with a local client.

Re:Jupyter Receives the ACM Software System Award by wenc on Wednesday May 02, 2018 @10:14PM (#16982852)
Umm, yes, in my case, the kernel is running remotely on a cloud VM. My client is a local browser (Chrome) which connects to localhost:8888, which is a tunnel set up to connect to the remote machine on port 8888.

This lets me run computationally heavy Jupyter calculations on a beefy remote backend in the cloud. My local browser merely talks to that backend via a tunnel.

Here's something on the web that describes this [1] -- except with Bitvise on Windows, you don't have to enter any SSH commands. The tunnel setup etc. is all done via a GUI. This is a pretty standard SSH tunnel technique. You can use this for more than just Jupyter.

[1] http://www.vickyfu.com/2017/04/using-jupyter-notebook-remote...

Re:Jupyter Receives the ACM Software System Award by nerdponx on Wednesday May 02, 2018 @11:26PM (#16983138)
Again, that's not what I mean. I want to run Jupyter (or some other front-end) on my laptop and have it talk to a kernel running on a server. You're describing running both Jupyter and the kernel on the server.
Re:Jupyter Receives the ACM Software System Award by wenc on Thursday May 03, 2018 @03:28PM (#16989051)
Oh I see now. You want to run the raw kernel with no front-end on the remote machine and communicate with it via the 0MQ/JSON transport layer. I'm curious, what is the advantage of doing this vs. simply running an instance of Jupyter on a remote machine?
Re:Jupyter Receives the ACM Software System Award by nerdponx on Saturday May 05, 2018 @05:26PM (#17003924)
I don't necessarily want to use Jupyter as the front end. This way lets me use e.g. Pycharm with the kernel running in a console.

BTW I managed to get it to work. I think I had missed a port the first time I tried.

Re:Jupyter Receives the ACM Software System Award by takluyver on Wednesday May 02, 2018 @01:43PM (#16979376)
Remote kernels: I'm working on some infrastructure that should make this easier, but it's still some way off being ready.

Kernel maturity: the Julia and Haskell kernels are pretty well supported, I understand, though I haven't used them myself.

Alternative frontends: Emacs IPython Notebook is pretty well maintained, if that's to your taste.

Re:Jupyter Receives the ACM Software System Award by d0mine on Wednesday May 02, 2018 @02:53PM (#16980054)
See whether you'd like Org-mode + Babel. Example: https://youtu.be/dljNabciEGg
Re:Jupyter Receives the ACM Software System Award by gbrown on Wednesday May 02, 2018 @12:50PM (#16978833)
Using a web browser as an IDE just seems like a solution in search of a problem. Also, maybe I just never spent enough time working with Jupyter, but it seemed to me that it encourages a sort of exploratory workflow, really well suited to teaching programming and data science. It was less clear to me how it could be used well in production environments.

I use Rmarkdown and Sweave to write homeworks for my students in a very Jupyter way. I also use them to generate data driven static webpages, procedurally generate production quality and easily formatted PDF and HTML reports. I also use them as a templating system for auto-generated model diagnostic emails. Perhaps I need to return to Jupyter to see what I'm missing, but I don't really know what purpose it would serve, or what kind of work it would make easier.

Re:Jupyter Receives the ACM Software System Award by takluyver on Wednesday May 02, 2018 @01:38PM (#16979299)
Doing the interface in the web browser has its ups and downs: it makes some things more awkward locally, but it's easy to deliver the same interface remotely - e.g. a university can run a JupyterHub instance for a course, and students visit a URL and login. nteract is an attempt to make a notebook interface as a local application.
Re:Jupyter Receives the ACM Software System Award by gbrown on Wednesday May 02, 2018 @01:51PM (#16979468)
For sure, I totally see how it's useful as a teaching tool. I don't see how it fits into a proper production system.
Re:Jupyter Receives the ACM Software System Award by carreau on Wednesday May 02, 2018 @02:08PM (#16979649)
Different system and requirement need different tools, if you prefer text editor. Depending on your preference look at Emacs IPython Notebook, the Jupyter VS-Code extension, or Atom Hydrogen. That will basically let you select chunk of code and execute in a kernel. You do not have to use the notebook format, or the browser based editor.

JupyterLab also allow Rmarkdown-like workflow where code-blocks in a markdown document can be executed to display graph.

I believe the important part is to allow interoperability between different ways people want to work. You can't have 1 size fits all, and there are still a lot of work that can be done to cover some use case.

Re:Jupyter Receives the ACM Software System Award by takluyver on Wednesday May 02, 2018 @04:43PM (#16980972)
This may depend on what you mean by 'proper production system'. It's definitely meant to complement, not replace Python modules, scripts and so on. I wouldn't write a web app in a notebook. But the LIGO team that discovered gravitational waves published a notebook demonstrating their data analysis.

I see it as useful where illustrating and explaining some computational steps is at least as important as executing them. Teaching is one obvious use case, but it's also valuable for sharing scientific methods, documenting a library with runnable examples, or presentations at programming conferences.

Re:Jupyter Receives the ACM Software System Award by asdlllkasdasd on Wednesday May 02, 2018 @12:38PM (#16978720)
Rmarkdown has the better version control story.
Re:Jupyter Receives the ACM Software System Award by goerz on Thursday May 03, 2018 @07:22PM (#16990894)
The number one feature request by far at this point would be collaborative features in the notebook. Not really because I actually want to collaboratively edit a notebook with others, but because I would like to open the same notebook in two separate browser windows (side-by-side), and edit a cell at the top of the notebook in one, and a cell at the bottom in the other, and have things get merged automatically. Or, not having to worry that I left a (remote) notebook open on my work computer when I connect to the same server from home, causing parts of the notebook to be accidentally overwritten.
Re:Jupyter Receives the ACM Software System Award by targafarian on Saturday May 05, 2018 @01:02AM (#17000408)
JupyterLab has the ability to open multiple "views" on the same file. http://jupyterlab.readthedocs.io/en/latest/user/notebook.htm...
Re:Jupyter Receives the ACM Software System Award by goerz on Sunday May 06, 2018 @01:09AM (#17005304)
That's amazing! I'll have to try out JupyterLab sometime very soon. I was holding out because I'm using a whole bunch of plugins for the classic notebook from https://github.com/ipython-contrib/jupyter_contrib_nbextensi... that I think have't been ported yet
Re:Jupyter Receives the ACM Software System Award by mschuetz on Wednesday May 02, 2018 @01:51PM (#16979472)
I guess it would be nice to make it run within an electron environment, without extra console and browser tabs to run it in. Just jupyter running as an electron app with maybe tabs for each notebook to give it a more native desktop app feel.
Re:Jupyter Receives the ACM Software System Award by po84 on Wednesday May 02, 2018 @01:57PM (#16979541)
Check out https://nteract.io/. It's based on Jupyter standards (protocol, kernels, notebook format), written in JS, and runs on your desktop.
Re:Jupyter Receives the ACM Software System Award by yiyus on Wednesday May 02, 2018 @04:00PM (#16980637)
I don't use it because I'm used to other things, but I really love the concept and I am sure I would be a user if it had existed some years ago. More importantly, I know it is doing a great job helping many scientists. Other tools like the ones you mention may improve certain aspects or fit better in some workflows, but Jupyter is the clear leader in the field, it is the one that changed the state of the art, even although some similar tools already existed and new (and maybe better) ones will come. I think the award is well deserved.
Re:Jupyter Receives the ACM Software System Award by gbrown on Wednesday May 02, 2018 @05:15PM (#16981218)
I think the workflow is great for the web tutorials I see all over the place, and I'm sure it's a pretty good fit for exploratory data analysis and model building. On the other hand, I see a lot of people pushing it as the must have tool for data science broadly, and I just don't see it fitting into most production workflows.

When a model and the associated data pipelines hit production, they need to be version controlled - plain text files can't be beat for that. The idea that the same tool should be both IDE and report is also very strange to me - I can see how it lowers the barrier to entry in some cases, but it doesn't seem optimal for most uses.

I do agree that Jupyter has helped a lot to get reproducibility on people's radars, and that's a positive thing.

Re:Jupyter Receives the ACM Software System Award by jncraton on Wednesday May 02, 2018 @03:08PM (#16980182)
You are definitely not alone. I personally use pweave, which is essentially a thin Markdown/LaTeX parser wrapping Jupyter kernels for injecting the output of code chunks.

I like being able to use my existing tools (text editor, make, version control, etc). I also like being able to write clean functions and run unit tests while still ultimately being able generate a clean final document.

Re:Jupyter Receives the ACM Software System Award by nicodjimenez on Wednesday May 02, 2018 @06:36PM (#16981759)
I agree. My big issue with Jupiter is that it tries to replace the command line instead of augmenting it. I want a web app that is a full fledged Linux command line plus some API's for visualizing information, don't think that exists yet. I just cannot work in any environment that doesn't support VIM + tmux + linux command line utilities.
Re:Jupyter Receives the ACM Software System Award by andrewla on Wednesday May 02, 2018 @03:58PM (#16980617)
I'm with you (although you should check out knitr on the R side).

I see two use cases for this sort of notebook thing. One is reproducible research, where I find that a woven solution is far preferable over a notebook. I can use version control to assist in iteration, and use an editor of my choice. The other is exploratory analysis, which Rmarkdown/Sweave/knitr is not really a good substitute for.

For exploratory analysis, I've found that I use the terminal integration in Vim together with the REPL works well for this. It lets me save half-working stuff and record some of my thought process; in a Jupyter notebook the only things I can leave in are working code snippets.

Re:Jupyter Receives the ACM Software System Award by your-nanny on Wednesday May 02, 2018 @11:25PM (#16983133)
I use the reply for exploration, and my notebook for final product. Do same in Matlab, but just with code.
Re:Jupyter Receives the ACM Software System Award by ILikeConemowk on Wednesday May 02, 2018 @12:44PM (#16978788)
>Am I the only person in the universe who doesn't like Jupyter?

Yes ;]

Re:Jupyter Receives the ACM Software System Award by pmarin on Wednesday May 02, 2018 @01:16PM (#16979075)
I would like something like make for notebook cells inside a repl.

I would write the notebook in my text editor (not in a web form) execute "reload" in the repl, execute the cells that have been changed and render the webpage. The output should be a complete self contained html file with everything else embeded and of course not a single line of javascript.

Re:Jupyter Receives the ACM Software System Award by po84 on Wednesday May 02, 2018 @01:55PM (#16979511)
If I understand you correctly, a combination of http://ipython.readthedocs.io/en/stable/interactive/magics.h... and http://nbconvert.readthedocs.io/en/latest/execute_api.html might get you there. Post if you build something like this!
Re:Jupyter Receives the ACM Software System Award by chubot on Wednesday May 02, 2018 @01:21PM (#16979111)
BTW I'm pretty sure that this is exactly what Sweave is. You write in a text editor, and then invoke a batch process to generate an HTML file with mixed code and data.

Wikipedia says it does incremental rebuilding, which was news to me. I've never used it, but I know a lot of R users who use it.

https://en.wikipedia.org/wiki/Sweave

Re:Jupyter Receives the ACM Software System Award by tincholio on Friday May 04, 2018 @01:23AM (#16992371)
Nope... you're not the only one