fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

An F# or C# shebang executable should use a cached binary on subsequent runs

Open vsfeedback opened this issue 1 year ago • 1 comments

This issue has been moved from a ticket on Developer Community.


I wrote an F# shebang. It starts up slowly, of course.

It would be good if .NET would provide infrastructure to compile a shebang with AOT (in the background), cache the result, and use the result for subsequent runs. By comparing the shebang file against a hash stored with the cached binary, the system can respond appropriately if the shebang has changed.

Years ago I implemented a version of this technique called “compileAndGo”. It works great.


Original Comments

Feedback Bot on 11/17/2023, 06:21 AM:

(private comment, text removed)

vsfeedback avatar May 22 '24 10:05 vsfeedback

So, I hope I'm not misunderstanding, but you basically seem to suggest the process of compiling F# source files through the fsc command? The output is a binary file that is optimized for loading by the .NET Runtime and when recompiling, it will only do so if the hash of the file has changed.

Similarly, the language service of F# does this too, but then for individual source files and much more.

abelbraaksma avatar May 24 '24 00:05 abelbraaksma

So, I hope I'm not misunderstanding, but you basically seem to suggest the process of compiling F# source files through the fsc command?

Yes.

daveyostcom avatar Feb 18 '25 19:02 daveyostcom