---
title: "spellIntrinsic(): function in Backends, TypeShade API"
description: "spellIntrinsic, a function in Backends. Spells a call for one target. The backend contract, the capability model and the registry that spells an intrinsic."
url: https://typeshade.dev/api/spellintrinsic/
language: en
---

# `spellIntrinsic()`

Function in Backends

Spells a call for one target.

`import { spellIntrinsic } from 'typeshade'`

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

## Syntax

```ts
function spellIntrinsic(
  target: IntrinsicTarget,
  name: string,
  args: readonly string[],
): string
```

## Parameters

**`target` `IntrinsicTarget`**

The target to spell for, `'wgsl'` or `'glsl'`.

**`name` `string`**

The builtin id or function name.

**`args` `readonly string[]`**

The argument expressions, already rendered as source text.

## Return value

`string`

The call as source text for `target`.

## Description

When `name` has an [`INTRINSICS`](https://typeshade.dev/api/intrinsics/) entry, returns that entry’s spelling for `target` applied to `args`; otherwise returns `name(args)` with the arguments joined by `,` , which covers portable builtins and user-defined function calls alike.

## Examples

### Example

```ts
spellIntrinsic('glsl', 'atan2', ['y', 'x']) // 'atan(y, x)'
spellIntrinsic('wgsl', 'dot', ['a', 'b'])   // 'dot(a, b)'
```

## See also

- [`INTRINSICS`](https://typeshade.dev/api/intrinsics/)

## Source

[`src/core/intrinsics.ts`, line 1122](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/intrinsics.ts#L1122), at commit af54ddad5
