News for hackers. Stuff that matters.
Re:I decided not to commercialize nbdev by enriquto on Wednesday May 31, 2023 @04:27PM (#36143852)
> For practical purposes, you cannot perform code reviews of notebooks on GitHub without purchasing a tool called ReviewNB.

This is false. If you save your notebooks with jupytext, they are just plain python files that can be reviewed normally.

Re:I decided not to commercialize nbdev by crimsoneer on Wednesday May 31, 2023 @06:16PM (#36145134)
... so you're not doing reviews on your notebooks. Your downloading a plugin that converts your notebooks, then doing reviews there.
Re:I decided not to commercialize nbdev by qbasic_forever on Wednesday May 31, 2023 @09:30PM (#36146663)
No, jupytext converts the binary .ipynb format into a text format that can be diffed and reasoned about like any other code in a git repo. It hooks into jupyter lab such that it automatically keeps both the .ipynb and text source version of a document in sync. How you review the text version is up to whatever source control system and other tools you use.
Re:I decided not to commercialize nbdev by protoplancton on Thursday June 01, 2023 @03:09AM (#36148337)
Note: ipynb is not binary, it's plain text containing a json object
Re:I decided not to commercialize nbdev by nl on Wednesday May 31, 2023 @06:37PM (#36145344)
Heavy notebook user here.

This isn't the same at all.

Often in a well done notebook you'll have data display etc which doesn't translate well to a plain python file.

Re:I decided not to commercialize nbdev by hoosieree on Wednesday May 31, 2023 @08:35PM (#36146334)
Alternatively, use org-mode and save your file with the save button.
Re:I decided not to commercialize nbdev by mloncode on Wednesday May 31, 2023 @08:44PM (#36146378)
I think a notebook is VERY different than an ephemeral REPL. I think that is worth considering when thinking about generating docs, tests and source code from a single source of truth (as opposed to separate files).
Re:I decided not to commercialize nbdev by hoosieree on Wednesday May 31, 2023 @08:50PM (#36146420)
Do you know what org-mode is?

[editing to be less snarky and more helpful]

I agree with your comment, but I do in fact use org-mode as a single source of truth document that can export documentation, tests, source code, and all that jazz. From what I can tell nbdev and org-mode are about the same in terms of features. It doesn't need any special post-processing to make git-diff useful, because org-mode's file format is plain text.

Re:I decided not to commercialize nbdev by mloncode on Wednesday May 31, 2023 @09:16PM (#36146571)
No snark interpreted at all. Yes I am well aware of org mode and love it! I think it is fantastic. There are some key differences that I think make notebooks a bit more interesting - however it sounds like you've made a system you are happy with? I would love to see what you have! Mind sharing it?
Re:I decided not to commercialize nbdev by hoosieree on Wednesday May 31, 2023 @10:00PM (#36146790)
Cool, I also wanted to say that I think nbdev looks great, and while I think it and org-mode get similar results, the user experience is surely quite different compared to emacs.

My org-mode workflows start with doom-emacs[1] because otherwise Emacs customization is too much of a time sink. I've written a couple peer-reviewed papers in org-mode (exporting to pdf), my blog is written org-mode (exported to html), and I've done the "literate" thing witih code+docs+tests in one file.

For me, org-mode is better as a file format because it's plain text. I don't mind making quick edits in GitHub or vim if I'm away from Emacs for some reason. But it's definitely best to work with org-mode from within Emacs.

Notebooks are more enjoyable to look at while you're editing them, whereas org-mode generally needs a separate "export" step to be pretty.

Here's a representative example from a blog post: https://gitlab.com/hoosieree/hoosieree.gitlab.io/-/blob/mast... (result is here: https://alexshroyer.com/posts/2023-05-21-Stack-VM-Language.h...)

The svg images (which gitlab renders) are actually generated by a code block in the org-mode file:

    #+CAPTION: N times M compilers
    #+headers: :file ../images/n_times_m.svg :cmdline -Tsvg
    #+begin_src dot :exports results
    digraph {
     node [fontname="Comic Sans MS" shape=record];
     L1[label="Language1"];
     L2[label="Language2"];
     node [shape=oval];
     A1[label="Arch1"];
     A2[label="Arch2"];
     A3[label="Arch3"];
     L1->A1;
     L1->A2;
     L1->A3;
     L2->A1;
     L2->A2;
     L2->A3;
    }
    #+end_src

I put my cursor in there and hit Enter, and it generates the svg.
Re:I decided not to commercialize nbdev by mloncode on Wednesday May 31, 2023 @10:14PM (#36146875)
This is cool, thanks for sharing. I’ll definitely check this out