Skip to content

[wasm][post-MVP] tailcall proposal in .NET #94352

@lambdageek

Description

@lambdageek

This issue tracks the support for the WebAssembly post-MVP tailcall proposal in .NET.

See #94351 for a summary of other WebAssembly proposals and their status.

Proposal

Repo: https://github.com/WebAssembly/tail-call

Explainer or overview: https://github.com/WebAssembly/tail-call/blob/main/proposals/tail-call/Overview.md

.NET Scenarios and User Stories

F# logic in a .NET WebAssembly app

As an F# developer, I would like to use tail-recursive functions in my library code that is used by a .NET WebAssembly application without overflowing the stack. My code is performance sensitive and I would like to utilize Just-in-Time or Ahead-of-Time compilation.

AOT

We need LLVM support for tailcalls in WASM.

Interpreter / jiterpreter

The interpreter already does not recuse in C when a .NET function is called (it managed its own stack of activation frames). It already has specialized tailcall opcodes.

The jiterpreter currently bails on traces that include function calls (tailcalls included).

Libraries / Tooling / Diagnostics

N/A

Upstream dependencies: engines and toolchain

Required WebAssembly engine support

Expected .NET targets or supported configurations: Desktop browsers + Mobile browsers + Node + WASI

Engine Status
Chrome ?
Firefox ?
Safari ?
Node ?
wasmtime ?

Required WebAssembly toolchain support

We need LLVM to support this for AOT.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions