# 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),](https://devs.truebit.io/developing-truebit-tasks/how-to-create-function-tasks/key-concepts/webassembly) 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="supported-languages/rust">Rust</a></td><td align="center"><a href="key-concepts/task-instrumentation">Yes</a></td><td align="center"><a href="rust#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="supported-languages/c-c++">C / C++</a></td><td align="center"><a href="key-concepts/task-instrumentation">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="supported-languages/javascript">Javascript</a></td><td align="center">No</td><td align="center"><a href="javascript#task-preparation">Js Task preparation</a> </td><td align="center">Node.js v22 LTS</td></tr><tr><td align="center"><a href="supported-languages/python">Python</a></td><td align="center">No</td><td align="center"><a href="python#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>
