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
Comments
|
@AlexDaniel My dyslexia was going strong. I re-read your title edit three times I still didn't see it! Thanks! |
|
My personal take is that:
Side benefit to that last one: rakupod really does sound like a type of dinosaur... |
To clarify, we already have this pull request which says 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. |
How do we not know? |
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
The whole As for modules, what @ugexe says sounds about right. |
|
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. |
|
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 |
|
@ugexe I'm not sure what you mean. Is there some special handling that is unusual among HLLs, here? When I currently run:
It is very clear what has to happen, regardless of what the filename on But if I do:
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? |
@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? |
|
@nxadm It's not a problem, I'm just pointing out that the distinction has a use. |
|
Noting this:
And this:
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. |
Yes, you are restricting your entire point to The behavior must be consistent for |
|
@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
This does not break because you named the file 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? |
People can and do put other files into the
It's a bit more complicated than that.
|
|
Amazing. |
and when there is (what would currently be)
Scripts aren't precompiled, so 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 |
|
|
This choice could be a recommendation. Like no one enforces a repository to be prefixed with |
|
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 |
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. |
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:
|
Maybe, but people are already using |
|
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: Even though that last one may be uncommon. Just some background as to why:
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. |
Not sure how happy the Racket folks are gonna be about this one..:) |
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. |
|
@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 If you want everything in one place, then just put them all in the same file. Rubar ne Perl 6 handles that just fine. |
They (at least in my case) are doing so because tests conventionally are |
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.) |
Isn't that the reason they do that strange thing? if __name__ == "__main__":
main() |
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)...? |
I think there's some substantial confusion here. There are two issues:
The equivalent of the above in Perl 6 is: Which as you can see, works exactly as the python in both contexts: 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 |
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
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. |
|
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. |
|
Thank you @ajs , I prefer
I also prefer
For test files, I think |
@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? |
Sure, done. |
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 ) |
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'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:
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. |
@ajs having more than one extension removes the ambiguity. Maybe we can encode the module/script files in the file extensions.
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 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. |
First, let's be clear: there is one (really 2, but more properly one) filename extension supported by Rakudo today: No other filename extension does anything. Indeed, I tend to write scripts with no filename extension whatsoever, and Rakudo deals with that just fine. So, to the issue you raise:
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: 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. |
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.
Everyone is using CURs so this seems unnecessary to mention.
Not uncommon.
Ok? It is not that uncommon to have a
Is that true on case insensitive file systems or just some arm chair nonsense?
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?"
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. |
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. |
|
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:
|
|
@vrurg sure, can you start a new ticket? :) |
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:
.rakuand.rk).rkm).rktwould be the obvious choices).rdas a proposal, but.rpod,.rakupodand.rakudocare also potentially useful. It should also be noted that.pod6isn't necessarily out of the question, given that it's not "Perl" specific and is currently recognized..rkto relate to an obsolete file format.Am I missing anything?
Pinging parties involved in the original discussion: @AlexDaniel @duncand @vrurg
The text was updated successfully, but these errors were encountered: