News for hackers. Stuff that matters.
Re:D compilation is too slow and I am forking the compiler by CJefferson on Wednesday November 21, 2018 @06:40AM (#18501908)
I wish that Jupyter used some kind of similar trick, to allow quickly recalculating a workbook starting at some cell.
Re:D compilation is too slow and I am forking the compiler by thomasballinger on Wednesday November 21, 2018 @01:15PM (#18504744)
The Jupyter models is hard for this, but if you only allow in-order execution (like a repl, say IPython whose kernel is used in Jupyter) you could do something like this.

We tried plugging in the rlundo tool https://github.com/thomasballinger/rlundo to IPython, it works ok, see http://ballingt.com/interactive-interpreter-undo/ for the long story.

I wanted something like this for live programming and felt like I needed to write my own interpreter because the behavior you need is so different: http://dalsegno.ballingt.com

Re:D compilation is too slow and I am forking the compiler by Waterluvian on Wednesday November 21, 2018 @07:48AM (#18502254)
If a notebook was written functionally without side effects, couldn't each function be explicitly or implicitly decorated with an @memoized ?
Re:D compilation is too slow and I am forking the compiler by dooglius on Wednesday November 21, 2018 @08:38AM (#18502540)
That's not really how notebooks are written, at least in my experience. Even if there aren't side effects, work is often done at the lowest level without defining functions at all. Also, the fact that function definitions can change makes it tricky, and I suspect you'd run into lots of subtle issues: e.g. if you modified a function foo and a subsequent function bar calls foo, then I think calls to bar would return stale memoized data.
Re:D compilation is too slow and I am forking the compiler by Waterluvian on Wednesday November 21, 2018 @08:48AM (#18502599)
Yes, agreed. I'm spitballing. I was thinking about how a hypothetical type of notebook could be structured in frames, where each frame can have side effects, but ultimately its input comes from the output of the previous frame. So each frame could be memoized. The UI could indicate what frames are being re-processed.

I'm basically thinking about ArcGIS Model Builder[1] that I used a lot in university. It was a great way to make complex process pipelines for GIS data, but only re-run the pieces that change. It allowed me to experiment at a very fast pace.

[1] http://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing...