Metadata-Version: 2.4
Name: synapse_lang
Version: 2.4.1
Summary: An interpreted language for uncertainty-aware scientific computing, with built-in quantum circuit simulation and parallel blocks
Home-page: https://github.com/michaelcrowe11/synapse-lang
Author: Michael Benjamin Crowe
Author-email: michael@crowelogic.com
Maintainer: Michael Benjamin Crowe
License: Proprietary
Project-URL: Homepage, https://github.com/michaelcrowe11/synapse-lang
Project-URL: Documentation, https://github.com/michaelcrowe11/synapse-lang
Project-URL: Repository, https://github.com/michaelcrowe11/synapse-lang
Project-URL: Bug Tracker, https://github.com/michaelcrowe11/synapse-lang/issues
Project-URL: Changelog, https://github.com/michaelcrowe11/synapse-lang/blob/main/CHANGELOG.md
Project-URL: Docker Hub, https://hub.docker.com/r/michaelcrowe11/synapse-lang
Project-URL: PyPI, https://pypi.org/project/synapse-lang/
Keywords: scientific-computing,uncertainty,uncertainty-propagation,quantum-computing,quantum-simulation,parallel-computing,programming-language,interpreter
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Interpreters
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: English
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: sympy>=1.12
Requires-Dist: matplotlib>=3.7.0
Requires-Dist: colorama>=0.4.6
Requires-Dist: networkx>=3.0
Requires-Dist: pandas>=2.0.0
Provides-Extra: gpu
Provides-Extra: jit
Requires-Dist: numba>=0.58; extra == "jit"
Provides-Extra: quantum
Requires-Dist: qiskit>=1.0.0; extra == "quantum"
Requires-Dist: pennylane>=0.35.0; extra == "quantum"
Requires-Dist: cirq>=1.4.0; extra == "quantum"
Provides-Extra: cloud
Requires-Dist: fastapi>=0.104.0; extra == "cloud"
Requires-Dist: uvicorn[standard]>=0.24.0; extra == "cloud"
Requires-Dist: aioredis>=2.0.1; extra == "cloud"
Requires-Dist: asyncpg>=0.29.0; extra == "cloud"
Requires-Dist: docker>=6.1.0; extra == "cloud"
Requires-Dist: kubernetes>=27.2.0; extra == "cloud"
Requires-Dist: pika>=1.3.2; extra == "cloud"
Provides-Extra: enterprise
Requires-Dist: stripe>=7.0.0; extra == "enterprise"
Requires-Dist: boto3>=1.29.0; extra == "enterprise"
Requires-Dist: motor>=3.3.0; extra == "enterprise"
Requires-Dist: prometheus-client>=0.19.0; extra == "enterprise"
Requires-Dist: ray[default]>=2.7.0; extra == "enterprise"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: black>=24.0; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Requires-Dist: mypy>=1.11; extra == "dev"
Requires-Dist: pre-commit>=3.8; extra == "dev"
Requires-Dist: tox>=4.18; extra == "dev"
Requires-Dist: flake8>=7.0.0; extra == "dev"
Requires-Dist: safety>=3.2.0; extra == "dev"
Requires-Dist: bandit>=1.7.9; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=6.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.3; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=1.23; extra == "docs"
Requires-Dist: myst-parser>=2.0; extra == "docs"
Provides-Extra: jupyter
Requires-Dist: jupyterlab>=3.4.0; extra == "jupyter"
Requires-Dist: ipykernel>=6.15.0; extra == "jupyter"
Provides-Extra: all
Requires-Dist: numba>=0.58; extra == "all"
Requires-Dist: qiskit>=0.34.0; extra == "all"
Requires-Dist: pennylane>=0.20.0; extra == "all"
Requires-Dist: cirq>=0.13.0; extra == "all"
Requires-Dist: pytest>=7.0; extra == "all"
Requires-Dist: pytest-cov>=4.0; extra == "all"
Requires-Dist: black>=23.0; extra == "all"
Requires-Dist: sphinx>=6.0; extra == "all"
Dynamic: author-email
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Synapse Language

An interpreted language for uncertainty-aware scientific computing, with
built-in quantum circuit simulation and parallel blocks.

[![PyPI](https://img.shields.io/pypi/v/synapse-lang.svg?label=PyPI)](https://pypi.org/project/synapse-lang/)
![Python](https://img.shields.io/badge/python-3.10%2B-blue)
![License](https://img.shields.io/badge/License-Proprietary-red.svg)

Synapse is a small language focused on a few ideas that are awkward in
general-purpose languages: values that carry uncertainty and propagate it
through arithmetic, simple parallel branches, and quantum circuits that run on
a built-in simulator.

This is an early-stage language. The sections below describe what runs today.
Larger aspirational programs (imports, control flow, functions, tensors,
reasoning chains, a full quantum DSL) are kept under `examples/roadmap/` as
design targets and do not execute yet.

## Install

```bash
pip install synapse-lang
```

Requires Python 3.10+. Core dependencies: numpy, scipy, sympy, matplotlib,
networkx, pandas, colorama.

## Runtime safety

Execution is trusted and in-process, not an operating-system security sandbox.
Do not run untrusted source or context callables without external isolation.
`execute(..., sandbox=True)`, `execute_program(..., sandbox=True)`, and
`--sandbox` fail explicitly rather than silently executing without isolation.
The default is now `sandbox=False`; `--no-sandbox` remains a compatibility flag.
The older security helper classes now refuse execution. An opt-in
[external Docker runner](docs/isolation.md) is available, with tested resource
and OS restrictions; it is separate from the ordinary interpreter API.

See [runtime optimization and verification](docs/runtime-optimization.md) for
AST reuse, parallel semantics, benchmark commands, and verification limits.

## Usage

```bash
synapse path/to/program.syn      # run a file
synapse -c 'print(1 + 2)'        # run a snippet
synapse --repl                   # interactive REPL
synapse --version
```

## What works today

### Printing, variables, and built-in math

```synapse
print("Hello from Synapse!")
x = 21
y = 21
print("x + y =", x + y)
print("sqrt(144) =", sqrt(144))
print("pi =", pi)
```

```
Hello from Synapse!
x + y = 42.0
sqrt(144) = 12.0
pi = 3.141592653589793
```

Built-ins include `print`, `str`, `int`, `float`, `bool`, `len`, `range`,
`abs`, `round`, `min`, `max`, `sum`, `sqrt`, `exp`, `log`, `log10`, `sin`,
`cos`, `tan`, `floor`, `ceil`, `mean`, `std`, and the constants `pi` and `e`.

### Uncertainty propagation

A value declared `uncertain` carries an uncertainty that propagates
automatically through arithmetic.

```synapse
uncertain measurement = 42.3 ± 0.5
uncertain temperature = 300 ± 10
energy = measurement * temperature
print("energy =", energy)
```

```
energy = 12690.0 ± 448.808422380864
```

### Parallel branches

```synapse
parallel {
    branch dataset_1: {
        print("Processing dataset 1...")
        result_1 = 100
    }
    branch dataset_2: {
        print("Processing dataset 2...")
        result_2 = 200
    }
}
print("Combined result:", result_1 + result_2)
```

```
Processing dataset 1...
Processing dataset 2...
Combined result: 300.0
```

### Quantum circuits on the built-in simulator

```synapse
quantum circuit bell(2) {
    h(0)
    cnot(0,1)
}
run bell { shots: 256 }
```

```
{'circuit': 'bell', 'backend': None, 'shots': 256, 'counts': {'11': 124, '00': 132}, 'noise': None}
```

A Bell state is entangled, so measurements only ever come out `00` or `11`.

## Examples

Runnable examples live in [`examples/`](examples/): `hello.syn`,
`uncertainty.syn`, `parallel.syn`, `quantum_bell.syn`. Each is covered by the
test suite. Aspirational examples are under
[`examples/roadmap/`](examples/roadmap/).

## License

Proprietary software. All rights reserved. Use, copying, modification, or
distribution requires a separate written license from the copyright holder; see
[LICENSE](LICENSE). Earlier copies distributed under MIT retain their granted
rights, and third-party components retain their own licenses.

## Citation

```bibtex
@software{synapse_lang,
    title = {Synapse: an interpreted language for uncertainty-aware scientific computing},
    author = {Michael Benjamin Crowe},
    year = {2026},
    version = {2.4.1}
}
```
