Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is fsi.exe an interpreter?

I've read that fsi.exe (F# Interactive) is not a true "interpreter" in the strict sense because it compiles F# code on the fly and displays its output.

I am under the impression that the word "interpreter" applies to "dynamic" languages (i.e. JavaScript) and therefore does not apply to F# since it is a compiled language.

Is this a fair assessment? Or can compiled languages be "interpreted"? Or is this just a semantics issue?

Appreciate any help.

like image 623
The Internet Avatar asked Dec 17 '22 05:12

The Internet


1 Answers

A difference between compilation and interpretation is blurred. Many languages perceived as "interpreted" are in fact often compiled to a native code (e.g., JavaScript with v8). Some implementations of the most dynamic feature of the dynamic languages, eval, are just wrappers around a compilation (e.g., in SBCL).

And of course REPL has nothing to do with compilation or interpretation, REPL can be built on top of any execution model. fsi is just a REPL, and it is using the same F# compiler core as fsc.

like image 187
SK-logic Avatar answered Dec 22 '22 00:12

SK-logic