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

Perl 6, if renamed, needs new filename extensions #101

Closed
ajs opened this issue Sep 10, 2019 · 49 comments
Closed

Perl 6, if renamed, needs new filename extensions #101

ajs opened this issue Sep 10, 2019 · 49 comments
Assignees
Labels
language Changes to the Raku Programming Language

Comments

@ajs
Copy link

ajs commented Sep 10, 2019

Perl 6 renaming is being discussed in "Perl" in the name "Perl 6" is confusing and irritating. This is not that.

The issue at question is, if the renaming happens as outlined there (to "Raku") then what are the new filename extensions? It was suggested that we should take this discussion to a new issue, and so here it is.

Current issues are:

  • What should the primary code filename extension be? (current contenders are .raku and .rk)
  • Should modules have their own extension? (current contenders are "no" and .rkm)
  • Should tests have their own extension? (currently there is not a suggestion, but I think "no" and .rkt would be the obvious choices)
  • Should documentation (Perl 6 POD) have its own extension? (currently I only see .rd as a proposal, but .rpod, .rakupod and .rakudoc are also potentially useful. It should also be noted that .pod6 isn't necessarily out of the question, given that it's not "Perl" specific and is currently recognized.
  • Some older editors expect .rk to relate to an obsolete file format.

Am I missing anything?

Pinging parties involved in the original discussion: @AlexDaniel @duncand @vrurg

@ajs ajs added the fallback If no other label fits label Sep 10, 2019
@AlexDaniel AlexDaniel changed the title Perl 6, if renamed, needs new filneame extensions Perl 6, if renamed, needs new filename extensions Sep 10, 2019
@AlexDaniel AlexDaniel added language Changes to the Raku Programming Language and removed fallback If no other label fits labels Sep 10, 2019
@AlexDaniel AlexDaniel assigned jnthn and unassigned jnthn and AlexDaniel Sep 10, 2019
@ajs
Copy link
Author

ajs commented Sep 10, 2019

@AlexDaniel My dyslexia was going strong. I re-read your title edit three times I still didn't see it! Thanks!

@ajs
Copy link
Author

ajs commented Sep 10, 2019

My personal take is that:

  • Code should be .raku. It's clear, short and doesn't bow to 90s Windows conventions.
  • Modules should also be .raku because nothing needs to parse them differently... the only issue is that of identifying modules when auto-packaging and I feel like we don't know how that will happen in Raku well enough to assign a filename extension for it. It's also not necessary in many other HLLs.
  • Tests should live in a descriptively named directory (we tend to use t in the Perl community, but tests is equally acceptable) but the tests themselves really don't need their own extension.
  • Documentation is a unique format, and as such deserves its own extension. I think .rakupod works well and it being longer makes sense for documentation: clear > terse.

Side benefit to that last one: rakupod really does sound like a type of dinosaur...

@AlexDaniel
Copy link
Member

Am I missing anything?

To clarify, we already have this pull request which says this:

The extension .rk for scripts, .rkm for modules, and .rd for
documentation (POD6) will become the defacto standards for files containing
Raku code or documentation.

I don't mind discussing if something else should be used, but these are exactly what we'll use if the PR goes through.

@ugexe
Copy link
Contributor

ugexe commented Sep 10, 2019

the only issue is that of identifying modules when auto-packaging and I feel like we don't know how that will happen in Raku well enough to assign a filename extension for it.

How do we not know? -I some-dir has to do something if there is no META6.json, and if modules shared a file extension with scripts and tests then -I. some-dir-without-meta6 would have to somehow figure out bin/foo.raku and t/bar.raku shouldn't be called with bin::foo and t::bar (and lets not get into if an e.g. lib/bin/foo.raku also exists). We don't get to reinvent everything or throw away existing architecture because a name is changing -- a name change must accommodate existing architecture.

@AlexDaniel
Copy link
Member

Documentation is a unique format, and as such deserves its own extension. I think .rakupod works well and it being longer makes sense for documentation: clear > terse.

If rakupod is “clear”, then what is “pod”? :) My hope is that “POD” as a name will go away, and it'll become just “RakuDoc” or similar. “.rakudoc” is fine for me but people tend to prefer short extensions (e.g. “.md” vs “.markdown”, even though “.markdown” is supported by most things). So the current .rd proposal is perfectly fine for me.

Tests should live in a descriptively named directory (we tend to use t in the Perl community, but tests is equally acceptable) but the tests themselves really don't need their own extension.

The whole .t thing is really weird, and it seems like tools are supposed to assume that .t files are perl5 executables even though there's no shebang, which doesn't really make much sense to me. At some point people started to use .t6, which makes the situation even weirder.

As for modules, what @ugexe says sounds about right.

@nxadm
Copy link

nxadm commented Sep 10, 2019

I agree with @AlexDaniel. While I don't think that the extension distinction between "scripts" and "modules" makes much sense (or even the use of extensions for executables in UNIX), I think this is a discussion for later because we need to minimize unintended consequences in the transition period as @ugexe points out.

@jnthn
Copy link
Contributor

jnthn commented Sep 10, 2019

On Windows, file extensions are used to determine an association with an interpreter. Thus, the distinction between scripts (entrypoints that we should run) and modules (things that aren't to be run directly) is carried by the file extension, not a +x.

@ajs
Copy link
Author

ajs commented Sep 10, 2019

@ugexe I'm not sure what you mean. Is there some special handling that is unusual among HLLs, here? When I currently run:

$ perl6 -I lib -e 'use Foo::Bar'

It is very clear what has to happen, regardless of what the filename on Foo is. Load it, parse it in a namespace based on its path (Foo/Bar -> Foo::Bar) and import from it.

But if I do:

$ perl6 -I lib lib/Foo/Bar.pm6

Then it's also equally clear what should be happening. Load the named file, compile and execute its RUN-MAIN if available.

This is exactly the way Perl 5 and Python work, for example.

Does it do something else in Rakudo today that I'm not aware of?

@nxadm
Copy link

nxadm commented Sep 10, 2019

On Windows, file extensions are used to determine an association with an interpreter. Thus, the distinction between scripts (entrypoints that we should run) and modules (things that aren't to be run directly) is carried by the file extension, not a +x.

@jnthn, I was under the impression that the single file extension model is not a problem for Python and Ruby on Windows. Do they do something differently?

@jnthn
Copy link
Contributor

jnthn commented Sep 10, 2019

@nxadm It's not a problem, I'm just pointing out that the distinction has a use.

@jnthn
Copy link
Contributor

jnthn commented Sep 10, 2019

Noting this:

I think this is a discussion for later

And this:

I don't mind discussing if something else should be used, but these are exactly what we'll use if the PR goes through.

I'd like to note that while I've not got especially strong feelings on the exact extensions we choose, I really want it settled as part of the renaming PR. I say this as somebody invested heavily in building Perl 6 development tooling; the Raku name changes is already going to make extra work for us, which is OK, but I'd rather do one round of extension changing work, not multiple. I suspect others who will want to update editor plugins etc. would also appreciate clarity on it sooner rather than later.

@ugexe
Copy link
Contributor

ugexe commented Sep 10, 2019

@ugexe I'm not sure what you mean. Is there some special handling that is unusual among HLLs, here? When I currently run:

Yes, you are restricting your entire point to -I lib and the assumption that all distributions have a folder lib. This obviously is not the case with existing behavior when one does echo ... > foo.pm6; perl6 -I. -Mfoo -e '' which your suggestion would break.

The behavior must be consistent for -I. and -Ilib.

@ajs
Copy link
Author

ajs commented Sep 10, 2019

@ugexe It seems like @jnthn would prefer that this not be the place that this get resolved, but I would like to understand your technical point. I certainly was not presuming "lib" as a directory name. It was an example. I do not see why perl6 -I. -Mfoo -e '' should break. It's going to:

  • Set the include path to include .
  • Search the include path for foo.<ext> where is whatever we want it to be (e.g. .raku)
  • Because -Mfoo means use foo we are then going to read the file, compile it under the namespace identified by its path (e.g. ::foo) and import from it.

This does not break because you named the file .raku.

I think you are making a presumption of more magic than there really is... can you cite the specific code in rakudo that you are referring to?

@Leont
Copy link

Leont commented Sep 10, 2019

Tests should live in a descriptively named directory (we tend to use t in the Perl community, but tests is equally acceptable) but the tests themselves really don't need their own extension.

People can and do put other files into the t/ directory, most obviously helper modules but sometimes also reference files. As such, them having an extension to differentiate them from the rest is certainly useful.

The whole .t thing is really weird, and it seems like tools are supposed to assume that .t files are perl5 executables even though there's no shebang, which doesn't really make much sense to me. At some point people started to use .t6, which makes the situation even weirder.

It's a bit more complicated than that. prove/perl5 will actually respect the shebang unless the shebang contains the word perl. Our executable being named perl6 rather complicated using prove.

prove6 always assumed .t files were perl6.

@AlexDaniel
Copy link
Member

Amazing.

@AlexDaniel AlexDaniel mentioned this issue Sep 10, 2019
@ugexe
Copy link
Contributor

ugexe commented Sep 10, 2019

Search the include path for foo. where is whatever we want it to be (e.g. .raku)

and when there is (what would currently be) foo.p6 and foo.pm6 we run into the same ambiguous non-sense as allowing .pm in addition to .pm6 as a marker of being a module. Additionally "search the include path" is not true of a META6.json exists, so lets not pretend it is so simple.

Because -Mfoo means use foo we are then going to read the file, compile it under the namespace identified by its path (e.g. ::foo) and import from it.

Scripts aren't precompiled, so -Mfoo pointing at a foo.raku is going to Do The Wrong Thing because of ambiguity


bin/foo.raku
lib/bin/foo.raku

perl6 -I. -Mbin::foo -e ''
perl6 -Ilib -Mbin::foo -e ''

Using the suggested behavior the two commands above would just run something even though its clearly not the intention. I can't think of a good reason for the first instance to not fail -- if one wants to include a specific file (such as a script for whatever reason) then you don't use -M or use (you use require).

@Grinnz
Copy link

Grinnz commented Sep 10, 2019

.t is not meant to be specific to Perl 5, and in fact very few online resources tie it to Perl 5, but in practice it no other language other than Perl 6 has adopted it for this purpose. So the primary reason not to use .t would be to disambiguate for things other than the interpreter that rely on the file extension and currently assume .t is Perl 5 due to usage: editors, github categorization, Windows file associations. That said, I honestly don't think this is a decision that needs to be made at all unless you really want to introduce something new for it like .rkt - it seems more like a choice of ecosystem convention.

@vrurg
Copy link
Contributor

vrurg commented Sep 10, 2019

.rkt - it seems more like a choice of ecosystem convention.

This choice could be a recommendation. Like no one enforces a repository to be prefixed with perl6- (or possibly raku-), but it's an appreciated practice.

@ugexe
Copy link
Contributor

ugexe commented Sep 10, 2019

I'd also like to make a point: the last time the community decided to bike shed on something they had little/no skin in the game on it ended up with me doing all the work (zef, travis, etc) despite not being a proponent of it (the .t6 extension). We need people willing to implement things, not more ideas.

@Leont
Copy link

Leont commented Sep 10, 2019

This choice could be a recommendation. Like no one enforces a repository to be prefixed with perl6- (or possibly raku-), but it's an appreciated practice.

Not entirely. The various tools (zef, mi6, prove6, assixt, …) need to agree on this sort of thing to cooperate. Your choice of test extension is much more than a recommendation if the result of not abiding by the convention is that your tests don't get to be run.

That said, it doesn't have to be one extension, and it already is two; adding a third (for now?) isn't all that hard.

@jnthn
Copy link
Contributor

jnthn commented Sep 10, 2019

It seems like @jnthn would prefer that this not be the place that this get resolved

It's fine to discuss it here, I'm just saying that the extensions described in #89 will - if the rename is approved - be what we end up with. There's still time for that to change as a result of the discussion here. At this point my feeling is:

  • Short is preferable (it's common, so is worth huffmanizing)
  • The script/module distinction is worth retaining
  • If we're going to have .rkm for Raku Module, then Raku Doc should be .rkd, not the proposed .rd (that gives us a productive prefix, which the suggested .rkt - should we determine it has value - would also follow).
  • The "do we really need something other than .t" decision can be deferred

@AlexDaniel
Copy link
Member

The "do we really need something other than .t" decision can be deferred

Maybe, but people are already using .t6.

@kentfredric
Copy link

I should probably mention a primary reason for me with wanting different extensions for various formats is for co-existence purposes.

Whatever extension is chosen, it should be able to support somebody doing:

  lib/Foo.x    # the source code
  lib/Foo.y    # documentation for Foo.x
  lib/Foo.z    # "unit" tests for Foo.x

Even though that last one may be uncommon.

Just some background as to why:

  • In Rust, you can define tests inside a given unit, inline, and they share the visibility rules of other code defined in the unit.
  • Tests defined in a tests/ dir are considered "Outside" the unit, and you have to abide by the public interface rules.
  • But having the tests in the unit itself ... is a bit annoying.

So subsequently, I kinda wish I could define tests some way that shared the visibility rules of a unit, but not inherently a member of that unit.

I imagine there could be some conceptual bleed-through into Raku that makes people want to make similar choices.

@vendethiel
Copy link
Member

* which the suggested `.rkt` - should we determine it has value - would also follow).

Not sure how happy the Racket folks are gonna be about this one..:)

@ajs
Copy link
Author

ajs commented Sep 11, 2019

I agree that supporting more than one filename extension is error-prone

If I understand correctly, I think what @ugexe is arguing is that having different extensions for script vs. module makes things less error-prone, because -M and use will only ever load something that is intentionally a module.

I'm not sure that I agree, but that wasn't the part of the comment I was replying to. I was noting the mutual agreement that if there is more than one MODULE filename extension that have to be disambiguate, I agree that that is going to be a source of issues (and is, today). How serious is anyone's guess, but Python does fine with just one filename extension, AFAIK, so if we're arguing that one filename extension is going to cause issues, I'd like to know what the basis for that claim is.

@ajs
Copy link
Author

ajs commented Sep 11, 2019

@kentfredric That is a very non-standard use-case, and I'm not sure that it really merits a major feature of all development in order to support. Tests generally get grouped together as t or tests and docs usually get grouped together as doc or docs. That's a pretty wide-ranging convention.

If you want everything in one place, then just put them all in the same file. Rubar ne Perl 6 handles that just fine.

@ajs
Copy link
Author

ajs commented Sep 11, 2019

The "do we really need something other than .t" decision can be deferred

Maybe, but people are already using .t6.

They (at least in my case) are doing so because tests conventionally are .t but editors such as sublime, which I use, don't want to treat things that end in .t as Radish ne Perl 6, they want to treat it as Perl 5. It's purely defensive. If everything were .raku then I would never need a .trhubarb.

@nxadm
Copy link

nxadm commented Sep 11, 2019

@ajs

If you want everything in one place, then just put them all in the same file. Rubar ne Perl 6 handles that just fine.

Go doesn't use a special file extension for tests but the "_test" suffix to the basename (e.g. foo.go and foo_test.go). To be run as tests, functions in the test files must start with "Test" (e.g. TestAddFoo() is supposed to test AddFoo()).

I am not advocating for adopting Go's way of testing (as it's very different of what we do), but just pointing out that having the tests in the same place as the regular code as the advantage to make visually clear what source file is not yet tested. It's easy to forget an almost empty "t" dir.

(Tests and extended docs in the source file is not something I like very much.)

@FCO
Copy link
Contributor

FCO commented Sep 11, 2019

but Python does fine with just one filename extension

Isn't that the reason they do that strange thing?

if __name__ == "__main__":
    main()

@ugexe
Copy link
Contributor

ugexe commented Sep 11, 2019

that one filename extension is going to cause issues, I'd like to know what the basis for that claim is.

Why do you think a name change is the ideal opportunity to make technical changes throughout various parts of the Perl 6 ecosystem? Again, scripts do not get precompiled and use different schematics for being loaded, so why should we get rid of the obvious way of discerning? To make sublime text easier to setup...? Because Python does it (insert no other reason, like why Python chose that route)...?

@ajs
Copy link
Author

ajs commented Sep 11, 2019

but Python does fine with just one filename extension

Isn't that the reason they do that strange thing?

if __name__ == "__main__":
    main()

I think there's some substantial confusion here. There are two issues:

  1. Are there technical impediments to any given filename extension?
  2. What should community standards be around filenames.

The equivalent of the above in Perl 6 is:

$ cat x/y.pm6 
sub MAIN() { say "yes" }

Which as you can see, works exactly as the python in both contexts:

$ perl6 -I. -Mx::y -e ''
$ perl6 x/y.pm6 
yes

Whether we like that or not, and whether we tell people that that is something their modules should be doing is a matter of community expectations and standards, and should have nothing to do with this conversation!

Today, the universal filename extension CAN BE .pm6, but we, as a community, do not generally advise that people name their scripts myscript.pm6 by convention. There is nothing technical preventing that, however!

@ajs
Copy link
Author

ajs commented Sep 11, 2019

that one filename extension is going to cause issues, I'd like to know what the basis for that claim is.

Why do you think a name change...

I don't understand how this is an answer to the question.

We've already ended the "what should the extensions be" discussion, here. I take @jnthn as authoritative on that. However, I did ask that someone explain the claim that there are technical issues with .raku that make it unusable. I have yet to hear what those technical issues are other than in the case where we support more than one module naming convention (e.g. if we supported .rakumod and .raku at the same time as module lookup extensions which I agreed with you was a terrible idea).

scripts do not get precompiled and use different schematics for being loaded, so why should we get rid of the obvious way of discerning?

This is misleading, as I pointed out above. The above script absolutely does get precompiled when it is used as a module but it does not when it is invoked directly. Today. In Rakudo.

If we do not select a module naming convention and instead keep one name for everything, nothing technical breaks. That's all I'm trying to establish, here.

@ugexe
Copy link
Contributor

ugexe commented Sep 11, 2019

You think that script gets precompiled in such a way that it can be useful to anything else? But nevermind me, just do whatever since I literally don't have time to teach every little facet of a complicated system to whomever wishes to bike shed.

A topic about file extensions with 36 replies... death by committee at its finest. Please do not @ me in this thread again.

@duncand
Copy link

duncand commented Sep 12, 2019

Thank you @ajs ,

I prefer .raku as the filename extension for all Raku source code files.

  • In the modern day when we don't have technical limitations making every byte precious, the greatly enhanced readability of .raku (merely 4 characters) wins out.

  • We have a much smaller mental burden, not having to keep track of a variety of different name variants of Raku; we see .raku and we know its Raku source; we don't have to see .rk or similar and unpack that as Raku versus say TCL (.tk) or various other much more similar extensions.

  • We have much better searchability and indexability; performing searches on Google for "raku" can more easily bring up source files even if they aren't separately documented with the 4 letters, and not just human prose.

  • There is no benefit to an extra file extension to differentiate main programs and modules; in practice any Raku source file can be directly executed or be used as a library no matter what its filename is.

  • In practice on any modern project layout, main programs and libraries are kept in different locations, such as under bin/ and lib/ subdirectories, which provides the needed context and separation, or main programs would tend to be located closer to the main folder and libraries be more nested.

  • Fewer extensions for Raku source means less complexity for editors or IDEs or other tooling.

I also prefer .rakudoc over other alternatives.

  • While pod has history and is more language-agnostic, its versions were still co-developed with and are generally only embedded in Perl or Raku source files respectively, if not in their own files, so including raku in the name is just more descriptive, its the documentation format codefined with the Raku language.

  • Its easier to understand at a glance for average people that doc is documentation while pod could sound like an archive format or something.

  • Despite its history, please keep numbers like 6 out of the extension, that doesn't really help anything.

For test files, I think .raku is also best, and helps editors that mainly conceptualize files on their extension, whereas .t means they would have to interpret shebang lines or such to know how to syntax color it or whatever; they can still live in a DIRECTORY named t, or test.

@duncand
Copy link

duncand commented Sep 12, 2019

Am I missing anything?

To clarify, we already have this pull request which says this:

The extension .rk for scripts, .rkm for modules, and .rd for
documentation (POD6) will become the defacto standards for files containing
Raku code or documentation.

I don't mind discussing if something else should be used, but these are exactly what we'll use if the PR goes through.

@AlexDaniel You are absolutely right.

In fact, the reason I started this whole extension thread is precisely because I didn't have priivileges to put my comments on that pull request, where ostensibly it belongs.

I hope that someone with privileges will see this current thread and look to modifying that pull request to reflect the prevailing feedback in this current discussion thread, or alternately to explicitly mark file name extensions as a detail that will be addressed in a separate pull request.

Alternately, may I be granted privileges to comment on that pull request?

@lizmat @vrurg

@AlexDaniel
Copy link
Member

Alternately, may I be granted privileges to comment on that pull request?

Sure, done.

@kentfredric
Copy link

In fact, the reason I started this whole extension thread is precisely because I didn't have priivileges to put my comments on that pull request, where ostensibly it belongs.

I'm glad this issue exists, trying to keep track of a conversation on that PR is so much noise.

Esp as it seems this needs to be fleshed out a bit, and it would only distract from the work on the PR.

Here's to hoping the mistake of ".pl" historically meaning "Perl Library" isn't repeated (where perl scripts simply have no extension )

@ajs
Copy link
Author

ajs commented Sep 12, 2019

You think that script gets precompiled in such a way that it can be useful to anything else?

I did not say or imply that. I think you are reading a discussion (possibly an argument, which I recommend against) that I am simply not engaging.

... I literally don't have time to teach every little facet of a complicated system to whomever wishes to bike shed.

I'm trying to understand a technical issue that you raised but as you have repeatedly deflected in answering it, I'm going to presume that it does not exist.

So, we are left with what I see as two primary technical issues in selecting filename extensions for Rutabaga ne Perl 6:

  • Editors are slow to change and already have mappings for some extensions we might consider
  • If module resolution and loading must consider more than one extension, then its resolution order is ambiguity the programmer must contend with (not to mention the fact that it can result in two files thinking they own the same namespace).

That is, as far as I can tell, the extent of the technical issues, and neither unduly impacts either of the primary models under consideration. Again, per @jnthn I will not seek to resolve which of the models we want to select, I'm just running down the list of concerns. Add to that list if you have a concrete, technical concern with either main approach.

@tony-o
Copy link

tony-o commented Sep 12, 2019

* If module resolution and loading must consider more than one extension, then its resolution order is ambiguity the programmer must contend with (not to mention the fact that it can result in two files thinking they own the same namespace).

@ajs having more than one extension removes the ambiguity.

Maybe we can encode the module/script files in the file extensions.

If we do not select a module naming convention and instead keep one name for everything, nothing technical breaks. That's all I'm trying to establish, here.

Yes, things do break when you have distributions in a CURF. You can read more about it here https://github.com/rakudo/rakudo/blob/master/src/core.c/CompUnit/Repository/FileSystem.pm6

As ugexe pointed out, if you have a distribution in a CURF with bin/script.pm6 and lib/bin/script.pm6. Then CURF incorrectly identifies what's available when extensions are the same and doesn't when the extensions are different. By stating that nothing breaks and implying that it's no big deal is aggravating and made worse by the I'm not engaging attitude when it's pointed out that your very narrow example may work fine but in a larger scenario having the same file extension for every type of file breaks things and puts an unnecessary burden on the people writing and maintaining tooling. Why someone would do that with their .pm6 files is neither of our business but when they ask for help that's a lot easier to find over IRC than trying to figure out that a CURF is mistaking bin/script.raku and lib/bin/script.raku.

There is no technical benefit to going with one extension justifying rewriting tooling and CUR* pointed out in this issue. Until there is, this seems like a bikeshedding discussion.

@ajs
Copy link
Author

ajs commented Sep 12, 2019

  • If module resolution and loading must consider more than one extension, then its resolution order is ambiguity the programmer must contend with (not to mention the fact that it can result in two files thinking they own the same namespace).

@ajs having more than one extension removes the ambiguity.

First, let's be clear: there is one (really 2, but more properly one) filename extension supported by Rakudo today: .pm6 (I say really 2 because .pm is also supported).

No other filename extension does anything. Indeed, I tend to write scripts with no filename extension whatsoever, and Rakudo deals with that just fine. .p6 is a convention that many users use, but I could name my scripts .perl6d-rakudo-2019.07.1-237-g0455f42, .pm6 or .python and they would continue to work. What we're talking about here is whether or not filename extensions supported by the compiler should suggest that such files are modules only. Of course, this ignores the Python-like approach of not having any scripts, and simply making entry-points in your modules which are installed with auto-generated wrappers which have no filename extension, in which case you again have only one practical extension.

So, to the issue you raise:

Yes, things do break when you have distributions in a CURF.

This only becomes an issue when you a) are using CURs, b) have a script directory at the top level AND c) have a lib directory that d) has a component of its path that is the same as that top-level bin directory and e) have a module with the same name as a script (including capitalization).

So, a filesystem like this:

x/
  y/
    z.q [module "y::z"]
y/
  z.q [script installed as, e.g., "/usr/bin/z"]

This is, to say the very least, a remote edge case that I have never seen play out in the wild (have you?) and for which I would expect ANY approach to involve a warning or error even if programatic ambiguity did not exist. But yes, this satisfies my request for a coherent statement of the technical issue. Thank you for that.

I think it is now safe to move on with the aforementioned resolution that there are no practical technical issues.

And with that, since this thread isn't about choosing anything, I think we have completed its useful purpose. I'll leave it to others to close out this issue or preserve it for posterity/reference.

@tony-o
Copy link

tony-o commented Sep 12, 2019

This is, to say the very least, a remote edge case that I have never seen play out in the wild (have you?)

Yes, we get issues like this for zef. You're limited experience isn't representative of the rest of the ecosystem. The issue I described is pretty easy to replicate on your local file system and far easier to replicate if you make the file extensions the same.

This only becomes an issue when you a) are using CURs

Everyone is using CURs so this seems unnecessary to mention.

b) have a script directory at the top level

Not uncommon.

c) have a lib directory that d) has a component of its path that is the same as that top-level bin directory

Ok? It is not that uncommon to have a bin/app that loads CLI commands from lib/bin/app.

e) have a module with the same name as a script (including capitalization).

Is that true on case insensitive file systems or just some arm chair nonsense?

I think it is now safe to move on with the aforementioned resolution that there are no practical technical issues.

I can't tell if you're intentionally being dense or trolling. Do you want to do the work to remove the ambiguity from module loading when the not so uncommon approach to loading/writing libraries? Do you even know what work would need to be done? If so, have you outlined it somewhere other than the lazy speculation you've provided on a github issue about file extensions for something that hasn't happened yet? Do you have PR pending that will DWIM even in not so uncommon "edge cases?"

Thank you for that.

Schoolyard cattiness aside, you're welcome.

Edit to add: this is one of many issues, this is one that requires a lot of work for a lot of people so we can aesthetically please "one file extension." I think it's inane and a waste of people's time and work when there are other places they can spend their effort.

@ajs
Copy link
Author

ajs commented Sep 13, 2019

Schoolyard cattiness aside

If you are reading some cattiness into what I've said, then I assure you that it's entirely on the reading end of the stick. I sought to coordinate a conversation. That was all. I asked technical questions and tried to be a proxy for those who would ask those questions years down the line in retrospect and got dismissal and condescension.

@ajs ajs closed this as completed Sep 13, 2019
@AlexDaniel AlexDaniel reopened this Sep 16, 2019
@vrurg
Copy link
Contributor

vrurg commented Sep 16, 2019

To my view, this topic is tainted. Opening a new, more constructive, one would be better. It would start with the following bottom line:

Basic (script) extension must be chosen: wether it be .raku or .rk. Depending on the choice:

  • for .raku accompanying extensions are:
    • .rakulib or .rakumod – TBD
    • .rakutest – TBD
    • .rakudoc - perhaps, everybody would agree
  • for .rk
    • .rkm
    • .rkd
    • no good option for test files.

@AlexDaniel
Copy link
Member

@vrurg sure, can you start a new ticket? :)

@AlexDaniel
Copy link
Member

OK, new ticket here. Thank you, @vrurg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language Changes to the Raku Programming Language
Projects
None yet
Development

No branches or pull requests