Interlisp / medley

The main repo for the Medley Interlisp project. Wiki, Issues are here. Other repositories include maiko (the VM implementation) and Interlisp.github.io (web site sources)
https://Interlisp.org
MIT License
377 stars 19 forks source link

LOOPS progress and puzzles #872

Closed masinter closed 2 years ago

masinter commented 2 years ago

I put current status in the README of the lmm-loops branch:

https://github.com/Interlisp/loops/blob/lmm-loops/README.md

masinter commented 2 years ago

See discussion about problems with loading loops source. loops PR interlisp/loops/13 I merged that PR (the lmm-loops branch) but there are several problems and areas to explore.

, read macro

The immediate problem when (LOADLOOPS NIL 'SOURCE) is an undefined function $AV when loading LOOPSWINDOW at byte 7560 image which is at the space before 'DontSave' in the line (window #,($AV LispWindowAV ((YIV0.C=N5.W_7 . 10))) DontSave (Value)

Now, the puzzle is: who sets #, to be a read-macro dispatch? It looks like this was previously done in LOOPS code in the file LOOPSPRINT but now is done by the Common Lisp and Interlisp readtables. (This might add some additional motivation to the 'OLD-INTERLISP-T' changes to the read table.) Tthere is code in LOOPSPRINT for setting up # that is turned off now


"Used to include the following: (COMS (P  (SETALLSYNTAX LoopsReadMacroChar '(MACRO FIRST HashMacro)))
        (ADVICE HPINITRDTBL)"
and a definition of SETALLSYNTAX (not called).
     grep -r HASHREADMACRO .
     grep -r '#\,' .

anyway, somehow loops is implementing #, as if it were #. or at least EVALing the following form.
But for some reason $AV isn't defined.

NOTE: http://clhs.lisp.se/Front/X_Mast_9.htm doesn't mention #, even though there is a HASH-COMMA on the file CMLREADTABLE. I haven't looked in CLTL2 yet.

![image](https://user-images.githubusercontent.com/1116587/184545107-cd46d998-fcea-4ada-8116-3b7f0cbe5358.png)

![image](https://user-images.githubusercontent.com/1116587/184545141-a7fe1d90-74d1-4ab9-aaab-aad8b56a029f.png)
nbriggs commented 2 years ago

You're going down a rabbit hole there -- the problem seems to be that LOOPSACTIVEVALUES gets LOADCOMP'd by one of the previously loaded files in the list, and then the (DOFILESLOAD (SOURCE) LOOPSACTIVEVALUES) doesn't load the source, so there is no code to run for the LOOPSWINDOW which depends on the active values infrastructure.

masinter commented 2 years ago

i'll try fixing DOFILESLOAD(SOURCE).

More suspicious stuff that is likely wrong for Medley 3.5:

The file LOOPSSPEEDUP has several constructs that are highly suspicious of being written for the old memory layout. image

nbriggs commented 2 years ago

How about starting with looking at what is in the LOADCOMP'd expressions to see if it's sufficient. We've had the discussion about DOFILESLOAD and LOADCOMP in the past, and it wasn't clear what it should be doing and Ron reported that it had changed over time. There's nothing wrong with the LOOPSSPEEDUP "Make-Not-Reference-Counted" function -- Ron did the same in LFG, and this code is very similar and also works.

tfeb commented 2 years ago

, did load-time evaluation. So I think it was like #. except that when compiling a file it the compiler had to delay it until the file was being loaded, I think. It was all a mess.

On 14 Aug 2022, at 17:02, Larry Masinter @.***> wrote:

 See discussion about problems with loading loops source. loops PR interlisp/loops/13 I merged that PR (the lmm-loops branch) but there are several problems and areas to explore.

, read macro

The immediate problem when (LOADLOOPS NIL 'SOURCE) is an undefined function $AV when loading LOOPSWINDOW at byte 7560

which is at the space before 'DontSave' in the line (window #,($AV LispWindowAV ((YIV0.C=N5.W_7 . 10))) DontSave (Value)

Now, the puzzle is: who sets #, to be a read-macro dispatch? It looks like this was previously done in LOOPS code in the file LOOPSPRINT but now is done by the Common Lisp and Interlisp readtables. (This might add some additional motivation to the 'OLD-INTERLISP-T' changes to the read table.) Tthere is code in LOOPSPRINT for setting up # that is turned off now

"Used to include the following: (COMS (P (SETALLSYNTAX LoopsReadMacroChar '(MACRO FIRST HashMacro))) (ADVICE HPINITRDTBL)" and a definition of SETALLSYNTAX (not called). grep -r HASHREADMACRO . grep -r '#\,' .

anyway, somehow loops is implementing #, as if it were #. or at least EVALing the following form. But for some reason $AV isn't defined.

NOTE: http://clhs.lisp.se/Front/X_Mast_9.htm doesn't mention #, even though there is a HASH-COMMA on the file CMLREADTABLE. I haven't looked in CLTL2 yet.

image

image

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

masinter commented 2 years ago

The issue #733 talks more about loading LOOPS from sources. There is a work-around of avoiding a couple of the loadcomps . Now that there are compiled versions of all the loops files (system, library, users, users/rules trucin/players) the problem left is making players whose name is NIL. Will make a separate focused issue