owned this note changed 6 years ago
Linked with GitHub

給 Web 工程師的 Rust 上手指南 - 舒欣

由於場地問題,第二天我們移動到另一棟大樓啦!議程教室變動請見網站上的議程表

歡迎來到 https://hackmd.io/@coscup/2019 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。

請從這裡開始

tags: COSCUP2019 Everything in Rust IB301
  • 舒欣,之前在 Matters ,現在自己創業

History of Rust

  1. Started as a hobby project ~ 2006
  2. Picked up by Mozilla in 2010
  3. Most loved language

Design Goal

  1. Fast, safe, concurrent system language for everyone

    • Fast: similiar to C++
      • No GC, compile to machine code, concurrency (to utilize CPU cores)
    • Safe: Strong & static typing, no undifined behaviour, no data race
      • No manual malloc() and free(), don't need to be C expert!
  2. 混合 functional ,也有點 oo ,和現在的 相關語言有點像

滿意度從出到現在一直都很高(最高)

Rust projects

Syntax

Rust

// variables
let a = 3;
a = 4; //error

let mut b = 3;
b = 4;
//function

//iterate over array

// define object shapes
struct Human {
    alive: bool,
    age: u16,
}

// Create objects
let andy = Human(
    alive : false,
    age: 80,
);

Javascript / Typescript

// variables
const a = 3
a = 4 //error

let b = 3
b = 5;

// define object shapes
interface Human { 
    alive: bool,
    age:number,
}

//create objects
let andy = {
    alive: false,
    age: 80
};

//Define object shapes
struct Human {
  alive: bool,
  age: u16
}

Live coding

Framework : Yew
Rust -> webAssembly -> browser
State -> yew::Component 映射
少什麼就 impl 什麼

Select a repo