back

by kristjansson·6y ago·view on hn ↗
Fastai/Fastcore are fascinating in their emphasis on interactive computing in notebooks. I think that starting from the assumption that users will be

(a) primarily using the abstractions in this library interactively

(b) to do analysis, or experiment with many different implementations of similar functions

(c) in long-lived sessions where re-running to the same point may be expensive in time or compute, or impossible due dependence on cell execution order etc.

makes their design choices make more sense to me.

Lots of the functionality identified here sort of nice if you're in a traditional environment, but imperative if you're in (or writing for users in) a notebook environment. For example, the emphasis on preserving propagating signature information in function objects themselves makes sense if you're relying on `inspect` to provide IDE-like autocompletion. The emphasis on easy monkey-patching and psuedo-generics makes sense if you're interactively working with classes in modules you don't control, or can't cleanly reimport.

Not only that, fastai/fastcore themselves are written in Jupyter notebooks via their literate programming environment nbdev [1]!

I don't know that there's a point here beyond a bit of begrudging admiration for how far they've pushed the notebook platform. It makes for a library (and a Python) that looks and feels just a few degrees off-axis from much of the rest of the ecosystem...

[1]: https://nbdev.fast.ai