4 ms·
> For example some Lisps allow us to save the state of the heap to disk easily, incl. the runtime, to make an executable. Wait, hang on. Is this feature analo
by filoeleven 5y ago
> For example some Lisps allow us to save the state of the heap to disk easily, incl. the runtime, to make an executable.
Wait, hang on. Is this feature analogous to Smalltalk’s image-based environment? Does this mean I could run a Lisp REPL and “save all” then “restore all” later? Or is this a subset of what Smalltalk does? Excluding the Smalltalk GUI environment, of course.
Asking because that’s the biggest “you must try it to understand the experience” selling point of Smalltalk. Some Lisps (hopefully some of the same ones?) have a really nice interactive debug mode, which IIRC is another Smalltalk selling point.
If those are both covered by a single Lisp, I’d like to try that out instead of Smalltalk, because Lisp’s structure makes more sense to me. I am biased towards Clojure because I like its opinionated language design choices irrespective of Java interop. Mainly the seq abstraction and immutable-by-default. A first-class debug REPL and “save / restore the whole runtime environment” are both things I want to examine though.
- diskzero 5y agoYes. Saving to an image, loading the image, modifying the image while the program is running and seeing the program update without recompilation is part of the magic of programming in a good Lisp IDE. Smalltalk was influenced by how Lisp used images and went on to build on the concept of images and do all the other things that make Smalltalk Smalltalk. Various commercial Smalltalks have come and gone over the years. I am assuming you have been looking at either Squeak or Pharo. Both are nice, but the user interface is trapped inside of a windowing system inside of the environment you are executing in. A Pharo program will present a window and inside that window is another desktop environment. This seems unnatural to me, but it is the result of how Smalltalk works; it does everything. If you have the time, you can read about this in the Smalltalk-80 books. LispWorks allows you to use the native widgets of the platform you are targeting. Your program will use native widgets. Clozure CCL (not Clojure) also has native widget support. Take a look at the OpusModus [1] composition program. It is written in Clozure CCL and is very polished, professional application. It sounds like you already understand the philosophical differences between Lisp and Smalltalk. You can use an object system in Lisp, but it is option. Smalltalk is objects all the way down. Lisp can be molded to operate in variety of idioms, so you can create your own opinionated system, but one is not dictated for you. [1] https://www.opusmodus.com/ https://www.opusmodus.com/
- lispm 5y agoLisp had images from day one -> already in 1960. The feature of saving and restarting was already developed then. Yes, one can save all and restore it later. Problems are then naturally: open files, network connections, native threads, ... those are usually not restored after load. The state of a network connection is not to be restored. Interlisp had also image-based development which is another step up: source code is managed and stored. Most Lisp systems nowadays save source code in files and can keep track of locations, etc. Thus the source code management feature is usually stronger in Smalltalk. Smalltalk usually also has a VM with machine-independent code, where Lisp systems often have machine-native code. Thus in Smalltalk one can transfer an image to a different machine architecture, where most Lisp systems only transfer images on the same machine architecture & operating system combination. The Java VM lacks this easy memory image feature.
- blacktriangle 5y agoYou CAN write CL in a very Clojure style, as there are libs for both the seq abstraction and immutable data structures. It won't be as ergonomic as in Clojure simply because the standard lib is not built around assuming these by default and its unlikely other libraries will be using them as well, but you can have a very Clojury experience if you like.
- igouy 5y agofyi http://www.sbcl.org/manual/#Saving-a-Core-Image http://www.sbcl.org/manual/#Saving-a-Core-Image