The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Persisting the Joys of the REPL

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Persisting the Joys of the REPL Posted: Jan 15, 2006 9:47 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Persisting the Joys of the REPL
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Over in Programming Musings, a comment from an earlier post is brought up:

Dumb question - you are happily programming in the environment, and the lights go out. Have you lost your state? How do you save “source” code? I'm interested from the angle of irb, as I like ruby. I still think in the mode of writing the source in an editor, checking it in, etc. I can't seem to imagine this environment in terms of day to day work, esp with a development group.

The answer goes over the typical "save your files" response, and then gets to images:

Don't despair, there are better ways. Most CL implementations and several Schemes (MIT/GNU Scheme and, again, scheme48 come to mind) allow you to save your complete state, at any time, in what is called and image file . This image contains a binary snapshot of the interpreter's state, and you can reload it at any later time. Being a binary representation, it will come to life blazingly fast. Besides Lisp, Smalltalk is the paradigmatic (and possibly pioneer, but i'm not 100% sure on this) image-based language: for instance, in Squeak , the only way to launch the environment is loading a previously saved image, which contains detailed information of your previous state (including the graphical environment). In this sense (and many others), Smalltalk is a dynamic programmer's dream come true.
Images makes things even better, but not perfect: you still need to save your state every now and then. In an ideal world, persistence should be automatic, managed behind the scenes by the system, even by the operating system.

Well, in Smalltalk - certainly in VisualWorks and Squeak - even a power outage isn't going to end up losing you any work (unless your HD dies simultaneously, of course). As it happens, each change you make to your image is saved off in a transaction log called the change file. When you restart the image, you can load the change file into a tool, and replay all (or a set of specific) actions so as to restore your state.

So if you are working on a large set of changes, and *poof* - off go the lights - when power comes back, you can roll it all back in. I think I'll do a screencast on that next week - it's a very cool, but under-publicized, feature of Smalltalk.

Read: Persisting the Joys of the REPL

Topic: After long holidays Previous Topic   Next Topic Topic: Book End of a very long day

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use