-
Notifications
You must be signed in to change notification settings - Fork 641
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
Split the .ipkg commands and the HTML doc gen into separate executables #1126
Comments
I think we can go one further with this, namely introduce Naturally |
Also whoever tackles this might want to look at Issue 897. |
Yes, this is clearly related to #897. In fact, I think this would be a good first step: get some of the ugly out and make it nice first, then tackle the big uglies. |
This is a quick and dirty solution for idris-lang#1071. I wish I were able to implement output of metadata, but since there is no metadata saved (currently) alongside of a package, there is nothing to display. Displaying metadata in the output of this subcommand would mean that there have to happen further improvements in the package-system of idris. Please see my proposal in idris-lang#1126.
Just made my PR for #1071 and knowing cabal hell as well as ruby's bundler, I would like to make some proposals of how package-management should be handled, and hope it is the right place here:
This is quite a lot of writing for someone just trying to enter the project, but I would also be willing to try to get some of this stuff implemented in idris. |
@NobbZ cheers for the suggests over what an Idris package manager should look like. Rarely have people put money where their mouth is! However, package management is not small task and there are lots of things to consider as you indicate in your above comment. I too have been working on a feature proposal for package management and see from my notes that we overlap. Aside from the issue of sub-commands I would like to welcome you to contribute.your ideas to the proposal once it has been made public. |
Looking for some more low-hanging fruit now that I'm up-to-date with Type Driven Development with Idris! It looks like the main problem here is the length of What do you folks think about addressing this issue by using "subcommands". One downside is that they are not backwardly compatible (but it could be something to consider before 1.0). It looks like this would work nicely, allowing us to separate the option processing of different subcommands which addresses the current centralisation in If folks are happy with the subcommand approach, we could even subsume the codegen executables (at least the 3 that are built into the idris library) — though perhaps a separate issue/PR. Note: Sometimes executables are hard-linked to have an effect like this. e.g. ScopeJust to confirm, it seems that the scope of this issue is to separate the following pkg options from
In particular, I cannot find any other documentation options other than the one here that's related to packages. |
'Great minds' think alike. I too have considered introducing the use of sub-commands, and to me that would be a 'better' fix for this issue. In some of the many undocumented conversations I have had with people about Idris' CLI it would be nice to retain the current CLI, and that when invoking I think with the sub command approach, it would allows us to retain the original functionality and have a shiny new better CLI. With all honestly haven't found the time to get round to producing a PR for this, there are other things that need addressing too... Some other minor things to bear in mind, I'll list them for convenience.
|
@jfdm, that sounds good. The idea that Nice to hear that you've been working on this and that As for the codegen executables, I don't have strong feelings about it but having a single executable I'm certainly happy to start looking into this with a focus on extracting the 'package' option processing into a separate Haskell module. In particular, are there any documentation generation options besides So, should I go ahead and start on this? Please assign this issue to me if you can! |
@jfdm Sorry for my confusion about I like that you've moved a bunch of functions from Anyhow, besides a few small tweaks to I've also got an idea about having sub-commands but retaining backwards compatibility. Basically:
That's the royal "we" of course. I'm happy to look at it :). |
Yeah, there are still small tweaks that can be made. Shifting I would like to keep this issue open as it encompasses the CLI of idris rather than just the state of REPL, and Also, there are definite other subcommands to consider. There might be a list somewhere, if not I think it could be adapted from comments made in #1454. For keeping the current interface, I thought a simpler approach would be: try parsing a sub command, if nothing recognised then fall back to it. However, my experiences with opt-parse-applicative is not great. SO do not take my word for it. As for a |
@jfdm hadn't realised you'd tried to clean up It's fine to keep this issue open but the name does need updating. I am unable to change it. I'm happy to keep niggling away at the CLI/sub-command thing and see what happens. As for the simpler approach to backwards compatibility. I like simpler approaches! I'm unsure what you mean by "fall back to it". Do you mean the current options parser? I don't think it would be a good idea to maintain subcommand options parsers and the current megalith. Perhaps you mean something else? I don't have a lot of experience with opt-parse-applicative either but I'm happy to get into it. The only thing that really slowed me down was some arrow syntax which I am unfamiliar with. I noticed that additional checks (beyond the option parsers) have been put in place. For example: $ idris --repl test/pkg001/test-pkg.ipkg fred
Not all command line options can be used to override package options.
The only changeable options are:
--log <lvl>, --total, --warnpartial, --warnreach
--ibcsubdir <path>, -i --idrispath <path>
--logging-categories <cats>
The options need removing are:
Filename "fred" Ideally these checks would be built into the parsers. No promises though — it's probably harder than it looks. There's certainly quite a few options (many of which I have never used). It's quite likely that incompatible/unused options are currently ignored by some commands. As for a list of sub-commands, I took a look at #1454 but it looks like I already have a fairly comprehensive list of candidates (compile, package, repl/console, client/ide-slave, info). AFAICT, the "documentation builder"/idrisdoc is no longer separate from the package sub-command. I did find more candidates as I trawl through $ idris --execute
Uncaught error: Elaborating {__infer0} arg {ival0}: NoSuchVariable Main.main
$ cat >foo.idr
module Main
main : IO ()
main = putStrLn "Hello there"
$ idris --execute foo.idr
Hello there
$ idris --exec 'putStrLn "Hello fred"'
Hello fred
$ idris --eval '6 * 7'
42 : Integer I've not used these options/commands before. Seems that |
This would be a good way to clean up REPL.hs, and it's a good project for a new developer. The idea is to have three (quite thin) top-level executables in the .cabal file, and then have them use the compiler as a library. This would also greatly simplify command-line processing. Suggested names:
idrispkg
andidrisdoc
.The text was updated successfully, but these errors were encountered: