---
title: "RawStmt: type in IR, TypeShade API reference for developers"
description: "RawStmt, a type in IR. The raw statement node: a fragment of target source spliced verbatim into a function body, spelled per target."
url: https://typeshade.dev/api/rawstmt-type/
language: en
---

# `RawStmt`

Type in IR

The raw statement node: a fragment of target source spliced verbatim into a function body, spelled per target.

`import type { RawStmt } from 'typeshade'`
`import type { RawStmt } from 'typeshade/core/ir'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
type RawStmt = Extract<Stmt, { s: 'raw' }>;
```

## Description

The `raw` statement node: a fragment of target source spliced verbatim into a function body, spelled per target. It carries a `wgsl` side, a `glsl` side, or both, and at least one is required. A [`Backend`](https://typeshade.dev/api/backend/) receives the whole node in its `rawStmt` method and emits its own side; when that side is absent it throws [`SD0030`](https://typeshade.dev/reference/errors/sd0030/), so a one-sided raw statement means “this module does not build for that target” and never emits the wrong text. The CPU backend throws on every raw statement, since raw text has no CPU evaluation. Build one with [`rawStmt`](https://typeshade.dev/api/rawstmt/).

## See also

- [`Backend`](https://typeshade.dev/api/backend/)
- [`rawStmt`](https://typeshade.dev/api/rawstmt/)

## Source

[`src/core/ir/nodes.ts`, line 334](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/nodes.ts#L334), at commit af54ddad5
