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.

Binary Installation

Requirements

You must have the following installed on your system:

Installation

  1. Download the etlas executable for your platform below.

    Etlas v1.2.0.0

    Note:

    On Safari the extension of the etlas binary is dms instead of dmg. So please avoid downloading on Safari.


  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
    • 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
$ ./install.sh # or install.cmd in windows command prompt

If you omit the --recursive flag to git clone, you will need to initialize the project’s submodules before running install.sh or install.cmd:


$ 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

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

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
$ ./cleaninstall.sh # or cleainstall.cmd in windows command prompt
$ etlas select local

Troubleshooting

If you have existing Etlas projects, make sure you run


$ etlas clean
$ etlas install --dependencies-only

inside each project before proceeding with your normal development so that Etlas recognizes the updated libraries.

Next Lesson

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