You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes that would be the best solution, but that's really far away since it
has to go into compiler and then deployed. The Paket project could
contribute code for this.
But I'm more talking about a solution which could be enabled today.
Something like #r referencing a paket lib and calling functions.
On Sep 19, 2014 5:34 PM, "Robin Neatherway" [email protected]
wrote:
We were talking about enabling this natively in FSI. Perhaps something
like:
#r "nuget:////assembly.dll
How do you see this integrating with Paket?
—
Reply to this email directly or view it on GitHub #124 (comment).
Yeah I agree, it might take a while. Providing an easy API from Paket is a great idea as a first step. Currently Paket is distributed as a single executable right? A simple approach might be:
or similar, where Paket would just place all the fetched dlls in a particular directory. It's a shame that #r doesn't accept string variables, otherwise Paket could just return a string hiding the package directory structure to be passed onto #r.
Any tab-completion-for-files story for #r ? (Paket keeps stuff like NuGet does in a packages off project root with a [versionless, in constrast to NuGet defaults] subdir per NuGet), i.e. the location might be #r "../packages/FSharp.Data/FSharp.Data.dll"
Tab completion for the filesystem would be simple to add to FCS, but then needs to be exposed in every editor. If #r could just accept a string variable we could hide the filesystem details.
Fair point. I was missing a /lib in there too (and relative paths are never fun). Would you envisage it as a good idea to have the area into which stuff gets fetched as being a temp folder or actually in a project folder (e.g. for fsi in VS) ? Whether that is necessary would influence whether the #r "Paket.exe" bit requires passing of a storage area. Assuming not, could it look like this?
Another option is for paket to have a command so that running paket repl or paket fsi from the command line would launch fsi with -r:<assembly> for each of the assemblies specified in paket.references or paket.dependencies. An optional argument could be used to select a particular .NET framework version, using the latest as the default. We could also look at loading the solution/project output assemblies if one is found in the current directory. The code I use for project inspection in FSharp.AutoComplete would handle some of this.
An editor can then easily be configured to use an alternative fsi, which in this case would be paket itself.
I got that its only a literal but was working on the basis that such an impediment could easily be overcome using the Art of the Possible / SEP fields :)
@rneatherway Interesting idea. In principle the dependencies file is not important - it can have mutually exclusive packages and/or very broadly scoped packages.
Which leaves paket.references as the primary authority. In principle a paket-wrapped FSI could work but the following would need to be figured out:
Are we attempting to work on the fly in temp dirs? If so, target FW is a key ingredient and paket.references does not include versions either so hard to imagine that's sufficient info. Also a key aspect of many packages is source files (and paket is also v likely to have various ways of grabbing and consuming file(s) from gists/fssnip/github etc. (either finessed into nuget packages or not, TBD). So, Q: is dealing with this a) important and b) can much useful be achieved? (I think no)
Bottom line: Paket could extract a nupkg to a temp place but you have to wonder what's Paket-specific about that.
assuming we're talking about starting in a project context, is it possible to have supplied:
target fw
project (folder) path - would allow derivation of either projectname.fsproj.paket.references / paket.references
sln folder path and/or walk up to paket.dependencies file [which is assumed to be adjacent to packages folder and/or would refer to same]
If it is, Paket can easily derive the relevant set of dlls and sources. Is it?
Side things are:
Would there be a neat way for a paket update/install to trigger invalidation / prompt for restart of session from in FSI ?
any command worthy of restarting FSI would also touch the .fsproj (which begs the question, could the IDE offer to restart FSI sessions when you say OK, reload project)
Does FSI lock DLLs or shadow copy? Paket only does in-place updates
Any typical paket install/update emits all useful info into the fsproj - can stuff not work from there?
Paket doesn't really have an equivalent of Install-Package X -Version Y - you add to deps and/or refs and tell it "make it so" by an overall install/update.
Bottom line is in a sln/proj case, the fsproj always has authoritative info so the info as a whole might as well be sourced there and as long as the DLLs are not being locked, paket can update v easily.
I personally would love to have a magic button to load/reload up my project in a FSI because having to copy refs to clipboard etc. makes it so much harder to Just Do.
Paket can then simply grow a "paket add" of some kiind which triggers download/install and a relevant reload as per above.
All of this is thinking aloud from someone that doesnt use FSI enough. @ptrelford Any ideas/dreams ? You tried Paket yet?
I got that its only a literal but was working on the basis that such an impediment could easily be overcome using the Art of the Possible / SEP fields :)
OK sorry! In that case it's a neat suggestion, but if we assume we can modify FSI, I would go the whole hog and add nuget/project support directly.
To answer some of your points/questions:
I do not imagine working in a temp dir, but rather in the context of a particular solution, project or just paket.* file. If the context is a solution or project, this can be used to determine an exact set of assemblies to include. So, to your question "is it?", I believe it is.
I believe FSI now supports shadow copy.
Yes we could work directly from the fsproj, but the argument for it being in Paket is then slightly weaker, although I believe still worthwhile.
Not sure about triggering updates/reloads of FSI. I agree it would be very nice to at least offer the chance to restart with new assemblies.
but the argument for it being in Paket is then slightly weaker,
I dont think anyone wants anything in Paket per se - people just want stuff to work. Paket is happy to helper and its nice is stuff is composable but it def doesn't 'want'/need it ? i.e. I dont know what you mean but assume you mean nothing!
Let Paket project into the .fsproj, run that via commandline and/or VS commandlined Ctrl-Alt-A to run paket install and work from there within VS:
shadow copying makes this doable
fsi reload is useful feature anyway
Q: that doesnt give a good standalone FSI story
Q: how does one mix fsx and DLLs then (i.e. have to go ferriting around in trees to find DLLs, copy those, then find fsxes)
So, circling back around, it seems to me that something in Paket like:
I dont think anyone wants anything in Paket per se - people just want stuff to work. Paket is happy to helper and its nice is stuff is composable but it def doesn't 'want'/need it ? i.e. I dont know what you mean but assume you mean nothing!
If this feature works directly from the .fsproj then it isn't Paket-specific, hence the argument for it being incorporated into Paket as opposed to some other tool is weaker than a feature that uses the paket.* files.
It seems to me that the "magic import" #124 (comment) ...
I'm discounting all features that require modification to FSI. The turnaround time and upgrade delay would leave this feature unreliable for years to come.
I also am not a fan of VS-specific solutions. I usually use Emacs, and I think Paket could be a great way to continue to improve the .NET development experience on Unix.
That said, I think emitting an fsx with the reference closure and optionally launching fsi including that fsx is a good option. I have an MSBuild task here that actually constructs such an fsx as part of the build. I also have code in the Emacs support for F# that could be used to do the same thing.
If this feature works directly from the .fsproj then it isn't Paket-specific, hence the argument for it being incorporated into Paket as opposed to some other tool is weaker than a feature that uses the paket.* files.
Ah, I was thinking of tool as a standalone exe / DLL. In the case of emitting to the fsproj, I'd picture the things picking it up being the e.g. VFPT which I don't see as fitting the term "tool" - I call that "integrated into one or more plugins and/or the project system". (Not arguing, just explaining why the comment didnt initially make sense to me)
AIUI #166 would deal with the files being present in the file system and in the project
I also am not a fan of VS-specific solutions. I usually use Emacs, and I think Paket could be a great way to continue to improve the .NET development experience on Unix.
I appreciate that. I'm effectively in the same camp despite on the surface being in a different world. I like and use VS but I like having a proper build too and I cant imagine using any variant of the NuGet tooling in VS again - i.e. Package Manager Console and its stuff makes no sense.
The view I take is that the more general/composable something like this is, the wackier a bot @mathias-brandewinder and his like can write .
I'm discounting all features that require modification to FSI. The turnaround time and upgrade delay would leave this feature unreliable for years to come.
That said, I think emitting an fsx with the reference closure and optionally launching fsi including that fsx is a good option. I have an MSBuild task here that actually constructs such an fsx as part of the build. I also have code in the Emacs support for F# that could be used to do the same thing.
Then perhaps... is there/should we request a #include facility in FSI that would allow an FSX to pull in another one?
If you had that, then you could tell paket install to generate fsxi files per project. These files would have #r and/or #load statements. They could be genned into the packages folders.
Then .fsx files can #include "../../packages/FSharp.Data/all.fsix"
In the meantime and/or for generalized builds you can have a task or a script that will CPP-stlye preprocess fsx files if it's not there yet.
i.e. Just because everyone can't use it now shouldnt rule out considering it as part of the solution.
Another thing to consider in all this is that a package can have nested dependencies - e.g. if you want to stand up an in memory owin host, the unit of what you want loaded into your fsx context might be 15 nupkgs worth of stuff (maybe source, maybe DLLs, prob a combo).
This isn't ready to be merged, but is working and shows you what I mean. I couldn't decipher the command-line parser (NDesk.Options is pretty nice, flexible and simple) so at the moment it uses the nuget option to specify the project file of interest.
Call with:
paket.exe emitfsx nuget <path/to/my.fsproj>
and it prints the full list of assemblies with #r needed for a fsx script to explore that project.
Activity
Create 2014-09-18-meeting-notes.md
rneatherway commentedon Sep 19, 2014
We were talking about enabling this natively in FSI. Perhaps something like:
How do you see this integrating with Paket?
forki commentedon Sep 19, 2014
Yes that would be the best solution, but that's really far away since it
has to go into compiler and then deployed. The Paket project could
contribute code for this.
But I'm more talking about a solution which could be enabled today.
Something like #r referencing a paket lib and calling functions.
On Sep 19, 2014 5:34 PM, "Robin Neatherway" [email protected]
wrote:
rneatherway commentedon Sep 19, 2014
Yeah I agree, it might take a while. Providing an easy API from Paket is a great idea as a first step. Currently Paket is distributed as a single executable right? A simple approach might be:
or similar, where Paket would just place all the fetched dlls in a particular directory. It's a shame that
#rdoesn't accept string variables, otherwise Paket could just return a string hiding the package directory structure to be passed onto#r.bartelink commentedon Sep 19, 2014
Any tab-completion-for-files story for
#r? (Paket keeps stuff like NuGet does in apackagesoff project root with a [versionless, in constrast to NuGet defaults] subdir per NuGet), i.e. the location might be#r "../packages/FSharp.Data/FSharp.Data.dll"rneatherway commentedon Sep 19, 2014
Tab completion for the filesystem would be simple to add to FCS, but then needs to be exposed in every editor. If
#rcould just accept a string variable we could hide the filesystem details.bartelink commentedon Sep 19, 2014
Fair point. I was missing a
/libin there too (and relative paths are never fun). Would you envisage it as a good idea to have the area into which stuff gets fetched as being a temp folder or actually in a project folder (e.g. for fsi in VS) ? Whether that is necessary would influence whether the#r "Paket.exe"bit requires passing of a storage area. Assuming not, could it look like this?rneatherway commentedon Sep 19, 2014
No sadly you can only pass it a literal string.
Another option is for paket to have a command so that running
paket replorpaket fsifrom the command line would launch fsi with-r:<assembly>for each of the assemblies specified inpaket.referencesorpaket.dependencies. An optional argument could be used to select a particular .NET framework version, using the latest as the default. We could also look at loading the solution/project output assemblies if one is found in the current directory. The code I use for project inspection in FSharp.AutoComplete would handle some of this.An editor can then easily be configured to use an alternative fsi, which in this case would be paket itself.
bartelink commentedon Sep 20, 2014
I got that its only a literal but was working on the basis that such an impediment could easily be overcome using the Art of the Possible / SEP fields :)
@rneatherway Interesting idea. In principle the dependencies file is not important - it can have mutually exclusive packages and/or very broadly scoped packages.
Which leaves
paket.referencesas the primary authority. In principle a paket-wrapped FSI could work but the following would need to be figured out:paket.referencesdoes not include versions either so hard to imagine that's sufficient info. Also a key aspect of many packages is source files (and paket is also v likely to have various ways of grabbing and consuming file(s) from gists/fssnip/github etc. (either finessed into nuget packages or not, TBD). So, Q: is dealing with this a) important and b) can much useful be achieved? (I think no)Bottom line: Paket could extract a
nupkgto a temp place but you have to wonder what's Paket-specific about that.projectname.fsproj.paket.references/paket.referencespaket.dependenciesfile [which is assumed to be adjacent topackagesfolder and/or would refer to same]If it is, Paket can easily derive the relevant set of dlls and sources. Is it?
Side things are:
paket update/installto trigger invalidation / prompt for restart of session from in FSI ?Install-Package X -Version Y- you add to deps and/or refs and tell it "make it so" by an overall install/update.Bottom line is in a sln/proj case, the fsproj always has authoritative info so the info as a whole might as well be sourced there and as long as the DLLs are not being locked, paket can update v easily.
I personally would love to have a magic button to load/reload up my project in a FSI because having to copy refs to clipboard etc. makes it so much harder to Just Do.
Paket can then simply grow a "paket add" of some kiind which triggers download/install and a relevant reload as per above.
All of this is thinking aloud from someone that doesnt use FSI enough. @ptrelford Any ideas/dreams ? You tried Paket yet?
rneatherway commentedon Sep 20, 2014
OK sorry! In that case it's a neat suggestion, but if we assume we can modify FSI, I would go the whole hog and add nuget/project support directly.
To answer some of your points/questions:
paket.*file. If the context is a solution or project, this can be used to determine an exact set of assemblies to include. So, to your question "is it?", I believe it is.bartelink commentedon Sep 26, 2014
@rneatherway Apologies for not replying earlier. I was hammocking #154 and #166
Firstly re
I dont think anyone wants anything in Paket per se - people just want stuff to work. Paket is happy to helper and its nice is stuff is composable but it def doesn't 'want'/need it ? i.e. I dont know what you mean but assume you mean nothing!
It seems to me that the "magic import" #124 (comment) : would mesh well with #154 if it can project out packages (see also my monolog 'with' @jeffhandley in https://jabbr.net/#/rooms/fsharp today)
The problem with
or
Is
#154 and projecting as
nupkgs would allow 2 broad approaches:work off Paket's knowledge:
#r <| Paket.Open "PACKAGENAME" "$SolutionFolder" "$(TargetPlatform)"Q: Could easily be >1 assembly, magic-#r would need to deal with that
Q: wouldnt you want to be able to
#loadsource items in it too ?So maybe a magic shellesque backtick operator in FSI could do:
could expand the packages and emit:
Let Paket project into the
.fsproj, run that via commandline and/or VS commandlined Ctrl-Alt-A to runpaket installand work from there within VS:Q: that doesnt give a good standalone FSI story
Q: how does one mix fsx and DLLs then (i.e. have to go ferriting around in trees to find DLLs, copy those, then find fsxes)
So, circling back around, it seems to me that something in Paket like:
paket.exe emitfsx --sourcescould generate something like
And then one could use that in commnandline fsi via cut and paste:
paket.exe emitfsx --sources | clipAnd with a bit of work, if fsxs supported a
#nor shelly backtick construct they could call out to paket a bit like this:OR
where
$(TargetPlatform)comes from VS--sourcescontrols whether/how to include snippets etcThoughts?
rneatherway commentedon Sep 26, 2014
If this feature works directly from the
.fsprojthen it isn't Paket-specific, hence the argument for it being incorporated into Paket as opposed to some other tool is weaker than a feature that uses thepaket.*files.I'm discounting all features that require modification to FSI. The turnaround time and upgrade delay would leave this feature unreliable for years to come.
I also am not a fan of VS-specific solutions. I usually use Emacs, and I think Paket could be a great way to continue to improve the .NET development experience on Unix.
That said, I think emitting an fsx with the reference closure and optionally launching fsi including that fsx is a good option. I have an MSBuild task here that actually constructs such an fsx as part of the build. I also have code in the Emacs support for F# that could be used to do the same thing.
bartelink commentedon Sep 26, 2014
Ah, I was thinking of tool as a standalone exe / DLL. In the case of emitting to the fsproj, I'd picture the things picking it up being the e.g. VFPT which I don't see as fitting the term "tool" - I call that "integrated into one or more plugins and/or the project system". (Not arguing, just explaining why the comment didnt initially make sense to me)
AIUI #166 would deal with the files being present in the file system and in the project
I appreciate that. I'm effectively in the same camp despite on the surface being in a different world. I like and use VS but I like having a proper build too and I cant imagine using any variant of the NuGet tooling in VS again - i.e. Package Manager Console and its stuff makes no sense.
The view I take is that the more general/composable something like this is, the wackier a bot @mathias-brandewinder and his like can write .
Then perhaps... is there/should we request a
#includefacility in FSI that would allow an FSX to pull in another one?If you had that, then you could tell
paket installto generatefsxifiles per project. These files would have#rand/or#loadstatements. They could be genned into the packages folders.Then
.fsxfiles can#include "../../packages/FSharp.Data/all.fsix"In the meantime and/or for generalized builds you can have a task or a script that will CPP-stlye preprocess fsx files if it's not there yet.
i.e. Just because everyone can't use it now shouldnt rule out considering it as part of the solution.
Another thing to consider in all this is that a package can have nested dependencies - e.g. if you want to stand up an in memory owin host, the unit of what you want loaded into your fsx context might be 15
nupkgsworth of stuff (maybe source, maybe DLLs, prob a combo).9 remaining items
forki commentedon Oct 15, 2014
Sounds exciting
On Oct 15, 2014 6:52 PM, "Robin Neatherway" [email protected]
wrote:
bartelink commentedon Oct 15, 2014
Interesting; sounds great. Really looking forward to using all of this!
forki commentedon Oct 28, 2014
What does this mean?
rneatherway commentedon Oct 28, 2014
Please see my just added PR #303
This isn't ready to be merged, but is working and shows you what I mean. I couldn't decipher the command-line parser (NDesk.Options is pretty nice, flexible and simple) so at the moment it uses the nuget option to specify the project file of interest.
Call with:
paket.exe emitfsx nuget <path/to/my.fsproj>
and it prints the full list of assemblies with #r needed for a fsx script to explore that project.
Starting to make the REPL support a thing - references #124
Starting to make the REPL support a thing - references #124
Starting to make the REPL support a thing - references #124
Starting to make the REPL support a thing - references #124
Add remove function for REPL - references #124
Add more docs for REPL - references #124
Add more docs for REPL - references #124
Add more docs for REPL - references #124
Add more docs for REPL - references #124
Add more docs for REPL - references #124