开发者

Does F# Interpreter (fsi.exe) also produces Intermediate Language-Code as F# Compiler (fsc.exe) does?

开发者 https://www.devze.com 2023-02-03 07:43 出处:网络
Currently I\'m doing a recherche for university about F#. I have a question about the F# interact开发者_开发技巧ive Console and the F# compiler.

Currently I'm doing a recherche for university about F#. I have a question about the F# interact开发者_开发技巧ive 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消