Skip to main content
Open source · Built for .NET + JavaScript

Put a real language
inside your product.

FScript is a small, statically typed, embeddable language for the parts of your product that need to change faster than your application.

$dotnet tool install --global MagnusOpera.FScript
Hindley–Milner inferencePattern matchingHost-controlled I/O
YOUR APP
pricing.fss in-process
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
EMBED ITTYPE ITCONTROL ITSHIP ITEMBED ITTYPE IT

Why FScript

Your users need flexibility.
Your system needs boundaries.

Most embedded scripting is a trade: power for safety, or simplicity for expressiveness. FScript gives you a compact ML-style language with static checks and an explicit capability boundary.

01Runs in your process
No sidecar. No RPC.
02Checks before execution
Types with no ceremony.
03You define the surface
No ambient authority.

Language, meet product

Small syntax.
Serious leverage.

Readable enough for a rule. Expressive enough for a workflow.

01

Model the messy parts

Records, unions, options, and exhaustive matching make business rules readable instead of fragile.

type Decision =
  | Approve of int
  | Review of string
  | Decline

let decide score =
  match score with
  | n when n > 80 -> Approve 5000
  | n when n > 55 -> Review "manual"
  | _ -> Decline
02

Hand it capabilities

Scripts only reach the functions your host exposes. The integration boundary is explicit and typed.

let notifyLateInvoice invoice =
  match invoice.Status with
  | "late" ->
      Host.notify invoice.Owner
        $"Invoice {invoice.Id} is late"
  | _ ->
      ()
03

Ship rules, not rebuilds

Load once, discover exports, and invoke them by name from .NET or JavaScript hosts.

type Event = { Kind: string }

[<export>] let route (event: Event) =
  match event.Kind with
  | "signup" -> "onboarding"
  | "payment.failed" -> "billing"
  | "churn.risk" -> "success"
  | _ -> "archive"

The host stays in charge

A language with
a visible boundary.

Core FScript has no secret door to your filesystem, network, or database. Your host exposes typed extern functions; scripts use exactly those capabilities and nothing more.

  • 01 Register typed host functions
  • 02 Parse and type-check the script
  • 03 Invoke explicit exports
See the embedding model
YOUR HOST.NET / JS
DatabaseHTTPEvents
typed externsexplicit exports
EMBEDDEDFScript
RulesFlowsLogic
CAPABILITY BOUNDARY

A gentler learning curve

From zero to embedded
in three clean moves.

No archaeology required. Start by changing a working example, learn the language as you need it, then connect your host.

FScript mascot

Your product. Their logic.

Stop hard-coding
the changeable parts.