Skip to main content
Open source · Interpret · Compile · Embed

Interpret. Compile.
Embed.

FScript is a typed, functional scripting language for standalone programs and application scripting. Start with the interpreter, compile for optimized .NET and native execution, or embed scripts in an application that controls their APIs and resources.

$dotnet tool install --global MagnusOpera.FScript
Static type inference.NET & JavaScript embeddingTyped host APIsOptimized compilation
YOUR CODE
pricing.fss source
type Customer =
  { Name: string
    Plan: string
    Seats: int }

export let quote (customer: Customer) =
  let basePrice =
    match customer.Plan with
    | "scale" -> 29
    | "team" -> 19
    | _ -> 9

  basePrice * customer.Seats
type checkedFScript
INTERPRETER✦COMPILE .NET✦PUBLISH NATIVE AOT✦EMBED IN .NET✦EMBED IN JAVASCRIPT✦

Learn it. Run it.​

Start here to get used to the language. Explore expressions in the REPL, automate everyday tasks, and run fscript program.fss without a build step. Static type inference checks source before execution.

In Next, execution starts with no permissions. Choose grants, providers, and a filesystem root through CLI options or fscript.toml as your script grows.

Use the interpreter Configure execution

Optimize. Distribute.

Compile working scripts for performance and standalone deployment. Build optimized .NET assemblies, self-contained executables, native AOT binaries, or a C# project. Generated programs run without an FScript interpreter.

Set build and publishing defaults in fscript.toml. The .NET compiler specializes functions and fuses eligible pipelines; generated programs run with OS permissions.

Use the compiler Explore the optimizations

Put your app in control.

Load scripts through a .NET or JavaScript host API, inspect exported types, and invoke rules inside your application. Update pricing, policies, or workflows without rebuilding the host application.

The host owns typed APIs, source resolution, lifecycle, and resource policy. .NET hosts explicitly grant capabilities; optional configuration can narrow those grants.

Embed FScript Control host permissions

Name the thing.
Or just ask for its shape.

FScript keeps the part of the ML family that makes programs pleasant to reason about: inferred types, immutable data, unions, curried functions, and pattern matching. Then it adds a useful choice. A record can carry a domain name, or a function can accept any value with the fields it needs.

Meet the language
app.example / live-pricing
rules/discount.fss · loaded
let discount customer =
  match customer.Plan with
  | "scale" -> 20
  | "team"  -> 10
  | _       -> 0
TYPECustomer → intRESULT20
checked in this tabnpm · ESM

Ship the app. Change the rules while it runs.

FScript is an npm package for browsers and Node. Keep pricing, eligibility, feature decisions, or customer-specific policy outside the application bundle. Fetch a rule when you need it, check its types, and call its exported functions from JavaScript.

The host supplies typed operations and decides where rule files come from. A new rule can take effect without rebuilding the interface or restarting the process. The application keeps running; the part you meant to make configurable is free to change.

Load rules from JavaScript