<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on Andrey's Notes on Everything</title><link>https://blog.dmitriev.de/posts/</link><description>Recent content in Posts on Andrey's Notes on Everything</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 12 May 2026 04:58:44 +0200</lastBuildDate><atom:link href="https://blog.dmitriev.de/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>My First WASM</title><link>https://blog.dmitriev.de/posts/my-first-post/</link><pubDate>Tue, 12 May 2026 04:35:34 +0200</pubDate><guid>https://blog.dmitriev.de/posts/my-first-post/</guid><description>&lt;p>Test: sieve_of_eratosthenes&lt;/p>


&lt;div id="wasm-container-0">
 &lt;input id="wasm-input-0" type="number" placeholder="Enter a number" />
 &lt;button id="wasm-btn-0">Run WASM&lt;/button>
 &lt;pre id="wasm-output-0">&lt;/pre>
&lt;/div>

&lt;script type="module">
 import init, * as wasm from "/rust_app\/pkg\/rust_app.js";

 init().then(() => {
 const runBtn = document.getElementById("wasm-btn-0");
 const input = document.getElementById("wasm-input-0");
 const output = document.getElementById("wasm-output-0");

 runBtn.addEventListener("click", () => {
 const val = parseInt(input.value);
 if (isNaN(val)) {
 output.textContent = "Please enter a valid number.";
 return;
 }

 const result = wasm["sieve_of_eratosthenes"](val);
 output.textContent = Array.isArray(result)
 ? result.join(", ")
 : result;
 });
 });
&lt;/script></description></item></channel></rss>