Saltar al contenido
onsuggest
Iniciar sesión
Artículo

Node.js、浏览器和 Cloudflare Workers 的wasm引入问题

Fuente: Est's Blog ·

最近在鼓捣 WebAssembly,这玩意没啥神秘的,可以看出一坨二进制的 .js 库文件 它本身的export和调用方式是统一的,但如今天我才知道,在不同 JavaScript 运行环境加载 .wasm 方式并不完全一样。 例如 Cloudflare Workers 可以直接: import wasm from "./simple.wasm"; const { instance } = await WebAssembly.instantiate(wasm, imports); Cloudflare 会把 .wasm 模块作为 WebAssembly.Module 提供给代码。 浏览器通常则是通过 fetch() 获取 Wasm,再使用 WebAssembly.instantiateStreaming() : const { instance } = await WebAssembly.instantiateStreaming( fetch("./simple.wasm"), imports, ); Node.js 则通过文件系统读取 .wasm 二进制,然后初始化。 .instantiate() 第一参数必须是 typed array 或者 ArrayBuffer 我自己 写了个 Wasm 库 ,AI 为 Node、浏览器、Cloudflare Workers 分别写一套初始化代

¿Qué es Node.js、浏览器和 Cloudflare Workers 的wasm引入问题?

Node.js、浏览器和 Cloudflare Workers 的wasm引入问题 is a artículo discovery curated from Est's Blog. 最近在鼓捣 WebAssembly,这玩意没啥神秘的,可以看出一坨二进制的 .js 库文件 它本身的export和调用方式是统一的,但如今天我才知道,在不同 JavaScript 运行环境加载 .wasm 方式并不完全一样。 例如 Cloudflare Workers 可以直接: import wasm from "./simple.wasm"; const

¿Cómo puedo acceder o experimentarlo?

You can experience this content directly on its original host (Est's Blog) by clicking the "Open Original" button.

¿De dónde proviene este contenido?

Curated from Est's Blog by the OnSuggest team to surface the most interesting and serendipitous content on the web.

Artículo · Tecnología

Amazon’s Alexa for Shopping agent will now take your orders by text

Amazon is rolling out texting for Alexa for Shopping, its AI shopping agent, starting with invited US customers. It can find products, place orders and track prices by text. Sponsored products can show up in its replies, free to advertisers for now. Amazon is letting shoppers text its AI shopping agent, Alexa for Shopping, which […] This story continues at The Next Web

The Next Web Ver detalles →
Artículo · Tecnología

TSMC is weighing a move into AI memory chips at Nvidia’s request

TSMC is considering making advanced memory chips and has begun drafting plans for 3D DRAM at Nvidia’s request, The Information reports. It would put TSMC up against Samsung, SK Hynix and Micron as AI demand keeps memory scarce. TSMC is considering making advanced memory chips, Bloomberg reported on Friday, citing The Information. The move would […] This story continues at The Next Web

The Next Web Ver detalles →
Artículo · Tecnología

Apollo-backed Brightspeed seeks up to $3B from creditors for fibre

Brightspeed, a US fibre broadband provider owned by Apollo, is in talks with creditors to raise $2B to $3B of new money, Bloomberg reports. It has about $10B of debt, has warned about its survival, and may file for bankruptcy as soon as December. Brightspeed, an Apollo-backed US fibre broadband provider, is in talks to […] This story continues at The Next Web

The Next Web Ver detalles →
Artículo · Tecnología

Musk says government work will be under 10% of SpaceX revenue

Elon Musk said government contracts will make up less than 10% of SpaceX’s revenue this quarter, down from 16.6%. SpaceX now earns most from renting AI computing, with Anthropic its biggest customer, though Anthropic can exit from early 2027. Government contracts will make up less than 10% of SpaceX’s revenue this quarter, Elon Musk said […] This story continues at The Next Web

The Next Web Ver detalles →
Artículo · Tecnología

Microsoft is winding down its deal to rent AI computing from Oracle

Microsoft is winding down a 2023 deal to rent AI computing from Oracle after declining to renew it, Bloomberg reports. The servers ran older Nvidia chips. Microsoft is reassessing more than $80B in contracts with outside cloud providers. Microsoft is winding down a deal to rent AI computing power from Oracle, Bloomberg reported on Friday, […] This story continues at The Next Web

The Next Web Ver detalles →
Artículo · Tecnología

Google takes over the Wyoming data centre site Crusoe had planned

Google has bought Crusoe’s data centre site in southeast Wyoming and will build the project itself, after pledging $17B there. Bloomberg had reported Crusoe was pushed aside after failing to sign customers. Terms were not disclosed. Google has bought Crusoe’s data centre site in southeast Wyoming and will build the project itself, Crusoe said on […] This story continues at The Next Web

The Next Web Ver detalles →

Atajos de teclado

Descubrimiento anterior
←P
Siguiente descubrimiento
→N
Me gusta
L
No es para mí
X
Guardar
S
Mostrar esta ayuda
?
Cerrar
Esc

Los atajos funcionan en la página de descubrimientos.