Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WingLangでインフラとアプリを同時にコード化!

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for 酢ろう 酢ろう
March 25, 2024
590

 WingLangでインフラとアプリを同時にコード化!

Avatar for 酢ろう

酢ろう

March 25, 2024
Tweet

Transcript

  1. 8 Wingとは? 新たなプログラミング言語 “cloud-oriented programming language.” ざっくり歴史 2022年: AWS CDKの産みの親

    Erad Ben-Israel と Shai Ber が Wing Cloud を設立 2023年: 2000万ドルの資金調達 現在(2024/03/21): バージョン0.62.2 (ベータ版) 1日に10回程度更新されるほど継続的に開発          
  2. 15 IAM, APIGateway, Lambda がコードに登場しない bring cloud; bring ex; bring

    util; let api = new cloud.Api(); api.get("/users/:id", inflight (request: cloud.ApiRequest): cloud.ApiResponse => { let id = request.vars.get("id"); return cloud.ApiResponse { status: 200, body: Json.stringify({message: "SUCCESS {id}"}) }; });
  3. 20 Table, APIを定義 let tasks = new ex.Table( name: "Tasks",

    columns: { "id" => ex.ColumnType.STRING, "title" => ex.ColumnType.STRING }, primaryKey: "id" ) as "taskTable"; let counter = new cloud.Counter(); // あとで解説 let api = new cloud.Api(); let path = "/tasks";
  4. 21 GETメソッド(一覧取得)を定義 api.get( path, inflight (request: cloud.ApiRequest): cloud.ApiResponse => {

    let rows = tasks.list(); let var result = MutArray<Json>[]; for row in rows { result.push(row); } return cloud.ApiResponse{ status: 200, headers: { "Content-Type" => "application/json" }, body: Json.stringify(result) }; });
  5. 29

  6. 33 • コンセプトに共感できる、引き続き追っていきたい • ローカルシミュレータでの開発体験が良い • 少ない記述で よしなに設定値を定義してくれる • 新しい言語なのでフォーマッタなどが存在しない

    • 「異なるクラウドにコード1つで」は難しそう • 実際使えるようになるまで、かなり時間がかかりそう • 細かい設定値を調整できない(調整しなくて済むために開 発されている)
  7. 38