Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Staticlink vs standalone quirk with F#

In vs2010 ultimate edition if you hand the --standalone flag to the f# compiler in the projects pane it will not link an empty C# project with a configuration files/resource files

It will, however, link the assembly if you explicitly declare --staticlink:Config

This feels like a bug...if it is intentional, may I ask why this would be?

like image 725
Snark Avatar asked Apr 12 '11 05:04

Snark


People also ask

Where is R installed ubuntu?

Maintenance of R Packages The other r-cran-* packages shipped with Ubuntu are installed into the directory /usr/lib/R/site-library.


Video Answer


1 Answers

This is an expected behavior:

  • The standalone flag statically links the FSharp.Core.dll (F# runtime) and any reference assemblies that depend on it (i.e. any other F# assemblies). They need to be linked because they may share some types with the primary assembly (e.g. F# list type etc.)

  • The staticlink flag links any assembly that you explicitly specify (and any assemblies that depend on it). This means that you can use the option to link, for example, C# library that your main F# assembly references.

I think that the two cases are handled separately, because inlining F# runtime requires slightly special handling (almost all F# code uses it in some way, and the compiler probably treats it differently)

like image 69
Tomas Petricek Avatar answered Oct 29 '22 12:10

Tomas Petricek