News for hackers. Stuff that matters.
Re:How to Grow Software Architecture out of Jupyter Notebooks by malux85 on Wednesday December 12, 2018 @02:08AM (#18661941)
One thing that I would love in python is some sort of snapshotting,

Like “this is my global state” - the entire state of the python process, all objects, etc.

Then I change a variable and that creates a new state. We have this now.

What I want is a rewind button, so I can go back to the previous state (quickly preferably) like a time travelling debugger.

Someone build this, I’ll pay for it (and I’m sure others would too)

I know there’d be some problems with external changes (API calls altering external system, writing to files, etc) that a time travelling debugger might not be able to reverse, but even so, I would live with this limitation happily if such a tool existed

Re:How to Grow Software Architecture out of Jupyter Notebooks by mpweiher on Wednesday December 12, 2018 @07:29AM (#18663317)
> snapshotting ... entire state of the python process, all objects, etc.

Someone else in this thread mentioned Smalltalk: this is exactly what a Smalltalk image gives you.

The image is everything, all your objects, code, temporary, everything. And at any time you can do "save" or even "save as" to persist a copy.

And there are variants that can work with Python code as well.

http://squeak.org/

Re:How to Grow Software Architecture out of Jupyter Notebooks by TuringTest on Wednesday December 12, 2018 @08:24AM (#18663627)
It's a shame that Smalltalk never gained traction as a system language, and the C/Unix approach took over enterprise-grade development.

I wonder what software engineering would look like if all the decades-long advancement of tools for stabilization and deployment of code had been researched over platforms that combined system and application code, like Smalltalk did. Instead, we consider both layers as isolated from each other. A lot of work over virtualization and containers seem to be used as a workaround for not having this integrated approach as part of the platform design.

Re:How to Grow Software Architecture out of Jupyter Notebooks by scroot on Wednesday December 12, 2018 @10:53AM (#18664895)
It could still work really well as the systems environment and language for a personal computing device. One needs to build the proper abstractions and DSLs on top of it, of course, but it would be a much more conducive environment to "literate computing," if that's the goal (and I think it should be).
Re:How to Grow Software Architecture out of Jupyter Notebooks by TuringTest on Wednesday December 12, 2018 @10:56AM (#18664920)
I think a lot of people reading this thread will agree :-)

It is definitely an approach more apt to personal computing than to industrial engineering, at least with the level of maturity of the tools available today. The increased ease of use of these environments may be a nice-to-have for professional developers, but they are essential for non-developers.

Re:How to Grow Software Architecture out of Jupyter Notebooks by detaro on Wednesday December 12, 2018 @06:09AM (#18662895)
A basic way of getting that on Unix systems is forking - you get a copy of the process with the same memory state, and likely relatively small interfaces would suffice to manage which process is currently receiving input from e.g. a REPL. (Sockets, open files, ... are more complex, but I guess many REPL workflows could do without that). Sadly you can't easily save much memory for the snapshots from copy-on-write (which otherwise is a neat trick with forking to keep old state) due to the way Python manages memory, at least not without modifying the interpreter.
Re:How to Grow Software Architecture out of Jupyter Notebooks by thomasballinger on Wednesday December 12, 2018 @11:54AM (#18665447)
If anyone wants to walk through these ideas more slowly I write about them in http://ballingt.com/interactive-interpreter-undo and implement this in https://github.com/thomasballinger/rlundo but as you say, eventually decided I had to implement an interpreter for which serialization of state was more efficient and all external resources had amenable interfaces http://dalsegno.ballingt.com/
Re:How to Grow Software Architecture out of Jupyter Notebooks by malux85 on Wednesday December 12, 2018 @12:22PM (#18665724)
Will you marry me?

this is really cool, I'm going to give deeper into the code tonight. Awesome work

Re:How to Grow Software Architecture out of Jupyter Notebooks by detaro on Wednesday December 12, 2018 @01:12PM (#18666215)
hooking into readline is a clever idea!
Re:How to Grow Software Architecture out of Jupyter Notebooks by CMCDragonkai on Wednesday December 12, 2018 @07:20AM (#18663273)
Interesting COW for whole process images and a tree like interface to jump between them. Could work if well if the process image itself had structured interfaces for everything important. Otherwise you'd end up with black box images everywhere.
Re:How to Grow Software Architecture out of Jupyter Notebooks by solomatov on Wednesday December 12, 2018 @09:06AM (#18663961)
If you want snapshotting, take a look at http://datalore.io/ It stores snapshots between cells, and can incrementally recalculate only what's needed.
Re:How to Grow Software Architecture out of Jupyter Notebooks by heavyset_go on Wednesday December 12, 2018 @01:48PM (#18666588)
I believe IPython cells keep their state throughout execution of the notebook.