dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.9k stars 783 forks source link

F# support and ASP.NET v5 ? #682

Closed ghost closed 8 years ago

ghost commented 9 years ago

Will F# completely support ASP.NET 5 (old postings like "http://blog.alxandr.me/2014/11/23/f-in-asp-net-5-the-good-the-bad-and-the-really-ugly/" seems to indicate problems) ?

ctaggart commented 9 years ago

I really hope so and I hope it works on Linux. Great progress was made a couple of weeks ago with getting the compiler to run on CoreClr #646. Over the weekend, I created a Docker container to see how far I could get with getting it to build on Linux #680. Besides ASP.NET, I'd like to get Suave running on CoreClr on Linux.

panesofglass commented 9 years ago

This should make Suave on Linux worthwhile with or without CoreClr: https://github.com/SuaveIO/suave/pull/306.

Alxandr commented 9 years ago

@bluemmc the main problem (IMHO), the ANI creation part is moot as ANIs were removed from DNX. F# in DNX works just fine (see https://github.com/YoloDev/YoloDev.Dnx.FSharp/tree/master/sample). There is some manual trickery to get tooling working, but it's not really a problem. Just a slight annoyance upstart. Obviously, there is no CoreClr support yet, but I'll update with that as soon as it's landed.

dsyme commented 9 years ago

Hi @Alxandr

How can we (both Microsoft and the F# community) help you move the YoloDev.Dnx work more into a mainstream role as the canonical F# + ASP.NET vNext solution for F#?

For example

I can help with this if you'd like to move in this direction.

forki commented 9 years ago

Maybe @davidfowl can comment on the https://github.com/aspnet question.

Alxandr commented 9 years ago

Highly doubt we're getting it into https://github.com/aspnet. As far as I understand, the ASP.NET team have more than enough work already. Even VB isn't yet supported officially in DNX (not that VB is more important than F# in any way, but given that VB uses Roslyn, adding support for it would be fairly easy compared to F#). This might be something worth investigating post v1 though.

@dsyme I'm not opposed to moving the repo anywhere, nor taking on contributions, but a few things needs to be understood first:

  1. I made the code with the intention of getting F# code running in DNX first and foremost. I'd attempted previously to write the compiler bridge (hereby just called the compiler) in F#, bootstrapping it using another program I created for that very purpose, but because of volatile APIs, this became unfeasible, so I gave up on it. So, as the goal was getting things to work first and foremost, I wrote the new version (abandoning the previous one and doing a complete rewrite) in C#. More than that, I even started with the Roslyn compiler, practically mirroring their API for F#.
  2. As you probably know, the code is written by me and me alone. I can not vouch for it's quality in any way. And there is negligible unit-testing in place (it just tests that an assembly written in F# can actually be loaded through DNX).
  3. The main work needed to get this working better than it already is, isn't work in the DNX F# compiler, but in FSharp.Compiler.Service. Primarily in getting it compiling to memory only. I attempted to do that myself, as you are probably well aware, ran into problems, asked for help, and have heard nothing in about a year. Except that PPDBs might play into this. See https://github.com/fsharp/FSharp.Compiler.Service/pull/271 for more info. Again, in the interest of getting things to just work, I abandoned compiling to memory altogether, resigning myself to having to take the speed penalty of the compilation IO during startup.

These are at least the points I can make at the top of my head. Also note that if you want to transfer the compiler out somewhere, you need a nuget distribution channel (ie. a myget feed), and a ci that can run ~nightly (I use appveyor), because the APIs still break every now and again.

ctaggart commented 9 years ago

linking https://github.com/aspnet/Home/issues/982

ghost commented 9 years ago

Thanks for all the answers.

@Alxandr So as I understand your answers it is possible to get F# work with ASP.NET 5 but there is no official way to do it. There is only your own hackish approach which is not quality assured. Also there is no support for CoreClr yet which is the most interesting deployment target of ASP.NET 5 IMO (would like to use F# + ASP.NET on CoreClr to write microservices for non-windows targets).

Alxandr commented 9 years ago

First of all, it's not hackish. It's adding F# compiler support in the way intended to add language support for other languages, using the same APIs the C# one does (which just happens to be the default compiler).

Second, the code is all up on GitHub, so you're more than welcome to quality assure it yourself if you want to. Or even contribute.

Otherwise your statements are correct. Nothing I can do about CoreCLR. It's not supported by F# yet.

On Wed, Oct 14, 2015, 12:08 bluemmc notifications@github.com wrote:

Thanks for all the answers.

@Alxandr https://github.com/Alxandr So as I understand your answers it is possible to get F# work with ASP.NET 5 but there is no official way to do it. There is only your own hackish approach which is not quality assured. Also there is no support for CoreClr yet which is the most interesting deployment target of ASP.NET 5 IMO (would like to use F# + ASP.NET on CoreClr to write microservices for non-windows targets).

— Reply to this email directly or view it on GitHub https://github.com/Microsoft/visualfsharp/issues/682#issuecomment-147999922 .

Alxandr

dsyme commented 9 years ago

To clarify, my suggestion is to use @Alxandr's work as a unified starting point for those who want to make F# + ASP.NET vNext work well together. This would include both contributors at Microsoft and the broader community.

The F# community have a good history of getting things off the ground this way: for example the Visual F# Power Tools started as a way to bring various F# refactoring tools together.

There would be much to do, and @Alxandr has described the technical path forward well. With CoreCLR support coming on line via @KevinRansom's work, I think we could do good things here.

Best Don

Alxandr commented 9 years ago

Sure. @dsyme, just let me know if you want me to transfer the repository somewhere. Or you can obviously just fork it if you want to. Also, if there's any license problems or the likes, let me know.

ctaggart commented 9 years ago

Here is the new home: :) https://github.com/fsprojects/fsharp-dnx

ghost commented 8 years ago

BTW: Have you all seen this "https://github.com/davidfowl/vNextLanguageSupport" which shows some F# support for the project types in vNext ?

Alxandr commented 8 years ago

Yes. And it's horribly outdated. The fsharp-dnx project builds on the same APIs (though the newer versions). The project you linked was a proof of concept made by Fowler like a year ago or so.

enricosada commented 8 years ago

i am working to use https://github.com/fsprojects/fsharp-dnx in coreclr branch ( add .xproj with parallel solution ), i'll send a pr soon

ghost commented 8 years ago

See also "https://github.com/Microsoft/visualfsharp/issues/788" which raise two major issues that is outside the current fsharp-dnx scope:

Alxandr commented 8 years ago

Interoperability works. Just not tooling.

On Mon, Dec 14, 2015, 08:08 bluemmc notifications@github.com wrote:

See also "#788 https://github.com/Microsoft/visualfsharp/issues/788" which raise two major issues that is outside the current fsharp-dnx scope:

  • Visual studio support.
  • Interoperability - solutions with mix of C# and F# projects.

— Reply to this email directly or view it on GitHub https://github.com/Microsoft/visualfsharp/issues/682#issuecomment-164364642 .

Alxandr

dsyme commented 8 years ago

Closing old discussion