zoukankan      html  css  js  c++  java
  • [Rust] Setup Rust for WebAssembly

    In order to setup a project we need to install the nightly build of Rust and add the WebAssembly target. For an improved workflow we also install the CLI tools wasm-pack and wasm-gc.

    Install:

    brew install rustup

    Run:

    rustup-init

    Setup nightly toolchain as default.

    rustup default nightly

    Then we add the target wasm32-unknown-unknown

    rustup target add wasm32-unknown-unknown

    In addition, we use cargo, Rust's package manager, to install wasm-pack

    cargo install wasm-pack

    This tool seeks to be the one-stop shop for building and working with Rust-generated WebAssembly that you would like to interop with JavaScript in the browser or with Node.js.

    For the first couple lessons, we don't use wasm-pack. Instead, we're going to use a tool called wasm-gc. We install it.

    cargo instal wasm-gc

    wasm-gc is a tool to remove all unneeded exports, imports, functions, and so on from a WebAssembly module.

    Install HTTPS server:

    cargo install https
  • 相关阅读:
    Vue 基础篇一
    ES6常用语法
    Django的认证系统
    Django中的Form表单
    AJAX
    Django中的中间件
    Django ORM操作__聚合,分组查询
    Django ORM操作
    Luogu1382 楼房 (线段树 扫描线)
    Luogu2251 质量检测 (ST表)
  • 原文地址:https://www.cnblogs.com/Answer1215/p/9814182.html
Copyright © 2011-2022 走看看