Bloch: a strongly typed, hardware-agnostic, hybrid quantum programming language

Bloch: a strongly typed, hardware-agnostic, hybrid quantum programming language - Published in JOSS (2026)

https://github.com/bloch-labs/bloch

Science Score: 92.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

hybrid programming-language quantum strongly-typed
Last synced: 22 days ago · JSON representation ·

Repository

The Bloch Quantum Programming Language

Basic Info
  • Host: GitHub
  • Owner: bloch-labs
  • License: apache-2.0
  • Language: C++
  • Default Branch: develop
  • Homepage: https://bloch-labs.com
  • Size: 1.08 MB
Statistics
  • Stars: 16
  • Watchers: 0
  • Forks: 2
  • Open Issues: 12
  • Releases: 19
Topics
hybrid programming-language quantum strongly-typed
Created 8 months ago · Last pushed 23 days ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

Bloch - A Strongly Typed, Hybrid Quantum Programming

Bloch is an open-source, strongly typed hybrid quantum programming language. The language is designed to be hardware-agnostic, so you can move from research sketches to production-grade circuits without switching stacks.

Highlights

  • Seamless classical/quantum integration with clear type boundaries.
  • Readable, expressive syntax that stays approachable under load.
  • Hardware-agnostic execution across simulators and future hardware backends.
  • Write once, run anywhere as targets evolve.

See It In Action

Demo Prepare an entangled Bell state, then measure both qubits 8192 times using a tracked array to observe the expected 00 / 11 correlation.

```bloch @quantum function createBellState(qubit a, qubit b) -> void { h(a); cx(a, b); }

function main() -> void { @tracked qubit[2] qreg;

createBellState(qreg[0], qreg[1]);

bit[2] out = {measure qreg[0], measure qreg[1]};

echo(out);

} ```

Get Started

Bloch is available as source plus manually produced release archives until the automated pipeline lands. The instructions below cover installing pre-built artifacts as well as building from source.

Install a release build

Linux & macOS

bash curl -fsSL https://raw.githubusercontent.com/bloch-labs/bloch/HEAD/scripts/install.sh | bash -s -- latest

Swap latest for a specific tag (eg v1.0.0). The script downloads the matching archive for your platform, verifies its checksum, installs the bloch binary into a writable directory, and updates your shell profile if needed. Add INSTALL_DIR=/custom/path before bash to override the destination. You can also self-update later with bloch --update; major version jumps will prompt for confirmation and link the changelog.

Windows

powershell powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr https://raw.githubusercontent.com/bloch-labs/bloch/HEAD/scripts/install.ps1 -UseBasicParsing -OutFile $env:TEMP\\bloch-install.ps1; & $env:TEMP\\bloch-install.ps1 -Version latest"

Swap -Version latest for any tag you want. The script downloads the Windows ZIP, verifies its checksum, installs bloch.exe into %LOCALAPPDATA%\Programs\Bloch by default, and adds that directory to your user PATH (opens in new shells). You can self-update later with bloch --update; major version jumps prompt for confirmation and show the changelog link.

Build from source

Linux & macOS

bash git clone https://github.com/bloch-labs/bloch.git cd bloch cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel ctest --test-dir build --output-on-failure

Run the compiler against an example with ./build/bin/bloch examples/02_bell_state.bloch.

Windows (Visual Studio)

powershell git clone https://github.com/bloch-labs/bloch.git cd bloch cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release cmake --build build --config Release --parallel ctest --test-dir build --config Release --output-on-failure

This produces a build/Bloch.sln you can open directly in Visual Studio for editing and debugging. The bloch.exe binary is placed in build/bin/Release/.

Additional generator options (Ninja, CLion toolchains, etc.) are covered in CONTRIBUTING.md.

Code Layout

  • bloch::core (src/bloch/core/*): lexer, Pratt parser, AST, and semantic analysis.
  • bloch::runtime (src/bloch/runtime/*): runtime evaluator plus the OpenQASM/statevector simulator.
  • bloch::support (src/bloch/support/*): errors, feature flags, and lightweight helpers shared across layers.
  • bloch::update (src/bloch/update/*): self-update plumbing used by the CLI.

User Documentation

docs.bloch-labs.com/bloch/overview

VS Code Extension

bloch-labs/bloch-vscode

Contributing

Contributions are welcome! CONTRIBUTING.md covers the development environment, conventions, and the lightweight review process we follow while the language is in active development.

How to Cite

  • If you use Bloch in research, cite it via the repository’s CITATION.cff file (GitHub exposes a “Cite this repository” button) or copy the metadata directly into your BibTeX database. The entry tracks the software release and the forthcoming JOSS article so reviewers can attribute the correct artifact.

Community

Acknowledgements

  • cpp-httplib (MIT) for HTTPS calls used in update checks and downloads.
  • OpenSSL for TLS support during release downloads (prefer statically linked in shipped binaries to avoid runtime deps).

License

Bloch is licensed under the Apache 2.0 license.

Owner

  • Name: bloch-labs
  • Login: bloch-labs
  • Kind: organization

JOSS Publication

Bloch: a strongly typed, hardware-agnostic, hybrid quantum programming language
Published
January 29, 2026
Volume 11, Issue 117, Page 9625
Authors
Akshay Pal ORCID
Independent Researcher, United Kingdom
Editor
Daniel S. Katz ORCID
Tags
quantum computing programming languages compilers simulation

Citation (CITATION.cff)

cff-version: 1.2.0
title: "Bloch: a strongly typed, hardware-agnostic, hybrid quantum programming language"
message: "If you use Bloch in your work, please cite it using the metadata below."
type: software
version: "v1.0.0"
repository-code: https://github.com/bloch-labs/bloch
license: Apache-2.0
keywords:
  - quantum computing
  - programming languages
  - compilers
  - simulation
authors:
  - family-names: Pal
    given-names: Akshay
    orcid: https://orcid.org/0009-0004-0465-4420
preferred-citation:
  type: software
  title: "Bloch: a strongly typed, hardware-agnostic, hybrid quantum programming language"
  authors:
    - family-names: Pal
      given-names: Akshay
      orcid: https://orcid.org/0009-0004-0465-4420
  version: "v1.0.0"
  repository-code: https://github.com/bloch-labs/bloch
  license: Apache-2.0
  notes: "JOSS article submission pending; update this entry with the DOI once accepted."

GitHub Events

Total
  • Release event: 10
  • Delete event: 53
  • Pull request event: 47
  • Issues event: 91
  • Watch event: 5
  • Issue comment event: 6
  • Push event: 130
  • Pull request review event: 1
  • Pull request review comment event: 1
  • Gollum event: 18
  • Create event: 47
Last Year
  • Release event: 10
  • Delete event: 53
  • Pull request event: 47
  • Issues event: 91
  • Watch event: 5
  • Issue comment event: 6
  • Push event: 130
  • Pull request review event: 1
  • Pull request review comment event: 1
  • Gollum event: 18
  • Create event: 47

Issues and Pull Requests

Last synced: 23 days ago

All Time
  • Total issues: 20
  • Total pull requests: 24
  • Average time to close issues: 4 days
  • Average time to close pull requests: about 14 hours
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 0.05
  • Average comments per pull request: 0.0
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 20
  • Pull requests: 24
  • Average time to close issues: 4 days
  • Average time to close pull requests: about 14 hours
  • Issue authors: 1
  • Pull request authors: 3
  • Average comments per issue: 0.05
  • Average comments per pull request: 0.0
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
  • bloch-akshay (20)
Pull Request Authors
  • bloch-akshay (17)
  • akshaypal123 (4)
  • github-actions[bot] (3)
Top Labels
Issue Labels
bug (8) good first issue (6) feature (5) refactor (5) help wanted (1) documentation (1)
Pull Request Labels
autorelease: pending (2) autorelease: tagged (1)