Currently I'm doing a recherche for university about F#. I have a question about the F# interactive Console and the F# compiler.
The F# compiler produces Microsoft Intermediate Language (MSIL) code when its compiling F#-source. This is then translated by the JIT-compiler to machine code, when executing the written program.
But what does the F# Interpreter Console do? Does it also line-per-line translate the F# Code into MSIL, and then JIT that into machine code? Or does it translate the F#-Code directly into machine code?
If it converts it to IL first, then I think there probably will be an IL-interpreter because the JIT-compiler only compiles complete programs. Won't it?
What do you think, how F#-interpreter handles F# code and translates it?
Greetings, Martin
The F# compiler emits IL using its own library AbsIL. AbsIL is another MSR project which was absorbed by F#.
When compiling for the interactive mode, AbsIL uses the System.Reflection.Emit namespace to emit IL in memory, at runtime, which is in turn compiled to native code by the JIT as it executes the code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With