<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Compiler on digitalitem: Claude skills library and product lab</title><link>https://digitalitem.online/en/tags/compiler/</link><description>Recent content in Compiler on digitalitem: Claude skills library and product lab</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 22 Oct 2026 10:05:00 +0000</lastBuildDate><atom:link href="https://digitalitem.online/en/tags/compiler/index.xml" rel="self" type="application/rss+xml"/><item><title>Database Kernel (1): Bind Is Semantic Analysis, Not Syntax Checking</title><link>https://digitalitem.online/en/posts/plan-bind-and-cte/</link><pubDate>Thu, 22 Oct 2026 10:05:00 +0000</pubDate><guid>https://digitalitem.online/en/posts/plan-bind-and-cte/</guid><description>&lt;p&gt;People often assume SQL parsing means &amp;ldquo;turn the string into a tree&amp;rdquo; and then execution can start. The step in between — &lt;strong&gt;bind&lt;/strong&gt; — is the most underrated: it decides which table and column every name refers to, in which scope.&lt;/p&gt;
&lt;p&gt;This is the first post in the &lt;a href="https://github.com/daviszhen/plan"&gt;plan&lt;/a&gt; implementation series: what bind does, and why the order matters.&lt;/p&gt;
&lt;h2 id="1-four-components"&gt;1. Four components&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Builder&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The driver for semantic analysis, one per select; also holds partial results&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;BindContext&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A scope: which relations are visible here; scopes nest&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Binding&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The definition of a relation (table or subquery) and its columns&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Expr&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Everything except relations becomes an expression&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The key design is &lt;strong&gt;nested BindContexts&lt;/strong&gt;: a subquery isn&amp;rsquo;t &amp;ldquo;a new parser&amp;rdquo;, it&amp;rsquo;s a new scope on top of the parent. Name lookup walks up until it finds something or errors.&lt;/p&gt;</description></item></channel></rss>