4 ms·
.NET has native ahead-of-time compile options that are getting better all the time. F# actually works better with these tools than other .NET languages because
by dfgdghdf 6y ago
.NET has native ahead-of-time compile options that are getting better all the time. F# actually works better with these tools than other .NET languages because it is less reliant on reflection etc. to build its abstractions.
You can write C bindings for F# libraries compiled this way.
- whb07 6y agoI've toyed around on a weekend or two looking at the different ways to AOT stuffs for F#. Here is what I found: Same hello-world console app from C# runs alright with AOT. The F# does not as it relies on heavier reflection stuffs (at least thats what it seems like). The F# version did compile but just crashed on run. The suspect appears to be the way to console print seems to call a different non AOT function. The interesting part was I did write some bindings calling for a console print via CFFI that did then allow me to compile the F# app and run fine.
- pjmlp 6y agoThat is a well known issue, also what prevented F# to be properly used in .NET Native. https://github.com/dotnet/corert/issues/5780#issuecomment-401877015 https://github.com/dotnet/corert/issues/5780#issuecomment-40...
- dfgdghdf 6y agoSounds like things have shifted since I last used it. Here's hoping they resolve this stuff soon!