<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chan Aethiopicus</title>
    <description>The latest articles on DEV Community by Chan Aethiopicus (@aethiopicuschan).</description>
    <link>https://dev.to/aethiopicuschan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1029592%2F714dc68d-57b2-4c22-a851-be2beaf48ab4.jpeg</url>
      <title>DEV Community: Chan Aethiopicus</title>
      <link>https://dev.to/aethiopicuschan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aethiopicuschan"/>
    <language>en</language>
    <item>
      <title>passkey-go: WebAuthn/passkey assertion verification in pure Go</title>
      <dc:creator>Chan Aethiopicus</dc:creator>
      <pubDate>Thu, 12 Jun 2025 03:11:26 +0000</pubDate>
      <link>https://dev.to/aethiopicuschan/passkey-go-webauthnpasskey-assertion-verification-in-pure-go-3219</link>
      <guid>https://dev.to/aethiopicuschan/passkey-go-webauthnpasskey-assertion-verification-in-pure-go-3219</guid>
      <description>&lt;p&gt;Hey all 👋&lt;/p&gt;

&lt;p&gt;I've released &lt;a href="https://github.com/aethiopicuschan/passkey-go" rel="noopener noreferrer"&gt;passkey-go&lt;/a&gt;, a Go library for handling server-side passkey (WebAuthn) assertion verification.&lt;/p&gt;

&lt;p&gt;It provides both low-level building blocks (CBOR, COSE, authData parsing) and a high-level &lt;code&gt;VerifyAssertion()&lt;/code&gt; function compatible with the output of &lt;code&gt;navigator.credentials.get()&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔐 Key Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Pure Go – No CGO or OpenSSL dependency&lt;/li&gt;
&lt;li&gt;🔒 End-to-end passkey (FIDO2/WebAuthn) support&lt;/li&gt;
&lt;li&gt;🔧 High-level API: &lt;code&gt;VerifyAssertion(...)&lt;/code&gt; to validate client responses&lt;/li&gt;
&lt;li&gt;🧱 Low-level parsing: AttestationObject, AuthenticatorData, COSE key → ECDSA&lt;/li&gt;
&lt;li&gt;🧪 Strong error types for HTTP mapping PasskeyError&lt;/li&gt;
&lt;li&gt;📎 Base64URL-compatible and ES256-only (per WebAuthn spec)&lt;/li&gt;
&lt;li&gt;🗂 Example code included for both registration and login&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  💡 Why?
&lt;/h3&gt;

&lt;p&gt;Most WebAuthn libraries in Go are tightly coupled to frontend flows or rely on external dependencies.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;passkey-go&lt;/code&gt; aims to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔹 Lightweight&lt;/li&gt;
&lt;li&gt;🔹 Backend-only&lt;/li&gt;
&lt;li&gt;🔹 Easy to integrate into your own auth logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can issue challenges, parse assertions, and verify signatures—all within your own backend service.&lt;/p&gt;

&lt;h3&gt;
  
  
  📦 Repo:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/aethiopicuschan/passkey-go" rel="noopener noreferrer"&gt;https://github.com/aethiopicuschan/passkey-go&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love any feedback, bug reports, or feature suggestions (e.g., support for EdDSA, Android quirks, etc). Contributions welcome!&lt;/p&gt;

&lt;p&gt;Thanks 🙌&lt;/p&gt;

</description>
      <category>go</category>
      <category>passkey</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>FlashKV - compatible with memcached and is slightly faster.</title>
      <dc:creator>Chan Aethiopicus</dc:creator>
      <pubDate>Mon, 31 Mar 2025 11:25:59 +0000</pubDate>
      <link>https://dev.to/aethiopicuschan/flashkv-compatible-with-memcached-and-is-slightly-faster-2an3</link>
      <guid>https://dev.to/aethiopicuschan/flashkv-compatible-with-memcached-and-is-slightly-faster-2an3</guid>
      <description>&lt;p&gt;Hello! Recently, I wanted to create a KVS for learning purposes, and I’ve been steadily working on developing one that’s compatible with memcached.&lt;br&gt;
Now, it’s finally reached a stage where I can consider it ready for public release, so I’d like to introduce it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/aethiopicuschan/flashkv" rel="noopener noreferrer"&gt;FlashKV&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As mentioned in the README, benchmark results show that it’s about 1.1 times faster than memcached. Although there are still many TODOs and it will take some more time before it’s production-ready, I hope you find it interesting.&lt;br&gt;
Also, issues and PRs are very welcome!&lt;br&gt;
Thank you for reading.&lt;/p&gt;

</description>
      <category>memcached</category>
      <category>go</category>
    </item>
    <item>
      <title>Unofficial Live2D Cubism SDK for Golang</title>
      <dc:creator>Chan Aethiopicus</dc:creator>
      <pubDate>Wed, 25 Dec 2024 23:58:00 +0000</pubDate>
      <link>https://dev.to/aethiopicuschan/unofficial-live2d-cubism-sdk-for-golang-32hi</link>
      <guid>https://dev.to/aethiopicuschan/unofficial-live2d-cubism-sdk-for-golang-32hi</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Q. What is Live2D?&lt;br&gt;
A. See &lt;a href="https://www.live2d.com/en/" rel="noopener noreferrer"&gt;Official Site&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Topic
&lt;/h2&gt;

&lt;p&gt;If you want to use Live2D, you’ll need the Cubism Framework and Cubism Core. The former has official open-source releases for various environments and programming languages, but the latter is closed and has no alternatives. (For detailed configuration, please refer to the &lt;a href="https://docs.live2d.com/en/cubism-sdk-manual/cubism-core-api-reference/" rel="noopener noreferrer"&gt;Cubism Core API Reference&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;Now, looking at the Cubism Framework, you can find available versions for &lt;a href="https://www.live2d.com/en/sdk/about/#unity" rel="noopener noreferrer"&gt;Unity&lt;/a&gt;, &lt;a href="https://www.live2d.com/en/sdk/about/#native" rel="noopener noreferrer"&gt;Native&lt;/a&gt;, &lt;a href="https://www.live2d.com/en/sdk/about/#web" rel="noopener noreferrer"&gt;Web&lt;/a&gt; and &lt;a href="https://www.live2d.com/en/sdk/about/#java" rel="noopener noreferrer"&gt;Java&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But I’m really into Golang and &lt;a href="https://ebitengine.org/" rel="noopener noreferrer"&gt;Ebitengine&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Deliverables
&lt;/h2&gt;

&lt;p&gt;In the end, I wrote my own code that replicates the Cubism Framework’s functionality and turned it into a library: &lt;a href="https://github.com/aethiopicuschan/cubism-go" rel="noopener noreferrer"&gt;github.com/aethiopicuschan/cubism-go&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The library also includes a reference renderer for Ebitengine, so if you’re using Ebitengine for development, you can easily incorporate it into your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faixv91b2seq261biabvn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faixv91b2seq261biabvn.png" alt="ScreenShot of example project" width="800" height="673"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  About Cubism Core
&lt;/h2&gt;

&lt;p&gt;Cubism Core is provided as a dynamic library (such as a &lt;code&gt;.dylib&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Let's consider how to use it from Golang. We could use &lt;code&gt;cgo&lt;/code&gt;, of course, but this time I employed a library called &lt;a href="https://github.com/ebitengine/purego" rel="noopener noreferrer"&gt;purego&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You'll need to grapple with a storm of &lt;code&gt;unsafe&lt;/code&gt; and &lt;code&gt;uintptr&lt;/code&gt;, but it's still much better than using &lt;code&gt;cgo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In this case, there's an implementation related to the following. Feel free to take a look and experience the storm for yourself!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/aethiopicuschan/cubism-go/blob/main/internal/core/core_5_0_0/core.go" rel="noopener noreferrer"&gt;core.go&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I did say you'd have to battle a storm, but &lt;a href="https://github.com/ebitengine/purego" rel="noopener noreferrer"&gt;purego&lt;/a&gt; is a fantastic library, so I encourage everyone to try it out.&lt;/p&gt;

&lt;p&gt;That's all. Thank you for reading.&lt;/p&gt;

</description>
      <category>live2d</category>
      <category>go</category>
      <category>ebitengine</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Wasm3 + TinyGo on PSP</title>
      <dc:creator>Chan Aethiopicus</dc:creator>
      <pubDate>Fri, 20 Dec 2024 01:59:01 +0000</pubDate>
      <link>https://dev.to/aethiopicuschan/wasm3-tinygo-on-psp-12c9</link>
      <guid>https://dev.to/aethiopicuschan/wasm3-tinygo-on-psp-12c9</guid>
      <description>&lt;p&gt;I will attach the GitHub repository first: &lt;a href="https://github.com/aethiopicuschan/wasm3-tinygo-psp" rel="noopener noreferrer"&gt;wasm3-tinygo-psp&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Topic
&lt;/h2&gt;

&lt;p&gt;For some time now, I have wanted to run Golang on the PSP.&lt;/p&gt;

&lt;p&gt;However, native compilation to the PSP is impossible (probably).&lt;/p&gt;

&lt;p&gt;Certainly, Golang does support &lt;code&gt;GOARCH=mipsle&lt;/code&gt;, but it assumes the presence of an operating system. If you attempt to achieve this, you would likely have to navigate a very difficult and thorny path.&lt;/p&gt;

&lt;p&gt;So, I chose another way. In other words, the approach is to convert it into WASM using &lt;a href="https://tinygo.org/" rel="noopener noreferrer"&gt;TinyGo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, let's take a look at the actual code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"unsafe"&lt;/span&gt;

&lt;span class="c"&gt;//go:wasmimport debug println&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="n"&gt;unsafe&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Pointer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt; &lt;span class="kt"&gt;int32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;//export start&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="s"&gt;"Hello, WebAssembly, from Golang!"&lt;/span&gt;
    &lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unsafe&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Pointer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unsafe&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StringData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="kt"&gt;int32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Essentially, we are simply calling the functions provided by the runtime. It's just a Hello World example.&lt;/p&gt;

&lt;h2&gt;
  
  
  About runtime
&lt;/h2&gt;

&lt;p&gt;There was also an option to use Rust and &lt;a href="https://github.com/wasmi-labs/wasmi" rel="noopener noreferrer"&gt;wasmi&lt;/a&gt; for the runtime, but although it worked on emulators like &lt;a href="https://www.ppsspp.org/" rel="noopener noreferrer"&gt;PPSSPP&lt;/a&gt;, errors occurred on the actual hardware (as shown in the screenshot below).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb1qzne14i0ewzk0utlot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb1qzne14i0ewzk0utlot.png" alt="PSP Error ScreenShot" width="480" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I suspect it may be related to kernel mode, but since I ultimately couldn't resolve it, I took a different approach.&lt;/p&gt;

&lt;p&gt;Ultimately, the combination of C and &lt;a href="https://github.com/wasm3/wasm3" rel="noopener noreferrer"&gt;Wasm3&lt;/a&gt; worked successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0k4yism9mxeyk3vs8av6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0k4yism9mxeyk3vs8av6.png" alt="Image of a PSP in Operation" width="800" height="597"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Regarding &lt;code&gt;println&lt;/code&gt;, which was mentioned in the earlier code, it is defined on the runtime side as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#define printf pspDebugScreenPrintf
&lt;/span&gt;
&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;host_debug_println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IM3Runtime&lt;/span&gt; &lt;span class="n"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;IM3ImportContext&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;uint64_t&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;uint32_t&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint32_t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="kt"&gt;uint32_t&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint32_t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="kt"&gt;uint8_t&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint8_t&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;mem&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;memcpy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;'\0'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since this is just a demo, this is all for now. However, if you also wrap other functions and make them callable from WASM, you should be able to develop full-fledged applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges Faced
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cross-compiling Wasm3
&lt;/h3&gt;

&lt;p&gt;It was necessary to compile Wasm3 using the PSP toolchain.&lt;/p&gt;

&lt;p&gt;I created a forked repository to make it easy for everyone to set up the environment, so please take a look for reference: &lt;a href="https://github.com/aethiopicuschan/wasm3-for-psp" rel="noopener noreferrer"&gt;wasm3-for-psp&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  TinyGo build options
&lt;/h3&gt;

&lt;p&gt;In the end, I ended up with the command &lt;code&gt;tinygo build -o hello.wasm -target=wasm -no-debug main.go&lt;/code&gt;, but it took me quite a bit of time just to arrive at such a simple command. I still have a lot to learn.&lt;/p&gt;

&lt;h3&gt;
  
  
  Export &lt;code&gt;main&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;If you are using &lt;code&gt;-target=wasi&lt;/code&gt;, TinyGo exports the main function as &lt;code&gt;_start&lt;/code&gt;. But in this case, I had to define and export a separate &lt;code&gt;start&lt;/code&gt; function.&lt;/p&gt;

&lt;h2&gt;
  
  
  And then...
&lt;/h2&gt;

&lt;p&gt;This time, I used TinyGo to compile Golang code into WASM, but if other languages can also be compiled into WASM, I believe they can be executed using a similar method. I am passionate about Golang, so I would be happy if someone could give it a try.&lt;/p&gt;

&lt;p&gt;That's all. Thank you for reading.&lt;/p&gt;

</description>
      <category>tinygo</category>
      <category>psp</category>
      <category>webassembly</category>
      <category>go</category>
    </item>
  </channel>
</rss>
