<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>编译器 on 吾思 梦阁</title><link>https://wstek.win/tags/%E7%BC%96%E8%AF%91%E5%99%A8/</link><description>Recent content from 吾思 梦阁</description><generator>Hugo</generator><language>zh-cn</language><managingEditor>wusitech@qq.com (WuSi09)</managingEditor><webMaster>wusitech@qq.com (WuSi09)</webMaster><copyright>本博客所有文章除特别声明外，均采用 BY-NC-SA 许可协议。转载请注明出处！</copyright><lastBuildDate>Sun, 08 Nov 2026 21:30:00 +0800</lastBuildDate><atom:link href="https://wstek.win/tags/%E7%BC%96%E8%AF%91%E5%99%A8/index.xml" rel="self" type="application/rss+xml"/><item><title>笑笑传之日⑨语言</title><link>https://wstek.win/posts/df9-dumbfuck/</link><pubDate>Sun, 08 Nov 2026 21:30:00 +0800</pubDate><author>wusitech@qq.com (WuSi09)</author><guid>https://wstek.win/posts/df9-dumbfuck/</guid><description>
<![CDATA[<h1>笑笑传之日⑨语言</h1><p>作者：WuSi09（wusitech@qq.com）</p>
        
          <p><strong>dumbfuck⑨</strong>，缩写 <strong>DF9</strong>，中文名 <strong>日⑨</strong>。仓库在 <a href="https://github.com/WuSiTech/dumbfxxk">WuSiTech/dumbfxxk</a>。</p>
<p>先看它的 Hello World：</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">DFI4main0,F3PRThello DF9;RET0&#39;
</span></span></code></pre></div><p>一行，没有空格，没有分号结尾，没有 <code>#include</code>。它打印 <code>hello DF9</code>，然后正常退出。</p>
<p>DF9 的每个缩写理论上都能解释：<code>DFI4main</code> = <strong>D</strong>efine <strong>F</strong>unction <strong>I</strong>nt，名字长度 <strong>4</strong>，名字 <code>main</code>。但解释完你还是看不懂——这正是它想要的效果。</p>
<p><a class="article-gallery-item" href="/images/posts/df9/pipeline.svg"><img src="/images/posts/df9/pipeline.svg" alt="从 .df 到可执行文件" loading="lazy" decoding="async" onload="this.parentNode.dataset.pswpWidth=this.naturalWidth;this.parentNode.dataset.pswpHeight=this.naturalHeight"></a>
</p>
<p>这篇文章按“先跑起来 → 语法 → 代码生成 → 运行时 → 自举 → 一行红黑树 → 编译器实现”的顺序拆。所有示例都在 Windows + MinGW-w64 GCC 11.5 + 仓库自带 <code>df9.exe</code> 上实际编译运行过。</p>
<h2 id="0x00-为什么会有这门语言">
<a class="header-anchor" href="#0x00-%e4%b8%ba%e4%bb%80%e4%b9%88%e4%bc%9a%e6%9c%89%e8%bf%99%e9%97%a8%e8%af%ad%e8%a8%80"></a>
0x00 为什么会有这门语言
</h2><p>整活</p>
<h2 id="0x10-先跑起来">
<a class="header-anchor" href="#0x10-%e5%85%88%e8%b7%91%e8%b5%b7%e6%9d%a5"></a>
0x10 先跑起来
</h2><h3 id="0x11-构建编译器">
<a class="header-anchor" href="#0x11-%e6%9e%84%e5%bb%ba%e7%bc%96%e8%af%91%e5%99%a8"></a>
0x11 构建编译器
</h3><p>需要 GCC / MinGW。</p>
<p>Linux：</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">g++ -std<span class="o">=</span>c++17 -O2 df9.cpp -o df9
</span></span></code></pre></div><p>Windows（MinGW-w64）：</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bat" data-lang="bat"><span class="line"><span class="cl">g++ -std=c++17 -O2 -static -static-libstdc++ -static-libgcc df9.cpp -o df9.exe
</span></span></code></pre></div><p>仓库里已经带了能跑的 <code>df9.exe</code>。</p>
        
        <hr><p>本文2026-11-08首发于<a href='https://wstek.win/'>吾思 梦阁</a>，最后修改于2026-11-08</p>]]></description><category>编程</category></item></channel></rss>