<commit_before># Legion Language Compiler

This directory contains the compiler for the Legion language. See
below for instructions for installing and running the compiler.

## Prerequisites

  * Terra-compatible LLVM installation on PATH (tested successfully
    with LLVM 3.4 and 3.5).
      * Or you can install Terra yourself; see below for instructions.

## Installing

Run the following command from the `language` directory:

    ./install.py [-h] [--debug] [--with-terra TERRA]

This command:

  * Downloads and builds Terra.
  * Builds a dynamic library with Legion and Lua bindings.
  * (OS X) Patches said dynamic library to avoid hard-coded absolute paths.
  * Sets everything up to run from `legion.py`.

Notes:

  * If you want a debug build Legion, pass `--debug` to `install.py`.
  * If you want to build with your own copy of Terra, pass the path to
    the Terra directory via the `--with-terra` flag. You will be
    responsible for building Terra yourself if you do this.

## Running

To use Legion, run:

    ./legion.py [SCRIPT]

This starts a Terra shell with the Legion dynamic library on
LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH on Max OS X). From this shell,
you can either:

  * Use the Lua bindings via Lua/Terra.
  * Use the C bindings via Terra or LuaJIT FFI.
  * Use the language.

## Using

From the Legion shell, run the following command to import the
language:

    import "legion"

This imports the Legion compiler into scope and adds hooks to the
Legion compiler to the Terra parser so that you can start writing
Legion code.

## Tests

To run the test suite, run:

    ./test.py<commit_msg>regent: Update README.<commit_after># Legion Language Compiler

This directory contains the compiler for the Legion language. See
below for instructions for installing and running the compiler.

## Prerequisites

  * Terra-compatible LLVM installation on PATH (tested successfully
    with LLVM 3.5).
      * Or you can install Terra yourself; see below for instructions.

## Installing

Run the following command from the `language` directory:

    ./install.py [-h] [--with-terra TERRA] [--debug] [--general] [--gasnet]
                 [--cuda] [-j [THREAD_COUNT]]

This command:

  * Downloads and builds Terra.
  * Builds a dynamic library with Legion and Lua bindings.
  * (OS X) Patches said dynamic library to avoid hard-coded absolute paths.
  * Sets everything up to run from `legion.py`.

Notes:

  * If you want a debug build Legion, pass `--debug` to `install.py`.
  * By default, this script will install Legion's shared-memory
    low-level runtime. For the general-purpose low-level runtime
    (required for CUDA and GASNet), pass `--gasnet`.
  * If you want to use CUDA and/or GASNet, pass `--cuda` and
    `--gasnet`, respectively. (Requires `--general`.)
  * If you want to build with your own copy of Terra, pass the path to
    the Terra directory via the `--with-terra` flag. You will be
    responsible for building Terra yourself if you do this.

## Running

To use Legion, run:

    ./legion.py [SCRIPT]

This starts a Terra shell with the Legion dynamic library on
LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH on Max OS X). From this shell,
you can either:

  * Use the Lua bindings via Lua/Terra.
  * Use the C bindings via Terra or LuaJIT FFI.
  * Use the language.

## Using

From the Legion shell, run the following command to import the
language:

    import "legion"

This imports the Legion compiler into scope and adds hooks to the
Legion compiler to the Terra parser so that you can start writing
Legion code.

## Tests

To run the test suite, run:

    ./test.py [-h] [-j [THREAD_COUNT]] [-v]
{'fraction_non_alphanumeric': 0.07704962983273923, 'fraction_numerical': 0.0016451878256100905, 'mean_word_length': 3.2867215041128084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5129988', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1049, 'n_words': 519}