@ Infra Study Meetup #8 「インフラと研究開発」 https://forkwell.connpass.com/event/193256/
この記事はもしかしたら誤りを含むかもしれません。 今週ツイッター眺めてたら色んな人が javy のリンクを共有していて、なんじゃこれ?と思ったのでそのまとめ。 FYI: https://github.com/Shopify/javy javy は Run your JavaScript on WebAssembly. と説明されていて、要するに JS を wasm で実行するものである。ただこのモチベーションなどがよく分からなかったので、wasm とは何かということから周辺知識をおさらいしつつ javy を理解しようとしてみる。 wasm とは こういうのは MDN を見る WebAssembly は最近のウェブブラウザーで動作し、新たな機能と大幅なパフォーマンス向上を提供する新しい種類のコードです。基本的に直接記述ではなく、C、C++、Rust 等の低水準の言語にとって効果的なコンパイル
はじめに 以前つくった Minsta というデジタルスタンプラリーの Web アプリの中で、ブラウザ上で Canvas を使用してスタンプ風の画像を生成する機能があるのですが、前々からもう少し画像のファイルサイズを落とせそうだなと思っていたので、今回 Rust と WebAssembly を使用して PNG ファイルを極限まで圧縮するのに挑戦してみました。 Minsta については以下の記事をご覧ください。 動機 Minsta では単色で背景透過の以下のようなスタンプの PNG 画像をブラウザ側で Canvas の toBlob メソッドを使用して生成しているのですが、このメソッドで PNG エンコードすると 32 bit の RGB+alpha 形式のファイルしか生成できず、 Minsta で扱うような単色の画像にとっては余計にデータサイズが膨らんでしまっていました。 PNG は使用する
TL;DR: DuckDB-Wasm is an in-process analytical SQL database for the browser. It is powered by WebAssembly, speaks Arrow fluently, reads Parquet, CSV and JSON files backed by Filesystem APIs or HTTP requests and has been tested with Chrome, Firefox, Safari and Node.js. You can try it in your browser at shell.duckdb.org or on Observable. DuckDB-Wasm is fast! If you’re here for performance numbers, h
And open a browser at localhost:3000. Features# Our demo version has a few neat features! Postgres 14.5, psql, pg_dump, etc. Save & restore state to/from a file. Save & restore Postgres state to/from the browser storage (IndexedDB). Quick start from a state file or fully reboot the emulator. Memory configuration options from 128MB to 1024MB. Adjust the font size for the terminal. Upload files to t
この記事は何 以前Qiitaで以下のようなRubyで仮想DOMを扱う方法を記事にしました。 これらで紹介した仮想DOMを使って、Brainf*ckのインタプリタを作ってみたのですが、簡単なプロトタイプを作るのにはかなり便利なことが改めて実感できたので、せっかくなのでライブラリとして公開してみました。 この記事では作成したruby-wasm-vdomについて紹介していきます。 ruby-wasm-vdomとは ruby-wasm-vdomは、文字通りRubyで仮想DOMを扱えるようにするためのライブラリです。 以下のような感じで仮想DOMを全てRubyのみで書くことができます。 <html> <head> </head> <body> <div id="app"></div> <script src="https://getty104.github.io/ruby-wasm-vdom/ind
Fast, Bump-Allocated Virtual DOMs with Rust and Wasm Dodrio is a virtual DOM library written in Rust and WebAssembly. It takes advantage of both Wasm’s linear memory and Rust’s low-level control by designing virtual DOM rendering around bump allocation. Preliminary benchmark results suggest it has best-in-class performance. Background Dodrio from a User’s Perspective Internal Design Preliminary Be
This post is also available in 简体中文, 繁體中文, 日本語, 한국어, Deutsch, Français and Español. ≈On April 1, 2018, Cloudflare announced the 1.1.1.1 public DNS resolver. Over the years, we added the debug page for troubleshooting, global cache purge, 0 TTL for zones on Cloudflare, Upstream TLS, and 1.1.1.1 for families to the platform. In this post, we would like to share some behind the scenes details and cha
Required background The post Deprecating and removing Web SQL announced the deprecation of the Web SQL database technology. While the technology itself may be deprecated, the use cases addressed by the technology very much are not, so the follow-up post SQLite Wasm in the browser backed by the Origin Private File System, outlines a replacement set of technologies based on the SQLite database, comp
これは来るんじゃないだろうか…。 Go1.11でJavaScript APIが実装され、WebAssemblyからDOMやネットワークにアクセスできるようになりました。しかし、そのコードは通常のGoのコードと異なり、JavaScriptと比べても分かりづらいものでした。 しかし将来的にうまくラッピングしたライブラリが出るだろうと思っていたのですが、それはVuguによって予想以上に早く実現されました。 Vuguの使い方 Vuguのメインとなるコードです。Vue風にWeb Component調にまとまっているのが分かります。 <div class="my-first-vugu-comp"> <button @click="data.Toggle()">Test</button> <div vg-if="data.Show">I am here!!</div> </div> <style> .m
Today we will see how we can interact with WebAssembly, from Go: how to execute WebAssembly bytecode from Go and how to generate WebAssembly bytecode with Go. But first of all: what is WebAssembly? WebAssembly According to webassembly.org, WebAssembly (wasm for short) is a new portable, size- and load-time-efficient format suitable for compilation to the web. In a way, wasm is the next evolution o
Kotlin/Wasmでサーバサイドアプリケーションを開発するフレームワーク「KoWasm」が登場。WebAssemblyのガベージコレクションやコンポーネントの活用を想定 JetBrainsでKotlinの開発を担当するZalim Bashorov氏と、VMwareでSpring Frameworkのコミッタとして働くSébastien Deleuze氏は、Kotlinで書かれたコードをWebAssemblyバイナリにコンパイルする機能を備えた「Kotlin/Wasm」を用いて、WebAssemblyベースでサーバサイドアプリケーションを開発するフレームワーク「KoWasm」を発表しました。 KoWasmの開発にはKotlinおよびKotlin/Wasmの開発元であるJetBrainsのKotlin/Wasmチームと協力しているとのことです。 Kotlin/WasmはWebブラウザ上のア
KotlinからWebAssemblyバイナリを生成するコンパイラ搭載、「Kotlin/Wasm」が試験的プレビュー公開。Kotlin 1.8.20ベータ版で Kotlinで書かれたコードをWebAssemblyバイナリとするコンパイル機能を備えた「Kotlin/Wasm」が、Kotlin 1.8.20ベータ版で搭載されたことが明らかになりました。 Kotlin 1.8.20-Beta brings many new features: - AutoCloseable interface and Base64 encoding in stdlib - New JVM incremental compilation enabled by default - Gradle composite builds in Kotlin Multiplatform - New Kotlin/Wasm co
はじめに WASM (WebAssembly) はブラウザを問わす色々な所で実行が可能になる仮想命令セットおよびアーキテクチャです。 WASM を使う事で、ブラウザでネイティブに近いパフォーマンスのコードを実行できる様になります。既に色々な開発言語から WASM を生成できる様になっています。Go 言語も WASM を生成できる様になっています。 WASM を実行できる処理系 WASM を実行できる処理系としてはブラウザや、wasmtime、Lucet、wasm-micro-runtime、wasmer 等があります。 wasmer は Rust で実装された WebAssembly ランタイムで、Go 言語からは wasmer-go というバインディングから利用できます。 Go 言語の WASM の残念なところ しかし Go 言語の WASM は、Rust や他の言語の様に関数を直接呼び
Envoy での WebAssembly サポートと WebAssembly Hub, WASM OCI Image Specification についてWebAssemblyenvoyistioenvoyproxyWebAssemblyHub はじめに この記事では Envoy で WebAssembly がサポートされるまでの背景と WebAssembly Hub, WASM OCI Image Specification に関する情報をまとめていきます。 Envoy で WebAssembly がサポートされるまでの背景 2016年に Istio で Envoy が採用されて以来、Istio ではユーザーの多様なニーズを満たすために豊富な拡張性が提供されてきました。Service Mesh の Data Plane の機能を拡張したい理由としては、独自のアクセス制御システムとの統合、
CDNエッジでJS/TS/WASMを実行できる「Vercel Edge Functions」正式リリース Node.jsサブセットを目指す 米Vercelが、CDNエッジでJavaScript/TypeScript/WebAssemblyを実行できるサーバレス基盤「Vercel Edge Functions」を正式リリース。Next.js、Nuxt、Astro、SvelteKitなどのWebアプリケーションフレームワークに対応するという。 Next.jsの開発元であり、Webアプリケーションのホスティングサービスなどを提供する米Vercelは、CDNエッジでJavaScript/TypeScript/WebAssemblyを実行できるサーバレス基盤「Vercel Edge Functions」の正式リリースを発表しました。 Vercel Edge FunctionsはMicroVMにChr
mavisとは mavisは私がフルスクラッチで開発している自作OSです。 これをビルドしてmake runするとshellが立ち上がり、"hello"コマンドを実行すると"Hello World!"が表示されます。 現状できることはたったこれだけですが、面白いのはその仕組みです。実は上の画像のshellとhello worldプログラムはどちらも WASMバイナリ です。そしてkernelは低レベルなメモリ管理機能とタスク管理機能を除くと、「WASMバイナリをタスクとして実行する」以外の機能を持ちません。つまりkernelがWASM Runtimeであり、それによって"ユーザーランド"を実現しているということです。 このOSは「仮想メモリ」を持ちません。なぜならWASMバイナリは位置独立だからです。WASMはスタックマシンベースの命令セットなので、スタックさえ用意すればどこでも、何度でも
WebAssembly (Wasm) is an universal low level bytecode that runs on the web. It is a compilation target for languages like Rust, AssemblyScript (Typescript-like), Emscripten (C/C++), and much more! Wasm offer a compact binary format with predictable performance, and portability to run alongside Javascript and other host languages. Wasm is currently shipped in all major browsers, and has runtimes me
1 row in 3 seconds is not impressive. 5 billion rows in 56 seconds is. Let’s see how we went from a to b: BigQuery strengths: Throughput, not latencyIf you are expecting results in less than one second, BigQuery is not the right tool: Usually BigQuery won’t return results in less than one second. This because BigQuery was built for throughput, not for latency. A race car will always be faster than
本記事はsudachiclone-rs開発の続編であり、Rustのコードをwasmにし、WebWorker内で状態を持ったまま使いつつ、Typescriptで開発する、ということをやる場合にハマりそうなところに悉くハマった気がするので、その備忘録です。 成果物 レポジトリ: Rustで開発したsudachiclone-rsをwasmにコンパイルし、WebWorker内で動くようにしたもののデモ。 デモページ: 上記をhostingしています。pipから辞書を取ってきてブラウザ上のみでわかち書きできるデモ。 使ったツール群 typescript-definition Rustのstructやfunctionからtypescriptのd.tsを生成してくれる優れもの。crates.ioにあるのもを使っていないのは今のRustでは動かないから。(詳しくはissue参照) wasm-bindgen
Zigのコミッタの方から有益なフィードバックを頂いたり、Wasmランタイムのメンテナからコメントしてもらったり、Twitterでプロ開発者に助けてもらったり、と良い話が多かったのでそのへんの話も含めつつメモとして残しておきます。 最初に断っておきますがWasmにもZigにも特に詳しくないです。 概要 実装 GoのWasmランタイム TinyGoのExample ランタイムの初期化 関数の実行 別の渡し方 Zigの実装 malloc free ptrToString stringToPtr 呼び出し側 サンプル まとめ 概要 自分の開発しているOSSでWebAssemblyによるプラグイン機能に対応したのですが*1、Wasmは仕様が小さく関数の引数や戻り値もi32/i64/f32/f64だけで頑張るみたいな世界なので直接ユーザに生のWasm用コードを書いてもらうのは利便性の面で厳しいです。*
Ruby 3.2 から WASI ベースの WebAssembly がサポートされるということで、すでに Preview 版も公開されています。 この記事は、正直 WebAssembly とか WASI とかよく分かっていない1人間がブラウザ上で Ruby を色々動かしてみる記事です。とりあえず動けばいいという感じなので、おそらく無駄な記述も多いかと思います。ご了承ください。 作るもの テキストボックス等に記述された任意の Ruby スクリプトをブラウザ上で動かして、その実行結果を得られるようなもの。 要するに RubyOnBrowser とか TryRuby とかの二番煎じを作りたいのです。 とりあえず Ruby スクリプトを動かす ruby.wasm の github 上に Quick Start (for Browser) が載っているので、まずはこれをほぼそのまま。 <html>
vim.wasm: Vim Ported to WebAssembly This project is an experimental fork of Vim editor by @rhysd to compile it into WebAssembly using emscripten and binaryen. Vim runs on Web Worker and interacts with the main thread via SharedArrayBuffer. The goal of this project is running Vim editor on browsers without losing Vim's powerful functionalities by compiling Vim C sources into WebAssembly. Try it wit
Recently we’ve seen how WebAssembly is incredibly fast to compile, speeding up JS libraries, and generating even smaller binaries. We’ve even got a high-level plan for better interoperability between the Rust and JavaScript communities, as well as other web programming languages. As alluded to in that previous post, I’d like to dive into more detail about a specific component, wasm-bindgen. Today
Kubernetesやクラウドネイティブをより便利に利用する技術やツールの概要、使い方を凝縮して紹介する本連載「Cloud Nativeチートシート」。今回は、最近注目されている「WebAssembly」について復習しながら、WebAssemblyのアプリケーションをKubernetesで試す方法を紹介します。 Webブラウザからサーバサイドへ~注目されるWebAssembly~ ブラウザ上で高速にアプリを実行する仕組みとして、WebAssembly(「Wasm」と省略されることもある)が注目されています。W3C(World Wide Web Consortium)で標準化されていることもあり、2017年ごろには既に主要なブラウザはWebAssemblyをサポートしています。さらに「Zoom」「Google Meet」「Google Earth」「Unity」などでWebAssemblyが
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く