Cover photo

How to set up Fe

Step-by-step guide to setting up your development environment in Fe

Important

  • The language is very recent, so there may be discrepancies after the publication of this post.

  • IT IS NOT READY FOR PRODUCTION: There are still certain bugs and limitations unless the team behind Fe notifies otherwise, I recommend using it locally or on testnet.


CLI setup

To have your development environment set up, it's very simple, just open your command console and paste this instruction.

curl -fsSL https://raw.githubusercontent.com/argotorg/fe/master/feup/feup.sh | bash

This will install the Fe compiler and add feup for future updates, as well as add the Fe directory to your PATH.

Once that’s done, all you have to do is open and close the console, and Fe will be ready to use. To verify that it’s installed, simply type:

fe --version

and it will show us the compiler version

Let's take a quick tour of what you can do with the Fe command.

Subcommand

Description

build

Compile Fe code to EVM bytecode. Generate the artifacts for deployment.

check

Compiles without generating bytecode. Validates syntax and types quickly, useful for CI or pre-commit hooks.

doc

Generate the project documentation

tree

Shows the dependency structure of the ingot (which ingots depend on which).

fmt

Automatically formats Fe code according to the official language style.

test

Runs tests marked with #[test]. Supports filters, parallelization, and debug flags

new

Create a new Fe (ingot) project or workspace with the standard structure

completion

Generate autocomplete scripts for your shell (bash, zsh, fish)

lsif

Generates an LSIF (Language Server Index Format) index for code navigation in editors/IDEs

root

Find the root of the ingot or workspace from any subdirectory. Useful for scripts.

lsp

Start the Language Server Protocol for integration with editors (VSCode, Neovim, etc.). It provides autocomplete, diagnostics, and “go to definition.”

scip

Generates a SCIP (Successors to LSIF) index for code navigation, a more modern format than LSIF.

help

Displays help for commands and subcommands.

Set up in editor

Since you already have Fe in your preferred CLI, the only thing left is to set it up in your preferred code editor. It's optional, but it will be a great help when you're writing code.

As of the date of creation of this post, the official extensions include:

  • vs code

  • zed

  • neovim

  • emacs

Let's take a look at how to install each one, or if you prefer, skip ahead to the one you use

vs code

  1. Download the .vsix file from the releases section of the GitHub repository https://github.com/fe-lang/vscode-fe/releases

  2. You have two options for installing it

    1. Open VS Code and, from the command palette, run “Extensions: Install from VSIX,” then select the file

    2. From the CLI, navigating to the folder where you downloaded it (usually Downloads), run code --install-extension fe-language-*.vsix

zed

  1. Clone the repository using git clone https://github.com/fe-lang/zed-fe

  2. In Zed, go to Extensions, click “Install Dev Extension,” and select the directory of the cloned repository

neovim

You must have Neovim 0.9+ with a C compiler (GCC or Clang), with those requirements you just need to add in:

lazy.nvim

{
    "https://github.com/fe-lang/nvim-fe",
    config = function() require("nvim_fe").setup() end,
}

packer.nvim

use({
    "https://github.com/fe-lang/nvim-fe",
    config = function() require("nvim_fe").setup() end,
})

emacs

You must have Emacs 29.1+ along with a C compiler, once you meet the requirements you just need to add:

(use-package fe
  :vc (:url "https://github.com/fe-lang/emacs-fe"
       :branch "main"))

To automatically start the language server with Eglot:

(setq fe-mode-eglot-auto t)

With the CLI and the editor ready, you can now create ingots, compile contracts, and run tests locally. In upcoming posts, we will explore the Fe syntax in depth and replicate classic Solidity contracts to compare both approaches.