We support Python versions 3.9 and above.
If you’re just using Exo, install it using pip
:
In case of ModuleNotFoundError: No module named 'attrs'
please upgrade your attrs module by pip install --upgrade attrs
.
Exo files can be directly excuted with Python:
To generate generate C and header files, use exocc
command:
Running the command will generate two files: exo_file.c
and exo_file.h
. These files will be created in a directory called exo_file/
by default.
You can use optional arguments to customize the output:
- The
-o
argument allows you to specify a different directory name. - The
--stem
argument allows you to specify custom names for the C file and header file.
We make active use of newer Python 3.x features. Please use Python 3.9 or 3.10 if you’re getting errors about unsupported features.
Setting up Exo for development is like any other Python project. We
strongly recommend you use a virtual environment.
$ git clone git@github.com:exo-lang/exo.git
$ cd exo/
$ git submodule update --init --recursive
$ python -m venv ~/.venv/exo
$ source ~/.venv/exo/bin/activate
(exo) $ python -m pip install -U pip setuptools wheel
(exo) $ python -m pip install -r requirements.txt
(exo) $ pre-commit install
This will make sure you have the submodules checked out and that the pre-commit
scripts (that run an autoformatter, maybe other tools in the future) run.
Finally, you can build and install Exo.
(exo) $ python -m build .
(exo) $ pip install dist/*.whl
Depending on your setup, getting PySMT to work correctly may be difficult. You
need to independently install a solver such as Z3 or CVC4, and even then getting
the PySMT library to correctly locate that solver may be difficult. We have
included the z3-solver
package as a requirement, which will hopefully avoid
this issue, but you can