2 ms·
> Unlike in Smalltalk, I currently know of no tools that allow one to easily edit source code of functions/methods that have already been compiled into the syst
by lispm 6y ago
> Unlike in Smalltalk, I currently know of no tools that allow one to easily edit source code of functions/methods that have already been compiled into the system
Lots of Common Lisp systems support that in some way. Those record the location of the source code together with the machine code. These locations are stored in the image.
For example the standard CL function ED takes a function name and in many Lisp systems this will edit the function in some implementation specific way. In Emacs one uses M-. to get the definition of a function. In those implementation it will ask the Lisp for the location of that function source code.
The one system that worked similar to Smalltalk is Interlisp. See https://interlisp.org https://interlisp.org . It recently has been open sourced and is in the process of making it more accessible. It's a glimpse into an alternative world of computing from the past.
- phoe-krk 6y agoI know that many implementations record source location, but the source itself is still on the filesystem, not in memory, therefore making source locations useless if we move the filesystem out of the equation. I also know that many implementations store the forms in FUNCTION-LAMBDA-EXPRESSION, but as I said, I know of no easy way to edit these in-memory forms either. Interlisp has had a structure editor to work with those, but that utility was not ported back into the CL workflow. I hope it eventually will be, with Interlisp being open sourced now.
- lispm 6y ago> therefore making source locations useless Just make source available on the file system. Mount it. Copy it. That's why Common Lisp has logical pathnames. Typically one uses logical pathnames in source locations. When I set up my application on a machine, I define a translation table to point to the source code. One can also just use standard pathnames and mount the source code to a standard path. That's how one also has set up Lisp systems in clusters. Every machine mounts the source in a standard path (or a logical path) and a client system will then have access to that source code. The image still has the recorded locations. Btw., even Smalltalk stores its source code not in the image. The Smalltalk source code is stored OUTSIDE of the image in the file system and it has to have the files available and needs to know the location of these source files. See: https://squeak.org/downloads/ https://squeak.org/downloads/ The Squeak/Smalltalk programming system consists of three parts: * a virtual machine for your platform, * both image and changes files of a particular version, and * a sources file for the particular image file. The source and changes files contain the source code of the running Smalltalk. An edit of source code will then lead to an entry in the changes file. Smalltalk usually can decompile byte code, so one can edit code which has no corresponding source code, with some loss of original source information.