Home

Awesome

FEZ - an F# to core erlang experiment

What is it?

Fez is an early doors experiment in compiling fsharp to BEAM compatible core erlang.

The primary aim is to implement enough of the language to evaluate what how well an ML type of language could become a practical language for writing code to be run on the beam.

Should this experiment succeed then it may lead to a fuller and usable fsharp backend.

See thoughts.md for some discussions on potential implementation approaches.

Getting started

Requirements

./build.sh   [on Linux/Mac]
./build.cmd  [on Windows]

after this you can:

./fezc <file.fs> <file2.fs> -o out     [on Linux/Mac]
./fezc.cmd <file.fs> <file2.fs> -o out [on Windows]

to try to compile fsharp modules to the beam.

You can use the --nobeam parameter if you only want to compile as core erlang files.

To run the tests:

./run-tests.sh

Self contained releases

See releases page.

Download and extract the zip for your operating system. Then run: fez help to see the available commands and options.

To compile:

fez compile <files>

The module can then be run used in an erlang shell. The release ships with a set of .beam files that need to be included. E.g:


erl -pa <path_to_fez>/ebin

What works?

FSharp is a multi-paradigmatic language and fez is targeting a solely functional language (core erlang). Given this impedence mismatch it is only reasonable to expect fez to adequately cover the functional language constructs of FSharp. That said there are aspects of the imperative and object oriented paradigms that can be covered, to a certain extent.

The most up-to-date resource for what language construct are covered is to look at basics.fs but it is fairly unstructured.

The lists below list feature that are implemented to one of the following degrees:

Functional

Object programming

Imperative

Erlang interop

How can I help?

Try it! Right now I need people to try stuff and find constructs that break or don't behave as expected. Especially for functional code. Once you find something (and I'm sure you will) please raise an issue including the smallest possible repro code.

Code is also welcome of course. Especially for the standard library erlang modules.