<?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>DEV Community: AAGASTYA VERMA 2012</title>
    <description>The latest articles on DEV Community by AAGASTYA VERMA 2012 (@thegreninjafan).</description>
    <link>https://dev.to/thegreninjafan</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4153947%2F15e45eee-e469-4fed-85ac-5c511dcc5c41.jpg</url>
      <title>DEV Community: AAGASTYA VERMA 2012</title>
      <link>https://dev.to/thegreninjafan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thegreninjafan"/>
    <language>en</language>
    <item>
      <title>I turned notebook pseudocode into a real programming language — C++17 VM and all</title>
      <dc:creator>AAGASTYA VERMA 2012</dc:creator>
      <pubDate>Thu, 01 Oct 2026 07:30:55 +0000</pubDate>
      <link>https://dev.to/thegreninjafan/i-turned-notebook-pseudocode-into-a-real-programming-language-c17-vm-and-all-1172</link>
      <guid>https://dev.to/thegreninjafan/i-turned-notebook-pseudocode-into-a-real-programming-language-c17-vm-and-all-1172</guid>
      <description>&lt;p&gt;The first program I ever wrote was in a school notebook. A guessing game, in plain steps: &lt;em&gt;pick a number, ask the player, if too low say "too low."&lt;/em&gt; I couldn't run it, obviously. Notebooks don't have compilers.&lt;/p&gt;

&lt;p&gt;That annoyed me more than it should have. Every beginner can write an algorithm in plain language — the syntax is the gatekeeper, not the logic. So a year ago, at 13, I started building the unreasonable version of the fix: a programming language where the pseudocode &lt;strong&gt;is&lt;/strong&gt; the code.&lt;/p&gt;

&lt;p&gt;This week it hit v0.4.1 — a native VM written from scratch in C++17, zero dependencies, and an AOT backend that compiles your program to machine code. It's called X++ (more on the name later, unfortunately).&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/aagastyaverma6-sys" rel="noopener noreferrer"&gt;
        aagastyaverma6-sys
      &lt;/a&gt; / &lt;a href="https://github.com/aagastyaverma6-sys/XPP" rel="noopener noreferrer"&gt;
        XPP
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      X++ is a versatile and superfast programming language made by Aagastya Verma i.e. Atom Software. It contains various modes with different speeds and a included a fully semantic, algorithmic mode using OpenRouter API.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/aagastyaverma6-sys/XPP/icons/xpp-logo.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Faagastyaverma6-sys%2FXPP%2FHEAD%2Ficons%2Fxpp-logo.png" alt="X++ logo"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;X++ (XPlusPlus) v0.4.1&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Programming For Everyone&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Same pseudocode. Same ease. Now a real native VM.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;X++ is an intent-driven language: you write &lt;strong&gt;strict pseudocode&lt;/strong&gt; (or loose English steps for the AI mode), type one command, and it &lt;em&gt;booms&lt;/em&gt;. Version 0.4.1 adds a &lt;strong&gt;zero-dependency native VM&lt;/strong&gt; (C++17) so your programs run &lt;strong&gt;without Python&lt;/strong&gt; — the Python stack is still available for the legacy and AI paths.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ease of Python&lt;/strong&gt; – pseudocode syntax, automatic garbage collection, no pointers, no manual memory management, no build files. Write the code, type &lt;code&gt;x run app.xp&lt;/code&gt;, done.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed of native code&lt;/strong&gt; – ZITR is a fast stack VM; ZJIT compiles your &lt;code&gt;.xp&lt;/code&gt; straight to machine code (via portable C++ emitted by the backend, compiled with your system compiler).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unmatched compatibility&lt;/strong&gt; – the VM and the native backend are pure C++17 and build on Windows / Linux / macOS. Same bytecode &lt;code&gt;.xbc&lt;/code&gt; (&lt;code&gt;.bc&lt;/code&gt;)…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/aagastyaverma6-sys/XPP" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  What it looks like
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;RNM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ZITR&lt;/span&gt;

&lt;span class="n"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&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;n&lt;/span&gt;
  &lt;span class="n"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;end&lt;/span&gt;

&lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;fib&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a complete program. &lt;code&gt;x run fib.xp&lt;/code&gt; prints the table.&lt;/p&gt;

&lt;p&gt;The entire language fits in a tweet's worth of rules: blocks end with &lt;code&gt;end&lt;/code&gt;. No types, no brackets, no semicolons. &lt;code&gt;push 4 to nums&lt;/code&gt; reads like what it does. Errors say &lt;code&gt;division by zero&lt;/code&gt;, not &lt;code&gt;TypeError: unsupported operand type(s) for /: 'int' and 'int'&lt;/code&gt;. Errors you can catch, too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;safe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;fail&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;caught:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
&lt;span class="n"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists, dicts, &lt;code&gt;loop x in list&lt;/code&gt;, &lt;code&gt;loop i from 1 to 10 step 2&lt;/code&gt;, closures, recursion, &lt;code&gt;and&lt;/code&gt;/&lt;code&gt;or&lt;/code&gt; that short-circuit. That's the whole shape of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it got out of hand
&lt;/h2&gt;

&lt;p&gt;v0.3 was, I'll admit it, a Python transpiler. X++ went in, Python came out, &lt;code&gt;exec&lt;/code&gt; happened. It worked! It also felt like cheating. And it meant my "language" died without Python installed and ran at Python speed.&lt;/p&gt;

&lt;p&gt;So for v0.4 I wrote a real engine — no dependencies, pure C++17:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;NaN-boxed values.&lt;/strong&gt; Int, float, string, list, dict, function, builtin — all in one machine word. Fun consequence I discovered the hard way: &lt;code&gt;nil + 1&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; instead of erroring, because the nil tag collides with a float path in my arithmetic. I've been calling it "nil propagation" until someone convinces me it's a bug.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Arena garbage collection.&lt;/strong&gt; No reference counting, no manual freeing. You write pseudocode; the VM cleans up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A flat, non-recursive dispatch loop.&lt;/strong&gt; A function call pushes a frame and the loop re-fetches it — no C++ recursion. My v0.1 interpreter was recursive and crashed around 100 frames deep. Recursion now works past 20,000.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ZJIT&lt;/strong&gt;, the fun one: it transpiles your program into a single self-contained C++ file (runtime inlined), compiles it with your system's g++/clang, and caches the binary — rebuilds only when the source changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You pick the engine with one header line: &lt;code&gt;RNM=ZITR&lt;/code&gt; (VM), &lt;code&gt;RNM=ZCOM&lt;/code&gt; (bytecode AOT), &lt;code&gt;RNM=ZJIT&lt;/code&gt; (native). Same &lt;code&gt;.xp&lt;/code&gt; file, same language, three different machines underneath.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers, asterisks included
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workload&lt;/th&gt;
&lt;th&gt;CPython 3.11&lt;/th&gt;
&lt;th&gt;ZITR (my VM)&lt;/th&gt;
&lt;th&gt;ZJIT (native AOT)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;sum 1..5,000,000&lt;/td&gt;
&lt;td&gt;381 ms&lt;/td&gt;
&lt;td&gt;202 ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;50 ms&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fib(28), recursive&lt;/td&gt;
&lt;td&gt;55 ms&lt;/td&gt;
&lt;td&gt;91 ms&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;10 ms&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Asterisks, because I'd rather say them first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One machine, my machine (Linux x86-64, g++ 12.2). &lt;code&gt;bash bench/test_all.sh&lt;/code&gt; reproduces everything — run it and post your numbers, good or bad.&lt;/li&gt;
&lt;li&gt;ZJIT times exclude the first build (~1s, then cached).&lt;/li&gt;
&lt;li&gt;Yes, you read the table right: &lt;strong&gt;my VM loses the recursive fib to CPython.&lt;/strong&gt; Call overhead is real and it's my next battle — a register JIT with profiling feedback is on the roadmap. I'd rather show the loss than hide it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  I diffed my language against itself
&lt;/h2&gt;

&lt;p&gt;The project's website has a playground that runs X++ entirely in your browser — a full JavaScript port of the VM's semantics. I didn't trust myself to write the same language twice (correctly, it turns out), so I built a test harness that runs 40+ programs on both engines and requires &lt;strong&gt;byte-identical stdout, stderr, and exit codes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It caught real things. My favorite: while porting &lt;code&gt;sum()&lt;/code&gt;, I discovered the native version drops the integer total if a float shows up later in the list — a genuine bug in my C++ accumulator. I reproduced it faithfully in the JavaScript port anyway, because right now divergence scares me more than bugs. Both get fixed in 0.4.2. Fidelity first, correctness second, apparently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things I got wrong (an incomplete list)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The name.&lt;/strong&gt; Microsoft Dynamics has had a language called X++ for decades. I found out after I'd committed. Genuinely collecting suggestions.&lt;/li&gt;
&lt;li&gt;My first interpreter blew the stack at 100 recursion frames and I shipped it anyway.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;sum()&lt;/code&gt; thing above.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Playground (browser, no install):&lt;/strong&gt; &lt;a href="https://xpplang.vercel.app/playground.html" rel="noopener noreferrer"&gt;https://xpplang.vercel.app/playground.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code (GPL-3.0):&lt;/strong&gt; &lt;a href="https://github.com/aagastyaverma6-sys/XPP" rel="noopener noreferrer"&gt;https://github.com/aagastyaverma6-sys/XPP&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learn X++ in 15 minutes:&lt;/strong&gt; &lt;a href="https://xpplang.vercel.app/docs.html" rel="noopener noreferrer"&gt;https://xpplang.vercel.app/docs.html&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What's next: modules (&lt;code&gt;use "file.xp"&lt;/code&gt;), a register JIT with profiling feedback, and native FFI.&lt;/p&gt;

&lt;p&gt;The part of a project you can't see from the inside is the part you got wrong — so benchmark it, break it, open issues, argue with me about &lt;code&gt;end&lt;/code&gt; vs indentation. The feedback form on the site goes straight to my inbox and the issue tracker is right there. Sharp feedback is the most useful thing you can hand me.&lt;/p&gt;

&lt;h2&gt;
  
  
  VERY BIG NOTE
&lt;/h2&gt;

&lt;p&gt;The website html and css was LLM generated, so if you smell AI there then you are right, also same is true for the readme because I don't have the skills to write a proper cool README so sorry for that too.&lt;/p&gt;

&lt;p&gt;— Aagastya Verma · Atom Software &lt;/p&gt;

</description>
      <category>showdev</category>
      <category>cpp</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
