Getting Started

An introduction to Eta - the language and the ecosystem.

Overview

In this section, we'll setup a working environment for Eta development so that you can follow along with the rest of the modules.


There are different ways to do this so we'll give you a quick overview of the benefits of each method.

  • Gradle - This is the easiest way to get started and also the recommended way of installing Eta on your system. You should use this method if you are working on mixed-language projects.
  • Etlas - Etlas is the build tool for Eta and it forms the backbone of any plugin to existing build tools (e.g. Gradle, Bazel, Maven). This method is preferred if you want to write projects in Eta entirely.
  • Source - Feel like contributing? Enjoy building software from source?
  • Docker - Like keeping your development environment containerized? Every commit to the master branch of the Eta repository builds a docker image allowing you to conveniently try out new features.
  • Nix - Fan of the Nix package manager? We have a Nix expressions ready for you that will set you up with a reproducible build environment.
  • sbt - An avid Scala developer? You may prefer the sbt-eta plugin to integrate Eta into your Scala projects.

Choose an Installation

Gradle Installation

How It Works

You'll clone a GitHub repository that contains a project template and you'll build the project using the Gradle Wrapper script. The script will install Gradle for you and Gradle will install Eta and Etlas for you.


Requirements

You must have the following installed on your system:

Installation

  1. Fire up your terminal and type the following commands:


    $ git clone https://github.com/typelead/eta-init
    $ cd eta-init
    

    Linux/OS X


    $ ./gradlew run
    

    Windows


    $ gradlew.bat run
    

  2. If this is your first time using Eta on your system, you will get prompted about your preference for telemetry.


    If you are fine with sending metrics, you can run the following commands:


    Linux/OS X


    $ ./gradlew run -PetaSendMetrics=true
    

    Windows


    $ gradlew.bat run -PetaSendMetrics=true
    

    If you are not file with sending metrics, you can replace true with false in the commands listed above.


    NOTE: You only need to send the -P argument the first time you are express your preference.

Etlas Installation

How It Works

You'll download the Etlas binary for your platform and make it available in your system PATH so that you can use the etlas command from your terminal. Etlas will install Eta for you when you build your first project.


Requirements

You must have the following installed on your system:

Installation

  1. Download the etlas executable for your platform below.


    Etlas v1.3.0.0

    Note:

    On Safari the extension of the etlas binary is dms when it shouldn't have an extension at all. You can fix this by manually renaming the file to avoid the .dms extension.


  2. If on Linux or OS X, give the program executable permissions.


    $ chmod +x /path/to/etlas
    

  3. Place the downloaded binary in in your $PATH and verify that it is.


    $ etlas --version
    

  4. Make sure java is on the $PATH.


    $ java -version
    

  5. Ensure that you have updated to the latest version of Eta.


    $ etlas update
    $ etlas select latest
    

  6. As soon as you start using etlas, eta and the standard libraries will be downloaded automatically for you on demand.

Source Installation

Requirements

You must have the following installed on your system:

  • Stack
    • Make sure the path that is obtained from running stack path --local-bin is present on the PATH.
  • JDK 7 or above
    • Make sure javac and java are on the PATH.
  • Check the OS-specific sections for additional requirements

Ubuntu

  • Install bz2, ncurses and zlib.


    $ sudo apt-get install zlib1g-dev libncurses5-dev libbz2-dev
    

  • Make sure locale is set to UTF-8.


    $ export LC_ALL=en_US.UTF-8
    $ export LANG=en_US.UTF-8
    

Fedora


Install bzip2, ncurses and zlib.


$ sudo dnf install zlib-devel ncurses-devel bzip2-devel

OpenSUSE


Install bz2, ncurses, and zlib.


$ sudo zypper install zlib-devel libncurses5 ncurses5-devel libbz2-devel

OS X


Make sure you have XCode installed and have accepted the license agreement (run XCode at least once).


Windows


On Windows, you have two options:

  1. Windows Subsystem for Linux (Windows 10 build 14986 or above)

    1. Enable WSL.
    2. Enter the root folder of WSL, and create a .local folder, and then inside of this create a bin folder.
    3. Follow the instructions for Ubuntu above to setup your environment.
    4. Proceed to source installation instructions below.
  2. Cygwin & MSYS

    1. Install Cygwin.
    2. Install MSYS.
    3. Proceed to source installation instructions below.

Installation

To obtain an environment with eta and etlas, run the following commands:


$ git clone --branch stable --recursive --depth 1 https://github.com/typelead/eta
$ cd eta

Linux/OS X


$ ./install.sh

Windows


$ install.cmd

If you omit the --recursive flag to git clone, you will need to initialize the project’s submodules before installing:


$ git submodule update --init --recursive

Once the installation is done, you will now have access to the following command-line tools:

  • eta - The main compiler
  • etlas - The package manager and build tool

Check to ensure that they are on the PATH.


$ eta --version
$ etlas --version

If you obtain an error that either tool is missing, run the following command:


$ stack path --local-bin

Add the path that you obtain in the output to your PATH environment variable.

Docker Installation

Requirements

You must have the following installed on your system:

Installation

To obtain an environment with eta and etlas, run the following command:


$ docker run -it typelead/eta

Nix Environment

Prerequisites

Make sure you have the following tools installed on your system:

Installation

To obtain an environment with eta and etlas, run the following commands:


$ git clone --branch stable --recursive --depth 1 https://github.com/typelead/eta
$ cd eta
$ nix-shell -A eta-build-shell

Once in the shell, run the following commands:


$ eta-build uninstall
$ eta-build install

sbt Installation

Coming Soon. The sbt-eta plugin currently does not work with the most recent versions of Eta. Work is underway to update the plugin.

Updating Eta

If you want to update you Eta installation, you have two options:

Binary Update

Binary updates are easy to do with existing etlas commands.


$ etlas update
$ etlas select latest

The next project you build will use the latest version of Eta.


Cutting-Edge Update

If you require a bug fix or feature that's not available in binary form, you will need to build it from source.


$ git clone --recursive --depth 1 https://github.com/typelead/eta
$ cd eta

Linux/OS X


$ ./cleaninstall.sh

Windows


$ cleaninstall.cmd

Next Lesson

We will now proceed to run our first program in Eta.