As of F# 1.9.6.16 and Mono 2.4.2.3 I am failing to AOT the F# assemblies, getting a segmentation fault. fsi
is barely usable (and sometimes crashes), and fsc
is quite painfully slow. Under windows, F# is not the fastest compiler either. Is there anything to help the situation?
views:
313answers:
2The best way to help this situation is to file bugs. If you have a particular project or environment which is having a significant slow down I highly encourage you to file a bug. Often times real world customer scenarios are very instructive in tracking down performance problems in products.
F#, like the rest of the languages in visual studio, process customer bugs filed via Microsoft's connect website.
(EDIT: In the specific case of F#, you are also welcome to email [email protected].)
I just found a way to write F# scripts on Linux that do not rely on fsi
but rather automatically recompile and are therefore reasonably fast:
Given /usr/local/bin/fsx
:
#!/bin/bash
src=$1
tgt=$src.exe
if [[ $src -nt $tgt ]]
then
fsc $src -o $tgt >/dev/null && exec mono $tgt
else
exec mono $tgt
fi
One can write scripts that omit the shebang, relying on the default shell:
#light (*
exec fsx $0
*)
printfn "Hello, world!"
When run, the shell skips the first line thinking it is a comment, and runs exec fsx $0
, which compiles the script with fsc
if the executable is out of date, and then runs it. For F#, the shell command is just a comment.