Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLEANUP should produce DFASL or LCOM consistent with what's already there and/or what was previously loaded #16

Open
rmkaplan opened this issue Aug 24, 2020 · 16 comments
Assignees

Comments

@rmkaplan
Copy link
Contributor

There are now 2 kinds of compiled files in Medley, with extensions DFASL and LCOM. DFASLs are produced by the common lisp compiler, LCOMs are produced by the byte compiler.

Some files have both DFASL and LCOM versions, that may be compiled on different dates and maybe even on different source versions. The one that gets loaded is likely determined by the order of extensions on a particular list. So this is not a good situation: for each source file there should be only one type of compiled file.

But also, this raises the question, why does the system as a whole have 2 different compilers and 2 different compile-file formats?

The LCOM files have the advantage that incremental loading of single compiled functions via LOADFNS is possible, and that is very useful in debugging contexts. Incremental loading is not possible from DFASL files.

DFASL files presumably have the advantage of faster loading, but on modern machines load-time is in the noise.

So: does anybody know whether the common-lisp compiler and DFASL files have other advantages that would be lost if we gradually deprecated them and reverted everything to LCOM? Are there constructs that only the common lisp compiler can compile, or does it have better or different optimizations than are provided by the byte compiler?

@nbriggs
Copy link
Contributor

nbriggs commented Aug 26, 2020

At least one DFASL shows up in the (instructions for the) MAKEINIT process. At this stage of our understanding I wouldn't count on it being able to use an LCOM interchangeably.

@masinter
Copy link
Member

they emit different code; we should run the benchmarks with different compilers

@rmkaplan
Copy link
Contributor Author

As part of the cleanup effort, if a symbolic file had compiled files of both types, I eliminated the one that was not specified by its compiler-type property. There should not be files with both lcom and dfasl now, and we should avoid creating new confusions.

I think that the various compiler functions (TCOMPL, compile-file) should be fixed to cause an error or at least a warning that requires confirmation if they are asked to compile a file with the wrong property. This is the sort of check that SAMEDIR does to prevent files from accidentally ending up in the wrong place. I think Larry didn't think that was a good idea, and so it is still hanging.

But without check such checks, manually calling the wrong compiler (as opposed to letting cleanup figure it out) will create the confused situation.

This is a separate issue from deciding whether one compiler produces better code than the other.

@masinter
Copy link
Member

My only concern is that SAMEDIR might interfere with a working style where users want to treat the distribution as read-only, and store updates in their project directory. I wasn't sure about the implications.

As for DCOM and DFASL, a warning would be fine, but warnings tend to get lost.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Dec 25, 2020 via email

@masinter
Copy link
Member

I've been remiss about not gathering together documentation about changes we've made to the default full loadup.
I think we need to do that I'm not sure how / where to do that, though. Updates to the Medley 2 user's guide? Google docs or GitHub Wiki?

@masinter
Copy link
Member

masinter commented Aug 3, 2021

I thought this was fixed, but the other day I did a
ED(MEDLEY-INIT-VARS)
which did a LOADFROM(LOADUP-LISP PROP)
when I did a CLEANUP it made a DFASL rather than LCOM

Any ideas? @rmkaplan

@masinter masinter changed the title DFASL vs LCOM ? CLEANUP should produce DFASL or LCOM consistent with what's already there and/or what was previously loaded Aug 3, 2021
@rmkaplan
Copy link
Contributor Author

rmkaplan commented Aug 3, 2021 via email

@masinter
Copy link
Member

check out internal/library/MULTI-COMPILE.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Sep 19, 2021 via email

@masinter
Copy link
Member

I want to get to the place where we can compile everything, starting from 'starter.sysout'.

we're not far from being able to do that. Then we can .gitignore *.LCOM *.DFASL
and instead ship them as part of a release

@masinter
Copy link
Member

both il:load and cl:load can load either. Why don't we settle on a single file extension (.dfasl? .ilc? whatever)
and reduce the complexity of loading?

@nbriggs
Copy link
Contributor

nbriggs commented Sep 25, 2021

They're still different formats, and while il:load and cl:load can both load both formats, there are operations you can do on LCOM format files that you can't do on DFASL format files -- so getting rid of the extension means that a person would now have to look in the file to see whether the contents were going to be suitable to do the operation they want... and that seems way more involved than just looking at the extension. I vote we have separate extensions for separate formats.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Sep 25, 2021 via email

@masinter
Copy link
Member

DOFILESLOAD (called by FILESLOAD, which is what implements the FILES Interlisp filepackagecommand)
is what we use to load the appropriate LCOM or DFASL file.
I think we've eliminated the files that had both LCOM and DFASL files.
I think all the files in the loadups have FILETYPE properties. What else do we need to do to close this issue?

@masinter
Copy link
Member

masinter commented Aug 7, 2022

reviewing old issues... DFASLs have the feature (also with FAKE-COMPILE-FILE) that top-level S-expressions are run compiled... eliminating some awkward behavior with MACROs and records not loaded in order. I am not sure but I think there are also loadup issues with having .DFASLs too early in the loadup. I know there are optimizations in DFASLs that aren't in the interlisp compiler, but I fear it's also vice versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

No branches or pull requests

3 participants