Sway Programming Language

repository·master·Indexed 13 days ago

https://github.com/fuellabs/sway

A Rust-inspired programming language designed for the Fuel blockchain, featuring high performance and modern development ergonomics. The ecosystem includes Forc (Fuel Orchestrator) for project lifecycle management, forc-doc for generating HTML documentation, and forc-debug for attaching to FuelVM instances.

Tokens
139.2K
Snippets
539
Records
801
Agent score
100%

What's inside Sway

  1. Overview of the Sway programming language

    master
    Sway is a statically typed, compiled programming language specifically designed for the FuelVM. It features type inference and traits, aiming to enhance the safety and efficiency of smart contract development through strong static analysis and comprehensive compiler feedback.
  2. Overview of Sway Intermediate Representation (sway-ir)

    master
    The sway-ir crate provides a Static Single Assignment (SSA) style Intermediate Representation (IR) for the Sway compiler middle end. It is modeled after LLVM and is designed to facilitate the optimization phase of the compiler pipeline. While currently a work-in-progress and lacking full documentation and optimization passes, it is functional enough to be targeted by Sway for code generation and passes its internal test suite.
  3. What is Forc (Fuel Orchestrator)?

    master
    Forc (Fuel Orchestrator) is a command-line toolset for developers working within the Fuel ecosystem. It provides essential workflows similar to Rust's cargo, including project scaffolding, code formatting, script execution, contract deployment, and contract testing.
  4. Overview of Sway

    master
    Sway is a programming language developed for the Fuel blockchain. It is heavily inspired by Rust and is designed to provide modern language development features and high performance within the blockchain ecosystem.
  5. Overview of Forc (Fuel Orchestrator)

    master
    Forc (Fuel Orchestrator) is a developer toolset for the Fuel ecosystem, providing functionality similar to cargo in the Rust ecosystem. It is used to manage the lifecycle of Sway projects, including scaffolding, formatting, running scripts, deploying contracts, and testing contracts.
  6. Use the Sway standard library for storage operations

    master

    The Sway standard library (sway-lib-std) provides specialized utilities for managing persistent storage. Instead of raw storage manipulation, you can use higher-level abstractions to manage data:

    • Mapping: Use this to track and manage key-value pairs in storage.
    • Vectors: Use this for persistent, non-heap-allocated collections of items.
    • Store & Get: Use these primitives for manual, low-level manipulation of specific storage slots.

    For detailed implementation details and usage, refer to the specific documentation for Mapping, Vectors, or Store & Get.