Garter – install

install guide

NOTE: The binary and source links mentioned in this article will not be populated until the 0.0.0-alpha release. Please do not attempt to follow these instructions until this notice has been removed.

Installing Binaries

NOTE: The prebuild binaries are all in English. If you'd like a non-english verison of the compiler, please scroll down to Installing from Source

The only dependencies for installing garter from binary is a program capable of downloading the file, such as wget or curl.

Linux and BSD

  1. Download the binary using curl, wget, or from your web browser. Depending on whether you are on an x86 or ARM system, you'll want either the lin386 or lina32 binary.
  2. Move the binary to a folder in your $PATH. We personally recommend either ~/.local/bin or /usr/local/bin.

For users on x86 systems looking for a system-wide install:

wget https://modula.dev/garter/lin386
mv lin386 /usr/local/bin/garter

MacOS

  1. Download the binary using curl, wget, or from your web browser. Depending on whether you are on an x86 or ARM system, you'll want either the mac686 or maca64 binary.
  2. Move the binary to a folder in your $PATH. We personally recommend either ~/bin or /usr/local/bin.

For users on x86 systems looking for a system-wide install:

curl https://modula.dev/garter/mac686 -o mac686
mv mac686 /usr/local/bin/garter

Windows

  1. Download the binary using curl, wget, or your web browser. Depending on whether you are on an x86 or ARM system, you'll want either the win686 or wina64 binary.
  2. Move the binary to a folder in your $PATH. A common directory for user-level programs is C:\Users\<YourUsername>\AppData\Local\Programs.
  3. Add this location to your $PATH if not already included. Press Win + R, type sysdm.cpl to open the System Properties utlity and press Enter. Go to the Advanced tab and click on Environment Variables. Under User variables or System variables, find the Path variable and click Edit. Add the path to the directory containing the binary to the list of paths. Click OK on all dialogs to save your changes.
  4. Rename the binary to garter. Then open your terminal (cmd) and type garter -v. If the binary is properly installed and in $PATH, you should see a message telling you what version of garter is now installed on your system.

Installing from Source

The instructions for building from source are mostly the same from system to system assuming you already have a C compiler installed. The only dependencies for builing and bootstrapping garter are a C compiler with standard libraries, and either git for cloning this repo, or both tar for unzipping and your choice of CLI for downloading it.

From hereon, we'll be referring to your system's C compiler as cc. Replace that name with whatever compiler you personally have.

  1. Clone the bootstrapping source code using git, or download and unzip it using wget and tar.
  2. Compile cgarter.c with a define-flag for the language you want it built with. For example, to get a Spanish garter compiler, run cc -o garter cgarter.c -D SPANISH
  3. Move the binary to a folder in $PATH.
  4. Optionally, you can now delete the source directory

Alternatively, if you'd like to build a self-hosted garter compiler:

  1. Clone the bootstrapping source code using git, or download and unzip it using wget and tar.
  2. Compile cgarter.c with a define-flag for the language you want it built with. For example, to get an English garter compiler, run cc -o cgarter cgarter.c -D ENGLISH
  3. Use cgarter to build self-hosted garter from the source file found in /assets. The localization will have been set when building cgarter, so you don't have to worry about defining the language during self-hosting. If you are building for x86 BSD, the build command might look like cgarter ./assets/garter.gy garter -f lin686
  4. Move the self-hosted binary to a folder in $PATH.
  5. Optionally, you can now delete the source directory

What's in the Box?

Both bootstrapping and self-hosted versions will include the compiler, assembler, linker, the standard library, and the package manager. If you would like a local copy of the language's documentation, it is available in PDF or HTML forms from our website at modula.dev/documentation in English, Spanish, and French.