Metadata-Version: 2.4
Name: wali-linux
Version: 0.2.0
Summary: Syscall definitions and ABI for the WebAssembly Linux Interface (WALI)
Author-email: Arjun Ramesh <arjunr2@andrew.cmu.edu>
License: MIT License
        
        Copyright (c) 2026 Arjun Ramesh
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://wasm-thin-kernel-interfaces.github.io/WALI/
Project-URL: Repository, https://github.com/Wasm-Thin-Kernel-Interfaces/WALI
Keywords: wasm,webassembly,wali,syscall,abi,linux,spec
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Operating System Kernels :: Linux
Classifier: Typing :: Typed
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# WebAssembly Linux Interface

Syscall definitions and ABI type system for the **WebAssembly Linux Interface
(WALI)**.

This package is the machine-readable source of truth for all syscalls and auxillary methods (with arguments types, names, and per-architecture Linux syscall numbers).
It also contains the **ABI** with exact
byte-level layouts of all relevant types.

This package is intended for building WALI
spec-related tooling: code generators, bindings, validators, documentation, etc.

## Install

```sh
pip install wali-linux
```

## Usage

```python
from wali.spec import SYSCALLS, AUX_SYSCALLS, TypeRegistry

# Syscall metadata
read = SYSCALLS["read"]
read.nr                 # 0  (x86_64 number)
read.nrs.arm64          # 63
read.args               # ['int', 'void*', 'size_t']
read.args_id            # ['fd', 'buf', 'count']
read.implemented        # True

# ABI type layout
TypeRegistry.resolve_size("struct stat")       # 144
TypeRegistry.resolve_primitive("off_t")         # Primitive(size=8, signed=True)

stat = TypeRegistry.struct_defs["struct stat"]
for f, off, sz in zip(stat.fields, stat.field_offsets, stat.field_sizes):
    print(f"+{off:>3}  {f.name:<12} {f.type_name:<16} ({sz} bytes)")
```

### Public API

Specification-related information is available in the `wali.spec` namespace

| Name | Description |
|------|-------------|
| `SYSCALLS` | `dict[str, Syscall]` of all defined Linux syscalls |
| `AUX_SYSCALLS` | `dict[str, AuxSyscall]` of WALI auxiliary calls |
| `TypeRegistry` | ABI type system: primitives, aliases, arrays, structs, and layout resolution |
| `Primitive`, `ArrayType`, `StructField` | type-system dataclasses |
