# Sway编程语言(The Sway Programming Language)

Sway is a domain-specific language (DSL) for the [Fuel Virtual Machine (FuelVM)](https://fuellabs.github.io/fuel-specs/master/vm/index.html), a blockchain-optimized VM designed for the Fuel blockchain. Sway is based on [Rust](https://doc.rust-lang.org/book/), and includes syntax to leverage a blockchain VM without needlessly verbose boilerplate.

Sway 是用于 [Fuel 虚拟机 (FuelVM)](https://fuellabs.github.io/fuel-specs/master/vm/index.html) 的领域特定语言 (DSL)，这是一种对于 Fuel 区块链优化的虚拟机。 Sway 基于 [Rust](https://doc.rust-lang.org/book/)，包括利用区块链虚拟机的语法，无需冗长的样板文件。

This book documents how to write smart contracts in Sway, along with how to install and use the Sway toolchain.

本书记录了如何在 Sway 中编写智能合约，以及如何安装和使用 Sway 工具链。

Before starting developing smart contracts in Sway, please keep in mind the [known issues and workarounds](https://fuellabs.github.io/sway/v0.38.0/book/reference/known_issues_and_workarounds.html) of the language and toolchain.

在开始使用 Sway 开发智能合约之前，请牢记语言和工具链的[已知问题和解决方法](https://fuellabs.github.io/sway/v0.38.0/book/reference/known_issues_and_workarounds.html)。


---

# 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://zenofchain.gitbook.io/sway-bian-cheng-yu-yan-geng-xin-zhong-the-sway-programming-languageupdatin/sway-bian-cheng-yu-yan-the-sway-programming-language.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.
