livebook icon indicating copy to clipboard operation
livebook copied to clipboard

Add live evaluation

Open josevalim opened this issue 2 years ago • 5 comments

The idea with live evaluation is that we will show the result as the user types. However, instead of evaluating every time, we will understand which lines changed, how, and only evaluate the necessary bits.

What is unclear, however, is how we will configure this feature and how it will play with Reevaluate automatically. Reevaluate automatically will be the default mode of a notebook when deployed, so I wonder if we should instead move that to a global setting to make it closer to the deployment mode. We also need to discuss if "Live evaluation" implies "Reevaluate automatically" for a specific cell, but most likely yes.

josevalim avatar Jun 21 '22 18:06 josevalim

I was thinking a bit on how to make the "Live evaluation" / "Reevaluate always" more accessible and I realized we could have a dropdown close to the Evaluate button:

Screenshot 2022-06-21 at 23 51 12

Clicking the button will open up a menu where you can between "Evaluate on demand" or "Evaluate automatically".

If that's not distinct enough, we could make the button a bit closer to GitHub buttons:

image

Similarly, if we have a "Evaluate all automatically", I think we could have it toggle in the code zen button. When you press it, it opens up a menu with "enter code zen" on top and a bunch of toggles. We could also move those to the sidebar.

josevalim avatar Jun 21 '22 21:06 josevalim

Is this right?

image

ByeongUkChoi avatar Jun 22 '22 14:06 ByeongUkChoi

Thank you! That’s definitely one of the ideas but I have also asked our designer to explore some concepts as well before we move forward. So hold on tight :-)

josevalim avatar Jun 22 '22 16:06 josevalim

Another idea we can build on top of this is to highlight on the left side which line number we are currently evaluating.

josevalim avatar Jul 11 '22 19:07 josevalim

As someone learning to program using livebook I think this will be very helpful. When I am confused and someone takes the time to show me what each bit of code is doing and how relates to other code the lightbulb goes off in my head and the code is understood.
The more information, (function and variable names, values, and the like) concerning how the code is being worked with is better for the inexperienced to begin to build good intuitions about programming. All efforts in this direction are truly valuable. Thanks

Billboz avatar Sep 21 '22 13:09 Billboz

Closing this for now as my experiments with live evaluation shows it is much trickier to implement than anticipated.

josevalim avatar Nov 03 '22 20:11 josevalim