Skip to content

Conversation

@npmurphy
Copy link
Contributor

Bug #53 seems to be caused by incompatible .Net versions.
Bug #52 is caused by hard coding a specific version of FSCharting into IfSharp.

This pull request is a suggestion to fix both these problems by using Paket in the installation directory.
Paket can provide the correct version of the libraries for the users framework as well as the latest versions via nuget or github.

This also acts as a kind of light-weight plugin system. To add support for a new library one adds it to the paket.dependancies file and adds an fsx script to load the dlls and add helper functions.

I have demonstrated the idea in this PR with XPlot.Plotly.

The user runs #load XPlot.Plotly.fsx in their notebook (similar to %matplotlib inline in IPython) and the namespace is populated with the functions needed to use XPlot.Plotly (InitialiseNotebook and Show).

After IfSharp installation the user should run ./paket/paket.bootstrapper.exe from their installation directory.
Then paket.exe install to download the latest packages to their installation folder.
In future these commands could be run automatically on the first run of ifsharp.exe or some "magic" %paket commands could be added to the IfSharp Kernel.

I have also prepared a similar solution for FSCharting, the library has been removed from the Kernel and is added back to the kernel at runtime by an fsx script.

@cgravill
Copy link
Member

cgravill commented Apr 17, 2016

This approach looks like it has a lot of potential.

When I attempt to load this with Visual Studio 2015 I get get failures for duplicate items. I've taken a look at IfSharp.Kernel.fsproj and you're doing something with custom elements:

<None Include=".\helpers\XPlot.Plotly.fsx">
  <!-- Copied in a post build event -->
  <CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>

and

<Helper Include=".\helpers\XPlot.Plotly.fsx" />

does this work for you on other platforms? Could you perhaps just copy the whole helpers directory instead?

@npmurphy
Copy link
Contributor Author

It worked fine for me using FAKE, but I see in MonoDevelop that the files show up twice in the Project explorer.
I have fixed that and I hope it also works for VS.
Also now the paket files are put in the build output directory instead of .paket.

@cgravill
Copy link
Member

cgravill commented May 5, 2016

Great, when testing it on windows I got a crash against msbuild. I was able to resolve this by updating the F# Compiler Service. I sent you a PR npmurphy#5

When I try running #load "XPlot.Plotly.fsx" it's not seeing the file. For the copy

<Copy SourceFiles="@(CopyHelpers)" DestinationFolder="$(OutDir)" />

should that be aiming for the IfSharpConsole output directory instead?

source https://www.nuget.org/api/v2

nuget FSharp.Data.TypeProviders
nuget XPlot.Plotly No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's almost like you could have all of FsLab (http://fslab.org) as a dependency. Not quite sure of the ramifications of that though!

Copy link
Member

@cgravill cgravill May 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dsyme I'm open to including more. I checked and FsLab comes down as about 100MB.

There's a bit of question of how to let the user change versions. At the moment we've been saying they need to go edit this paket.dependencies file. Perhaps if we add helper functions to let users alter the dependencies inside the notebook? Then Paket will make fetch as needed.

@npmurphy
Copy link
Contributor Author

npmurphy commented May 5, 2016

@cgravill Yes it should. I have fixed that.

@npmurphy
Copy link
Contributor Author

npmurphy commented May 5, 2016

https://github.com/npmurphy/IfSharp/tree/fscharting_ripout
Provisional version of decoupling FSCharting using this method is here.
Please try it out.
For FSCharting.GTK I am currently modifying FSCharting.Gtk and using an unstable version of Oxyplot.

@cgravill
Copy link
Member

cgravill commented May 6, 2016

OK, I'll merge this then we can look at the other improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants