Header menu logo F# Compiler Guide

FSharp.Compiler.Service

The FSharp.Compiler.Service package is a component derived from the F# compiler source code that exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes dynamic execution of F# code that can be used for embedding F# scripting into your applications.

Available services

The project currently exposes the following services that are tested & documented on this page. The libraries contain additional public API that can be used, but is not documented here.

NOTE: The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published

The Public Surface Area

We are in the process of cleaning up the surface area of FCS to allow it to be fully binary compatible going forward.

The full current surface area can be seen at: https://fsharp.github.io/fsharp-compiler-docs/reference/index.html

The API is generally designed with F#/.NET design conventions (e.g. types in namespaces, not modules, no nesting of modules etc.) and we must continue to iterate to make this so.

The parts of the compiler under FSharp.Compiler.AbstractIL.* are "incidental" and not really designed for public use apart from the hook for JetBrains Rider (Aside: In theory all these other parts could be renamed to FSharp.Compiler though there's no need to do that right now). These internal parts tend to be implemented with the "module containing lots of stuff in one big file" approach for layers of the compiler.

Basics - Syntax, Text and Diagnostics

Tokenization

Symbols and Code Analysis

Editor Services

Interactive Execution

Internal extension points

Projects using the F# Compiler Services

Some of the projects using the F# Compiler Services are:

Older things:

Contributing and copyright

The F# source code is copyright by Microsoft Corporation and contributors.

Type something to start searching.