fsprojects / IfSharp

F# for Jupyter Notebooks
Other
440 stars 71 forks source link

WIP: Migrate to .Net core #185

Closed baronfel closed 5 years ago

baronfel commented 5 years ago

This is seemingly (wondrously?) most of the way over to working on dotnet core. The projects have been migrated to target .netstandard2.0/.netcoreapp2.1 where appropriate, and we've got the publish step packaging all the libraries in-line.

The only big change so far is having to rework how the resource extraction works, because on .net core right now all resources from resx come across as the literal value string. I sorta like this way better because it's a bit more explicit about what we're doing with each of the resources.

Anywho, if you clone down and run ./build.sh Release && dotnet bin/IfSharp.dll, you should get this:

image

I haven't tested paket dependencies yet or the plotting/charting integrations, because I'm not that familiar with them.

cartermp commented 5 years ago

I love seeing all of that red in the project file 😄

baronfel commented 5 years ago

I have a suspicion that the appveyor build is configured in the appveyor settings (since I can't find an appveyor.yml). I could add one?

baronfel commented 5 years ago

I downloaded the artifacts and ran dotnet path/to/download/dir/IfSharp.dll and it installed itself in my jupyter and I was able to use the kernel.

cgravill commented 5 years ago

This is great!

I'd done some preparation by moving up to .NET 4.7.1 but hadn't tried running with .NET Core yet.

Yes, happy to switch to appveyor.yml it was just configured directly but doing it via source control is clearer and easier to coordinate.

There is a bit of a challenge here. It'd be great to move to .NET Core but there are existing people using the notebook with .NET Framework. For example, some people I work with have libraries that aren't built for .NET Core. Perhaps we should adopt an approach of supporting multiple kernels? I'm not sure of the best way to manage this, potentially totally separate installers with a .NET Standard shared library?

Note I made some conflicting changes to improve Mono support, hopefully they won't cause too much bother to merge.

baronfel commented 5 years ago

It would be pretty easy to multitarget and output a publish directory for mono/full framework and for dotnet core. We'd then just have to look into how best to configure the kernel configuration to choose one or the other.

cgravill commented 5 years ago

Perhaps it would make sense to have another console application e.g. ifsharpcore that targets .NET Core? That way we can manage the two ways of running and required dependencies. Hopefully the shared library can .NET Standard and adjusted to work with both.

With the Python there's precedent for having multiple kernels particularity for the Python2/Python3. We could do the same with e.g. F# and F# (Core) so that people can run them in parallel on systems that support it.

Moving everything over to SDK projects, the appveyor.yml are great changes to apply throughout.

baronfel commented 5 years ago

Thats definitely doable. Sorry for the radio silence, it's been a bit of a busy week at work and I haven't done much extracurricular work

cgravill commented 5 years ago

No problem, this is a side project for us all!

cgravill commented 5 years ago

I've gone ahead and merged #197 which builds directly on your efforts here @baronfel thanks for showing it was possible. It would great to do follow up to enable more parts of F# Jupyter to work on .NET with plotting and NuGet.