Live Debugging in Smalltalk

Channel:jarober · Length:2:50 · Published:2008-09-18 · Views:1231

Watch on YouTube

Summary

A brief demo of the Smalltalk debugger, including defining a method that doesn't exist yet while the program is stopped mid-crash.

Why HN recommends it

HN cites it as a concise demo of live debugging and editing code in a running Smalltalk environment.

That's a demo of a Smalltalk environment with the programmer deliberately writing some code that crashes, going into the debugger, adding the method on the fly — HN, 2017

Testing, debugging & developer tools · GUI, HCI & interface history

Subtitles (excerpt)

welcome to Small Talk daily for Wednesday September 17 2008 this morning I'd like to go through how you can write code in the debugger even though you're in the middle of fixing something that didn't really exist yet what do I mean by that well let's take a look at this small class here counter instance variable of count and an initialized method that sets the count to zero all right that looks fine let's go ahead and test that out counter new add more one now the add one method doesn't exist yet right so we'll go ahead and we'll do an inspect to see what the answer that comes back from that is and as expected we get a debugger so we'll go through bring this up and now what we'll do is something interesting if we go here to correct you'll notice there's a Define method option so we'll go ahead and select that notice what it does now it goes ahead and puts an add one method in my class for me and asks me to start writing it so let's just write that to self count self count plus one now let's go ahead and hit that and sure enough it now completes and finishes up by giving me the answer so that's interesting let's go ahead and we'll write another method let's go ahead and write subtract one and we'll make a common kind of error

On Hacker News

Smalltalk has a meta API that is designed to allow introspection and modification of both static and dynamic code entities [1,2]. Static entities such as classes and methods (and depending on your Smalltalk implementation namespaces and object versions) can be modified at runtime, i.e. while your program is running you can make a change and get an immediate effect. This is now known as "live" pro… — robertkrahn01, 2017-12
This may have been posted in 2008, but the tech it is demoing was decades (yes, plural) old by then: [VIDEO] This video is a simple demonstration of very mature tech, not a demo of something hot and new. That's a demo of a Smalltalk environment with the programmer deliberately writing some code that crashes, going into the debugger, adding the method on the fly, and then having the original metho… — jerf, 2017-10
A small example of refactoring running code is at [VIDEO] And a more lengthy example of writing tests first, letting the code fail, and fixing things in the debugger: [LINK] This is kind of like writing code that doesn't exist or doesn't work, and letting the type checker guide you through the things you need to fill in. The difference is that Smalltalk is actually executing your code, so you can… — tree_of_item, 2012-05

Related videos