[m-rev.] for review: always-in-cur-dir group of extensions

Zoltan Somogyi zoltan.somogyi at runbox.com
Fri Aug 11 19:12:40 AEST 2023


On 2023-08-11 06:17 +02:00 CEST, "Peter Wang" <novalazy at gmail.com> wrote:
> I'm not sure why it was decided to separate files in the Mercury
> subdirectory in the first place. (I can imagine some possible technical
> reasons for doing so, but I suspect it was motivated by aesthetics.)

At the time, we were using filesystems whose code for filename lookups
in directories had O(N^2) complexity, so there was strong incentive
to reduce N. Today, filesystems use O(N log N) algorithms. so reducing N
is still useful, though far less so. It is useful because you trade
the fixed, small cost of selecting the right subdir for the variable and
somewhat larger cost of comparing the filename you are searching for
with the filenames you are comparing against.

> Nor is it clear why it was necessary to add the "s" suffixes on the
> subdir names.

I don't think it was necessary. I think Fergus just picked "os" and "cs"
to store .o and .c files, wrote code for "delete the period, add an s",
and then that code was automatically also used for every other extension.
(Until I started working on file_names.m recently, there was no
explicit extension name to subdir name map anywhere in the compiler.)
And I agree, he probably picked "os" and "cs" for aesthetics.

> I agree with Julien on each of the proposals.

Thank you both. I am attaching a list of the changes that we agreed on;
I intend to act on it tomorrow.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EXTENSION_CHANGES_PROPOSAL_2
Type: application/octet-stream
Size: 1069 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20230811/07b30a4e/attachment.obj>


More information about the reviews mailing list