Metadata-Version: 2.1
Name: typon
Version: 0.3
Summary: A Python-to-C++ compiler geared towards concurrency
Author-email: Xavier Thompson <xavier.thompson@nexedi.com>, Tom Niget <tom.niget@nexedi.com>
Project-URL: Homepage, https://typon.nexedi.com
Project-URL: Repository, https://lab.nexedi.com/typon/typon-compiler
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: clang-format ~=18.1.3
Requires-Dist: colorama ~=0.4.6
Requires-Dist: colorful ~=0.6.0a1
Requires-Dist: nanobind ~=1.9.2
Requires-Dist: numpy ~=2.0.0rc1
Requires-Dist: pybind11 ~=2.12.0
Requires-Dist: Pygments ~=2.17.2
Requires-Dist: python-dotenv ~=1.0.1
Provides-Extra: test
Requires-Dist: numpy ~=1.25.1 ; extra == 'test'

# Typon compiler

Typon is a two-part project to bring practical GIL-free concurrency to Python:
1. [`typon-concurrency`](https://lab.nexedi.com/typon/typon-concurrency), a C++ concurrency runtime
2. typon-compiler (this repository), a compiler from Python syntax into C++

## Getting started

### Install

#### From code

```bash
git clone https://lab.nexedi.com/typon/typon-compiler.git --recursive
python3 -m venv typenv
source typenv/bin/activate
pip install ./typon-compiler
```

#### From PyPI

```
pip install typon
```

### Install dependencies

```
apt install g++-13 libfmt-dev liburing-dev python3.12-dev libssl-dev
```

## Basic usage

Typon can be used from the command-line to compile a Python file:

```
typon [-o/--output output] [-d/--debug] [-v/--verbose] input
```

Once generated, the C++ code file can be compiled using your compiler of choice:

```
$(CXX) -O3 $(typon --cpp-flags) input.cpp
```

Currently, you'll get the best support with G++ 13.

## Directory structure

### `docs`, documentation

Currently using Sphinx.

### `include`, standard library and compiler primitives/intrinsics

TODO.

### `runtime`, concurrency runtime (Git submodule)

See the [runtime repository](https://lab.nexedi.com/typon/typon-concurrency).

### `trans`, transpiler

This repository, TODO.

## Test harness

`cd` into the `trans` directory, set up your `.env` file (you can copy the `.env.example` file), and run `python3 test_runner.py`.

