<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Yash Arya Publiction Hashnode]]></title><description><![CDATA[Yash Arya Publiction Hashnode]]></description><link>https://yasharya.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6accc13705ad79716a6c579f/7e26b35b-c489-4712-a49f-401b72543a6d.png</url><title>Yash Arya Publiction Hashnode</title><link>https://yasharya.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 26 Oct 2026 10:02:07 GMT</lastBuildDate><atom:link href="https://yasharya.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Introducing Ion+: Building a Custom Low-Level Programming Language from Scratch in Python]]></title><description><![CDATA[Ion+ (Ion Plus), a custom C-like low-level programming language built from scratch in Python. Explore the custom Lexer, AST parser, and GitHub repo]]></description><link>https://yasharya.hashnode.dev/build-custom-programming-language-ion-plus</link><guid isPermaLink="true">https://yasharya.hashnode.dev/build-custom-programming-language-ion-plus</guid><category><![CDATA[Python]]></category><category><![CDATA[Python 3]]></category><category><![CDATA[programming language]]></category><category><![CDATA[compiler design]]></category><category><![CDATA[#CompilerDesign]]></category><category><![CDATA[Ion plus]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[low level programming]]></category><category><![CDATA[low level system design]]></category><category><![CDATA[low-level programming language]]></category><category><![CDATA[ast]]></category><category><![CDATA[Python ast]]></category><category><![CDATA[low level design]]></category><category><![CDATA[Systems Programming]]></category><category><![CDATA[Systems Architecture]]></category><category><![CDATA[System Design]]></category><dc:creator><![CDATA[yash arya]]></dc:creator><pubDate>Wed, 21 Oct 2026 08:04:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6accc13705ad79716a6c579f/96d1f982-c72d-4d52-8015-4f51e9db0065.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Have you ever loved the raw speed and power of C, but wished it had a cleaner, more modern syntax?</p>
<p>That is exactly the problem I set out to solve when I started building <strong>Ion+</strong> (Ion Plus). I wanted to create a low-level programming language that tracks indentation, uses clean syntax, and provides a powerful frontend foundation. Today, I am excited to share the early-stage development of the Ion+ compiler, written entirely in Python, and walk you through how the Lexer and Abstract Syntax Tree (AST) parser work under the hood.</p>
<p><strong>Check out the source code on GitHub:</strong> <a href="https://github.com/YashAryaPersonal/ion-plus">https://github.com/YashAryaPersonal/ion-plus</a></p>
<hr />
<img src="https://cdn.hashnode.com/uploads/covers/6accc13705ad79716a6c579f/c8705f45-ec92-4e48-a295-4df9b893e3e0.png" alt="Ion Plus Logo" style="display:block;margin:0 auto" />

<h2>What is Ion+?</h2>
<p>Ion+ (with source files ending in <code>.ionx</code>) is a custom programming language project focused on building a robust compiler frontend. The ultimate vision is a C-like systems programming language, but without the clutter of traditional brackets and semicolons. Instead, it relies on clean indentation and block structures.</p>
<p>Right now, the project is heavily focused on the frontend compiler stages. The compiler can successfully:</p>
<ul>
<li>Read custom <code>.ionx</code> source files.</li>
<li>Tokenize complex keywords, operators, literals, and identifiers.</li>
<li>Detect and handle indentation and block structures perfectly.</li>
<li>Parse variable declarations and basic expressions.</li>
<li>Construct detailed AST-like (Abstract Syntax Tree) nodes for future type checking and code generation.</li>
</ul>
<hr />
<img src="https://cdn.hashnode.com/uploads/covers/6accc13705ad79716a6c579f/26dde2fb-cdd7-4a96-8210-91e32039b88c.png" alt="Ion-plus In-Progress Working Image" style="display:block;margin:0 auto" />

<h2>The Syntax: Clean, Readable, and Low-Level</h2>
<p>To give you an idea of the direction Ion+ is heading, here is an example of what the syntax looks like. Notice how it blends the low-level memory concepts of C (like pointers and structs) with the highly readable block indentation of Python:</p>
<pre><code class="language-ionx">struct Buffer:
    int size
    ptr byte data

?int Buffer.validate(int max_size):
    if size &lt;= 0 or size &gt;= max_size:
        return none
    return size
</code></pre>
<p>It is designed to feel intuitive while keeping you close to the hardware!</p>
<hr />
<h2>How the Compiler Frontend Works</h2>
<p>Building a compiler from scratch is a massive architectural challenge. For Ion+, I wrote the entire toolchain in Python.</p>
<p>Here is the exact straightforward flow the Ion+ compiler uses to process code:</p>
<ol>
<li><strong>File Reading:</strong> The compiler ingests the <code>.ionx</code> file.</li>
<li><strong>Scanning (Lexical Analysis):</strong> The <code>scanner.py</code> breaks the raw text down into recognizable tokens (keywords, literals, etc.).</li>
<li><strong>Indentation Handling:</strong> A custom post-lexer processes whitespace, tracking indentation levels to determine block scope without needing <code>{ }</code> brackets.</li>
<li><strong>Parsing:</strong> The <code>core_parser.py</code> and <code>main_parser.py</code> read the token stream and parse them based on the language's grammar.</li>
<li><strong>AST Construction:</strong> Finally, the tokens are mapped into structured objects inside <code>nodes.py</code> to prepare for the backend semantic work.</li>
</ol>
<h3>An Inside Look at the AST Output</h3>
<p>When you run the compiler using <code>PYTHONPATH=. python test/main.py</code>, it generates a beautifully structured Abstract Syntax Tree. For a simple variable declaration with modifiers (like <code>const volatile int x = 10</code>), Ion+ generates this precise output:</p>
<pre><code class="language-python">Program(
  line=1, 
  col=0, 
  body=[
    VariableDeclaration(
      line=1, 
      col=16, 
      type=Int(line=1, col=20, is_custom=False), 
      identifier=Identifier(line=1, col=20, value='x'), 
      value=IntegerLiteral(line=1, col=26, value='10'), 
      modifiers=[Const(line=1, col=7), Volatile(line=1, col=16)]
      )
    ], 
  name='test2.ionx'
)
</code></pre>
<p>As you can see, every single token is tracked with precise line and column numbers, which is crucial for building the custom error-reporting engine inside the <code>compiler/Errors</code> module!</p>
<hr />
<h2>Project Architecture</h2>
<p>If you want to dive into the codebase, I have kept the architecture modular and easy to navigate.</p>
<ul>
<li><strong>/compiler/Lexer</strong> — Where the magic of token generation and indentation handling happens.</li>
<li><strong>/compiler/Parser</strong> — The brain of the frontend, containing parsing logic and AST node definitions.</li>
<li><strong>/compiler/Errors</strong> — Custom error utility tracking.</li>
<li><strong>/test</strong> — Sample <code>.ionx</code> source files and the main runner entry point.</li>
</ul>
<hr />
<h2>What's Next for Ion Plus?</h2>
<p>Ion+ is still in its early stages. The Lexer and Parser ( not complete ) working beautifully, and the AST is growing every day. The next major hurdles include expanding statement handling, expression parsing, full language semantics, and eventually building out the execution backend.</p>
<p>In future this language will replace traditional C/C++ heap or other slow old logic with new <code>arena</code> based memory infrastructure which will remove traditional error causes like <code>Double Free</code>, <code>Memory Leak</code> etc.</p>
<p>Building a programming language and learning compiler design from scratch has been an incredible journey. If you are interested in parsing, ASTs, or language design, I would love for you to check it out!</p>
<p>Help and Advice Needed for improving my language!!</p>
<p><strong>Star the repo on GitHub:</strong> <a href="https://github.com/YashAryaPersonal/ion-plus">YashAryaPersonal/ion-plus</a></p>
<p><strong>Let's connect:</strong> You can find me on <a href="https://discord.com/users/1551194367627239545">Discord here</a>.</p>
]]></content:encoded></item></channel></rss>