# Supported Languages

## Language Capabilities

Function Tasks are executed in a specially instrumented version of the WasmEdge runtime.\
Functions written in Rust or C++ are compiled directly to [WebAssembly (WASM),](/developing-truebit-tasks/how-to-create-function-tasks/key-concepts/webassembly.md) while JavaScript and Python are executed by a WASM-compiled interpreter. As is generally true, compiled functions tend to execute faster than interpreted ones.

<table data-full-width="false"><thead><tr><th width="128" align="center">Language</th><th width="195" align="center">Task Instrumentation</th><th width="180" align="center">Task preparation</th><th align="center">Dependencies</th></tr></thead><tbody><tr><td align="center"><a href="/pages/JawcFJ0XEUZkDFNiG5PL">Rust</a></td><td align="center"><a href="/pages/U7e9U4cLqjafj5LwD9Na">Yes</a></td><td align="center"><a href="/pages/JawcFJ0XEUZkDFNiG5PL#task-preparation">Built-in</a></td><td align="center"><p>Rust v1.81 <strong>only</strong></p><p>WASM32-WASI target</p></td></tr><tr><td align="center"><a href="/pages/69qYDI6K5X8tG6JkJk18">C / C++</a></td><td align="center"><a href="/pages/U7e9U4cLqjafj5LwD9Na">Yes</a></td><td align="center">Custom</td><td align="center"><p>Wasienv</p><p>WASI-SDK 16</p></td></tr><tr><td align="center"><a href="/pages/plwj2UkIkgNtZhDaNkm0">Javascript</a></td><td align="center">No</td><td align="center"><a href="/pages/plwj2UkIkgNtZhDaNkm0#task-preparation">Js Task preparation</a> </td><td align="center">Node.js v22 LTS</td></tr><tr><td align="center"><a href="/pages/FVQC0oXst75T8MZIpwiW">Python</a></td><td align="center">No</td><td align="center"><a href="/pages/FVQC0oXst75T8MZIpwiW#task-preparation">Py Task preparation</a></td><td align="center">Python 3.12 <strong>only</strong></td></tr></tbody></table>

## Setup

You can write Function Tasks in various development languages. Here's how to install different versions of these languages:

{% tabs %}
{% tab title="Rust" %}
Currently, we support Rust version **1.81 only**. Please install it by running the following command-line commands:

```bash
curl https://sh.rustup.rs -sSf | sh
source "$HOME/.cargo/env"
rustup install 1.81.0
rustup default 1.81
```

Please run the following line to install WebAssembly and WASI Preview 1 support for Rust:

```
rustup target add wasm32-wasip1
```

{% endtab %}

{% tab title="C/C++" %}
Please run the following command-line commands to download and install the C and C++ compilers and utilities:

**Linux**

{% code overflow="wrap" %}

```bash
sudo apt install wabt
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sdk-16.0-linux.tar.gz
tar xvf wasi-sdk-16.0-linux.tar.gz -C ${HOME}
echo "export WASI_SDK_PATH=${HOME}/wasi-sdk-16.0/" >> ~/.profile
source ~/.profile
```

{% endcode %}
{% endtab %}

{% tab title="JS" %}
Currently, we support Node version **22 LTS or above**.&#x20;

We recommend to visit <https://nodejs.org/en/download> and install the latest **v22 LTS** version.
{% endtab %}

{% tab title="Python" %}
Currently, we support Python version **3.12 only**.&#x20;

We recommend to visit <https://www.python.org/downloads/> and install version **v3.12**.
{% endtab %}
{% endtabs %}

### -l, --lang Options

<table><thead><tr><th>Language</th><th valign="middle">Value</th></tr></thead><tbody><tr><td>Rust</td><td valign="middle">Rs (default value)</td></tr><tr><td>Javascript</td><td valign="middle">js</td></tr><tr><td>Python</td><td valign="middle">py</td></tr><tr><td>C</td><td valign="middle">c</td></tr><tr><td>C++</td><td valign="middle">c++</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devs.truebit.io/developing-truebit-tasks/how-to-create-function-tasks/supported-languages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
