Beam target is in alpha meaning that breaking changes can happen between minor versions.

This section is specific to Beam (Erlang) targeting. It will guide you through the process of setting up your project and using Fable to compile F# to Erlang.

Prerequisites

You need Erlang/OTP 25 or higher and rebar3 installed. Verify with:

erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
rebar3 version
  • Compile your project to Erlang:

    dotnet fable --lang beam

    Fable generates .erl files in src/ subdirectories and automatically creates a rebar3 project scaffold (rebar.config, .app.src files).

  • Compile the generated Erlang files with rebar3:

    rebar3 compile
  • Run your code:

    erl -noshell -pa _build/default/lib/*/ebin -eval 'program:main(), halt().'
  • Run Fable in watch mode for development:

    dotnet fable watch --lang beam

For more details, see Build and Run.