<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Yuri Zinchenko</title>
    <description>The latest articles on Forem by Yuri Zinchenko (@ymz-ncnk).</description>
    <link>https://forem.com/ymz-ncnk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3853885%2F10e4587e-5c48-48a4-a941-21ead1acb31d.jpeg</url>
      <title>Forem: Yuri Zinchenko</title>
      <link>https://forem.com/ymz-ncnk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ymz-ncnk"/>
    <language>en</language>
    <item>
      <title>AI vs Codegen: A Practical Experiment in Go Serialization</title>
      <dc:creator>Yuri Zinchenko</dc:creator>
      <pubDate>Wed, 01 Apr 2026 16:30:57 +0000</pubDate>
      <link>https://forem.com/ymz-ncnk/ai-generated-go-serialization-zero-boilerplate-maximum-speed-49f8</link>
      <guid>https://forem.com/ymz-ncnk/ai-generated-go-serialization-zero-boilerplate-maximum-speed-49f8</guid>
      <description>&lt;p&gt;I wanted to share a quick story about a weekend experiment.&lt;/p&gt;

&lt;p&gt;There is a library called &lt;a href="https://github.com/ymz-ncnk/mok" rel="noopener noreferrer"&gt;mok&lt;/a&gt; that lacks a code generator, so every time you want to mock an interface, it requires you to write all the boilerplate yourself. It's simple but tedious work. I usually just offload it to an AI agent, and with a small example, it completes this task exceptionally well.&lt;/p&gt;

&lt;p&gt;This got me thinking - could AI handle something more complex, like writing serialization code? If it could, we'd basically get the best of both worlds: the raw speed of generated code, with the same simplicity you get from reflection-based libraries.&lt;/p&gt;

&lt;p&gt;But is it safe to trust AI with something as sensitive as serialization logic? With all its non-determinism and unpredictable behavior, the answer is more likely a hard "No", unless we enforce two strict requirements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Provide a solid foundation — give the AI a robust library to work with.&lt;/li&gt;
&lt;li&gt;Test everything — all AI-generated code must be rigorously tested.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With those guidelines in place, I decided to give it a shot. After a few late nights, and honestly, way more fun than expected, I ended up building &lt;a href="https://github.com/mus-format/mus-skill-go" rel="noopener noreferrer"&gt;mus-skill&lt;/a&gt;: an AI skill for generating &lt;a href="https://ymz-ncnk.medium.com/mus-serialization-format-20f833df12d5" rel="noopener noreferrer"&gt;MUS&lt;/a&gt; serialization code.&lt;/p&gt;

&lt;p&gt;At its core, the skill is just a set of rules for combining the serialization primitives provided by the &lt;a href="https://github.com/mus-format/mus-go" rel="noopener noreferrer"&gt;mus&lt;/a&gt; and &lt;a href="https://github.com/mus-format/mus-stream-go" rel="noopener noreferrer"&gt;mus-stream&lt;/a&gt; libraries. In addition to the code itself, it also generates the accompanying tests so you can be sure everything works correctly.&lt;/p&gt;

&lt;p&gt;Because the code looks exactly like the output of a traditional &lt;a href="https://github.com/mus-format/mus-gen-go" rel="noopener noreferrer"&gt;code generator&lt;/a&gt; you can expect from it the same high-performance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="o"&gt;|&lt;/span&gt;     &lt;span class="n"&gt;NAME&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="n"&gt;NS&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;OP&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;SIZE&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="n"&gt;B&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;OP&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ALLOCS&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;OP&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|--------------|----------|--------|---------|-----------|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;mus&lt;/span&gt;          &lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="m"&gt;102.90&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="m"&gt;58.00&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="m"&gt;48.00&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;         &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;protobuf&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="m"&gt;531.70&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="m"&gt;69.00&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="m"&gt;271.00&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;         &lt;span class="m"&gt;4&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;         &lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="m"&gt;2779.00&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="m"&gt;150.00&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="m"&gt;600.00&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;         &lt;span class="m"&gt;9&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;

&lt;span class="n"&gt;Full&lt;/span&gt; &lt;span class="n"&gt;benchmarks&lt;/span&gt; &lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="c"&gt;//github.com/ymz-ncnk/go-serialization-benchmarks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach even works flawlessly on deeply nested, complex types (where AI usually hallucinates), such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// mus:vl = ValidateLen&lt;/span&gt;
&lt;span class="c"&gt;// mus:elemVl = ValidateComplexMapValue&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;ComplexMap&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;][][]&lt;/span&gt;&lt;span class="kt"&gt;float32&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And supports user hints, so you can easily customize the generated code to fit your exact needs (like specifying custom validators).&lt;/p&gt;

&lt;p&gt;Getting started is simple. Just clone this repository into your project's agent directory (e.g., &lt;code&gt;.agents/skills&lt;/code&gt;). Or, even easier, install it using the &lt;a href="//..."&gt;skills&lt;/a&gt; CLI tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx skills add github.com/mus-format/mus-skill-go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, simply give your AI agent a prompt like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Generate MUS serializers for the types found in the &amp;lt;file_name&amp;gt;.go file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result? Two newly generated files: &lt;code&gt;mus.ai.gen.go&lt;/code&gt; and &lt;code&gt;mus.ai.gen_test.go&lt;/code&gt;. As always, just be sure to double-check that the generated tests actually cover all your edge cases.&lt;/p&gt;

&lt;p&gt;Have you ever tried a similar approach? I'd love to hear how it went for you!&lt;/p&gt;

</description>
      <category>go</category>
      <category>ai</category>
      <category>serialization</category>
      <category>performance</category>
    </item>
    <item>
      <title>MUS: "No-Tax" Serialization Format</title>
      <dc:creator>Yuri Zinchenko</dc:creator>
      <pubDate>Wed, 01 Apr 2026 15:30:35 +0000</pubDate>
      <link>https://forem.com/ymz-ncnk/mus-serialization-format-20c5</link>
      <guid>https://forem.com/ymz-ncnk/mus-serialization-format-20c5</guid>
      <description>&lt;p&gt;&lt;strong&gt;MUS (Marshal, Unmarshal, Size)&lt;/strong&gt; is a serialization format founded on the “Keep It Simple” principle. If you are engineering high-performance systems, MUS offers three mechanical advantages that traditional formats don’t:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extreme Density: By eliminating almost all metadata, MUS payloads are often the smallest possible representation of your data.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;| NAME     | Bytes  |
|----------|--------|
| MUS      | 58.00  |
| Protobuf | 69.00  |
| JSON     | 150.00 |

Full benchmarks https://github.com/ymz-ncnk/go-serialization-benchmarks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The Size Function: The ability to calculate the exact memory required before allocating a buffer, which allows you to:

&lt;ul&gt;
&lt;li&gt;Reuse buffers effectively to minimize GC pressure.&lt;/li&gt;
&lt;li&gt;Avoid expensive append calls and re-allocations during marshaling.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;DTM (Data Type Metadata): A one-byte solution for “heavy” features like versioning and interface serialization.&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Untyped Serialization
&lt;/h2&gt;

&lt;p&gt;In most cases, the sender (marshal) and the receiver (unmarshal) already agree on the data type they are communicating with. For example, with dedicated REST endpoints like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://example.com/api/v1/foo
http://example.com/api/v1/bar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both sides know exactly which type is being transferred. In this scenario, any type-hinting or metadata in the payload is a redundant “tax”. Knowing the type is enough, even for structured data, because the type definition itself provides the required order of fields.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example: Struct to Bytes
&lt;/h3&gt;

&lt;p&gt;Consider a simple User struct. In MUS, we don’t store field names like &lt;code&gt;id&lt;/code&gt; or &lt;code&gt;age&lt;/code&gt;. We only store the raw values in the order they appear in the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;    &lt;span class="kt"&gt;int&lt;/span&gt;    &lt;span class="c"&gt;// Field 1&lt;/span&gt;
  &lt;span class="n"&gt;age&lt;/span&gt;   &lt;span class="kt"&gt;int&lt;/span&gt;    &lt;span class="c"&gt;// Field 2&lt;/span&gt;
  &lt;span class="n"&gt;admin&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;   &lt;span class="c"&gt;// Field 3&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;// Data: id=42, age=30, admin=true&lt;/span&gt;
&lt;span class="c"&gt;// MUS Payload (Binary): [84 60 1]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the receiver is using the same &lt;code&gt;User&lt;/code&gt; definition, it knows that the first Varint it reads is the &lt;code&gt;id&lt;/code&gt;, the second is the &lt;code&gt;age&lt;/code&gt;, and the final byte is the &lt;code&gt;admin&lt;/code&gt; flag. By offloading the “schema” to the application code, the payload remains 100% data and 0% overhead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Typed Serialization (DTM)
&lt;/h2&gt;

&lt;p&gt;While shared context covers most scenarios, there are cases where we simply don’t know the data type in advance. This is common when the receiver is expecting to receive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One of several completely different types (e.g., an event stream that could be a &lt;code&gt;LoginEvent&lt;/code&gt; or a &lt;code&gt;LogoutEvent&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;One of several versions of the same data structure (facilitating smooth schema migrations).&lt;/li&gt;
&lt;li&gt;A concrete implementation of an interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In these dynamic cases, we use DTM (Data Type Metadata) — a simple prefix added to your payload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DTM + Data = Typed Data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By reading the DTM first, the receiver can determine exactly which type is coming next. The beauty of this approach is that it maps complex architectural problems onto simple switch logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Different Types
&lt;/h3&gt;

&lt;p&gt;When incoming data (from a network, a database, or a file) can represent different structures, the DTM acts as the router.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Foo&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Bar&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;FooDTM&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;BarDTM&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;UnmarshalDifferentTypes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;dtm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;UnmarshalDTM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="n"&gt;dtm&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;FooDTM&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
      &lt;span class="c"&gt;// unmarshal and handle Foo&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;BarDTM&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
      &lt;span class="c"&gt;// unmarshal and handle Bar&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Data Versioning
&lt;/h3&gt;

&lt;p&gt;Instead of adding optional fields that bloat your struct, MUS uses explicit versioning. By using DTMs to distinguish between versions, you keep your current data structures clean and move migration logic into an unmarshaling step.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Foo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FooV2&lt;/span&gt; &lt;span class="c"&gt;// current version&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;FooV1&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;FooV2&lt;/span&gt;

&lt;span class="c"&gt;// DTMs represent both the type and the version.&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;FooV1DTM&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;FooV2DTM&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;UnmarshalWithVersioning&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Foo&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt; &lt;span class="n"&gt;Foo&lt;/span&gt;
  &lt;span class="n"&gt;dtm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;UnmarshalDTM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="n"&gt;dtm&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;FooV1DTM&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
      &lt;span class="c"&gt;// unmarshal FooV1, migrate to FooV2, assign to foo&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;FooV2DTM&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
      &lt;span class="c"&gt;// unmarshal FooV2, assign to foo&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Interface Serialization
&lt;/h3&gt;

&lt;p&gt;To serialize an interface, each concrete implementation encodes itself as typed data. During unmarshaling, the DTM tells you which specific struct to instantiate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Interface&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Impl1&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Impl2&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Impl1DTM&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Impl2DTM&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;UnmarshalInterface&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Interface&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;intr&lt;/span&gt; &lt;span class="n"&gt;Interface&lt;/span&gt;
  &lt;span class="n"&gt;dtm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;UnmarshalDTM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="n"&gt;dtm&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;Impl1DTM&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
      &lt;span class="c"&gt;// unmarshal Impl1, assign to intr&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;Impl2DTM&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
      &lt;span class="c"&gt;// unmarshal Impl2, assign to intr&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;intr&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Streaming Support
&lt;/h2&gt;

&lt;p&gt;MUS is naturally streaming-ready. Because the format is a deterministic sequence of fields where every type carries its own size, you don’t need to know the total data length in advance. You can start writing to the wire immediately, field by field.&lt;/p&gt;

&lt;h3&gt;
  
  
  Processing on the Fly
&lt;/h3&gt;

&lt;p&gt;Once the receiver identifies the type, via DTM or protocol context, it can begin decoding as soon as the first bytes arrive, consuming exactly the right number of bytes per field without any envelope. This enables non-blocking, low-RAM processing for high-throughput systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementations
&lt;/h2&gt;

&lt;p&gt;At the moment, the MUS ecosystem is focused on the Go programming language. This includes the core serializer, the DTM support modules, and their respective streaming variants.&lt;/p&gt;

&lt;p&gt;Because the format is built on a minimalist specification, it is highly portable. If you’re interested in bringing the “no-tax” philosophy to other languages like Rust, C++, or Java, the spec is ready for implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/mus-format/specification" rel="noopener noreferrer"&gt;specification&lt;/a&gt;: The format definition.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/mus-format/mus-go" rel="noopener noreferrer"&gt;mus&lt;/a&gt;: The core Go implementation.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/mus-format/mus-stream-go" rel="noopener noreferrer"&gt;mus-stream&lt;/a&gt;: The streaming version of &lt;code&gt;mus&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;MUS isn’t trying to be a “JSON killer.” It’s a tool for when you need high performance, minimal payloads, and absolute control over your memory allocations. By moving metadata out of the payload and making “Size” a first-class citizen, MUS lets you write more efficient code without the overhead of heavy frameworks.&lt;/p&gt;

</description>
      <category>go</category>
      <category>performance</category>
      <category>serialization</category>
      <category>distributedsystems</category>
    </item>
  </channel>
</rss>
