<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Tuntii · Tunay Engin - Blog</title>
    <subtitle>Tunay Engin. Open-source projects and writing on Rust, distributed systems, and LLM tooling.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://tuntii.com/en/blog/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-11-16T00:00:00+00:00</updated>
    <id>https://tuntii.com/en/blog/atom.xml</id>
    <entry xml:lang="en">
        <title>Why I Work on iyi, and Why I Wrote kilim</title>
        <published>2026-11-16T00:00:00+00:00</published>
        <updated>2026-11-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/kilim-and-iyi/"/>
        <id>https://tuntii.com/en/blog/kilim-and-iyi/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/kilim-and-iyi/">&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;iyi.dev&quot;&gt;iyi&lt;&#x2F;a&gt; is not my language. Serdar Doğruyol started it.&lt;&#x2F;p&gt;
&lt;p&gt;If you know Serdar from Kemal, Crystal&#x27;s web framework, that&#x27;s where I know him from too. He&#x27;s someone I&#x27;ve genuinely looked up to since I was a kid.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-iyi-is&quot;&gt;What iyi is&lt;&#x2F;h2&gt;
&lt;p&gt;iyi is a language that grew out of Crystal. Its name means &quot;good&quot; in Turkish, and its mascot is a red heart, waving. Its README lists four goals: developer and agentic experience, portability, performance, efficiency. Under all of them sits one design decision: a module is compiled against its dependencies&#x27; declarations only, never their bodies.&lt;&#x2F;p&gt;
&lt;p&gt;You can see the result in the README&#x27;s numbers. In a 7,207-line project, editing one module and rebuilding takes 0.13 seconds. &lt;code&gt;hello&lt;&#x2F;code&gt; is a 36 KB binary. And my favorite part: once you build a library and keep its artifact, you can delete its source and the program still builds.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;kilim&quot;&gt;kilim&lt;&#x2F;h2&gt;
&lt;p&gt;I wrote a GUI library for iyi: &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;kilim&quot;&gt;kilim&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Why me? Because I think I&#x27;m one of the open-source focused developers in Turkey best placed to run the GUI side.&lt;&#x2F;p&gt;
&lt;p&gt;kilim is written from scratch. It doesn&#x27;t wrap anyone&#x27;s library:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;It draws its own widgets. It doesn&#x27;t use the operating system&#x27;s controls, so an app looks the same on Windows, Linux and macOS.&lt;&#x2F;li&gt;
&lt;li&gt;On Windows it uses only the system&#x27;s own Win32, Direct2D and DirectWrite. No DLLs to ship. On Linux and macOS, SDL3 and SDL3_ttf.&lt;&#x2F;li&gt;
&lt;li&gt;Turkish text displays and edits correctly. It has an embedded Noto Sans.&lt;&#x2F;li&gt;
&lt;li&gt;It doesn&#x27;t draw unless something changes. Idle means idle.&lt;&#x2F;li&gt;
&lt;li&gt;Every commit runs the tests, a smoke test, and a self-driving to-do app on three platforms.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;It&#x27;s at v0.2.1 right now.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;loser&quot;&gt;loser&lt;&#x2F;h2&gt;
&lt;p&gt;The first real app I wrote with kilim is &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;loser&quot;&gt;loser&lt;&#x2F;a&gt;: a desktop app where I track my own projects. Three panes, plain Markdown files, read-only sync from GitHub, and an MCP server so Claude can read and update my tasks. All of it in iyi, on kilim.&lt;&#x2F;p&gt;
&lt;p&gt;On November 6, kilim got a multi-line text area, a dropdown and a modal confirmation dialog in a single day, followed by fourteen fixes. Three days later, on November 9, I made loser&#x27;s first commit. The MCP server, the GitHub sync and the three-pane window were done the same day. If a GUI library lets you write an app in a day, I&#x27;d say it&#x27;s doing its job.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-i-maintain-it&quot;&gt;Why I maintain it&lt;&#x2F;h2&gt;
&lt;p&gt;iyi is Serdar&#x27;s product. But what grows a language isn&#x27;t only its compiler. It&#x27;s the ecosystem around it: libraries, tools, apps written with it.&lt;&#x2F;p&gt;
&lt;p&gt;And that ecosystem is us.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>MCP Took Off, RustAPI Didn&#x27;t</title>
        <published>2026-11-16T00:00:00+00:00</published>
        <updated>2026-11-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/mcp-took-off-rustapi-didnt/"/>
        <id>https://tuntii.com/en/blog/mcp-took-off-rustapi-didnt/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/mcp-took-off-rustapi-didnt/">&lt;p&gt;On July 6 I published a post called &lt;a href=&quot;&#x2F;en&#x2F;blog&#x2F;agent-first-architecture-mcp&#x2F;&quot;&gt;Agent-First Architecture&lt;&#x2F;a&gt;. The claim was simple: every SaaS will have an MCP endpoint, the way every SaaS had a REST API in 2015. Its last sentence was: &quot;Those who prepare now will be a step ahead in 2027.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Four months have passed. I was half right.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-part-that-held&quot;&gt;The part that held&lt;&#x2F;h2&gt;
&lt;p&gt;Enterprise companies started shipping MCP endpoints one after another. A year ago people gave you a strange look if you said &quot;AI agents will call APIs&quot;. Now a product without an MCP server looks like it is missing something.&lt;&#x2F;p&gt;
&lt;p&gt;While writing this I looked at the MCP servers connected to my own editor: Atlassian, Notion, Figma, HubSpot, Canva, Gmail, Google Drive. I set up none of them myself. Each one is the company&#x27;s own official server.&lt;&#x2F;p&gt;
&lt;p&gt;It went the same way on my side. All my repos are mirrored on my own server, and agents read them over MCP. &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;loser&quot;&gt;loser&lt;&#x2F;a&gt;, the desktop app I track my own projects in, ships with its own MCP server. What I wrote in July as &quot;one day it will be like this&quot;, I now use every day.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-part-that-didn-t&quot;&gt;The part that didn&#x27;t&lt;&#x2F;h2&gt;
&lt;p&gt;I wrote RustAPI for exactly this world. Every endpoint came out of the same code as both REST and an MCP tool. You could grant permissions per tool. And I tuned the DX from the start for one thing: keep Rust&#x27;s speed while making it easy to write code with an AI, so a model can read the framework and produce the right thing.&lt;&#x2F;p&gt;
&lt;p&gt;I was happy with what came out technically. When agents started asking for MCP endpoints, RustAPI was ready for them.&lt;&#x2F;p&gt;
&lt;p&gt;But it didn&#x27;t catch on.&lt;&#x2F;p&gt;
&lt;p&gt;Whenever I opened a thread on the Rust forums, the replies were roughly the same: &quot;Bro, there&#x27;s AI in it, nooo, that can&#x27;t work.&quot; People got stuck on the word &quot;AI&quot; before looking at what the framework did. You explain once, twice. At some point you notice you are making the same defense in every new thread.&lt;&#x2F;p&gt;
&lt;p&gt;I got tired.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;then-v&quot;&gt;Then V&lt;&#x2F;h2&gt;
&lt;p&gt;In mid July I started playing with V. On July 18 I published &lt;a href=&quot;&#x2F;en&#x2F;blog&#x2F;viltrum-http-engine-in-v&#x2F;&quot;&gt;the first Viltrum post&lt;&#x2F;a&gt;. In it I wrote &quot;no relation to RustAPI, zero&quot;. As code, that&#x27;s true. But the reason I slid into V so easily is in this post: I had run out of energy on the Rust side.&lt;&#x2F;p&gt;
&lt;p&gt;Viltrum went from 0.1 to 1.18 in four months. The new example in 1.18, released today, came from a PR I didn&#x27;t write.&lt;&#x2F;p&gt;
&lt;p&gt;The RustAPI repo is still public. I didn&#x27;t delete it. I stand behind everything I wrote about MCP. I just tried to grow the framework that would carry that idea in the wrong community.&lt;&#x2F;p&gt;
&lt;p&gt;Right now I&#x27;m writing V. Long live V.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Poise Labs: The Deal We Didn&#x27;t Sign in Dubai</title>
        <published>2026-11-16T00:00:00+00:00</published>
        <updated>2026-11-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/poise-labs-dubai/"/>
        <id>https://tuntii.com/en/blog/poise-labs-dubai/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/poise-labs-dubai/">&lt;p&gt;There were no LLMs in the Poise Labs days. The pitch deck, the technical docs, every email to an investor: we sat down and wrote them ourselves.&lt;&#x2F;p&gt;
&lt;p&gt;I was 17. My partner was Ceyhun (Ceyhun Kasım Arslan). We had also started Bones Interactive together when we were 15.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;where-the-idea-came-from&quot;&gt;Where the idea came from&lt;&#x2F;h2&gt;
&lt;p&gt;It was a time when I was tired of building projects on Solana.&lt;&#x2F;p&gt;
&lt;p&gt;An idea kept going around in my head: Blockchain as a Service.&lt;&#x2F;p&gt;
&lt;p&gt;Companies were dealing with one security incident after another back then, and I thought it fit right there. The problem was this: on horizontally scaled blockchains with a fixed structure, everyone uses the same nodes. The nodes get polluted. Fake transactions pile up, and the center has no way to control it.&lt;&#x2F;p&gt;
&lt;p&gt;We did the opposite. Every company gets its own node. The company opens its own instance through an SDK or an API, sets it up, runs it. It shares it with no one.&lt;&#x2F;p&gt;
&lt;p&gt;The real part was this: every piece of data leaving the company was a transaction. Anything on layer 7. Meetings, emails, call transcripts, documents moving around inside the company, all of it. Every transaction followed the same simple pattern, so connecting IoT devices was easy too. Move did the confirmation, and thanks to Move, nothing waited.&lt;&#x2F;p&gt;
&lt;p&gt;In the end, what went on inside the company became transparent and manageable. When something leaked or got changed, its trace stayed on the chain.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;dubai&quot;&gt;Dubai&lt;&#x2F;h2&gt;
&lt;p&gt;We went to Dubai for the investment.&lt;&#x2F;p&gt;
&lt;p&gt;When I think of that time, tiredness is not the first thing that comes to mind. It was intense, but it was great. The memories Ceyhun and I have from then are like stories from military service. Dubai was a lot of fun. That part stays between the two of us.&lt;&#x2F;p&gt;
&lt;p&gt;We got all the way to the investment&#x27;s door. The number was 5.2 million dollars.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-day-we-didn-t-sign&quot;&gt;The day we didn&#x27;t sign&lt;&#x2F;h2&gt;
&lt;p&gt;The deal was on the table. Our lawyer told us not to sign.&lt;&#x2F;p&gt;
&lt;p&gt;We decided something was off, and we didn&#x27;t sign.&lt;&#x2F;p&gt;
&lt;p&gt;We actually could have made the deal. If we had, we would have been the youngest startup in Turkey to raise 5.2 million dollars. Two names, 17 years old: Ceyhun Kasım Arslan and Tunay Engin.&lt;&#x2F;p&gt;
&lt;p&gt;It didn&#x27;t happen.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;turkey&quot;&gt;Turkey&lt;&#x2F;h2&gt;
&lt;p&gt;We didn&#x27;t take the investment. We walked away from it.&lt;&#x2F;p&gt;
&lt;p&gt;We came back to Turkey and met investors here. The answer was short:&lt;&#x2F;p&gt;
&lt;p&gt;&quot;We can&#x27;t invest in you, there&#x27;s no market.&quot;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Viltrum: No Wrapper in Between</title>
        <published>2026-11-16T00:00:00+00:00</published>
        <updated>2026-11-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/viltrum-no-wrapper-in-between/"/>
        <id>https://tuntii.com/en/blog/viltrum-no-wrapper-in-between/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/viltrum-no-wrapper-in-between/">&lt;p&gt;On July 18, when I wrote &lt;a href=&quot;&#x2F;en&#x2F;blog&#x2F;viltrum-http-engine-in-v&#x2F;&quot;&gt;the first Viltrum post&lt;&#x2F;a&gt;, its last section ended like this: &quot;No HTTP&#x2F;2. No TLS. Good; the focus stays.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;By October 24 it had both. Its own TLS 1.3 record layer and handshake, HTTP&#x2F;2 chosen by ALPN, and h2c on the same port. What changed my mind is what this post is about.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-i-wanted&quot;&gt;What I wanted&lt;&#x2F;h2&gt;
&lt;p&gt;My goal was a fast round trip for an API, or for IoT devices talking to each other. A request comes in, the answer goes back without delay. That&#x27;s it.&lt;&#x2F;p&gt;
&lt;p&gt;V is a good start for that. It is a fast language by design. It compiles to native code, the binary is small, &lt;code&gt;v run&lt;&#x2F;code&gt; doesn&#x27;t keep you waiting.&lt;&#x2F;p&gt;
&lt;p&gt;The problem was on the framework side. Most of the V web frameworks I looked at were wrappers: a thin layer over another server or library. The router is nice, there&#x27;s middleware, but the place where bytes come off the socket and turn into an HTTP message is someone else&#x27;s code. And the speed is only as fast as that code.&lt;&#x2F;p&gt;
&lt;p&gt;Very few frameworks were written in pure V, owned the wire themselves, and focused on exactly this point.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-owning-the-wire-means&quot;&gt;What &quot;owning the wire&quot; means&lt;&#x2F;h2&gt;
&lt;p&gt;It&#x27;s the first sentence of Viltrum&#x27;s README: &quot;A web framework for V that owns the wire.&quot; In practice:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Its own HTTP&#x2F;1.1, HTTP&#x2F;2 and WebSocket engine.&lt;&#x2F;strong&gt; Including HTTP&#x2F;2&#x27;s HPACK compression.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Its own TLS 1.3.&lt;&#x2F;strong&gt; AES-GCM records on AES-NI and PCLMUL, the handshake with X25519 and RSA certificates. To be honest here: X25519 and the RSA-PSS signing are in C. The rest is V.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Its own DEFLATE encoder.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;One epoll worker per CPU.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Zero allocations per request.&lt;&#x2F;strong&gt; I don&#x27;t just claim it. There&#x27;s a gate in CI: if a request allocates a single byte, the build goes red.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I think the last one matters most. If you want a fast round trip, you want nothing on the request&#x27;s path that asks for memory. And you can only guarantee that if the whole path is your code. With a wrapper you can&#x27;t, because whatever the code under the wrapper does, happens.&lt;&#x2F;p&gt;
&lt;p&gt;I wrote TLS for the same reason. In July I was saying &quot;need TLS? put a reverse proxy in front&quot;. But a proxy in front means putting another layer I didn&#x27;t write back on the request&#x27;s path. There was no point escaping the wrapper only to land in a proxy.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;speed&quot;&gt;Speed&lt;&#x2F;h2&gt;
&lt;p&gt;The second half of the difference is speed, and I measured it.&lt;&#x2F;p&gt;
&lt;p&gt;On October 14, on HttpArena&#x27;s baseline, Viltrum was 99th out of 151 frameworks. In the run twelve days later, in the Experimental category, it was first out of 19 entries on HTTP&#x2F;1.1 and first out of 14 on WebSocket. Everything that happened between those two dates is in the repo. I wrote about how I measured it &lt;a href=&quot;&#x2F;en&#x2F;blog&#x2F;viltrum-httparena-benchmark-method&#x2F;&quot;&gt;in a separate post&lt;&#x2F;a&gt;, and about why I threw the engine away and rewrote it &lt;a href=&quot;&#x2F;en&#x2F;blog&#x2F;viltrum-1x-rewriting-the-engine&#x2F;&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;vision&quot;&gt;Vision&lt;&#x2F;h2&gt;
&lt;p&gt;Two things make Viltrum different: its vision and its speed. Speed is above. The vision is this: between a request and its answer, nothing I didn&#x27;t write and can&#x27;t measure.&lt;&#x2F;p&gt;
&lt;p&gt;1.18.0 came out today. The new example in it, &lt;code&gt;todo_api&lt;&#x2F;code&gt;, came from a PR I didn&#x27;t write.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Viltrum 1.x: I Threw the Engine Away and Rewrote It</title>
        <published>2026-10-24T00:00:00+00:00</published>
        <updated>2026-10-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/viltrum-1x-rewriting-the-engine/"/>
        <id>https://tuntii.com/en/blog/viltrum-1x-rewriting-the-engine/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/viltrum-1x-rewriting-the-engine/">&lt;p&gt;When I &lt;a href=&quot;&#x2F;en&#x2F;blog&#x2F;viltrum-http-engine-in-v&#x2F;&quot;&gt;first wrote about Viltrum&lt;&#x2F;a&gt; in July, I said: &quot;No HTTP&#x2F;2. No TLS. Good thing, too; no distractions.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Three months later, we&#x27;re at v1.5. There&#x27;s TLS, there&#x27;s WebSocket, there&#x27;s static files and uploads. HTTP&#x2F;2 still isn&#x27;t there, so I kept my word on that one.&lt;&#x2F;p&gt;
&lt;p&gt;But the real story isn&#x27;t these features. Somewhere in between, I threw the whole engine in the trash once.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-0-x-was&quot;&gt;What 0.x was&lt;&#x2F;h2&gt;
&lt;p&gt;The 0.x series ran from July to October. A spawn per connection, my own HTTP&#x2F;1.1 parser, upgrades via hijack, WebSocket, TLS on top of mbedtls (reloading the certificate on SIGHUP), forms, a small HTTP client. In v0.13 I squeezed the hot path quite a bit.&lt;&#x2F;p&gt;
&lt;p&gt;Then I took a step back: no matter how much I squeezed, the model was the same. A spawn per connection, allocations per request. Instead of building another floor on top, the foundation had to change.&lt;&#x2F;p&gt;
&lt;p&gt;I shipped 1.0 on October 15 and wrote this in the CHANGELOG: TLS, WebSocket, static files, forms and the client are not in 1.0. I deleted all of them. From a user&#x27;s point of view it looked like a step backwards, and it was. But I didn&#x27;t want to keep anything that hadn&#x27;t been moved onto the new core.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;1-0-s-one-rule&quot;&gt;1.0&#x27;s one rule&lt;&#x2F;h2&gt;
&lt;p&gt;The core was written from day one with a single rule: zero allocations per request inside the framework. And that rule isn&#x27;t a statement of intent, it&#x27;s a test in CI:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;v&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-v &quot;&gt;&lt;code class=&quot;language-v&quot; data-lang=&quot;v&quot;&gt;&lt;span&gt;&#x2F;&#x2F; The acceptance gate of the whole rewrite: once buffers have grown to their working
&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;&#x2F; size, serving a request allocates nothing on the GC heap.
&lt;&#x2F;span&gt;&lt;span&gt;fn test_hot_path_allocates_nothing() {
&lt;&#x2F;span&gt;&lt;span&gt;	mut w := new_worker(make_router(), Options{}, 0)
&lt;&#x2F;span&gt;&lt;span&gt;	mut c := new_conn()
&lt;&#x2F;span&gt;&lt;span&gt;	for name, raw in shapes {
&lt;&#x2F;span&gt;&lt;span&gt;		req := raw.bytes()
&lt;&#x2F;span&gt;&lt;span&gt;		for _ in 0 .. 200 {
&lt;&#x2F;span&gt;&lt;span&gt;			run(mut w, mut c, req)
&lt;&#x2F;span&gt;&lt;span&gt;		}
&lt;&#x2F;span&gt;&lt;span&gt;		before := http1.allocated_bytes()
&lt;&#x2F;span&gt;&lt;span&gt;		for _ in 0 .. 10000 {
&lt;&#x2F;span&gt;&lt;span&gt;			run(mut w, mut c, req)
&lt;&#x2F;span&gt;&lt;span&gt;		}
&lt;&#x2F;span&gt;&lt;span&gt;		assert http1.allocated_bytes() - before == 0, &amp;#39;${name} allocates&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;	}
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;200 requests warm up the buffers, and if the GC heap grows by even one byte over the next 10,000 requests, the test goes red. Every PR goes through this gate.&lt;&#x2F;p&gt;
&lt;p&gt;A few decisions make this possible:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One worker per CPU.&lt;&#x2F;strong&gt; Each one has its own &lt;code&gt;SO_REUSEPORT&lt;&#x2F;code&gt; listener and its own epoll loop. Whichever worker a connection lands on, it stays there for its whole life. On the request path, workers don&#x27;t wait on each other.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fixed buffers per connection.&lt;&#x2F;strong&gt; 8 KiB for reading, 16 KiB for writing. They grow for large messages and shrink when the connection closes.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Request strings are views, not copies.&lt;&#x2F;strong&gt; &lt;code&gt;c.path()&lt;&#x2F;code&gt;, &lt;code&gt;c.param()&lt;&#x2F;code&gt;, &lt;code&gt;c.body()&lt;&#x2F;code&gt; point into the connection&#x27;s buffer and stay valid until the handler returns. If you want to keep one, &lt;code&gt;.clone()&lt;&#x2F;code&gt; it.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Pipelining is a single send.&lt;&#x2F;strong&gt; However many complete requests arrive in one read, all of them get answered, and the responses go out in a single &lt;code&gt;send&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;two-bugs-the-gate-couldn-t-see&quot;&gt;Two bugs the gate couldn&#x27;t see&lt;&#x2F;h2&gt;
&lt;p&gt;I wrote the test, it went green, I relaxed. I relaxed way too early.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;First: V&#x27;s GC pins.&lt;&#x2F;strong&gt; When V 0.5.2 compiles with &lt;code&gt;-prod&lt;&#x2F;code&gt; and Boehm GC, it puts a scan around every function call made while a by-value struct or array holding pointers is in scope. Once the pointer count goes over 32, it callocs a root list and takes the GC&#x27;s global lock. The allocation gate can&#x27;t see this, because technically the heap doesn&#x27;t grow. But every worker queues up on the same lock.&lt;&#x2F;p&gt;
&lt;p&gt;The JSON encoder was doing this once per element on a 40-element page. At 8 threads that was 400 µs of CPU per request, at a single thread 50 µs. After the fix, on a 12-thread Ryzen 5 3600, json-comp went from 19.9 thousand requests&#x2F;sec to 51.6 thousand. CI now has &lt;code&gt;scripts&#x2F;gcpin_check.sh&lt;&#x2F;code&gt;, which fails the build if it sees a pin on the hot path.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Second: a Conn per fd.&lt;&#x2F;strong&gt; fd numbers are process-wide. With &lt;code&gt;SO_REUSEPORT&lt;&#x2F;code&gt;, any worker can get any fd number. Each worker was keeping a Conn for every fd number it had ever seen. With connections constantly opening and closing, every worker ends up allocating a Conn for almost every fd, each one with 24 KiB of buffers. At 64 workers that adds up to gigabytes, and every allocation takes the GC lock again.&lt;&#x2F;p&gt;
&lt;p&gt;On HttpArena&#x27;s short-lived profile (10 requests per connection), they measured 158 thousand requests&#x2F;sec, 373% CPU and 2.2 GiB of memory. With one free list per worker, the same scenario on my 8-core server came down to 223 thousand requests&#x2F;sec and 233 MiB. Today that profile is at 2.70 million requests&#x2F;sec on HttpArena.&lt;&#x2F;p&gt;
&lt;p&gt;The lesson I took from both: a &quot;no allocations&quot; test is necessary but not enough. You have to measure lock and memory behavior separately.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;deferred-responses-timers&quot;&gt;Deferred responses: timers&lt;&#x2F;h2&gt;
&lt;p&gt;1.1 brought &lt;code&gt;c.after(ms, cb, arg)&lt;&#x2F;code&gt;. The handler returns right away and doesn&#x27;t hold the worker; &lt;code&gt;ms&lt;&#x2F;code&gt; milliseconds later, &lt;code&gt;cb&lt;&#x2F;code&gt; writes the response on the same worker. Underneath there&#x27;s one min-heap per worker. The epoll loop waits until the next timer.&lt;&#x2F;p&gt;
&lt;p&gt;This week I found a nice bug here. &lt;code&gt;epoll_wait&lt;&#x2F;code&gt; takes its timeout in whole milliseconds. To avoid firing early, I was rounding the remaining time up. A request that should have been answered after 0.2 ms went out after 1 ms. Under load this piles up: a &lt;code&gt;&#x2F;delay&#x2F;10&lt;&#x2F;code&gt; request was getting an extra 1.0 to 1.7 ms on top of its 10 ms.&lt;&#x2F;p&gt;
&lt;p&gt;The fix is &lt;code&gt;epoll_pwait2&lt;&#x2F;code&gt;. It&#x27;s been around since Linux 5.11 and takes the timeout in nanoseconds. If the kernel doesn&#x27;t support it or seccomp rejects it, it falls back to the old path. On my own server the overshoot dropped to 0.3-0.4 ms, and requests&#x2F;sec went up 7-13%. The cost is 15-25% more CPU per request, because timers now fire in smaller batches. This change shipped in v1.5.1.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tls-the-handshake-in-mbedtls-the-records-in-my-code&quot;&gt;TLS: the handshake in mbedtls, the records in my code&lt;&#x2F;h2&gt;
&lt;p&gt;Viltrum has a rule: no third-party dependencies. No vendored C code either. Only what ships with V itself. That&#x27;s why TLS sits on top of mbedtls 3.6, which comes bundled with V.&lt;&#x2F;p&gt;
&lt;p&gt;In 1.2, TLS moved onto the same epoll workers. Non-blocking handshake, &lt;code&gt;WANT_READ&lt;&#x2F;code&gt; &#x2F; &lt;code&gt;WANT_WRITE&lt;&#x2F;code&gt; translated into epoll, the certificate reloaded when the file changes (no SIGHUP, it watches the file), and a half-written certificate pair never replaces the one in use.&lt;&#x2F;p&gt;
&lt;p&gt;Then I profiled it: on a 10 KB TLS echo, two thirds of the CPU was in mbedtls&#x27;s GCM. mbedtls pushes a record through the cipher layer in 16-byte blocks.&lt;&#x2F;p&gt;
&lt;p&gt;In 1.3.2, once the TLS 1.3 handshake finishes, I started doing the records myself: AES-GCM with AES-NI and PCLMULQDQ in &lt;code&gt;engine&#x2F;aesgcm.h&lt;&#x2F;code&gt;. The methods are the ones Intel published, the code is mine. Eight counter blocks side by side, GHASH with a single reduction per eight blocks, tags checked in constant time before decryption. For correctness there are the GCM specification&#x27;s test vectors and a comparison against mbedtls on 1200 random inputs.&lt;&#x2F;p&gt;
&lt;p&gt;The handshake, TLS 1.2, ChaCha20 and CPUs without AES-NI stayed in mbedtls.&lt;&#x2F;p&gt;
&lt;p&gt;Result: CPU per 10 KB echo went from 283-357 µs down to 135-171 µs.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;gzip-my-own-deflate&quot;&gt;gzip: my own DEFLATE&lt;&#x2F;h2&gt;
&lt;p&gt;In the json-comp profile, gzip was half the profile. The miniz that ships with V is a streaming compressor: on every call it clears roughly 97 KB of window and hash state and runs the input through a ring buffer. For a 1 KB JSON that&#x27;s way too much setup.&lt;&#x2F;p&gt;
&lt;p&gt;Adding libdeflate came up. The rule was clear: no dependencies. So I&#x27;d write libdeflate&#x27;s ideas myself.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;http1&#x2F;deflate.v&lt;&#x2F;code&gt; compresses the body in place. Chunks of up to 64 KB, a hash table sized to the chunk, hash chains with a single lazy step, the smallest block type per chunk (dynamic, fixed or stored), slice-by-8 CRC-32. State is allocated once per worker, zero allocations per call.&lt;&#x2F;p&gt;
&lt;p&gt;I tuned the search depth to json-comp&#x27;s scoring formula. There, HttpArena multiplies requests&#x2F;sec by &lt;code&gt;(smallest size &#x2F; my size)²&lt;&#x2F;code&gt;, so every byte counts. On the profile&#x27;s three JSON bodies it&#x27;s 52 µs per body, versus 126 µs for miniz at level 6. Size is 1263 B versus 1232 B, so a bit bigger but much faster.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;websocket-and-topics&quot;&gt;WebSocket and topics&lt;&#x2F;h2&gt;
&lt;p&gt;WebSocket came back in 1.3: &lt;code&gt;app.ws(pattern, handler)&lt;&#x2F;code&gt;, RFC 6455, on the same workers, &lt;code&gt;ws:&#x2F;&#x2F;&lt;&#x2F;code&gt; and &lt;code&gt;wss:&#x2F;&#x2F;&lt;&#x2F;code&gt;. Messages arrive as views into the read buffer, with no allocations on the echo path.&lt;&#x2F;p&gt;
&lt;p&gt;For topics (&lt;code&gt;subscribe&lt;&#x2F;code&gt; &#x2F; &lt;code&gt;publish&lt;&#x2F;code&gt;) I gave each worker an inbox: a queue behind a mutex and an eventfd in the epoll set. Publish copies the message once and drops it into each worker&#x27;s queue, and each worker writes to its own subscribers. A connection&#x27;s buffers never leave its own worker.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-missing&quot;&gt;What&#x27;s missing&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;HTTP&#x2F;2. The decision is pending. First h2c, then h2 over TLS with ALPN, but I haven&#x27;t started yet.&lt;&#x2F;li&gt;
&lt;li&gt;HTTP client. It was in 0.x, it didn&#x27;t get moved to the 1.x core.&lt;&#x2F;li&gt;
&lt;li&gt;Serving outside Linux. The engine is epoll. On macOS and Windows, tests and examples compile in CI and you can test handlers with &lt;code&gt;handle_raw&lt;&#x2F;code&gt;, but &lt;code&gt;listen&lt;&#x2F;code&gt; returns an error.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;recover&lt;&#x2F;code&gt; doesn&#x27;t catch real panics. V can&#x27;t catch a panic, the process exits. Run it behind a supervisor like systemd&#x27;s &lt;code&gt;Restart=always&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;&#x2F;h2&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; clone https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;viltrum.git &amp;amp;&amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span&gt; viltrum
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;bash&lt;&#x2F;span&gt;&lt;span&gt; scripts&#x2F;install.sh
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;v&lt;&#x2F;span&gt;&lt;span&gt; run examples&#x2F;hello
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# in another terminal
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span&gt; http:&#x2F;&#x2F;127.0.0.1:8080&#x2F;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Repo: &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;viltrum&quot;&gt;github.com&#x2F;Tuntii&#x2F;viltrum&lt;&#x2F;a&gt;. The roadmap is in &lt;code&gt;ROADMAP.md&lt;&#x2F;code&gt;, and so is what we&#x27;re not going to do.&lt;&#x2F;p&gt;
&lt;p&gt;At the end of the July post I said &quot;if you don&#x27;t like it, open an issue&quot;. That still stands. Let me add this too: rewriting the engine looks scary, but the scary part is writing it without tests. With the gate in place, deleting is easy.&lt;&#x2F;p&gt;
&lt;p&gt;In the next post I&#x27;ll explain where these numbers come from: HttpArena, A&#x2F;B measuring on a noisy VM, and the medals I lost yesterday.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>First Place on HttpArena, Medals Lost a Day Later</title>
        <published>2026-10-24T00:00:00+00:00</published>
        <updated>2026-10-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/viltrum-httparena-benchmark-method/"/>
        <id>https://tuntii.com/en/blog/viltrum-httparena-benchmark-method/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/viltrum-httparena-benchmark-method/">&lt;p&gt;On October 23 the HttpArena results page was updated. Viltrum, in the Experimental category: first out of 13 entries on HTTP&#x2F;1.1. First out of 11 entries on WebSocket. 9 gold, 1 silver.&lt;&#x2F;p&gt;
&lt;p&gt;Same day, I put the medal table in the README.&lt;&#x2F;p&gt;
&lt;p&gt;Next day I looked at the table again: 7 gold, 2 silver, 1 bronze.&lt;&#x2F;p&gt;
&lt;p&gt;This post is about what happened between those two days and where my numbers come from. In the previous post I covered &lt;a href=&quot;&#x2F;en&#x2F;blog&#x2F;viltrum-1x-rewriting-the-engine&#x2F;&quot;&gt;the engine itself&lt;&#x2F;a&gt;; this one is the measurement side.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-httparena&quot;&gt;Why HttpArena&lt;&#x2F;h2&gt;
&lt;p&gt;When people said web framework benchmark, they meant TechEmpower. On March 24, 2026 the repo was archived, and it no longer accepts new entries. The active successor is &lt;a href=&quot;https:&#x2F;&#x2F;http-arena.com&quot;&gt;HttpArena&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Everyone runs on the same machine: a 64-core Threadripper PRO 3995WX, the server gets 64 threads, the load generator sits on separate cores. You write your own entry (a Dockerfile, the handlers, a &lt;code&gt;meta.json&lt;&#x2F;code&gt;), open a PR, and the maintainer runs the benchmark and commits the results.&lt;&#x2F;p&gt;
&lt;p&gt;Viltrum&#x27;s entry lives in the repo under &lt;code&gt;benches&#x2F;httparena&#x2F;&lt;&#x2F;code&gt;. The first PR was merged on October 14.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-the-score-is-calculated&quot;&gt;How the score is calculated&lt;&#x2F;h2&gt;
&lt;p&gt;If you don&#x27;t understand this, you can&#x27;t tell which work matters.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Each profile is scored from 0 to 1000.&lt;&#x2F;strong&gt; The best result in a profile gets 1000, everyone else is scored relative to it. The reference is the whole field, not the view you filtered.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The composite is a sum, not an average.&lt;&#x2F;strong&gt; If you skip a profile, you get 0 for it. So every missing profile is 1000 points.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;json-comp has a size penalty.&lt;&#x2F;strong&gt; Requests&#x2F;sec are first multiplied by &lt;code&gt;(smallest response size &#x2F; your response size)²&lt;&#x2F;code&gt;. If your response is twice as big, your score drops to a quarter.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The fixed-rate profiles are different.&lt;&#x2F;strong&gt; latency-1m, latency-10k and 8gbit fix the request rate. There the score is set by CPU, average latency and p99.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Completeness.&lt;&#x2F;strong&gt; For each of routing, middleware, request and response that you handle yourself instead of the framework, the composite drops by 2.5%.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;On October 21 things looked like this: composite 5267, seventh out of 13 entries in Experimental. json-tls and 8gbit were zero because there was no TLS. 2000 points sitting on the table. json-comp was 418, the weakest scored cell.&lt;&#x2F;p&gt;
&lt;p&gt;So the to-do list wrote itself: TLS first, then json-comp.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;where-i-measure&quot;&gt;Where I measure&lt;&#x2F;h2&gt;
&lt;p&gt;My test machine is hostlab: a VMware VM with 8 vCPUs, Xeon E5-2690 v2. My live services run on it too. Not ideal for benchmarking, but it&#x27;s what I have.&lt;&#x2F;p&gt;
&lt;p&gt;On this VM, ±10% swing from one run to the next is normal. So I have a few rules:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Alternate the A&#x2F;B runs.&lt;&#x2F;strong&gt; Instead of running A three times and then B three times, do A, B, A, B, A, B. Whatever mood the VM is in gets spread evenly across both sides.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Read ratios, not totals.&lt;&#x2F;strong&gt; On this machine one HTTP keep-alive request eats about 80 µs of server CPU, most of it in the kernel. The absolute number can&#x27;t be compared with the HttpArena machine. &quot;B uses 20% less CPU than A&quot; can.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Measure CPU per request.&lt;&#x2F;strong&gt; I pin the server to four cores with &lt;code&gt;taskset -c 0-3&lt;&#x2F;code&gt; and the client to the other four. Before and after the run I read the server&#x27;s CPU time from &lt;code&gt;&#x2F;proc&#x2F;&amp;lt;pid&amp;gt;&#x2F;stat&lt;&#x2F;code&gt; and divide by the request count. Throughput is noisy, CPU&#x2F;request is much calmer.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Min-of-N for microbenchmarks.&lt;&#x2F;strong&gt; The best run is the one with the least noise mixed in.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;One more snag: HttpArena&#x27;s load generator, gcannon, uses io_uring buffer rings, and hostlab&#x27;s 5.15 kernel can&#x27;t run that. So I wrote myself a small epoll client. Its only job is to send one request per connection, wait for the response, and write the latency into a histogram.&lt;&#x2F;p&gt;
&lt;p&gt;Before every PR I also run HttpArena&#x27;s own &lt;code&gt;validate.sh&lt;&#x2F;code&gt; script. The last entry passed 73&#x2F;73, TLS checks included.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-paid-off&quot;&gt;What paid off&lt;&#x2F;h2&gt;
&lt;p&gt;In short, biggest to smallest:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;TLS (1.2.0) and my own AES-GCM record layer (1.3.2).&lt;&#x2F;strong&gt; Two zero cells filled. CPU per 10 KB TLS echo cut in half.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;My own DEFLATE (1.2.2) and the JSON path (1.3.1).&lt;&#x2F;strong&gt; json-comp went from 418 to 902.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Taking GC pins out of the hot path (1.0.1).&lt;&#x2F;strong&gt; A global lock the allocation test couldn&#x27;t see. On Ryzen, json-comp went from 19.9k to 51.6k requests&#x2F;sec.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The per-fd Conn bug (1.0.3).&lt;&#x2F;strong&gt; On HttpArena, short-lived had choked at 158k requests&#x2F;sec with 2.2 GiB of memory.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;In the October 22 run the composite rose to 7011. In the October 23 run, 7786: first in Experimental.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-i-didn-t-chase&quot;&gt;What I didn&#x27;t chase&lt;&#x2F;h2&gt;
&lt;p&gt;In the rankings there&#x27;s one entry way ahead on json-comp at 2.49 million requests&#x2F;sec: vanilla-epoll. I looked at how it does it. It caches the compressed responses by (count, parameter) pair. So it never compresses the same request twice.&lt;&#x2F;p&gt;
&lt;p&gt;vanilla-epoll&#x27;s type is &quot;engine&quot;, and that category is scored separately, under its own rules. Framework rules don&#x27;t allow this. So I didn&#x27;t do it in my entry. If I bend the rules for points, the points stop meaning anything.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;a-day-later&quot;&gt;A day later&lt;&#x2F;h2&gt;
&lt;p&gt;On October 24 I looked at the table and saw a new name: &lt;code&gt;httparena-io_uring&lt;&#x2F;code&gt;. Behind it is libioxd: written in C23, on top of io_uring, one ring per thread, raw syscalls, TLS records in the kernel (kTLS). It&#x27;s the personal library of MDA2AV, who runs HttpArena. Entered as Experimental.&lt;&#x2F;p&gt;
&lt;p&gt;It passed me in three profiles:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Profile&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: right&quot;&gt;libioxd&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: right&quot;&gt;Viltrum&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: right&quot;&gt;Gap&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Baseline&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;4.25M&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;4.06M&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;4.6%&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Short-lived&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;2.74M&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;2.70M&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;1.7%&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Async (&lt;code&gt;&#x2F;delay&#x2F;10&lt;&#x2F;code&gt;)&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;2.76M&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;2.49M&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;11%&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;My first question was &quot;did something break?&quot; Nothing had. My numbers were the same. Someone just showed up faster. The composite dropped to 7686, but I&#x27;m still first out of 14 entries on HTTP&#x2F;1.1. Gold went from 9 to 7, silver from 1 to 2, plus a bronze.&lt;&#x2F;p&gt;
&lt;p&gt;On baseline and short-lived we both saturate all 64 cores. The gap is most likely the syscall cost of io_uring versus epoll. 1.7% is small enough to swing from run to run. 4.6% looks more real. Getting it back would need an io_uring path inside the engine, and that&#x27;s a big job.&lt;&#x2F;p&gt;
&lt;p&gt;Async was telling a different story. There Viltrum was only using 44 of the 64 cores. CPU wasn&#x27;t the bottleneck. Average latency was 12.77 ms, against 11.53 ms for libioxd. Every request waits 10 ms and the connection count is fixed, so requests&#x2F;sec is determined entirely by latency.&lt;&#x2F;p&gt;
&lt;p&gt;Where was the extra 1.2 ms coming from? The answer was simple. While the epoll loop waited for the next timer, I was rounding the timeout up to milliseconds. &lt;code&gt;epoll_wait&lt;&#x2F;code&gt; doesn&#x27;t take any other unit. A response that should have gone out after 0.2 ms went out after 1 ms.&lt;&#x2F;p&gt;
&lt;p&gt;The fix is &lt;code&gt;epoll_pwait2&lt;&#x2F;code&gt; with a nanosecond timeout. On hostlab, at 64 and 128 connections, three alternating rounds:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style=&quot;text-align: right&quot;&gt;Connections&lt;&#x2F;th&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: right&quot;&gt;Requests&#x2F;sec&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: right&quot;&gt;p50&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: right&quot;&gt;CPU&#x2F;request&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right&quot;&gt;64&lt;&#x2F;td&gt;&lt;td&gt;before&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;~5.8k&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;~11.0 ms&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;57-75 µs&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right&quot;&gt;64&lt;&#x2F;td&gt;&lt;td&gt;after&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;~6.15k&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;~10.3 ms&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;71-77 µs&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right&quot;&gt;128&lt;&#x2F;td&gt;&lt;td&gt;before&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;~10.9k&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;~11.55 ms&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;52-62 µs&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right&quot;&gt;128&lt;&#x2F;td&gt;&lt;td&gt;after&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;~12.2k&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;~10.3 ms&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: right&quot;&gt;62-72 µs&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;The overshoot above 10 ms went from 1.0-1.7 ms down to 0.3-0.4 ms. The cost is 15-25% more CPU per request, because timers now fire one by one instead of in batches. The HttpArena machine had 20 idle cores, so there&#x27;s room.&lt;&#x2F;p&gt;
&lt;p&gt;I also tried adding 200 µs of slack and firing timers in batches. It came out almost as bad as before and didn&#x27;t save any CPU either. Threw it out.&lt;&#x2F;p&gt;
&lt;p&gt;Whether I climb above bronze on async, we&#x27;ll see in the next run. I can&#x27;t try 32,000 connections on this VM, so no promises.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-experimental-means&quot;&gt;What Experimental means&lt;&#x2F;h2&gt;
&lt;p&gt;Viltrum&#x27;s type on HttpArena is &quot;experimental&quot;. The default leaderboard shows flagship and emerging entries; to see Experimental you have to tick a checkbox. Scoring is the same, only the view differs.&lt;&#x2F;p&gt;
&lt;p&gt;At first I had put &quot;emerging&quot;. The maintainer asked me to change it. The criteria are clear: production use, users, ecosystem. Outside contributions, issues being opened, people talking about it online. Age helps but it&#x27;s secondary. Having written your own engine also counts against you, because it&#x27;s one more layer that needs hardening.&lt;&#x2F;p&gt;
&lt;p&gt;He&#x27;s right. A few outside contributions have come in (the latest is this week&#x27;s new logo), but real users are close to none so far. That&#x27;s why the next phase on the roadmap isn&#x27;t performance, it&#x27;s community. This post is part of that.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;takeaways&quot;&gt;Takeaways&lt;&#x2F;h2&gt;
&lt;p&gt;Three things I learned from the benchmark:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Read the scoring formula.&lt;&#x2F;strong&gt; A missing profile is 1000 points, json-comp penalizes you by bytes squared. The formula tells you what matters.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Trust ratios, not totals.&lt;&#x2F;strong&gt; Even on a noisy VM, alternating A&#x2F;B and CPU&#x2F;request get you to the right place.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Losing medals is a good thing.&lt;&#x2F;strong&gt; A day earlier I was first and couldn&#x27;t see the 1 ms rounding bug in async. When someone faster showed up, I saw it.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Results page: &lt;a href=&quot;https:&#x2F;&#x2F;http-arena.com&#x2F;frameworks&#x2F;viltrum&#x2F;&quot;&gt;http-arena.com&#x2F;frameworks&#x2F;viltrum&lt;&#x2F;a&gt;. The entry&#x27;s code: &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;viltrum&#x2F;tree&#x2F;main&#x2F;benches&#x2F;httparena&quot;&gt;benches&#x2F;httparena&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If you spot a mistake in the method, open an issue. Challenging numbers is worth more than publishing them.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Viltrum: I Wrote My Own HTTP Engine in V</title>
        <published>2026-07-18T00:00:00+00:00</published>
        <updated>2026-07-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/viltrum-http-engine-in-v/"/>
        <id>https://tuntii.com/en/blog/viltrum-http-engine-in-v/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/viltrum-http-engine-in-v/">&lt;p&gt;I have RustAPI. 55+ stars, MCP, a production path. One framework is enough, right?&lt;&#x2F;p&gt;
&lt;p&gt;Nope. Not for me, anyway.&lt;&#x2F;p&gt;
&lt;p&gt;In July 2026 I was poking around with V. While I was looking for something to build, the answer got clear: not something Axum-flavored. A thin HTTP framework with its own accept loop, its own parsing, its own keep-alive. I named it &lt;strong&gt;Viltrum&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-v&quot;&gt;Why V?&lt;&#x2F;h2&gt;
&lt;p&gt;Few people take V seriously. High star count, debatable production claims, thin ecosystem. That&#x27;s exactly why it fits a side project.&lt;&#x2F;p&gt;
&lt;p&gt;My rules are simple:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Don&#x27;t touch RustAPI. That&#x27;s a separate world.&lt;&#x2F;li&gt;
&lt;li&gt;Limited hours per week. Don&#x27;t let the other work die.&lt;&#x2F;li&gt;
&lt;li&gt;A single binary, readable code, and that &quot;the engine is mine&quot; feeling.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;V gives me that. &lt;code&gt;v run&lt;&#x2F;code&gt; is fast. The stdlib has net. There&#x27;s veb, but I didn&#x27;t want to wrap veb. I wanted the stack to be mine, from framed TCP up to the HTTP&#x2F;1.1 message.&lt;&#x2F;p&gt;
&lt;p&gt;A learning project? Yes. A toy? No, I won&#x27;t call it a toy. Because parse edge cases, keep-alive, the mandatory Host header, the 413 path... that&#x27;s not &quot;hello world&quot;. That&#x27;s an engine.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-i-built-short-version&quot;&gt;What I built (short version)&lt;&#x2F;h2&gt;
&lt;p&gt;The flow goes like this:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;TCP accept
&lt;&#x2F;span&gt;&lt;span&gt;  -&amp;gt; multi-read until end of headers
&lt;&#x2F;span&gt;&lt;span&gt;  -&amp;gt; Content-Length body
&lt;&#x2F;span&gt;&lt;span&gt;  -&amp;gt; parse
&lt;&#x2F;span&gt;&lt;span&gt;  -&amp;gt; router (:param)
&lt;&#x2F;span&gt;&lt;span&gt;  -&amp;gt; middleware
&lt;&#x2F;span&gt;&lt;span&gt;  -&amp;gt; response
&lt;&#x2F;span&gt;&lt;span&gt;  -&amp;gt; keep-alive or close
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;v0.1: PoC. It worked, single buffer, &lt;code&gt;Connection: close&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;v0.2: Real framing. Keep-alive, path params, a rest example (in-memory TODO JSON).&lt;&#x2F;p&gt;
&lt;p&gt;v0.2.1: Polish. Query decoding, trailing slash, options, CI.&lt;&#x2F;p&gt;
&lt;p&gt;v0.3: Graceful shutdown on SIGINT&#x2F;SIGTERM, keep-alive idle timeout, &lt;code&gt;recover&lt;&#x2F;code&gt; middleware, timing in the logger.&lt;&#x2F;p&gt;
&lt;p&gt;The public API is small on purpose:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;v&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-v &quot;&gt;&lt;code class=&quot;language-v&quot; data-lang=&quot;v&quot;&gt;&lt;span&gt;mut app := viltrum.new()
&lt;&#x2F;span&gt;&lt;span&gt;app.use(viltrum.recover)
&lt;&#x2F;span&gt;&lt;span&gt;app.use(viltrum.logger)
&lt;&#x2F;span&gt;&lt;span&gt;app.get(&amp;#39;&#x2F;hi&#x2F;:name&amp;#39;, hello)
&lt;&#x2F;span&gt;&lt;span&gt;app.listen(&amp;#39;127.0.0.1:8080&amp;#39;) or { panic(err) }
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Handlers are plain functions. No extractor magic. No type-level magic. I got tired of that side of things; this one is deliberately plain.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-engine-decision&quot;&gt;The engine decision&lt;&#x2F;h2&gt;
&lt;p&gt;Some people ask &quot;why not the stdlib&#x27;s net.http.server?&quot; Answer: learning and control.&lt;&#x2F;p&gt;
&lt;p&gt;Writing a server is two jobs:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Framing.&lt;&#x2F;strong&gt; Getting HTTP messages out of a byte stream. Incomplete headers, half a body, leftover buffer, keep-alive.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Application surface.&lt;&#x2F;strong&gt; Routes, middleware, JSON helpers.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Most frameworks polish 2 and leave 1 to someone else. I wanted to write 1 myself. Because on the RustAPI side the &quot;engine&quot; debate keeps coming up too. Trying it at small scale in V is cheap.&lt;&#x2F;p&gt;
&lt;p&gt;To be honest: the V runtime has no Go-style panic recover. My &lt;code&gt;recover&lt;&#x2F;code&gt; middleware hardens the response (status 0, missing Content-Length). It doesn&#x27;t magically catch a panic that takes down the process. I wrote that in the CHANGELOG too. No exaggeration.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;relation-to-rustapi&quot;&gt;Relation to RustAPI&lt;&#x2F;h2&gt;
&lt;p&gt;None. Zero.&lt;&#x2F;p&gt;
&lt;p&gt;I don&#x27;t want to split two framework brands at the same time. RustAPI is the Rust world. Viltrum is a V experiment. There&#x27;s neither a reason nor the time to merge them.&lt;&#x2F;p&gt;
&lt;p&gt;Viltrum isn&#x27;t a money-making tool. It&#x27;s a side track. Commits are under Tuntii, MIT, public.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;who-would-use-it&quot;&gt;Who would use it?&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Someone learning V who wants &quot;something real&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Someone writing a single-binary tool API&lt;&#x2F;li&gt;
&lt;li&gt;Someone curious about &quot;what does a framework actually do?&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Who wouldn&#x27;t?&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Someone who wants TLS + HTTP&#x2F;2 + WebSocket in prod tomorrow (not there yet, put a reverse proxy in front)&lt;&#x2F;li&gt;
&lt;li&gt;Someone looking for an ORM + auth suite (a deliberate non-goal)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;where-are-we&quot;&gt;Where are we?&lt;&#x2F;h2&gt;
&lt;p&gt;Repo: &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;viltrum&quot;&gt;github.com&#x2F;Tuntii&#x2F;viltrum&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; clone https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;viltrum.git
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span&gt; viltrum
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;mkdir -p ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.vmodules &amp;amp;&amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;ln -sfn &lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;$&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;pwd&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;)&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.vmodules&#x2F;viltrum
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;v&lt;&#x2F;span&gt;&lt;span&gt; run examples&#x2F;hello
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# another terminal
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span&gt; http:&#x2F;&#x2F;127.0.0.1:8080&#x2F;hi&#x2F;tunay
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;examples&#x2F;rest&lt;&#x2F;code&gt; is a small TODO JSON API. It dogfoods keep-alive and the body path.&lt;&#x2F;p&gt;
&lt;p&gt;Next up: getting the bench numbers properly settled, more parse fuzzing, maybe route groups. No HTTP&#x2F;2. No TLS. Good thing, too; keeps the focus from scattering.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;wrapping-up&quot;&gt;Wrapping up&lt;&#x2F;h2&gt;
&lt;p&gt;The best way to try a new language isn&#x27;t &quot;finishing the tutorial&quot;. It&#x27;s writing a small but real system. An HTTP engine is exactly that: clear boundaries, fast feedback, hard to lie to yourself.&lt;&#x2F;p&gt;
&lt;p&gt;That&#x27;s exactly what Viltrum is. I talked to V, wrote the engine, shipped it.&lt;&#x2F;p&gt;
&lt;p&gt;If you don&#x27;t like it, open an issue. If you do, no obligation to star it; fork it and break it. That&#x27;s where the real fun is.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to Start Programming: 2026 Edition</title>
        <published>2026-07-14T00:00:00+00:00</published>
        <updated>2026-07-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/how-to-start-programming-2026-edition/"/>
        <id>https://tuntii.com/en/blog/how-to-start-programming-2026-edition/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/how-to-start-programming-2026-edition/">&lt;p&gt;You google “how do I start programming?” It’s 2026. ChatGPT is open on your phone, a 40-hour “full stack from zero” YouTube playlist is sitting in your download queue, someone on a Discord has posted “looking for a mentor”, and somewhere else an ad for “80k USD remote in 3 months” keeps spinning.&lt;&#x2F;p&gt;
&lt;p&gt;This isn’t a motivational speech. It’s a &lt;strong&gt;2026 Edition&lt;&#x2F;strong&gt;, meaning: the title is a joke, the content stings a bit. It’s for anyone who wants it, because in 2026 the “how do I start” question doesn’t change with age. It changes with your &lt;strong&gt;stockpile of excuses&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;spoiler-there-s-ai-so-it-s-easier-and-harder&quot;&gt;Spoiler: there’s AI, so it’s &lt;em&gt;easier&lt;&#x2F;em&gt; (and &lt;em&gt;harder&lt;&#x2F;em&gt;)&lt;&#x2F;h2&gt;
&lt;p&gt;The easy part: everything exists now.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Language docs&lt;&#x2F;li&gt;
&lt;li&gt;Free courses&lt;&#x2F;li&gt;
&lt;li&gt;Open source examples&lt;&#x2F;li&gt;
&lt;li&gt;The Stack Overflow archive&lt;&#x2F;li&gt;
&lt;li&gt;Step-by-step YouTube&lt;&#x2F;li&gt;
&lt;li&gt;And yes: &lt;strong&gt;AI&lt;&#x2F;strong&gt; :D&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;In our day (my day) there was no learning curve this smooth and no guide “shoved into your hands” like this. When something broke you spent three days pleading on a forum. Now you paste in “what is this error” and an answer comes back. You can write and sketch whatever you want. Sandboxes, cloud free tiers, GitHub, package managers: the environment is &lt;strong&gt;annoyingly&lt;&#x2F;strong&gt; comfortable.&lt;&#x2F;p&gt;
&lt;p&gt;The hard part: comfort is not a substitute for discipline.&lt;&#x2F;p&gt;
&lt;p&gt;AI won’t stop you. What usually stops you is this trio:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Not starting&lt;&#x2F;strong&gt; (the research phase stretches into infinity)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Not finishing&lt;&#x2F;strong&gt; (tutorial hell)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Not showing&lt;&#x2F;strong&gt; (the code stays “safe” on your hard drive)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;So in 2026 the “there are no resources” excuse is dead. The excuses left are more personal. And more irritating.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;there-s-ai-no-need-to-learn-to-code-2026-s-cutest-lie&quot;&gt;“There’s AI, no need to learn to code”: 2026’s cutest lie&lt;&#x2F;h2&gt;
&lt;p&gt;AI generates code. Yes.&lt;br &#x2F;&gt;
AI sometimes generates nice code. Yes.&lt;br &#x2F;&gt;
AI sometimes generates code that &lt;em&gt;looks like it works but is wrong&lt;&#x2F;em&gt;. &lt;strong&gt;Even more yes.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Learning to program isn’t pouring characters out of a keyboard. It’s learning to:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Break a problem down&lt;&#x2F;li&gt;
&lt;li&gt;Say clearly what you want (to AI and to humans)&lt;&#x2F;li&gt;
&lt;li&gt;Verify the output&lt;&#x2F;li&gt;
&lt;li&gt;Understand why it broke when it breaks&lt;&#x2F;li&gt;
&lt;li&gt;See the limits of the system&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Someone who uses AI but doesn’t know what the computer is doing is like a driver who turned on autopilot and let go of the wheel. Great while the road is straight. On the curve, they won’t even notice.&lt;&#x2F;p&gt;
&lt;p&gt;In 2026 AI is a &lt;em&gt;tool&lt;&#x2F;em&gt;. A hammer. Some people build houses with a hammer, some smash their fingers. The difference: &lt;strong&gt;who’s holding the hammer, and who’s being held by it.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Whoever wants to learn will learn, one way or another. AI doesn’t stop that; sometimes it speeds it up. But effort and time are still on the table. As long as you put them in, you’ll get the fruit.&lt;&#x2F;p&gt;
&lt;p&gt;Or you might not. It’s a mystery.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tutorial-hell-the-free-plan-of-modern-hell&quot;&gt;Tutorial hell: the free plan of modern hell&lt;&#x2F;h2&gt;
&lt;p&gt;The classic 2026 route:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;“HTML CSS in 10 hours”&lt;&#x2F;li&gt;
&lt;li&gt;“JavaScript masterclass”&lt;&#x2F;li&gt;
&lt;li&gt;“React 2026 complete”&lt;&#x2F;li&gt;
&lt;li&gt;“Next.js + tRPC + Prisma + Docker + K8s + AI agent”&lt;&#x2F;li&gt;
&lt;li&gt;Still no project of your own&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Watching tutorials &lt;em&gt;feels good&lt;&#x2F;em&gt;. Dopamine hits. You think “I’m making progress”. But watching is like watching swimming videos: you don’t know how to swim until you get in the water.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Learn project-first.&lt;&#x2F;strong&gt; Something small, ugly, and yours:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Personal site&lt;&#x2F;li&gt;
&lt;li&gt;CLI tool&lt;&#x2F;li&gt;
&lt;li&gt;Notes app&lt;&#x2F;li&gt;
&lt;li&gt;Bot&lt;&#x2F;li&gt;
&lt;li&gt;Game clone&lt;&#x2F;li&gt;
&lt;li&gt;A “something I actually need” script&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;It doesn’t have to be perfect. It has to be finished. Then add something. Then break it. Then fix it. That loop is learning.&lt;&#x2F;p&gt;
&lt;p&gt;Courses are scaffolding. The building that stays is the silly project you wrote.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;github-get-past-the-shame-threshold&quot;&gt;GitHub: get past the shame threshold&lt;&#x2F;h2&gt;
&lt;p&gt;“My code is bad, I can’t put it up.”&lt;&#x2F;p&gt;
&lt;p&gt;Everyone’s code starts out bad. The difference is that some people &lt;strong&gt;leave their bad code public&lt;&#x2F;strong&gt; and make it better over time.&lt;&#x2F;p&gt;
&lt;p&gt;In 2026, GitHub is:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Not a CV (only)&lt;&#x2F;li&gt;
&lt;li&gt;Not a diary (only)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Proof of habit&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Commit. Write a README. Open issues for yourself. Read small PRs. Even a “typo fix” on someone else’s project beats shame, because you’ve touched the system.&lt;&#x2F;p&gt;
&lt;p&gt;If a public repo scares you, keep it private at first, but &lt;em&gt;finish it&lt;&#x2F;em&gt;. Open it up once you’ve got the nerve. What matters: your work doesn’t live only in your head, it lives on disk and ideally somewhere remote.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;looking-for-a-mentor-and-other-social-traps&quot;&gt;“Looking for a mentor” and other social traps&lt;&#x2F;h2&gt;
&lt;p&gt;Community is good. Discord, forums, Reddit, X: sometimes one answer saves your life.&lt;&#x2F;p&gt;
&lt;p&gt;But in 2026 there’s also this type:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;0 projects&lt;&#x2F;li&gt;
&lt;li&gt;0 commits&lt;&#x2F;li&gt;
&lt;li&gt;“Any mentors?” in 40 servers&lt;&#x2F;li&gt;
&lt;li&gt;“Drop a roadmap”&lt;&#x2F;li&gt;
&lt;li&gt;“Which is better, Python or Java?” (for the 40th time)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;A mentor isn’t a wizard. They can’t sit down and learn in your place. The best mentoring usually looks like this: &lt;strong&gt;a specific question&lt;&#x2F;strong&gt; + “I tried this, got this error, read this”.&lt;&#x2F;p&gt;
&lt;p&gt;The answer to the generic “how do I start?” question is still the same in 2026:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Pick something. Build it. Ask when you get stuck.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;There’s no magic roadmap. If there is one, someone’s selling it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;career-hobby-money-three-different-games&quot;&gt;Career, hobby, money: three different games&lt;&#x2F;h2&gt;
&lt;p&gt;Mix them up and you’ll suffer.&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Game&lt;&#x2F;th&gt;&lt;th&gt;Scoreboard&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Hobby&lt;&#x2F;td&gt;&lt;td&gt;Fun, curiosity&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Learning&lt;&#x2F;td&gt;&lt;td&gt;Depth of understanding&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Career&lt;&#x2F;td&gt;&lt;td&gt;Job &#x2F; money &#x2F; reliability&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;The “FAANG + Lambo in 3 months” promise still sells in 2026 because &lt;em&gt;hope&lt;&#x2F;em&gt; sells. The reality is more boring:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Job listings are competitive&lt;&#x2F;li&gt;
&lt;li&gt;AI is both opening doors and squeezing some entry-level jobs&lt;&#x2F;li&gt;
&lt;li&gt;Portfolio + proof still works&lt;&#x2F;li&gt;
&lt;li&gt;Networking exists, but a network made of empty promises is trash&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Want money: product or a job.&lt;br &#x2F;&gt;
Want to learn: projects.&lt;br &#x2F;&gt;
Want to have fun: whatever you feel like.&lt;&#x2F;p&gt;
&lt;p&gt;Want all three “fast and guaranteed”: you’re buying a fantasy.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;a-short-note-from-me&quot;&gt;A short note from me&lt;&#x2F;h2&gt;
&lt;p&gt;If you want to do it, you will. Nobody can stop that, especially in 2026. Compared to our day, the learning curve and the tutorial guides are &lt;em&gt;absurdly&lt;&#x2F;em&gt; plentiful. There’s AI. There are resources. There’s access to a computer.&lt;&#x2F;p&gt;
&lt;p&gt;It’s that simple: whoever wants to learn will learn, one way or another. It takes effort and time. As long as you put them in, you’ll get the fruit.&lt;&#x2F;p&gt;
&lt;p&gt;Or you might not. It’s a mystery.&lt;&#x2F;p&gt;
&lt;p&gt;I put in 13 years; I’ve only actually been eating the fruit for the last 3–4. Most of those 13 years were “keep going even when there’s nothing to show yet”. Not a shiny highlight reel.&lt;&#x2F;p&gt;
&lt;p&gt;As Feyyaz Yiğit (a Turkish comedian) put it: &lt;strong&gt;even if you work on the truth, you might not make it.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;That sentence isn’t there for despair. It’s against fake guarantees. Working is mandatory; success is optional and sometimes unfair. Still, to me the “I wish” of people who didn’t work weighs more than the “it didn’t pan out” of people who did.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;2026-edition-the-actual-start-jokes-over-here-s-the-list&quot;&gt;2026 Edition: the actual start (jokes over, here’s the list)&lt;&#x2F;h2&gt;
&lt;p&gt;A no-hype plan for tomorrow:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Pick a language.&lt;&#x2F;strong&gt; After week 3, which one it is isn’t all that sacred. Pick it, don’t drop it.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Pick a project.&lt;&#x2F;strong&gt; Small. An embarrassing v1 in 2 weeks.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Touch it every day (or most days).&lt;&#x2F;strong&gt; Even 20 minutes.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Make AI your assistant, not a teacher to copy from.&lt;&#x2F;strong&gt; Try first, ask when stuck, &lt;em&gt;understand&lt;&#x2F;em&gt; the answer.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Put it in Git.&lt;&#x2F;strong&gt; Even if it’s private.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Write things down somewhere.&lt;&#x2F;strong&gt; Bugs &#x2F; what you learned &#x2F; “what’s next tomorrow”.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Postpone job listings &#x2F; money &#x2F; image for 90 days.&lt;&#x2F;strong&gt; Build the muscle first.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;So the 2026 answer to “how do I start” isn’t that romantic: &lt;strong&gt;start, keep going, verify.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;wrapping-up&quot;&gt;Wrapping up&lt;&#x2F;h2&gt;
&lt;p&gt;“How to Start Programming 2026 Edition” is really a mask for this question:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;In a world where it’s gotten this easy, if I’m still not starting, is the problem the resources, or is it me?&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;In 2026 the resources aren’t the ones to blame. There’s AI. There are guides. There are tools.&lt;&#x2F;p&gt;
&lt;p&gt;What’s left: time, effort, the shame threshold, and that strange mystery where even working on the truth doesn’t guarantee anything.&lt;&#x2F;p&gt;
&lt;p&gt;Still, whoever wants to do it does it. What stops you is mostly not the outside world, it’s procrastination and the endless “I’m getting ready” mode.&lt;&#x2F;p&gt;
&lt;p&gt;Now close this post. Open your editor. Create a file. Write one line.&lt;&#x2F;p&gt;
&lt;p&gt;That’s how the 2026 Edition starts. The rest is commit history.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Agent-First Architecture: MCP Is the Future of APIs</title>
        <published>2026-07-06T00:00:00+00:00</published>
        <updated>2026-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/agent-first-architecture-mcp/"/>
        <id>https://tuntii.com/en/blog/agent-first-architecture-mcp/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/agent-first-architecture-mcp/">&lt;p&gt;In 2025 everyone was saying &quot;AI will call APIs.&quot; In 2026 it actually happened, just not the way anyone expected.&lt;&#x2F;p&gt;
&lt;p&gt;AI agents started calling APIs. But REST APIs weren&#x27;t designed for them. Swagger docs were for humans. JSON Schema was meant to be read by human eyes. Error codes were built around &quot;developer experience.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Then Anthropic announced MCP. And everything changed.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;rest-s-blind-spot&quot;&gt;REST&#x27;s blind spot&lt;&#x2F;h2&gt;
&lt;p&gt;REST was born in 2000 with Roy Fielding&#x27;s doctoral dissertation. It has been the backbone of the web for 25 years. For human developers it&#x27;s great: predictable URLs, HTTP verbs, stateless communication.&lt;&#x2F;p&gt;
&lt;p&gt;But to an AI agent, REST looks like this:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;Agent: &amp;quot;Get the user&amp;#39;s latest order.&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;API: 401 Unauthorized
&lt;&#x2F;span&gt;&lt;span&gt;Agent: &amp;quot;So I need a token? Where do I get one?&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;API: [silence]
&lt;&#x2F;span&gt;&lt;span&gt;Agent: &amp;quot;Let me try GET &#x2F;orders?filter=latest...&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;API: 400 Bad Request, &amp;quot;use &amp;#39;sort&amp;#39; not &amp;#39;filter&amp;#39;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;Agent: &amp;quot;...&amp;quot;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;AI agents don&#x27;t get REST&#x27;s implicit contracts. They need things explicit. A contract where everything is written down, discoverable and machine-readable.&lt;&#x2F;p&gt;
&lt;p&gt;That is exactly what MCP is.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-is-mcp&quot;&gt;What is MCP?&lt;&#x2F;h2&gt;
&lt;p&gt;Model Context Protocol (MCP) is a standard protocol, announced by Anthropic in November 2024, that lets AI agents discover tools and data sources. It runs on top of JSON-RPC 2.0.&lt;&#x2F;p&gt;
&lt;p&gt;Put simply: you tell your AI agent &quot;here are the tools you can use.&quot; The agent discovers the tools&#x27; names, parameters and descriptions over JSON-RPC. Then it calls whichever one it needs.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;json&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-json &quot;&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; The agent asks:
&lt;&#x2F;span&gt;&lt;span&gt;{&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;method&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;tools&#x2F;list&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; The server answers:
&lt;&#x2F;span&gt;&lt;span&gt;{&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;tools&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: [{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;get_weather&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;description&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Gets the weather for the given city&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;inputSchema&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: {
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;object&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;properties&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: {
&lt;&#x2F;span&gt;&lt;span&gt;      &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;city&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: {&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;string&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;description&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;City name&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;}
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;  }
&lt;&#x2F;span&gt;&lt;span&gt;}]}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; The agent calls:
&lt;&#x2F;span&gt;&lt;span&gt;{&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;method&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;tools&#x2F;call&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;params&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: {&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;get_weather&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;arguments&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: {&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;city&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;İstanbul&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;}}}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That simple. But that simplicity marks a paradigm shift in API design.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;5-principles-of-agent-first-api-design&quot;&gt;5 principles of agent-first API design&lt;&#x2F;h2&gt;
&lt;p&gt;These are the principles I picked up while building RustAPI, while making it the first web framework with native MCP support:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-every-endpoint-should-describe-itself&quot;&gt;1. Every endpoint should describe itself&lt;&#x2F;h3&gt;
&lt;p&gt;For a human developer, &lt;code&gt;GET &#x2F;api&#x2F;v2&#x2F;orders?sort=desc&amp;amp;limit=10&lt;&#x2F;code&gt; might be enough. For an AI agent, it isn&#x27;t.&lt;&#x2F;p&gt;
&lt;p&gt;In an agent-first API, every endpoint needs a &lt;strong&gt;description&lt;&#x2F;strong&gt;, every parameter needs an &lt;strong&gt;explanation&lt;&#x2F;strong&gt;, and every response needs a &lt;strong&gt;schema&lt;&#x2F;strong&gt;. Swagger&#x2F;OpenAPI already did this, but MCP makes it discoverable at runtime, by the agent itself.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-the-input-output-contract-must-be-explicit&quot;&gt;2. The input&#x2F;output contract must be explicit&lt;&#x2F;h3&gt;
&lt;p&gt;AI agents don&#x27;t understand implicit knowledge like &quot;in this case it returns this HTTP status.&quot; You have to spell out every possibility:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;## What does this endpoint return?
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;- 200: Success (WeatherResponse JSON)
&lt;&#x2F;span&gt;&lt;span&gt;- 404: City not found (ErrorResponse JSON)  
&lt;&#x2F;span&gt;&lt;span&gt;- 429: Rate limit exceeded, please wait 60 seconds
&lt;&#x2F;span&gt;&lt;span&gt;- 500: Server error, retry
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;When you write this into the MCP tool description, the agent can handle the error cases. Where were you putting this information in REST? Maybe in Swagger, maybe in the docs, maybe nowhere.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-tools-should-be-composable&quot;&gt;3. Tools should be composable&lt;&#x2F;h3&gt;
&lt;p&gt;An AI agent rarely calls a single endpoint. Usually it chains several:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Find the user (&lt;code&gt;search_users&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;Get their orders (&lt;code&gt;get_orders&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;Pick the latest one (&lt;code&gt;-&lt;&#x2F;code&gt; the agent does this itself)&lt;&#x2F;li&gt;
&lt;li&gt;Track the shipment (&lt;code&gt;track_shipment&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;In an agent-first API, tools should be designed so one tool&#x27;s output can be another&#x27;s input. The &lt;code&gt;user_id&lt;&#x2F;code&gt; that &lt;code&gt;search_users&lt;&#x2F;code&gt; returns should have the same name and the same format as the &lt;code&gt;user_id&lt;&#x2F;code&gt; that &lt;code&gt;get_orders&lt;&#x2F;code&gt; expects.&lt;&#x2F;p&gt;
&lt;p&gt;I call this &lt;strong&gt;tool compatibility&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-the-permission-model-should-be-granular&quot;&gt;4. The permission model should be granular&lt;&#x2F;h3&gt;
&lt;p&gt;You can tell a human developer &quot;you can do anything with this API key.&quot; You can&#x27;t say that to an AI agent.&lt;&#x2F;p&gt;
&lt;p&gt;In an agent-first API, the permission model should look like this:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Agent X can do &lt;code&gt;read:orders&lt;&#x2F;code&gt; but not &lt;code&gt;write:orders&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Agent Y can do &lt;code&gt;read:orders&lt;&#x2F;code&gt; + &lt;code&gt;read:users&lt;&#x2F;code&gt; but not &lt;code&gt;delete:*&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Agent Z (admin agent) can do everything, but asks a human for approval on operations where &lt;code&gt;amount &amp;gt; 10000TL&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;In RustAPI I do this with &lt;strong&gt;MCP Permission Scoping&lt;&#x2F;strong&gt; (v0.1.508). You can assign a scope to each MCP tool and define a scope set for each agent.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-output-should-be-agent-readable&quot;&gt;5. Output should be agent-readable&lt;&#x2F;h3&gt;
&lt;p&gt;This one is critical. The response you write for a human:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;json&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-json &quot;&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span&gt;{&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;message&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Your order was created successfully, thank you!&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The response you write for an AI agent:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;json&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-json &quot;&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;order_id&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;ord_2026_0706_001&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;status&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;confirmed&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;estimated_delivery&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;2026-07-08T14:00:00+03:00&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;total_amount&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: {&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;value&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;149.90&lt;&#x2F;span&gt;&lt;span&gt;, &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;currency&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;TRY&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;},
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;tracking_url&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;https:&#x2F;&#x2F;kargo.example.com&#x2F;track&#x2F;TRK123456&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;A human reads &quot;thank you&quot; and feels good. An AI agent looks at &lt;code&gt;order_id&lt;&#x2F;code&gt; and moves on to the next step. Two different worlds.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;mcp-vs-rest-vs-grpc-vs-graphql&quot;&gt;MCP vs REST vs gRPC vs GraphQL&lt;&#x2F;h2&gt;
&lt;p&gt;Which one, and when?&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Protocol&lt;&#x2F;th&gt;&lt;th&gt;Where it shines&lt;&#x2F;th&gt;&lt;th&gt;Good fit for AI agents?&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;REST&lt;&#x2F;td&gt;&lt;td&gt;APIs for human developers&lt;&#x2F;td&gt;&lt;td&gt;No, implicit contracts&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;GraphQL&lt;&#x2F;td&gt;&lt;td&gt;Flexible data querying (for humans)&lt;&#x2F;td&gt;&lt;td&gt;Partly, there&#x27;s a schema but no tool semantics&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;gRPC&lt;&#x2F;td&gt;&lt;td&gt;Communication between microservices&lt;&#x2F;td&gt;&lt;td&gt;Partly, protobuf is explicit but there&#x27;s no discovery&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;MCP&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Exposing tools to AI agents&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Yes, it was designed for this&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;The stack of the future: REST&#x2F;GraphQL for humans, gRPC for services, MCP for AI agents. All three on the same backend, as different &quot;views&quot; of the same endpoints.&lt;&#x2F;p&gt;
&lt;p&gt;That&#x27;s exactly what I&#x27;m doing in RustAPI. You write one endpoint and it&#x27;s automatically exposed as both a REST (HTTP) and an MCP (JSON-RPC) endpoint. Same code, two protocols.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-will-we-see-in-2026-2027&quot;&gt;What will we see in 2026-2027?&lt;&#x2F;h2&gt;
&lt;p&gt;My predictions:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Every SaaS will have an MCP endpoint.&lt;&#x2F;strong&gt; Just like every SaaS had a REST API in 2015.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Agent-first, human-second.&lt;&#x2F;strong&gt; New APIs will be designed for AI agents first, human developers second.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;MCP gateways will become common.&lt;&#x2F;strong&gt; Gateways that gather all of a company&#x27;s APIs behind a single MCP endpoint.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Agent-to-agent protocols.&lt;&#x2F;strong&gt; Not just agent-to-API: agent-to-agent communication protocols will get standardized too.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Permission models will be the biggest problem.&lt;&#x2F;strong&gt; Who controls what an AI agent can access, and how?&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;That last one is especially critical. It&#x27;s something the security community hasn&#x27;t talked about nearly enough yet. But it&#x27;s going to blow up soon.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-should-you-do-now&quot;&gt;What should you do now?&lt;&#x2F;h2&gt;
&lt;p&gt;If you&#x27;re building an API, start today:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Add an MCP endpoint to your existing API. Start with 3-5 tools.&lt;&#x2F;li&gt;
&lt;li&gt;Write an explicit description and input&#x2F;output schema for every endpoint. Not just types, actual descriptive text.&lt;&#x2F;li&gt;
&lt;li&gt;Test it with an AI agent. Hook your MCP server up to Claude Desktop and say &quot;get the user&#x27;s latest order.&quot; What happens? Where does it get stuck?&lt;&#x2F;li&gt;
&lt;li&gt;Think through the permission model. Decide what agents can access and what they can change.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The future is agent-first. The people getting ready now will be a step ahead in 2027.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;This post is based on what I learned from RustAPI&#x27;s MCP architecture. In the next post I&#x27;ll explain how Hyperembed and its embedding inference engine work.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>BareEngine: Writing a Game Engine from Scratch in C++</title>
        <published>2026-07-06T00:00:00+00:00</published>
        <updated>2026-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/bareengine-game-engine/"/>
        <id>https://tuntii.com/en/blog/bareengine-game-engine/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/bareengine-game-engine/">&lt;p&gt;It all started 10 years ago. Metin2 private servers, Knight Online emulators, game server communities... An 11-year-old kid was trying to figure out how a game works. He was sniffing packets, writing server emulators, learning C++.&lt;&#x2F;p&gt;
&lt;p&gt;That kid was me.&lt;&#x2F;p&gt;
&lt;p&gt;And now, at 21, I&#x27;m making that kid&#x27;s dream real: BareEngine, my own game engine.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-your-own-game-engine&quot;&gt;Why your own game engine?&lt;&#x2F;h2&gt;
&lt;p&gt;There are ready-made engines: Unity, Unreal, Godot. Why write yet another one from scratch?&lt;&#x2F;p&gt;
&lt;p&gt;Because they don&#x27;t do what I want.&lt;&#x2F;p&gt;
&lt;p&gt;Here&#x27;s what I want: open an editor, drop in a few models, write a few scripts, and &lt;strong&gt;have the game server get generated automatically too.&lt;&#x2F;strong&gt; The editor and the server should be parts of the same toolchain. To do that in Unity you need third-party libraries like Mirror, FishNet or Netcode for GameObjects. I want it native.&lt;&#x2F;p&gt;
&lt;p&gt;Also, games like Metin2 and Knight Online have a &quot;feel&quot; of their own. Camera angle, character control, combat system, UI: all of it has a specific style. That style is hard to capture in modern engines, because they&#x27;re optimized for FPS games or open-world RPGs.&lt;&#x2F;p&gt;
&lt;p&gt;I want an engine optimized for Metin2-style MMORPGs. So I&#x27;m writing it myself.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;architecture&quot;&gt;Architecture&lt;&#x2F;h2&gt;
&lt;p&gt;BareEngine is made of three main components:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;┌──────────────────────────────────────────┐
&lt;&#x2F;span&gt;&lt;span&gt;│              BareEditor (GUI)             │
&lt;&#x2F;span&gt;&lt;span&gt;│  ┌─────────┐ ┌──────────┐ ┌──────────┐   │
&lt;&#x2F;span&gt;&lt;span&gt;│  │ World   │ │ Asset    │ │ Script   │   │
&lt;&#x2F;span&gt;&lt;span&gt;│  │ Editor  │ │ Browser  │ │ Editor   │   │
&lt;&#x2F;span&gt;&lt;span&gt;│  └─────────┘ └──────────┘ └──────────┘   │
&lt;&#x2F;span&gt;&lt;span&gt;├──────────────────────────────────────────┤
&lt;&#x2F;span&gt;&lt;span&gt;│             BareEngine (Core)            │
&lt;&#x2F;span&gt;&lt;span&gt;│  ┌─────────┐ ┌──────────┐ ┌──────────┐   │
&lt;&#x2F;span&gt;&lt;span&gt;│  │Renderer │ │ Physics  │ │ Audio    │   │
&lt;&#x2F;span&gt;&lt;span&gt;│  │(OpenGL) │ │(Bullet)  │ │(OpenAL)  │   │
&lt;&#x2F;span&gt;&lt;span&gt;│  └─────────┘ └──────────┘ └──────────┘   │
&lt;&#x2F;span&gt;&lt;span&gt;├──────────────────────────────────────────┤
&lt;&#x2F;span&gt;&lt;span&gt;│            BareServer (Server)            │
&lt;&#x2F;span&gt;&lt;span&gt;│  ┌─────────┐ ┌──────────┐ ┌──────────┐   │
&lt;&#x2F;span&gt;&lt;span&gt;│  │Network  │ │ Game     │ │ DB       │   │
&lt;&#x2F;span&gt;&lt;span&gt;│  │(ENet)   │ │ Logic    │ │(SQLite)  │   │
&lt;&#x2F;span&gt;&lt;span&gt;│  └─────────┘ └──────────┘ └──────────┘   │
&lt;&#x2F;span&gt;&lt;span&gt;└──────────────────────────────────────────┘
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;BareEditor:&lt;&#x2F;strong&gt; An ImGui-based desktop editor. World editor (terrain, object placement), asset browser (models, textures, sounds), script editor (Lua integration). The editor itself is editor-first, meaning the editor is the product and the game output is a by-product.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;BareEngine (Core):&lt;&#x2F;strong&gt; Renderer (OpenGL), physics engine (Bullet Physics), audio (OpenAL). All in C++, all native.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;BareServer:&lt;&#x2F;strong&gt; The server players connect to. ENet (reliable UDP), game logic (C++), database (SQLite). The server reads the world file exported from the editor.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-editor-first-philosophy&quot;&gt;The editor-first philosophy&lt;&#x2F;h2&gt;
&lt;p&gt;Most game engines are &quot;engine-first.&quot; You write the engine first, then bolt on the editor. I&#x27;m doing the opposite.&lt;&#x2F;p&gt;
&lt;p&gt;In BareEngine the editor isn&#x27;t an interface to the engine, &lt;strong&gt;the editor is the product itself.&lt;&#x2F;strong&gt; A game maker opens the editor, builds their world, hits &quot;Build,&quot; and out comes a game. Just like RPG Maker. But unlike RPG Maker:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Multiplayer is native (for MMORPGs)&lt;&#x2F;li&gt;
&lt;li&gt;Performance-focused (C++, OpenGL)&lt;&#x2F;li&gt;
&lt;li&gt;Scriptable (Lua)&lt;&#x2F;li&gt;
&lt;li&gt;Open source&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Target audience: the private server communities of games like Metin2, Knight Online and Silkroad. For years these communities have been wrestling with emulators and reverse-engineered server files. I want to give them a tool that says &quot;make your own game.&quot;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;technical-decisions&quot;&gt;Technical decisions&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;why-imgui&quot;&gt;Why ImGui?&lt;&#x2F;h3&gt;
&lt;p&gt;For the editor I&#x27;m using ImGui (Dear ImGui). Not Qt, not wxWidgets, ImGui.&lt;&#x2F;p&gt;
&lt;p&gt;The reason: ImGui is immediate mode. You redraw the GUI from scratch every frame. That&#x27;s great for game engine editors because:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Render state and GUI state live in the same place&lt;&#x2F;li&gt;
&lt;li&gt;Debugging is easy (everything is computed right then)&lt;&#x2F;li&gt;
&lt;li&gt;It&#x27;s fast (no unnecessary state)&lt;&#x2F;li&gt;
&lt;li&gt;It&#x27;s portable (runs on OpenGL, Vulkan and DirectX)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The downside: it doesn&#x27;t look &quot;pretty.&quot; The default ImGui theme is... let&#x27;s call it functional. But I don&#x27;t care. An editor doesn&#x27;t have to look pretty, it has to work.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-bullet-physics&quot;&gt;Why Bullet Physics?&lt;&#x2F;h3&gt;
&lt;p&gt;Not PhysX, not Havok, Bullet. The reason: it&#x27;s open source and it&#x27;s enough for MMORPGs. MMORPG physics isn&#x27;t FPS physics. No ragdolls, no destructible environments. Just collision detection, simple rigid bodies, character control. Bullet does all of that and then some.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-enet&quot;&gt;Why ENet?&lt;&#x2F;h3&gt;
&lt;p&gt;MMORPG servers need a UDP-based protocol, not TCP. Movement input, combat events: all of it needs low latency. TCP&#x27;s head-of-line blocking is deadly here.&lt;&#x2F;p&gt;
&lt;p&gt;ENet is a lightweight library built on reliable UDP. Ordered packet delivery, fragmentation, throttling: it&#x27;s all there. And most importantly: it&#x27;s simple. Just one &lt;code&gt;.c&lt;&#x2F;code&gt; file. No dependencies.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-lua&quot;&gt;Why Lua?&lt;&#x2F;h3&gt;
&lt;p&gt;Writing game logic in C++... possible, but not practical. Recompile on every change. Write it in Lua and you get:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Hot-reload (update scripts without shutting down the server)&lt;&#x2F;li&gt;
&lt;li&gt;Accessible to modders&lt;&#x2F;li&gt;
&lt;li&gt;Safer than C++ (even if a script crashes, the server doesn&#x27;t go down)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For Lua bindings I&#x27;m using Sol3. It builds the bridge between C++ and Lua in a few lines.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;challenges&quot;&gt;Challenges&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;1. Editor-state synchronization.&lt;&#x2F;strong&gt; When you drag an object in the editor, that change has to reach the renderer, the physics engine and the network layer. When you undo&#x2F;redo, all of it has to roll back. The command pattern solves this, but the implementation gets detailed.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;2. Multiplayer synchronization.&lt;&#x2F;strong&gt; When a player moves, that movement has to reach the other players. But if you send every movement, your bandwidth explodes. You need client-side prediction + server reconciliation. That&#x27;s a solved problem for FPS games, but the scale is different in MMORPGs: hundreds of players, thousands of entities.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;3. Metin2 format compatibility.&lt;&#x2F;strong&gt; Metin2&#x27;s file formats (&lt;code&gt;.gr2&lt;&#x2F;code&gt; models, &lt;code&gt;.dds&lt;&#x2F;code&gt; textures, &lt;code&gt;.msm&lt;&#x2F;code&gt; animations) aren&#x27;t documented. They need reverse-engineering. This is the part that eats most of my time.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;4. Cross-platform.&lt;&#x2F;strong&gt; I develop on Windows but it&#x27;ll run on Linux servers. OpenGL, ENet, Bullet: all cross-platform. But the build system (CMake), dependency management (vcpkg) and CI&#x2F;CD all need platform-specific configuration.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;where-it-stands-now&quot;&gt;Where it stands now&lt;&#x2F;h2&gt;
&lt;p&gt;The project is at a very early stage. What works right now:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;OpenGL renderer (basic meshes, textures)&lt;&#x2F;li&gt;
&lt;li&gt;ImGui editor UI (world outliner, property editor)&lt;&#x2F;li&gt;
&lt;li&gt;ENet networking (connections, messaging)&lt;&#x2F;li&gt;
&lt;li&gt;Basic Lua scripting (&lt;code&gt;onPlayerJoin&lt;&#x2F;code&gt;, &lt;code&gt;onChatMessage&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;What doesn&#x27;t work yet (next milestone):&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Asset import pipeline (&lt;code&gt;.fbx&lt;&#x2F;code&gt;, &lt;code&gt;.gltf&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;Physics (collision detection)&lt;&#x2F;li&gt;
&lt;li&gt;Animation system&lt;&#x2F;li&gt;
&lt;li&gt;Database persistence (saving characters)&lt;&#x2F;li&gt;
&lt;li&gt;Metin2 format parsers&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;why-does-this-project-matter&quot;&gt;Why does this project matter?&lt;&#x2F;h2&gt;
&lt;p&gt;BareEngine isn&#x27;t a commercial product. It&#x27;s a passion project. Like a letter to my 11-year-old self.&lt;&#x2F;p&gt;
&lt;p&gt;That kid was sniffing packets to understand how games work. Now I&#x27;m building something that can tell him &quot;here&#x27;s how it works.&quot; Open source. So everyone can see it and learn from it.&lt;&#x2F;p&gt;
&lt;p&gt;Also, game development is growing in Turkey. But most studios use Unity&#x2F;Unreal. Few people understand &quot;how an engine works&quot; at a low level. BareEngine is one way to spread that knowledge through open source.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;&#x2F;h2&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; clone https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;BareEngine
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span&gt; BareEngine
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Build (CMake + vcpkg):
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cmake -B&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span&gt; .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --toolchain&lt;&#x2F;span&gt;&lt;span&gt; ...
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cmake --build&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --config&lt;&#x2F;span&gt;&lt;span&gt; Release
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Run editor:
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;.&#x2F;build&#x2F;Release&#x2F;BareEditor.exe
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;It&#x27;s not at the &quot;you can make a game with it&quot; stage yet. But it&#x27;s on the way. Every commit brings me one step closer to my 11-year-old self.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;This isn&#x27;t the last post in the series. Next up: alexander-storage (self-hosted S3), IntentScript (LLM task runner) and more. Stay tuned.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Hyperembed: Writing an Embedding Inference Engine in Rust</title>
        <published>2026-07-06T00:00:00+00:00</published>
        <updated>2026-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/hyperembed-rust-embedding-inference/"/>
        <id>https://tuntii.com/en/blog/hyperembed-rust-embedding-inference/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/hyperembed-rust-embedding-inference/">&lt;p&gt;When I decided to write an embedding inference engine, people said &quot;why? sentence-transformers already exists.&quot; They were right. &lt;code&gt;sentence-transformers&lt;&#x2F;code&gt; runs in Python, supports more than 5000 models, and the PyTorch ecosystem is mature.&lt;&#x2F;p&gt;
&lt;p&gt;But my goal wasn&#x27;t just doing embeddings. My goal was doing embeddings &lt;strong&gt;everywhere&lt;&#x2F;strong&gt;. Not on a server, not on a phone, not on an embedded device. On all of them. With a single binary. Zero Python dependencies. Zero PyTorch dependencies. Zero ONNX runtime.&lt;&#x2F;p&gt;
&lt;p&gt;Pure Rust. Just Rust.&lt;&#x2F;p&gt;
&lt;p&gt;That&#x27;s how Hyperembed was born.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-problem-where-does-embedding-inference-happen&quot;&gt;The problem: where does embedding inference happen?&lt;&#x2F;h2&gt;
&lt;p&gt;Today embedding inference happens in these places:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Cloud API (OpenAI, Cohere, etc.):&lt;&#x2F;strong&gt; The easiest. But you get network latency, API costs and data privacy issues.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Server side (sentence-transformers + GPU):&lt;&#x2F;strong&gt; Better. But you need a GPU, a Python runtime, memory management.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Edge &#x2F; on-device:&lt;&#x2F;strong&gt; Nearly impossible. PyTorch Mobile is big, ONNX Runtime is heavy, model optimization is complicated.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Hyperembed targets that third category: embedding inference at the edge, on-device, on embedded systems. Thanks to Rust.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-does-it-work&quot;&gt;How does it work?&lt;&#x2F;h2&gt;
&lt;p&gt;An embedding inference engine has to do the following:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Tokenizer:&lt;&#x2F;strong&gt; Turn text into tokens (BERT tokenizer, WordPiece)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Model loading:&lt;&#x2F;strong&gt; Load the BERT model (weights, config)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Forward pass:&lt;&#x2F;strong&gt; Run the tokens through the model, get the hidden states&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Pooling:&lt;&#x2F;strong&gt; Produce a single embedding vector from the hidden states (mean pooling, CLS token, etc.)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Hyperembed implements all of this from scratch, in Rust.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;tokenizer-wordpiece&quot;&gt;Tokenizer (WordPiece)&lt;&#x2F;h3&gt;
&lt;p&gt;Implementing the BERT tokenizer was more fun than I expected. The WordPiece algorithm:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Split the text on whitespace&lt;&#x2F;li&gt;
&lt;li&gt;Split each word into the longest matching subtokens in the vocabulary&lt;&#x2F;li&gt;
&lt;li&gt;Convert the subtokens into IDs&lt;&#x2F;li&gt;
&lt;li&gt;Add the special tokens ([CLS], [SEP])&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;To do this in Rust I used a trie (prefix tree). With a 30,000-token vocabulary, subword tokenization runs on the order of microseconds. About 50x faster than Python, because Python does string slicing for every token.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;model-loading&quot;&gt;Model loading&lt;&#x2F;h3&gt;
&lt;p&gt;BERT models usually come in two formats:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;PyTorch (.bin):&lt;&#x2F;strong&gt; Raw (pickle + tensors)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;ONNX (.onnx):&lt;&#x2F;strong&gt; Portable but big&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Hyperembed reads the PyTorch format directly. To parse tensors saved with &lt;code&gt;torch.save()&lt;&#x2F;code&gt; in Rust, I implemented the pickle format. What Python&#x27;s &lt;code&gt;pickle&lt;&#x2F;code&gt; module does, I wrote from scratch in Rust.&lt;&#x2F;p&gt;
&lt;p&gt;How hard was it? Pretty hard. The pickle format was designed to serialize Python objects. It works like a stack-based VM. There are opcodes, there&#x27;s memoization, there&#x27;s reference resolution. Implementing it in Rust took about 2000 lines of code. But the result: I can load any PyTorch BERT model without PyTorch.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;forward-pass&quot;&gt;Forward pass&lt;&#x2F;h3&gt;
&lt;p&gt;The most critical part. The Transformer forward pass:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;Input → Embedding → [Attention → FFN] × 12 → Pooling → Output
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Every layer is matrix multiplication. A lot of matrix multiplication. For the 12-layer BERT-base:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Each attention head: Q, K, V projections (3 matrix multiplications)&lt;&#x2F;li&gt;
&lt;li&gt;Attention: Q @ K^T, softmax, then multiply by V&lt;&#x2F;li&gt;
&lt;li&gt;FFN: 2 big matrix multiplications (768→3072, 3072→768)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;About 110M parameters in total. Billions of floating-point operations per forward pass.&lt;&#x2F;p&gt;
&lt;p&gt;To make this fast:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;SIMD optimizations:&lt;&#x2F;strong&gt; Matrix multiplication with AVX2&#x2F;NEON instructions using Rust&#x27;s &lt;code&gt;std::simd&lt;&#x2F;code&gt; module&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Cache-friendly memory layout:&lt;&#x2F;strong&gt; Storing weights column-major instead of row-major to improve cache locality&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fused operations:&lt;&#x2F;strong&gt; Doing LayerNorm + the residual connection in a single pass&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Weight quantization:&lt;&#x2F;strong&gt; INT8 quantization instead of FP32 (optional, shrinks the model 4x)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The result: about 3-5x faster than sentence-transformers (in CPU mode). Not in GPU mode, of course. I can&#x27;t compete with CUDA kernels. But on the CPU, especially on a low-power ARM chip, Hyperembed pulls way ahead.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;pooling&quot;&gt;Pooling&lt;&#x2F;h3&gt;
&lt;p&gt;To produce an embedding vector from BERT&#x27;s final hidden states:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CLS token pooling:&lt;&#x2F;strong&gt; Take the hidden state of the [CLS] token&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Mean pooling:&lt;&#x2F;strong&gt; Take the average of all tokens&#x27; hidden states (excluding padding tokens)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Max pooling:&lt;&#x2F;strong&gt; Take the maximum values&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Hyperembed supports all of them. The default is mean pooling, the best choice for most use cases.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;benchmarks&quot;&gt;Benchmarks&lt;&#x2F;h2&gt;
&lt;p&gt;A few benchmark results (MacBook M2, CPU only, batch size=1):&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;&#x2F;th&gt;&lt;th&gt;Framework&lt;&#x2F;th&gt;&lt;th&gt;Latency (ms)&lt;&#x2F;th&gt;&lt;th&gt;Memory (MB)&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;BERT-base&lt;&#x2F;td&gt;&lt;td&gt;sentence-transformers (Python)&lt;&#x2F;td&gt;&lt;td&gt;45&lt;&#x2F;td&gt;&lt;td&gt;850&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;BERT-base&lt;&#x2F;td&gt;&lt;td&gt;ONNX Runtime (C++)&lt;&#x2F;td&gt;&lt;td&gt;28&lt;&#x2F;td&gt;&lt;td&gt;520&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;BERT-base&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Hyperembed (Rust)&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;11&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;180&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;BERT-tiny&lt;&#x2F;td&gt;&lt;td&gt;sentence-transformers (Python)&lt;&#x2F;td&gt;&lt;td&gt;12&lt;&#x2F;td&gt;&lt;td&gt;340&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;BERT-tiny&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Hyperembed (Rust)&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;2.3&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;65&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;ARM Cortex-A72 (Raspberry Pi 4):&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;&#x2F;th&gt;&lt;th&gt;sentence-transformers&lt;&#x2F;th&gt;&lt;th&gt;Hyperembed&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;BERT-tiny&lt;&#x2F;td&gt;&lt;td&gt;380ms&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;45ms&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;This is where the cost difference shows up on embedded devices. The Python runtime, the GIL, the garbage collector, dynamic type checks: all of it is very expensive on ARM. Rust&#x27;s zero-cost abstractions are what make the real difference on resource-constrained devices.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;semantic-search-pipeline&quot;&gt;Semantic search pipeline&lt;&#x2F;h2&gt;
&lt;p&gt;Hyperembed&#x27;s main use case: semantic search. Finding the documents in a collection that are semantically closest to the user&#x27;s query.&lt;&#x2F;p&gt;
&lt;p&gt;Pipeline:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Vectorize all documents with Hyperembed&lt;&#x2F;li&gt;
&lt;li&gt;Write the vectors to a vector database (Qdrant, Milvus, or a simple FAISS index)&lt;&#x2F;li&gt;
&lt;li&gt;Vectorize the user&#x27;s query&lt;&#x2F;li&gt;
&lt;li&gt;Find the k closest documents with cosine similarity&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Hyperembed&#x27;s Rust API:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;use &lt;&#x2F;span&gt;&lt;span&gt;hyperembed::{Embedder, EmbedderConfig};
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; config = EmbedderConfig::default()
&lt;&#x2F;span&gt;&lt;span&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;with_model&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;sentence-transformers&#x2F;all-MiniLM-L6-v2&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)?
&lt;&#x2F;span&gt;&lt;span&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;with_pooling&lt;&#x2F;span&gt;&lt;span&gt;(PoolingStrategy::Mean);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; embedder = Embedder::new(config)?;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; documents = vec![
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;The Rust programming language is designed for systems programming.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Python is popular in data science and machine learning.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;JavaScript is a language that runs in web browsers.&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;];
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; doc_embeddings = embedder.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;embed_batch&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;documents)?;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; query_embedding = embedder.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;embed&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;systems programming language&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)?;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; similarities: Vec&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;f32&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; = doc_embeddings.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;iter&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt;(|&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;d&lt;&#x2F;span&gt;&lt;span&gt;| &lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cosine_similarity&lt;&#x2F;span&gt;&lt;span&gt;(&amp;amp;query_embedding, d))
&lt;&#x2F;span&gt;&lt;span&gt;    .&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;collect&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; → [0.92, 0.45, 0.31] - Rust is the closest, as expected
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;the-future-of-local-first-ai&quot;&gt;The future of local-first AI&lt;&#x2F;h2&gt;
&lt;p&gt;Hyperembed is part of a bigger vision: &lt;strong&gt;local-first AI.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Today 99% of AI runs in the cloud. OpenAI API, Anthropic API, Google Cloud AI. That model brings these problems:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Latency:&lt;&#x2F;strong&gt; A network round-trip for every query&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Cost:&lt;&#x2F;strong&gt; Per-token pricing that multiplies as you scale&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Privacy:&lt;&#x2F;strong&gt; Your data sits on someone else&#x27;s server&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Dependency:&lt;&#x2F;strong&gt; When the API goes down, your app stops working&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Offline:&lt;&#x2F;strong&gt; No internet, no AI&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Local-first AI solves all of these. The model runs on your device. Embeddings are computed on your device. The vector database runs on your device (something like SQLite + sqlite-vec).&lt;&#x2F;p&gt;
&lt;p&gt;Hyperembed is the embedding layer of this vision. The other layers:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Inference:&lt;&#x2F;strong&gt; local LLM runtimes like llama.cpp and mistral.rs&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Vector storage:&lt;&#x2F;strong&gt; LanceDB, sqlite-vec&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Orchestration:&lt;&#x2F;strong&gt; your own agent framework&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;In 2026 you can run a 7B-parameter LLM on a MacBook. In 2027 you&#x27;ll be able to run one on a phone. Hyperembed handles the embedding side of that shift. And since it&#x27;s written in Rust, it can run in the same process as the LLM runtimes, with zero IPC overhead.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-did-i-learn&quot;&gt;What did I learn?&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;1. The pickle format is a dark art.&lt;&#x2F;strong&gt; I never would have guessed I&#x27;d have to implement a VM just to parse Python objects. But I did. And it works.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;2. SIMD in Rust is more accessible than you think.&lt;&#x2F;strong&gt; &lt;code&gt;std::simd&lt;&#x2F;code&gt; is stabilizing on nightly. Writing portable SIMD no longer needs &lt;code&gt;unsafe&lt;&#x2F;code&gt; and inline assembly.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;3. BERT inference is simpler than you think.&lt;&#x2F;strong&gt; The Transformer architecture looks complicated, but it&#x27;s really a few basic operations on repeat: matmul, softmax, layer norm, GELU. Once you implement those, the rest is a loop.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;4. Rust is underrated for ML inference.&lt;&#x2F;strong&gt; Everyone writes Python + CUDA, but for CPU inference Rust is much better. Memory management, SIMD, zero-cost abstractions: all of it cuts inference latency dramatically.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-next&quot;&gt;What&#x27;s next?&lt;&#x2F;h2&gt;
&lt;p&gt;v0.3 roadmap:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;More model architectures:&lt;&#x2F;strong&gt; RoBERTa, DistilBERT, MiniLM&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;GGUF format support:&lt;&#x2F;strong&gt; the quantization format llama.cpp uses&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;WASM target:&lt;&#x2F;strong&gt; embedding inference in the browser (!)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Python binding:&lt;&#x2F;strong&gt; usable from Python with &lt;code&gt;pip install hyperembed&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;ONNX export:&lt;&#x2F;strong&gt; export your own model as ONNX (the reverse: ONNX → Hyperembed)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;&#x2F;h2&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; clone https:&#x2F;&#x2F;github.com&#x2F;neuralforgeone&#x2F;hyperembed
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span&gt; hyperembed
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --release
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; run&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --example&lt;&#x2F;span&gt;&lt;span&gt; semantic_search
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;It&#x27;s not on crates.io yet. But soon you&#x27;ll be able to type &lt;code&gt;cargo add hyperembed&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;In the next post I&#x27;ll talk about BareEngine: an editor-first game engine for Metin2-style MMORPG worlds. A return, with C++, to where I started 10 years ago: game servers.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>KayaDB: Writing a Distributed Database from Scratch</title>
        <published>2026-07-06T00:00:00+00:00</published>
        <updated>2026-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/kayadb-writing-a-distributed-database/"/>
        <id>https://tuntii.com/en/blog/kayadb-writing-a-distributed-database/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/kayadb-writing-a-distributed-database/">&lt;p&gt;Distributed systems are the Everest of software engineering. Everyone sees the summit, very few climb it. I decided to climb. The result: KayaDB, a Raft-based distributed key-value storage engine written in Rust and being prepared for production.&lt;&#x2F;p&gt;
&lt;p&gt;This post is the log of that climb.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-did-i-write-my-own-database&quot;&gt;Why did I write my own database?&lt;&#x2F;h2&gt;
&lt;p&gt;Honest answer: porque puedo. (Because I can.)&lt;&#x2F;p&gt;
&lt;p&gt;Serious answer: etcd exists, TiKV exists, FoundationDB exists. But none of them were what I wanted. What I wanted:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero operational overhead.&lt;&#x2F;strong&gt; Download a binary, run it. No config file, no YAML hell.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Embeddable.&lt;&#x2F;strong&gt; It should work as a library. You should be able to write &lt;code&gt;kayadb = &quot;0.1&quot;&lt;&#x2F;code&gt; and embed it in your own application.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Jepsen-tested.&lt;&#x2F;strong&gt; No claim from a distributed system can be taken seriously unless it has passed Kyle Kingsbury&#x27;s tests.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Rust.&lt;&#x2F;strong&gt; C++ performance without dealing with manual memory management.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Nothing gave me all of these at once. So I built it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;architecture&quot;&gt;Architecture&lt;&#x2F;h2&gt;
&lt;p&gt;At the heart of KayaDB sits the Raft consensus algorithm. Raft is the most understandable consensus protocol for leader election, log replication and safety guarantees in distributed systems (the &quot;understandable by humans&quot; version of Paxos).&lt;&#x2F;p&gt;
&lt;p&gt;Three core layers:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;┌─────────────────────────────────┐
&lt;&#x2F;span&gt;&lt;span&gt;│         Client API (gRPC)       │
&lt;&#x2F;span&gt;&lt;span&gt;├─────────────────────────────────┤
&lt;&#x2F;span&gt;&lt;span&gt;│      Raft Consensus Layer       │
&lt;&#x2F;span&gt;&lt;span&gt;│  ┌─────────┐  ┌──────────────┐  │
&lt;&#x2F;span&gt;&lt;span&gt;│  │ Leader  │  │  Follower x2  │  │
&lt;&#x2F;span&gt;&lt;span&gt;│  │ Election│  │  Log Repl.   │  │
&lt;&#x2F;span&gt;&lt;span&gt;│  └─────────┘  └──────────────┘  │
&lt;&#x2F;span&gt;&lt;span&gt;├─────────────────────────────────┤
&lt;&#x2F;span&gt;&lt;span&gt;│     Storage Engine (LSM-Tree)   │
&lt;&#x2F;span&gt;&lt;span&gt;│  ┌─────────┐  ┌──────────────┐  │
&lt;&#x2F;span&gt;&lt;span&gt;│  │ MemTable│  │  SSTables    │  │
&lt;&#x2F;span&gt;&lt;span&gt;│  └─────────┘  └──────────────┘  │
&lt;&#x2F;span&gt;&lt;span&gt;└─────────────────────────────────┘
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Storage engine:&lt;&#x2F;strong&gt; LSM-tree (Log-Structured Merge-tree). Optimized for write-heavy workloads. Accumulate in the MemTable, flush to disk as an SSTable once it hits a certain size, run compaction in the background. A simpler, easier to follow version of what RocksDB does.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Raft layer:&lt;&#x2F;strong&gt; Elects a leader, replicates logs, advances the commit index. Standard Raft: no surprises, follows the spec to the letter.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Client API:&lt;&#x2F;strong&gt; gRPC for now. A native TCP protocol is coming later.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;from-m1-to-m13-13-milestones-6-months&quot;&gt;From M1 to M13: 13 milestones, 6 months&lt;&#x2F;h2&gt;
&lt;p&gt;I run the project in milestones. Each milestone takes a few weeks and produces something concrete.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;M1-M3 (January 2026):&lt;&#x2F;strong&gt; The basic storage engine. Single-node, memory-only. &lt;code&gt;put(key, value)&lt;&#x2F;code&gt; and &lt;code&gt;get(key)&lt;&#x2F;code&gt; work. Not exciting, but it&#x27;s the foundation.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;M4-M6 (February):&lt;&#x2F;strong&gt; Persistence. WAL (Write-Ahead Log), MemTable flush, the SSTable format. For the first time we stopped losing data on restart. I can&#x27;t describe that feeling: code you wrote brings back the data of a program you shut down.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;M7-M9 (March):&lt;&#x2F;strong&gt; The Raft implementation. The hardest part. I read the Raft paper roughly 17 times. Leader election, log replication, snapshotting: each one is a world of its own. The biggest headache: &lt;strong&gt;network partition simulation.&lt;&#x2F;strong&gt; Writing the tests was harder than the implementation.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;M10-M12 (April-May):&lt;&#x2F;strong&gt; Jepsen tests. Kyle Kingsbury&#x27;s famous distributed systems testing framework. Linearizability, partition tolerance, clock skew. It tests all of it. And on the first run... red. Everything was red.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;M13 (June 2026):&lt;&#x2F;strong&gt; Production prep. And then that moment: 6&#x2F;6 Jepsen gates &lt;strong&gt;green&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Getting green from Jepsen is like being knighted in the distributed systems world. It means &quot;your system keeps data consistent even when the network splits, the disk dies and the clock drifts.&quot;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;dancing-with-jepsen&quot;&gt;Dancing with Jepsen&lt;&#x2F;h2&gt;
&lt;p&gt;Writing Jepsen tests is nothing like writing normal tests. In a normal test you say &quot;this input gives this output.&quot; In Jepsen you ask &quot;in this chaotic scenario, is the system&#x27;s behavior linearizable?&quot; The difference is like testing a building with an earthquake simulation.&lt;&#x2F;p&gt;
&lt;p&gt;A Jepsen test does the following:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Starts a cluster (usually 5 nodes)&lt;&#x2F;li&gt;
&lt;li&gt;Sends random operations (append, read, cas)&lt;&#x2F;li&gt;
&lt;li&gt;Meanwhile, it brings in the nemeses:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;partition-random-node:&lt;&#x2F;strong&gt; Randomly splits the network&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;kill-random-node:&lt;&#x2F;strong&gt; Kills a random node&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;clock-skew:&lt;&#x2F;strong&gt; Shifts the system clock&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;pause-random-node:&lt;&#x2F;strong&gt; Freezes a node (SIGSTOP)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;At the end of the test, it analyzes the full operation history&lt;&#x2F;li&gt;
&lt;li&gt;It answers the question &quot;is this history linearizable?&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;If the answer is &quot;no,&quot; you have violated the consistency guarantee somewhere. And believe me, on the first try the answer is always &quot;no.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;What was my biggest mistake? &lt;strong&gt;Skipping fsync.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I confess: I had forgotten to call &lt;code&gt;fsync()&lt;&#x2F;code&gt; when writing the WAL. I was writing data with &lt;code&gt;write()&lt;&#x2F;code&gt;, and it sat in the page cache, not on disk. When a node crashed... the WAL was empty. Jepsen caught it right away: &quot;Your system has no durability guarantee.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Fix: &lt;code&gt;fsync()&lt;&#x2F;code&gt; after every WAL write. Did performance drop? Yes, by 30%. But we stopped losing data. That was the trade-off.&lt;&#x2F;p&gt;
&lt;p&gt;Another mistake: &lt;strong&gt;implementing the Read Index optimization wrong.&lt;&#x2F;strong&gt; In Raft, reads have to go through the leader, but writing a log entry for every read is expensive. The Read Index technique makes reads safe without writing to the log. But I had calculated the lease duration wrong: a partitioned leader could still think &quot;I&#x27;m the leader&quot; and return stale reads. Jepsen: red.&lt;&#x2F;p&gt;
&lt;p&gt;Fix: Lease-based leader check + heartbeat confirmation before every read.&lt;&#x2F;p&gt;
&lt;p&gt;I caught 11 Jepsen bugs like this. Each one a separate lesson.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-did-i-learn&quot;&gt;What did I learn?&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;1. There is no &quot;works on my machine&quot; in distributed systems.&lt;&#x2F;strong&gt;
Code that doesn&#x27;t work under a network partition, a disk failure or clock skew doesn&#x27;t work. Jepsen rubs your face in it.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;2. Reading the Raft paper isn&#x27;t enough, you have to implement it.&lt;&#x2F;strong&gt;
You only understand how many edge cases leader election has, or what a sentence on page 5 of the paper really means, while implementing it.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;3. fsync is everything.&lt;&#x2F;strong&gt;
Durability = fsync. There&#x27;s no other way. However much you batch, sooner or later you have to make that system call.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;4. Test infrastructure matters more than product code.&lt;&#x2F;strong&gt;
KayaDB has more lines of test code than product code. Network partition simulations, fault injection, chaos engineering: all of it lives on the test side.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-next&quot;&gt;What&#x27;s next?&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;M14: Jepsen test suite final + prod deployment.&lt;&#x2F;strong&gt; Goal: run KayaDB on a real server under real traffic, not on my own machine.&lt;&#x2F;p&gt;
&lt;p&gt;After that:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;gRPC API stabilization&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Rust client library&lt;&#x2F;strong&gt; (&lt;code&gt;kayadb-client&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Go client library&lt;&#x2F;strong&gt; (maybe)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Publishing benchmarks&lt;&#x2F;strong&gt; (compared against etcd and TiKV)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;&#x2F;h2&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; clone https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;KayaDB
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span&gt; KayaDB
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --release
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;.&#x2F;target&#x2F;release&#x2F;kayadb --id&lt;&#x2F;span&gt;&lt;span&gt; node1&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --peers&lt;&#x2F;span&gt;&lt;span&gt; node2:5001,node3:5001
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;3 nodes, 3 terminals, and your Raft cluster is ready.&lt;&#x2F;p&gt;
&lt;p&gt;GitHub: &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;KayaDB&quot;&gt;github.com&#x2F;Tuntii&#x2F;KayaDB&lt;&#x2F;a&gt;
Documentation: &lt;a href=&quot;https:&#x2F;&#x2F;tuntii.github.io&#x2F;KayaDB&#x2F;&quot;&gt;tuntii.github.io&#x2F;KayaDB&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Distributed systems are hard. But doable. And when you pull it off, you&#x27;ve solved one of the most fundamental problems in computer science with your own hands. That feeling is priceless.&lt;&#x2F;p&gt;
&lt;p&gt;In the next post I&#x27;ll talk about Hyperembed: a pure-Rust BERT embedding inference engine.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Getting into Quantum Computing with Rust and Python: QuantumNN and qec-playground</title>
        <published>2026-07-06T00:00:00+00:00</published>
        <updated>2026-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/quantum-computing-quantumnn-qec-playground/"/>
        <id>https://tuntii.com/en/blog/quantum-computing-quantumnn-qec-playground/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/quantum-computing-quantumnn-qec-playground/">&lt;p&gt;One night in early 2026, around 02:00, I read a paper on arXiv: Li &amp;amp; Martonosi&#x27;s SWIPER-SIM behavioral model, an analysis of speculative window decoders for quantum error correction codes. It took me 4 hours to understand the paper. 2 weeks to implement it.&lt;&#x2F;p&gt;
&lt;p&gt;The result: &lt;code&gt;qec-playground&lt;&#x2F;code&gt;, the world&#x27;s first open-source SWIPER-SIM simulator. And as a side product, &lt;code&gt;QuantumNN&lt;&#x2F;code&gt;, a playground for quantum neural networks.&lt;&#x2F;p&gt;
&lt;p&gt;This post is the story of those 2 weeks and what came after.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-quantum&quot;&gt;Why quantum?&lt;&#x2F;h2&gt;
&lt;p&gt;Let me be honest: because it&#x27;s cool.&lt;&#x2F;p&gt;
&lt;p&gt;Serious answer: because there are problems classical computers can&#x27;t solve. Integer factorization (Shor), unstructured search (Grover), quantum simulation (Feynman&#x27;s original motivation). And once quantum computers become widespread, these problems will suddenly become solvable.&lt;&#x2F;p&gt;
&lt;p&gt;But the real reason is this: quantum computing is the last frontier of computer science. AI exploded, distributed systems matured, WebAssembly got standardized. But quantum? We&#x27;re still at the very beginning. Learning quantum programming in 2026 is like learning web development in 1995. Whoever gets in early wins.&lt;&#x2F;p&gt;
&lt;p&gt;I wanted to be one of the early ones.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;qec-playground-implementing-swiper-sim&quot;&gt;qec-playground: implementing SWIPER-SIM&lt;&#x2F;h2&gt;
&lt;p&gt;Li &amp;amp; Martonosi&#x27;s paper (arXiv:2606.24048) says this: the biggest problem with quantum error correction (QEC) codes is decoding latency. While a quantum processor is running, decoding the error correction code takes time. And you have a limited time window before the quantum bits (qubits) decohere.&lt;&#x2F;p&gt;
&lt;p&gt;SWIPER (Sliding Window Interleaved Parallel Error Resolution) is a technique that parallelizes this decoding speculatively. The idea: instead of waiting for the whole error correction code, decode it piece by piece with a sliding window, and speculatively predict the next window.&lt;&#x2F;p&gt;
&lt;p&gt;The paper was theoretical. It described a simulation framework, but there was no implementation. I said, &quot;someone should write this.&quot; That someone was me.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;technical-details&quot;&gt;Technical details&lt;&#x2F;h3&gt;
&lt;p&gt;qec-playground does the following:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Quantum circuit simulation&lt;&#x2F;strong&gt;: Simulates qubits, gates and measurements on a classical computer. (Not a real quantum computer, a simulation. But it&#x27;s enough for developing algorithms.)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Error modeling&lt;&#x2F;strong&gt;: Injects quantum error models like bit-flip, phase-flip and the depolarizing channel.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;SWIPER decoder implementation&lt;&#x2F;strong&gt;: I implemented the paper&#x27;s sliding window algorithm one-to-one. Window size, overlap amount, speculative prediction parameters: all configurable.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Streamlit interface&lt;&#x2F;strong&gt;: Web-based and interactive. You can change the parameters with sliders and see the result instantly.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Metric analysis&lt;&#x2F;strong&gt;: Decoding latency, logical error rate, pseudo-threshold. It computes every metric from the paper.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;On the code side it&#x27;s Python + Streamlit. A pretty simple stack. Because the hard part here isn&#x27;t the code, it&#x27;s the physics. Understanding quantum mechanics, figuring out the stabilizer formalism, grasping how surface codes work: that was the real work.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-i-learned&quot;&gt;What I learned&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quantum error correction is completely different from classical error correction.&lt;&#x2F;strong&gt; In the classical world you fix bit flips. In the quantum world you have both bit flips and phase flips, measuring destroys the state, and you can&#x27;t copy anything because of the no-cloning theorem. A completely different world.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The stabilizer formalism is beautiful.&lt;&#x2F;strong&gt; Thanks to the Gottesman-Knill theorem, you can simulate stabilizer circuits efficiently on a classical computer. Turning the paper&#x27;s mathematical formalism into code looked impossible at first. But once I sat down and worked through it line by line, I saw that it&#x27;s actually a very elegant system.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Streamlit is great for scientific simulations.&lt;&#x2F;strong&gt; It gives a better UX than a Jupyter notebook. Change a parameter, see it instantly. Ideal for showing to paper authors.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open source spreads fast in academia.&lt;&#x2F;strong&gt; Within 3 days of putting the project on GitHub, a quantum computing researcher opened an issue: &quot;Can we adapt this for surface code rotation too?&quot; Answer: yes, I&#x27;m working on it.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;quantumnn-quantum-neural-networks&quot;&gt;QuantumNN: Quantum neural networks&lt;&#x2F;h2&gt;
&lt;p&gt;While writing qec-playground, a side effect happened: the quantum circuit simulation infrastructure was already there. I asked myself, &quot;can I use this for neural networks too?&quot; The answer was yes. And out came QuantumNN.&lt;&#x2F;p&gt;
&lt;p&gt;QuantumNN is a framework that replaces classical neural network layers with quantum circuits. The idea:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Use a &lt;strong&gt;variational quantum circuit (VQC)&lt;&#x2F;strong&gt; instead of a classical neural network layer&lt;&#x2F;li&gt;
&lt;li&gt;Optimize the circuit&#x27;s parameters with gradient descent&lt;&#x2F;li&gt;
&lt;li&gt;End up with a hybrid classical-quantum model&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;what-s-it-good-for&quot;&gt;What&#x27;s it good for?&lt;&#x2F;h3&gt;
&lt;p&gt;In theory, quantum neural networks have these advantages:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Higher expressiveness with fewer parameters.&lt;&#x2F;strong&gt; A quantum circuit can represent exponentially more states than a classical neural network layer (thanks to the dimension of the Hilbert space).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Native quantum data processing.&lt;&#x2F;strong&gt; Data from quantum sensors can be fed straight into a quantum model without classical preprocessing.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Potential for quantum advantage.&lt;&#x2F;strong&gt; Not demonstrated in practice yet (we&#x27;re in the NISQ era), but in theory it could beat classical models on some problems.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;In practice? I&#x27;m not sure yet. QuantumNN is a playground. Where a classical CNN gets 99% accuracy on MNIST, the quantum NN gets 92%. But with 10x fewer parameters. That&#x27;s interesting.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;technical-structure&quot;&gt;Technical structure&lt;&#x2F;h3&gt;
&lt;p&gt;QuantumNN is made up of these components:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;quantumnn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;QuantumLayer, HybridModel
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Quantum layer: 4 qubits, 3-layer variational circuit
&lt;&#x2F;span&gt;&lt;span&gt;qlayer = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;QuantumLayer&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;n_qubits&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;n_layers&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;encoding&lt;&#x2F;span&gt;&lt;span&gt;=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;angle&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# Hybrid model: classical dense + quantum + classical dense
&lt;&#x2F;span&gt;&lt;span&gt;model = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;HybridModel&lt;&#x2F;span&gt;&lt;span&gt;([
&lt;&#x2F;span&gt;&lt;span&gt;    torch.nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Linear&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;784&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;16&lt;&#x2F;span&gt;&lt;span&gt;),
&lt;&#x2F;span&gt;&lt;span&gt;    qlayer,
&lt;&#x2F;span&gt;&lt;span&gt;    torch.nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Linear&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;10&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;])
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;encoding=&quot;angle&quot;&lt;&#x2F;code&gt; encodes classical data into qubit rotation angles. There are other encoding strategies too: amplitude encoding (more efficient but more complex), basis encoding (simple but carries little information).&lt;&#x2F;p&gt;
&lt;p&gt;Optimization: gradients are computed with the parameter shift rule. Backpropagation doesn&#x27;t work on quantum circuits: for each parameter you have to run the circuit twice and take the difference. That&#x27;s slow even in classical simulation. On real quantum hardware it&#x27;ll be even slower.&lt;&#x2F;p&gt;
&lt;p&gt;But that&#x27;s research: slow and hard. What matters is getting started.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-nisq-era-and-reality&quot;&gt;The NISQ era and reality&lt;&#x2F;h2&gt;
&lt;p&gt;Right now we&#x27;re in the NISQ (Noisy Intermediate-Scale Quantum) era. Here&#x27;s what that means:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Noisy:&lt;&#x2F;strong&gt; Qubits are noisy. Error rates are high. In a 100-qubit circuit, even with 0.1% error per gate, the chance of the circuit running correctly is very low.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Intermediate-Scale:&lt;&#x2F;strong&gt; There are devices with 50-1000 qubits (IBM, Google, Rigetti). But no error correction. Each &quot;logical qubit&quot; needs thousands of physical qubits.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Quantum advantage:&lt;&#x2F;strong&gt; Google claimed &quot;quantum supremacy&quot; in 2019. IBM pushed back. They tried again in 2024. The debate is still going.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;That&#x27;s exactly why I got into this field: it&#x27;s early. Nobody is a &quot;quantum developer&quot; yet. Everyone is learning. And I&#x27;m one of the people learning.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-next&quot;&gt;What&#x27;s next?&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;qec-playground:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Surface code rotation simulation&lt;&#x2F;li&gt;
&lt;li&gt;Color code support&lt;&#x2F;li&gt;
&lt;li&gt;Testing against a real IBM Quantum backend (IBM Q Experience API)&lt;&#x2F;li&gt;
&lt;li&gt;More decoder algorithms: MWPM, Union-Find, belief propagation&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;QuantumNN:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Bigger models (8-12 qubits)&lt;&#x2F;li&gt;
&lt;li&gt;Testing on real quantum hardware (IBM, Rigetti)&lt;&#x2F;li&gt;
&lt;li&gt;Quantum transfer learning experiments&lt;&#x2F;li&gt;
&lt;li&gt;Taking part in QML benchmarks&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;&#x2F;h2&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# qec-playground
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; clone https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;qec-playground
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span&gt; qec-playground
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;pip&lt;&#x2F;span&gt;&lt;span&gt; install&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span&gt; requirements.txt
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;streamlit&lt;&#x2F;span&gt;&lt;span&gt; run app.py
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# QuantumNN
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; clone https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;QuantumNN
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span&gt; QuantumNN
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;pip&lt;&#x2F;span&gt;&lt;span&gt; install&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span&gt; requirements.txt
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;python&lt;&#x2F;span&gt;&lt;span&gt; examples&#x2F;mnist_hybrid.py
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Both are public repos. Both are experimental. Neither is &quot;production-ready,&quot; and they don&#x27;t need to be. Research code doesn&#x27;t have to be pretty, it just has to work.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;Quantum computing has been the hardest learning experience of my career. But also the most rewarding. If you&#x27;re curious too, grab a paper and implement it. That&#x27;s the best way to learn.&lt;&#x2F;p&gt;
&lt;p&gt;In the next post I&#x27;ll talk about Hyperembed: a pure-Rust BERT embedding inference engine, SIMD optimizations and local-first AI.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>RustAPI: Rust&#x27;s Answer to FastAPI</title>
        <published>2026-07-06T00:00:00+00:00</published>
        <updated>2026-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/rustapi-rusts-answer-to-fastapi/"/>
        <id>https://tuntii.com/en/blog/rustapi-rusts-answer-to-fastapi/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/rustapi-rusts-answer-to-fastapi/">&lt;p&gt;It all started in December 2025 with one question: &quot;Why has nobody done what FastAPI does, but in Rust?&quot;&lt;&#x2F;p&gt;
&lt;p&gt;There actually was an answer. There&#x27;s Axum, there&#x27;s Actix, there&#x27;s Poem. They&#x27;re all good frameworks. But none of them had FastAPI&#x27;s &quot;it&#x27;s right there under your fingers&quot; ergonomics. None of them gave you that feeling of writing &lt;code&gt;app.get(&quot;&#x2F;&quot;)&lt;&#x2F;code&gt; and having an endpoint in three lines. And more importantly, none of them treated the AI&#x2F;LLM world as a first-class citizen.&lt;&#x2F;p&gt;
&lt;p&gt;So I built it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-story&quot;&gt;The story&lt;&#x2F;h2&gt;
&lt;p&gt;It was the last quarter of 2025. I had a ton of parallel projects going. Between Hyperembed&#x27;s embedding inference engine and a few LLM tools, I noticed I kept writing the same thing over and over: HTTP endpoints. In every project I was defining routes, writing middleware and doing error handling from scratch. It was a toxic pattern: the exact opposite of DRY.&lt;&#x2F;p&gt;
&lt;p&gt;&quot;Let me build it once and use it everywhere,&quot; I said. First commit: December 15, 2025. I named it RustAPI. Plain, descriptive, ambitious.&lt;&#x2F;p&gt;
&lt;p&gt;The first version was terrible. Only &lt;code&gt;app.get()&lt;&#x2F;code&gt; and &lt;code&gt;app.post()&lt;&#x2F;code&gt; worked. But they worked. And most importantly, Rust didn&#x27;t have an API this simple.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-it-does&quot;&gt;What it does&lt;&#x2F;h2&gt;
&lt;p&gt;RustAPI does in Rust what FastAPI does in Python. But with a few extra layers:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Macro-based route definitions.&lt;&#x2F;strong&gt; You write an attribute, and your function becomes an endpoint:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;hello&#x2F;{name}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)]
&lt;&#x2F;span&gt;&lt;span&gt;async &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;hello&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span&gt;: String) -&amp;gt; String {
&lt;&#x2F;span&gt;&lt;span&gt;    format!(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Hello, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#d08770;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;!&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;, name)
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Path parameters, query parameters, request body: all resolved automatically. If you&#x27;re a FastAPI user, you&#x27;ll feel right at home.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Native MCP (Model Context Protocol) support.&lt;&#x2F;strong&gt; This is the most interesting part. Every endpoint you write with RustAPI can automatically become an MCP tool. That means an AI agent can call your API directly. To do that:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;rust&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-rust &quot;&gt;&lt;code class=&quot;language-rust&quot; data-lang=&quot;rust&quot;&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;weather&#x2F;{city}&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)]
&lt;&#x2F;span&gt;&lt;span&gt;#[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;mcp_tool&lt;&#x2F;span&gt;&lt;span&gt;(description = &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;Get weather for a city&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot;)]
&lt;&#x2F;span&gt;&lt;span&gt;async &lt;&#x2F;span&gt;&lt;span style=&quot;color:#b48ead;&quot;&gt;fn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fa1b3;&quot;&gt;weather&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;city&lt;&#x2F;span&gt;&lt;span&gt;: String) -&amp;gt; Json&amp;lt;WeatherResponse&amp;gt; {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;&#x2F;&#x2F; ...
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s it. The &lt;code&gt;#[mcp_tool]&lt;&#x2F;code&gt; attribute turns your endpoint into a tool definition that follows Anthropic&#x27;s MCP specification. Claude, GPT, Gemini: all of them can call this endpoint as if it were their own tool.&lt;&#x2F;p&gt;
&lt;p&gt;Let me explain how big a deal this is.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;agent-first-api-design&quot;&gt;Agent-first API design&lt;&#x2F;h2&gt;
&lt;p&gt;Until now, APIs were designed for humans. RESTful, well documented, fed with Swagger&#x2F;OpenAPI. Developer experience came first.&lt;&#x2F;p&gt;
&lt;p&gt;But the world is changing. In 2026, the consumers of APIs aren&#x27;t only humans anymore. AI agents call APIs too. And what an AI agent expects from an API is very different from what a human developer expects.&lt;&#x2F;p&gt;
&lt;p&gt;For a human developer: &quot;Call this endpoint, add this header, parse the response.&quot;
For an AI agent: &quot;Tell me what it does, define the parameters, I&#x27;ll call it.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;The MCP support in RustAPI represents exactly this shift in mindset. Every endpoint is agent-readable from birth. Zero extra work. The moment you add &lt;code&gt;#[mcp_tool]&lt;&#x2F;code&gt;, your endpoint lands in Claude&#x27;s tool registry.&lt;&#x2F;p&gt;
&lt;p&gt;I call this &quot;agent-first API design&quot;. And I think it&#x27;ll be the biggest API trend of 2026-2027.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;technical-details-for-the-curious&quot;&gt;Technical details (for the curious)&lt;&#x2F;h2&gt;
&lt;p&gt;A quick look at what&#x27;s going on behind the scenes:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;HTTP layer:&lt;&#x2F;strong&gt; I wrote my own HTTP&#x2F;1.1 implementation. Yes, from scratch. I didn&#x27;t use &lt;code&gt;hyper&lt;&#x2F;code&gt; or &lt;code&gt;actix-http&lt;&#x2F;code&gt;. The reason is simple: to zero out the dependency chain. Today RustAPI&#x27;s total dependency count is incredibly low. That shortens compile times, shrinks the binary, and most importantly, I know how everything works.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;MCP layer:&lt;&#x2F;strong&gt; Implements the MCP specification over JSON-RPC 2.0. Tool listing, tool calling, error handling: all spec-compliant.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Permission scoping:&lt;&#x2F;strong&gt; The most critical feature that came with v0.1.508. Which agent can call which endpoint, and how often? Rate limiting? Scope restrictions? All configurable.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Cloud CLI:&lt;&#x2F;strong&gt; You type &lt;code&gt;rustapi deploy&lt;&#x2F;code&gt; and your project goes live. The goal is to bring the Vercel model to the Rust ecosystem.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;We&#x27;re at v0.1.528 right now. 55+ GitHub stars, 3 forks. Those look like small numbers, but for a web framework in the Rust ecosystem that&#x27;s not bad at all, especially in 7 months.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;performance&quot;&gt;Performance&lt;&#x2F;h2&gt;
&lt;p&gt;I&#x27;ll keep it short. Benchmark results:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Framework&lt;&#x2F;th&gt;&lt;th&gt;Request&#x2F;sec (hello world)&lt;&#x2F;th&gt;&lt;th&gt;P99 latency&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;FastAPI (Python)&lt;&#x2F;td&gt;&lt;td&gt;~14,000&lt;&#x2F;td&gt;&lt;td&gt;~8ms&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Express (Node)&lt;&#x2F;td&gt;&lt;td&gt;~24,000&lt;&#x2F;td&gt;&lt;td&gt;~5ms&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Actix-web (Rust)&lt;&#x2F;td&gt;&lt;td&gt;~180,000&lt;&#x2F;td&gt;&lt;td&gt;~0.6ms&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;RustAPI (Rust)&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;~210,000&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;~0.5ms&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;On the MCP invocation side it&#x27;s even crazier: &lt;strong&gt;28 microseconds&lt;&#x2F;strong&gt;. Yes, microseconds. Calling an MCP tool is faster than a Python function call.&lt;&#x2F;p&gt;
&lt;p&gt;These are &quot;hello world&quot; benchmarks. In the real world the gap gets even wider, because Rust&#x27;s zero-cost abstractions are what really make the difference under real workloads.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;where-is-it-going&quot;&gt;Where is it going?&lt;&#x2F;h2&gt;
&lt;p&gt;The roadmap is clear:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;RustAPI Cloud&lt;&#x2F;strong&gt; (Q3 2026): Managed hosting. Deployment in a single command with &lt;code&gt;rustapi deploy&lt;&#x2F;code&gt;. Free tier + pro tier. The Rust version of Vercel.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;MCP Gateway&lt;&#x2F;strong&gt; (Q4 2026): A gateway that gathers all your deployed APIs behind a single MCP endpoint. An AI agent will be able to reach hundreds of APIs from a single URL.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Plugin ecosystem&lt;&#x2F;strong&gt;: Auth plugins, rate limiting, caching, monitoring. Open to community contributions.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;gRPC + WebSocket&lt;&#x2F;strong&gt;: Going beyond HTTP. Agents sometimes want streaming.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;what-i-learned&quot;&gt;What I learned&lt;&#x2F;h2&gt;
&lt;p&gt;Writing a web framework from scratch teaches you HTTP inside and out. Keep-alive connections, chunked transfer encoding, pipelined requests: you have to implement all of them. I could say reading RFCs ruined my eyesight.&lt;&#x2F;p&gt;
&lt;p&gt;But the biggest thing I learned is this: &lt;strong&gt;in Rust, ergonomics doesn&#x27;t come at zero cost.&lt;&#x2F;strong&gt; Thanks to the macro system you can offer an API as clean as Python&#x27;s, but behind the scenes everything is resolved statically. No runtime overhead. That&#x27;s Rust&#x27;s superpower.&lt;&#x2F;p&gt;
&lt;p&gt;The second big lesson: &lt;strong&gt;open source is like compound interest.&lt;&#x2F;strong&gt; For the first 3 months nobody looked at it. Then I wrote a blog post, shared it on Hacker News, and suddenly 30 stars came in. Now every week a few people open issues and send PRs. Slow, but steady growth.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;&#x2F;h2&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span&gt; install rustapi
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rustapi&lt;&#x2F;span&gt;&lt;span&gt; new my-project
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#96b5b4;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span&gt; my-project
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rustapi&lt;&#x2F;span&gt;&lt;span&gt; dev
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;3 commands, 10 seconds. Then start building.&lt;&#x2F;p&gt;
&lt;p&gt;Website: &lt;a href=&quot;https:&#x2F;&#x2F;rustapi.cloud&quot;&gt;rustapi.cloud&lt;&#x2F;a&gt;
GitHub: &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Tuntii&#x2F;RustAPI&quot;&gt;github.com&#x2F;Tuntii&#x2F;RustAPI&lt;&#x2F;a&gt;
Documentation: &lt;a href=&quot;https:&#x2F;&#x2F;tuntii.github.io&#x2F;RustAPI&#x2F;&quot;&gt;tuntii.github.io&#x2F;RustAPI&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;If you write Rust and build APIs, give it a shot. If you don&#x27;t like it, open an issue. I mean it, I try to implement every piece of feedback.&lt;&#x2F;p&gt;
&lt;p&gt;In the next post I&#x27;ll talk about KayaDB: what it&#x27;s like to write a distributed key-value store from scratch, implementing Raft consensus, Jepsen tests... That one&#x27;s even crazier.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Self-Taught Founder&#x27;s Handbook</title>
        <published>2026-07-06T00:00:00+00:00</published>
        <updated>2026-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Tunay Engin
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://tuntii.com/en/blog/self-taught-founder/"/>
        <id>https://tuntii.com/en/blog/self-taught-founder/</id>
        
        <content type="html" xml:base="https://tuntii.com/en/blog/self-taught-founder/">&lt;p&gt;I met my first computer at 5. I wrote my first code in C++. I started with game server infrastructure: Metin2 private servers, Knight Online emulators. At 12 I was hanging out on cybersecurity forums. At 15 I founded my first company. At 21 I&#x27;m writing this post.&lt;&#x2F;p&gt;
&lt;p&gt;This isn&#x27;t a success story. It&#x27;s a survival story.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;school-no-thanks&quot;&gt;School? No, thanks.&lt;&#x2F;h2&gt;
&lt;p&gt;I tried two universities. I dropped out of both. Management Information Systems at Istanbul University: boring. Computer Programming at Trakya University: slow.&lt;&#x2F;p&gt;
&lt;p&gt;The problem wasn&#x27;t the school, and it wasn&#x27;t me. The problem was the pace. When I want to learn something, I start that night and finish by dawn. School was telling me &quot;we&#x27;ll cover this topic over 14 weeks.&quot; 14 weeks? I had figured out Rust&#x27;s borrow checker in 14 hours.&lt;&#x2F;p&gt;
&lt;p&gt;Have I ever felt like I&#x27;m missing something because I didn&#x27;t get a formal education? No. Because there&#x27;s no single way to learn. My way: find the problem, learn whatever it takes to solve it, solve it, move on to the next one. They call this &quot;just-in-time learning.&quot; I call it &quot;learning to cook when you get hungry.&quot;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;my-stack-whatever-works&quot;&gt;My stack: whatever works&lt;&#x2F;h2&gt;
&lt;p&gt;I&#x27;m not tied to a single stack. I use whatever the project needs.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rust:&lt;&#x2F;strong&gt; Anything that needs performance. A web framework? RustAPI. A database? KayaDB. Embedding inference? Hyperembed.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;TypeScript:&lt;&#x2F;strong&gt; Anything that needs a fast prototype. Lots of prototypes started in TypeScript.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Python:&lt;&#x2F;strong&gt; On the AI&#x2F;ML side. qec-playground, QuantumNN.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Go:&lt;&#x2F;strong&gt; When the need comes up. Alexander-storage, for example, is written in Go, because Go&#x27;s ecosystem is more mature for an S3 server.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;C++:&lt;&#x2F;strong&gt; Left over from the past. The BareEngine game engine is in C++. Because you don&#x27;t write a game engine in anything else.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;There&#x27;s a saying: &quot;Jack of all trades, master of none.&quot; The full version goes: &quot;Jack of all trades, master of none, but oftentimes better than master of one.&quot; That&#x27;s my philosophy. Rather than being an expert in one thing, know everything well enough and go deep depending on the project.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;projects-quantity-or-quality&quot;&gt;Projects: quantity or quality?&lt;&#x2F;h2&gt;
&lt;p&gt;I have 23 GitHub repos. 20 are active. Every month 2-3 new projects start and 1-2 die. That&#x27;s normal.&lt;&#x2F;p&gt;
&lt;p&gt;In the open source world there&#x27;s this advice: &quot;have one big project.&quot; I do the opposite. I have a lot of projects, and each one teaches me something different. RustAPI taught me HTTP and MCP. KayaDB, distributed systems. Hyperembed, embedding models. BareEngine, game engine architecture.&lt;&#x2F;p&gt;
&lt;p&gt;They all feed each other. I used the &lt;code&gt;fsync&lt;&#x2F;code&gt; optimization I learned in KayaDB in RustAPI&#x27;s file serving layer. I adapted the SIMD optimizations from Hyperembed to KayaDB&#x27;s storage engine.&lt;&#x2F;p&gt;
&lt;p&gt;I call this &quot;cross-pollination.&quot; The secret weapon of people who build a lot of projects.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;failures-these-matter&quot;&gt;Failures (these matter)&lt;&#x2F;h2&gt;
&lt;p&gt;Nobody talks about their failures. Let me talk about mine.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Poise Labs (2022-2024):&lt;&#x2F;strong&gt; I wrote my own blockchain. I forked it from the Diem (formerly Libra) blockchain and called it &quot;Poisechain.&quot; In Dubai we got as far as a $5.2 million investment, and on our lawyer&#x27;s advice we did not sign. Back in Turkey, the investors we met told us &quot;we can&#x27;t invest in you, there&#x27;s no market.&quot; It went under. (&lt;a href=&quot;&#x2F;en&#x2F;blog&#x2F;poise-labs-dubai&#x2F;&quot;&gt;The whole story&lt;&#x2F;a&gt;) My most expensive lesson: &lt;strong&gt;solve a problem, not a technology.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;The THT era (teenage years):&lt;&#x2F;strong&gt; I was writing and handing out tools on cybersecurity forums. Some were serious tools, some were... well, hacktivist stuff. Luckily I grew up. But that period taught me how systems get broken, which is the best way to learn how to protect them.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;The first company, the website business (age 15):&lt;&#x2F;strong&gt; Ceyhun (Ceyhun Kasım Arslan) and I founded Bones Interactive. We were going to make money selling websites. We sold to the first customer, got paid, celebrated. Then the second customer never came. We waited three months. Pivot: ERP software. That didn&#x27;t stick either. Pivot: embedded systems. That didn&#x27;t stick either. But every pivot taught something new. And in the end, something stuck.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-money-question&quot;&gt;The money question&lt;&#x2F;h2&gt;
&lt;p&gt;Let me be honest: I&#x27;m not making money. Yet.&lt;&#x2F;p&gt;
&lt;p&gt;RustAPI has 55 stars. KayaDB has 4. Coverium has 1. None of these pay the bills.&lt;&#x2F;p&gt;
&lt;p&gt;But here&#x27;s the plan: RustAPI Cloud. Managed hosting. Free tier + pro tier. The Vercel model. If 1000 developers use RustAPI and 5% move to the pro tier, that covers the basics. Target: end of 2026.&lt;&#x2F;p&gt;
&lt;p&gt;In the meantime? I&#x27;m surviving. My family supports me. I take freelance work. I&#x27;ve worked at Solana, at Aptos and at a few other companies before. I put some money aside. Now I&#x27;m burning through it.&lt;&#x2F;p&gt;
&lt;p&gt;They call this &quot;ramen profitability.&quot; I call it &quot;one plate of pasta + one project.&quot;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;daily-routine-so-called&quot;&gt;Daily routine (so-called)&lt;&#x2F;h2&gt;
&lt;p&gt;I don&#x27;t have a fixed routine. Some days I get up at 04:00 and work until 22:00. Some days I get up at noon and work until 03:00. Wherever the energy is, that&#x27;s where I am.&lt;&#x2F;p&gt;
&lt;p&gt;The moment I wake up, I sit down at the computer. Breakfast? Sometimes. Lunch? At the computer. Dinner? If I didn&#x27;t go out, at the computer again.&lt;&#x2F;p&gt;
&lt;p&gt;This isn&#x27;t healthy. I know. But until the projects are done and I start making money, I can&#x27;t relax. This isn&#x27;t a race, it&#x27;s survival mode. And in that mode, routine is a luxury.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;7-things-i-ve-learned-so-far&quot;&gt;7 things I&#x27;ve learned (so far)&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Find the problem, not the solution.&lt;&#x2F;strong&gt; Most developers do the opposite: pick a technology, then look for a problem for it. Find the pain first, then the cure.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Ship early, ship often.&lt;&#x2F;strong&gt; The first version will be terrible. That&#x27;s fine. You can&#x27;t build a perfect product without user feedback.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;You can&#x27;t do it alone.&lt;&#x2F;strong&gt; Without Ceyhun there would be no Bones Interactive. Without open source contributors RustAPI wouldn&#x27;t be where it is today. Work with people.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;English is a must.&lt;&#x2F;strong&gt; Turkish resources are limited. RFCs, papers, documentation: all in English. You have to learn it.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Go deep.&lt;&#x2F;strong&gt; If you really want to understand something, implement it. I implemented Raft to understand Raft. I implemented HTTP to understand HTTP. I implemented BERT to understand BERT.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Don&#x27;t neglect your health.&lt;&#x2F;strong&gt; (I haven&#x27;t learned this one yet, I just know it in theory.)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Know your why.&lt;&#x2F;strong&gt; Why do you write code? For money, to learn, to change the world? Mine: to make something meaningful. I can&#x27;t stand busywork.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;what-s-next&quot;&gt;What&#x27;s next?&lt;&#x2F;h2&gt;
&lt;p&gt;Short term: make money. RustAPI Cloud, maybe some consulting gigs, maybe sponsorships.&lt;&#x2F;p&gt;
&lt;p&gt;Mid term: raise investment. But only from the right investor. Someone who gets my vision and doesn&#x27;t say &quot;exit in 3 months.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Long term: be happy. That&#x27;s it. The rest is details.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;I wrote this for people walking a similar path. For everyone who teaches themselves, who dropped out of school, who keeps wondering &quot;am I doing this wrong?&quot;&lt;&#x2F;p&gt;
&lt;p&gt;There&#x27;s no right path. There&#x27;s only your path. Keep walking.&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
