32

I'm really interested if someone knows a programming language that uses an image like Smalltalk...

I think that is one of the greatest ides in the history of computer science.. I can not find other language besides Smalltalk that is base on an image.

Claudio Acciaresi
  • 31,951
  • 5
  • 33
  • 43
  • 3
    I've always thought this "greatest idea in the history of computer science" was one of the reasons Smalltalk is so underused. I like Smalltalk in theory, but the image thing always makes me a little uneasy. – Chuck Apr 06 '09 at 17:24
  • I feel the same way as Chuck, only I've been into Smalltalk for not even a month, and I don't think I'll do anything "big" in it in order to say how good the idea of images is. – Andrei Vajna II Apr 06 '09 at 20:34
  • It would be silly to think image based development is appropriate for every situation - it isn't. When the situation involves a rich domain model, a bit like a simulation, being able to play with and fix the populated domain model on the fly helps keep clients happy. – igouy Apr 06 '09 at 23:33
  • Related: https://stackoverflow.com/questions/3561145/what-is-a-smalltalk-image - Smalltalk image = restartable core dump. Like a [restorable tasklet](https://stackless.readthedocs.org/en/latest/library/stackless/tasklets.html) in Stackless Python. – Cees Timmerman Aug 24 '15 at 10:10
  • 2
    Its a shame this ones closed as its an interesting way to come at the question of "whats an image". I'll give one good one example though. Zope. Zope uses python, but the code, and data are all stored in a NoSQL type heirachical database. Zope was huge in the 1990s, but fell out of favor because it was pretty alien to the uninitiative and ultimately lost favor to Django, a much more familiar framework. None the less it was for all purposes a monolithic image system that paved the way for modern NoSQLs and adding a few unique features of its own. – Shayne Feb 13 '18 at 02:22

11 Answers11

25

Images

Images are basically memory dumps. Typically a Lisp development system starts a runtime plus an image. The user then makes changes and later can write a new image. Sometimes this is a feature used by the developer, sometimes it's also used during the development of the Lisp system itself.

Many Lisp systems are using 'images'. That's where Smalltalk got it from, possibly - since Lisp had images already long before Smalltalk existed. McCarthy's Lisp 1.5 in the early 60s used images. The knowledge about Lisp implementation techniques was transferred to Xerox. L Peter Deutsch for example worked in the 60s on Lisp implementations - in the early 60s as a young kid he wrote his first Lisp. In the 70s he worked at Xerox and there especially on Smalltalk's virtual machine implementation.

Later in the 70s/80s, the OS on the Lisp Machines were basically Lisp images (often called worlds) (even hierarchical images with incremental delta images). Lisp Machines also store development environment state (example: which code is loaded from where in what version written by whom) in an image, but the MIT variants of the Lisp Machine usually stored the source code itself in files.

Managed source code

If you ask which language uses a similar way to organize and manage source code (i.e. not in files in project directories), then Xerox Interlisp did that. Apple's Dylan did that. Some DB development tools might do that.

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
13

Factor is a Forth with many high-level features and an image.

Damien Pollet
  • 6,488
  • 3
  • 27
  • 28
7

You could actually consider SQL databases as being image based - the data and the code (stored procedures) are all stored together in one big opaque blob.

  • 2
    I'd add "Unix" is an image based development system. The image is the file system – sadly they just store dead text instead of meaningful objects. Relational DBMs are image based development systems. I agree with the OP that images are amazingly powerful. I think a mistake was thinking of "an" image is an important thing. It should be a replicated cache, like a git repo. Not "all your work", like a word document. – Benjohn Nov 04 '16 at 10:16
  • Just came across this and found it insightful! I.e. that the “right amount” of image is somewhere between everything and nothing. – agam Jun 14 '22 at 03:17
3

From what I remember sitting at my dad's side back in the 80s, MUMPS is image-based. I could certainly be wrong, and a quick scan of the Wikipedia article didn't show anything, but it's possible...

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • Your memory is accurate. I don't think of MUMPS as image-based, but does have a container/alternate-storage-system where data is solely managed by the MUMPS system. APL has workspaces to store code and arrays. I think you could even argue that Forth did some of this with its block-oriented filesystem for code. There were at one time Prolog systems that saved "working memory" as disk images. It used to be common practice, especially when the OS system calls didn't do a good job with compression and memory-management of special data structures, which is why LISP and Smalltalk did it too. – David Whitten May 12 '12 at 22:53
3

I happened across this comment which I think gives a flavor of image based development.

'So while I can and do use the JVM for server-side computation, it’s a bit heavy weight for small and simple tasks. Common Lisp’s answer to this problem was an ingenious one. Instead of building programs that you run over and over, it offers an “environment” in which code is iteratively evaluated, so that you actually grow and nurture a burgeoning set of functionality within a long-running VM. I like this model when appropriate, and enjoy it, for example, in Emacs, which I can leave running for days on end while at the same time extending its functionality by writing new functions and customizing variables."

igouy
  • 2,547
  • 17
  • 16
2

I'm curious as to if the Smalltalk Image system scales.

If you had 20 programmers working on the same codebase, how does that work? Do they each have their own image, or do they share one?

If you make a code modification that requires a modification of your environment, and someone makes a different modification with similar requirements, can the images be merged (as with Version Control)?

Bill K
  • 62,186
  • 18
  • 105
  • 157
  • 6
    why not post that as a question? – Rainer Joswig Apr 06 '09 at 16:53
  • 1
    Either developers exchange *change sets*, i.e. the equivalent of patches, or they use version control tools, which tend to work in a more DVCS-like fashion, and on code entities (classes and methods) rather than files and lines of code: - Envy - Store (Cincom Smalltalk) - Monticello (Squeak, Pharo). – Damien Pollet Apr 06 '09 at 17:17
  • 1
    For example with Envy/Developer, one programmer could create a new edition of a method, make and accept a series of changes to that method (each accepted change would be recoverable), explicitly name and version a particular edition (other programmers can see the changes) and then publish. – igouy Apr 06 '09 at 23:13
  • For example with Envy/Developer, although you could see that another programmer had created editions of code you were also working with, in practice you'd probably ignore that and merge with the published version and then publish your merged version. – igouy Apr 06 '09 at 23:16
2

Most implementations of Common Lisp.

stesch
  • 7,202
  • 6
  • 47
  • 62
  • I do not know why but the LISP syntax is so hard to read... anyway I will check How common lisp is implemented using images. – Claudio Acciaresi Apr 06 '09 at 17:00
  • 2
    I haven't recommended Common Lisp. I've just answered the question. – stesch Apr 06 '09 at 17:12
  • 1
    The reason some people find the syntax so hard to read is that there pretty much isn't one. You just write the parse tree as S-expressions. Some people find this lack of structure...disturbing. – David Thornley Apr 06 '09 at 17:16
  • 1
    I found Smalltalk code hard to read till I started learning the language and understanding that everything reduces to "Object - Message". The same is for Lisp, everything reduces to "(function args)". I used to think the Lisp model is the simplest evere. But now I think Smalltalk's is more natural. – Andrei Vajna II Apr 06 '09 at 17:22
  • Yes, I see what you mean, and I Agree, Smalltalk is really close to natural language (at lest from my point of view :)) – Claudio Acciaresi Apr 08 '09 at 13:42
2

Yea, most Forths are image based.

Will Hartung
  • 115,893
  • 19
  • 128
  • 203
1

Early BASIC interpreters could be considered image-based, in that they incorporated a rudimentary editor, and retained the source form of a program in memory while the user worked on it, and provided commands like "SAVE" and "LOAD" (or was it "READ"?) to save the whole program to a source file and load it again later.

Phil Rand
  • 111
  • 1
1

Single-page applications can be considered as a sort of images for JavaScript+HTML. Single-page application means a [web]-application where all data, code and state are contained in a single HTML document.

Consider TiddleWiki as an example: http://www.tiddlywiki.com/

Boris Berkgaut
  • 158
  • 2
  • 8
1

To answer Bill K's question: apparently it works just fine (though I've not tried version control in a team personally).

All Smalltalk systems do it a bit differently, though. There's a very interesting podcast all about it on The Stack Trace. Much of it applies to all image-based development environments.

wbg
  • 1,104
  • 2
  • 8
  • 18