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 24 or higher installed. Verify with:

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

    dotnet fable --lang beam

    This generates .erl files in the project directory (where the .fsproj is) by default.

  • Compile the generated Erlang files:

    erlc -o output/fable_modules/fable-library-beam output/fable_modules/fable-library-beam/*.erl
    erlc -pa output/fable_modules/fable-library-beam -o output output/*.erl
  • Run your code:

    erl -pa output -pa output/fable_modules/fable-library-beam -noshell -eval 'program:main(), halt().'
  • Run Fable in watch mode for development:

    dotnet fable watch --lang beam

For more details, see Build and Run.