# stanc3 mit Homebrew, MacPorts, Nix installieren

Prüfe Installationswege, Executables, Metadaten und Sicherheitshinweise für stanc3 in AI-Agent-Workflows.

## Installation

```sh
sudo av install brew:stanc3
```

Weitere Installationsbefehle:

### macOS

- Homebrew (100%):

```sh
brew install stanc3
```

  Evidenz: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install stanc3
```

  Evidenz: MacPorts ports tree: math/stanc3/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#stanc
```

  Evidenz: nixpkgs package indexes: pkgs/by-name/st/stanc/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Paketfakten

- **Paketschlüssel:** brew:stanc3
- **Paketmanager:** Homebrew
- **Version:** 2.39.0
- **Quellzusammenfassung:** Stan transpiler
- **Homepage:** <https://github.com/stan-dev/stanc3>
- **Repository:** <https://github.com/stan-dev/stanc3>
- **Zuletzt aktualisiert:** 2026-07-13T05:11:31Z
- **Generiert:** 2026-08-03T19:37:03+00:00

## Executables

- stanc (Alias)

## Installationsverhalten

- Bottle: nicht verfügbar

## Version und Aktualität

- Seite generiert: 2026-08-03
- Manager-Version: 2.39.0
## Projektgeschichte und Nutzung

stanc3 is the OCaml implementation of the Stan compiler, exposed to users as the stanc command.

### Projektgeschichte

The official repository describes stanc3 as a new Stan-to-C++ compiler written in OCaml, with a frontend, middle representation, analysis and optimization layer, and Stan Math backend. The Stan User's Guide says the Stan compiler has been implemented in OCaml since Stan 2.22, while the repository README says stanc3 has been the default compiler for Stan since version 2.26.

### Adoptionsgeschichte

stanc3 became part of normal Stan usage because Stan interfaces call the stanc compiler when translating models. The official releases page shows signed multi-platform binaries and a JavaScript version, while the package facts show Homebrew, MacPorts, and Nix packaging.

### Wie es verwendet wird

Users generally encounter stanc through CmdStan and other Stan interfaces, or directly as a CLI with syntax like stanc options model_file. The User's Guide documents options for output files, generated C++ printing, automatic formatting, canonicalization, warnings, optimization levels, OpenCL support, and compiler diagnostics.

### Warum Paket-Nerds sich dafür interessieren

Package nerds care about stanc3 because it is the compiler binary behind a large statistical programming ecosystem. Its OCaml toolchain, generated multi-platform assets, JavaScript build, and integration with CmdStan make it a packaging-sensitive developer tool rather than just an internal library.

### Zeitleiste

- 2018: Stan developers publicly discussed choosing OCaml for the new compiler implementation.
- Stan 2.22: Stan User's Guide says the compiler has been implemented in OCaml since this version.
- Stan 2.26: stanc3 became the default compiler for Stan, according to the official README.
- 2026: stanc3 v2.39.0 release notes added language features, warning improvements, parser fixes, and optimization bug fixes.

### Related projects

- stanc3 is tightly related to Stan, CmdStan, Stan Math, Stan interfaces, stancjs, and the Stan documentation. Its developer docs also point to OCaml tooling such as dune, opam, ocamlformat, and Merlin.

### Quellen

- <https://mc-stan.org/docs/stan-users-guide/using-stanc.html>
- <https://mc-stan.org/stanc3/stanc/index.html>
- <https://raw.githubusercontent.com/stan-dev/stanc3/master/README.md>
- <https://raw.githubusercontent.com/stan-dev/stanc3/master/RELEASE-NOTES.txt>


## Sicherheitshinweise

Für stanc3 wurde kein passendes lokales Secret-Handling-Manifest gefunden. Nucleus-Paketmetadaten bleiben hier veröffentlicht, damit künftige Abdeckung eine stabile Paket-URL hat.


## Andere Paketmanager-Einträge

- MacPorts - stanc3: normalized package name match | MacPorts ports tree: math/stanc3/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Nix - stanc: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/st/stanc/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/stanc3.yml](https://github.com/mxcl/pkgdb/blob/main/combined/stanc3.yml)


## Quellen

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
