---
title: "emitExpr(): function in Emit, TypeShade API reference"
description: "emitExpr, a function in Emit. Emit one Expr as WGSL source text, using wgslBackend with the default 'full' parenthesisation."
url: https://typeshade.dev/api/emitexpr/
language: en
---

# `emitExpr()`

Function in Emit

Emit one Expr as WGSL source text, using wgslBackend with the default 'full' parenthesisation.

`import { emitExpr } from 'typeshade'`

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

## Syntax

```ts
const emitExpr: (e: Expr) => string
```

## Parameters

**`e` `Expr`**

## Return value

`string`

## Description

The expression is written as given; the lowering and optimization passes that [`emitModule`](https://typeshade.dev/api/emitmodule/) runs do not run here.

## Targets

| Target | Support | Notes |
| --- | --- | --- |
| WGSL (WebGPU) | Supported | Writes WGSL for WebGPU. |
| GLSL ES 3.00 (WebGL2) | Does not apply | |
| CPU oracle | Does not apply | |

## See also

- [`Expr`](https://typeshade.dev/api/expr/)
- [`wgslBackend`](https://typeshade.dev/api/wgslbackend/)
- [`emitModule`](https://typeshade.dev/api/emitmodule/)

## Source

[`src/core/backends/wgsl.ts`, line 155](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/backends/wgsl.ts#L155), at commit af54ddad5
