4 ms·
As a result of the serialize-to-json approach, jupyter supports R, python, scala, go, lua, bash, julia, and haskell, among others. Its accessible to a much wide
by joshuamorton 8y ago
As a result of the serialize-to-json approach, jupyter supports R, python, scala, go, lua, bash, julia, and haskell, among others. Its accessible to a much wider range of programmers, at the cost of version control being a bit weirder.
- jonnycomputer 8y agoIt might be the case that serializing to json facilitates support for multiple languages, though I wonder how. With the reticulate package in R Markdown you can run python chunks, by putting, e.g. ```{python} for i in range(1:10): print("{}:{}".format(i, i*i)) # etc ``` And in emacs org-mode you can: #+begin_src python for i in range(1:10): print("{}:{}".format(i, i*i)) #+end_src Language support in org-mode is pretty comprehensive, afaik. I do not know the details of the implementations behind these, but my own source code is plain and simple unserialized text, and that means a lot to me.
- joshuamorton 8y agoAh, actually it looks like I'm somewhat mistaken. R Markdown supports other languages as well. I think the real difference is that it doesn't look like R Markdown supports partial evaluation. By that I mean that that to share the r-markdown doc it appears that you need to rerun the whole thing. It does some tricks to do concurrent visualization, but to actually share the doc you have to rerun all the R/python from scratch. In jupyter OTOH, if I have a long running ML pipeline as part of my doc, I can render without rerunning the pipeline.
- huac 8y agoYou can cache the results of an rmd cell, and you can also share the rendered version of the doc first. You're right that there's a higher emphasis on "run the whole thing," and I think that that's a conscious (and acceptable) design choice vs not being sure that the shared doc will run as provided.
- joshuamorton 8y agoYeah I don't disagree about that, but when the question is why is this ugly format more popular, the answer "one has a share button and the other can be edited in emacs" sort of gives you the answer.
- taeric 8y agoThat is a complete non-sequitur. Json in no way enables that. Just having a defined format enables that. Emacs org-mode is proof that a simple text format with markup rules is all you really need to support multiple languages in a single file. You lose some of the simplicity of parsing the file, but you gain a ton more.
- kortex 8y agoJson enables you to chuck the notebook to any browser client anywhere on the net. Org-mode is great, but you still have to install emacs.
- taeric 8y agoEmacs is, amusingly, a lighter client than most browsers nowadays. On point, a browser can not remember ifa notebook. Just parse the json. It can also parse text/plain. So, could show the org document without styling. The org document is actually readable. Json... Not so much. To see the notebook, you have to have a Jupyter setup somewhere. Edit: For example, see https://raw.githubusercontent.com/taeric/taeric.github.io/master/ChangeForDollar.org https://raw.githubusercontent.com/taeric/taeric.github.io/ma... which is the source for http://taeric.github.io/ChangeForDollar.html http://taeric.github.io/ChangeForDollar.html Not styled, and that is a short document, so probably woudn't be that tough to read in a json document, but I'm glad I don't have to.
- PurpleRamen 8y agoHow is a notebook without proper software to handle it in any way more useful then other structured plaintext-file? Yes, JSON can be prettyprinted in a browser, but what then? It's still a useless mess you can't work with.
- rtpg 8y agoThis isn't true though, right? If you were writing an org mode document about org mode, you now need an escaping mechanism to not mix your structure and text Multi-language parsing is much harder to solve than simply enforcing some escaping mechanism in the inner protocol level and having tools do the "heavy" lifting (basically a solved problem).