dotnet / llilc

This repo contains LLILC, an LLVM based compiler for .NET Core. It includes a set of cross-platform .NET code generation tools that enables compilation of MSIL byte code to LLVM supported platforms.
MIT License
1.52k stars 153 forks source link

Will LLILC be expected to work with F# code too? #980

Closed 7sharp9 closed 4 years ago

7sharp9 commented 8 years ago

If so it would be great to get a few simple tests in place to see this evolve over time :-)

AndyAyersMS commented 8 years ago

Yes, LLILC should be able to process any and all valid CIL.

It would be great to have F# tests for RyuJit too.

I don't believe anyone on our team has yet looked into what it would take to get F# tests added. We build tests from source so we'd need a cross-platform capable toolset. We could start with just windows support if there's a plausible roadmap suggesting how we'd have general cross-platform support (similar to what we're doing with IL-based tests and ILASM).

We have this on our roadmap and will get around to it sometime in the not-too-distant future, but we'd certainly welcome PRs here too.

7sharp9 commented 8 years ago

I'm using F# from mono on OSX, incidentally the F# compiler is bundled with mono.

Work is currently underway to support F# with coreclr I'm not entirely sure how coreclr will be deployed on OSx, currently there is still a dependency on mono until nuget is ported I think.

DemiMarie commented 8 years ago

I suspect that the hardest part will be mandatory tail calls. In F# these are not an optimization – they are guaranteed by the language specification, and the runtime must support them no matter what the caller and callee are.

LLVM supports this but only if the fastcc calling convention is used, which is incompatible with that of CoreCLR. One solution is to generate duplicate copies of the method: one exposed to the VM and one private to the JIT.

enricosada commented 8 years ago

@AndyAyersMS can you pls add some info? and maybe a link to an existing test you need in f#? or how we can help with this project or somethere else (coreclr/corert)?

Now the .NET Core sdk support F# OOTB, the fsharp compiler, the FSharp.Core library are both netstandard and works on all os supported by .net core sdk (osx/ubuntu/win)

using .net core sdk 1.0.0-preview2-003131 (the september update):

dotnet new --lang fsharp
dotnet restore
dotnet build

how can we help?