Metadata-Version: 2.4
Name: niblick
Version: 1.0.0
Summary: A C-like compiler for the Hackaday Supercon.6 (Voja4) 4-bit badge
Author: Mike Abbott
License-Expression: GPL-3.0-only
Project-URL: Homepage, https://furrysalamander.github.io/niblick/
Project-URL: Documentation, https://furrysalamander.github.io/niblick/docs/
Project-URL: Repository, https://github.com/furrysalamander/niblick
Project-URL: Issues, https://github.com/furrysalamander/niblick/issues
Keywords: badge,supercon6,voja4,4-bit,compiler,niblick
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Embedded Systems
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pyserial>=3.5; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: hypothesis>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: z3-solver>=4.13; extra == "dev"
Requires-Dist: pre-commit>=3.7; extra == "dev"
Requires-Dist: pip-audit>=2.9; extra == "dev"
Provides-Extra: lsp
Requires-Dist: pygls>=2.0; extra == "lsp"
Provides-Extra: docs
Requires-Dist: sphinx>=9; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=3.1; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx-autobuild; extra == "docs"
Requires-Dist: sphinx-reredirects; extra == "docs"
Dynamic: license-file

# Niblick

C-like compiler for the Hackaday Supercon.6 2022 (Voja4) badge. It compiles to
the badge's 12-bit instruction set, emits assembly and a `.hex` image, and
includes a headless emulator.

[Open the live editor](https://furrysalamander.github.io/niblick/) |
[Read the documentation](https://furrysalamander.github.io/niblick/docs/)

## Target

| Item | Value |
|---|---|
| Data width | 4 bits |
| Code space | 4096 12-bit words |
| Data RAM | 256 nibbles |
| General registers | 10 |
| Hardware call stack | 5 entries |
| Display | 8x16 LED matrix |
| Serial | 9600 8N1 UART |

## Install

```bash
python3 -m venv .venv
.venv/bin/python -m pip install -e ".[dev]"
```

## Quick start

```bash
.venv/bin/python -m niblick examples/hello.nbl --run
```

```c
import "lib/uart.nbl";

const char message[] = "Hello, Supercon!\n";

fn main() {
    uart_route(1);
    uart_init(3);
    uart_puts(message);
}
```

The compiler writes `<source>.asm` and `<source>.hex` next to the source file.

## Documentation

| Page | Contents |
|---|---|
| [Installation](https://furrysalamander.github.io/niblick/docs/getting-started/install.html) | Requirements and setup |
| [Language](https://furrysalamander.github.io/niblick/docs/language/index.html) | Syntax, types, expressions, statements, functions, structs, imports |
| [Standard library](https://furrysalamander.github.io/niblick/docs/standard-library/index.html) | Intrinsics and `lib/` modules |
| [Toolchain](https://furrysalamander.github.io/niblick/docs/toolchain/emulator.html) | CLI, emulator, diagnostics, debugger, editors |
| [Internals](https://furrysalamander.github.io/niblick/docs/internals/compiler.html) | Compiler, runtime ABI, ISA, memory map, numeric helpers |
| [Examples](https://furrysalamander.github.io/niblick/docs/examples/index.html) | Example index |
| [Project](https://furrysalamander.github.io/niblick/docs/project/repo-layout.html) | Layout, contributing, tests, release |

## License

GPL-3.0-only. See `LICENSE`.
