<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>https://expr-lang.org/blog</id>
    <title>Expression language Blog</title>
    <updated>2024-08-16T00:00:00.000Z</updated>
    <generator>https://github.com/jpmonette/feed</generator>
    <link rel="alternate" href="https://expr-lang.org/blog"/>
    <subtitle>Expression language Blog</subtitle>
    <icon>https://expr-lang.org/favicon.png</icon>
    <entry>
        <title type="html"><![CDATA[Exploring Virtual Machines for Embedded Languages]]></title>
        <id>https://expr-lang.org/blog/exploring-virtual-machines-for-embedded-languages-in-go</id>
        <link href="https://expr-lang.org/blog/exploring-virtual-machines-for-embedded-languages-in-go"/>
        <updated>2024-08-16T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[During my tenure at Google, I had the opportunity to work with several talented interns. One of them, Maria Chizhova,]]></summary>
        <content type="html"><![CDATA[<p>During my tenure at Google, I had the opportunity to work with several talented interns. One of them, Maria Chizhova,
undertook an impressive research project for her master’s thesis titled “Investigation of Virtual Machines for
Embedded Languages in Go.” In her study, Maria compared different types of virtual machines tailored for embedded
languages, a task crucial for ensuring high performance in various applications.</p>
<p>Embedded languages, which are specialized languages written within another language, often require efficient virtual
machines to optimize performance. Maria’s research, conducted within the innovative environment at Google, involved
implementing and benchmarking five distinct types of virtual machines: a tree-traversal VM, three variations of
stack-based VMs, and a register-based VM.</p>
<p>One notable aspect of her research was the use of Google Cloud Platform (GCP) for performance monitoring and analysis.
Leveraging GCP’s robust infrastructure provided detailed insights into the performance characteristics of each virtual
machine type under different scenarios, ensuring accurate and comprehensive results.</p>
<p>For those interested in a deep dive into her findings, we have made Maria Chizhova’s complete thesis available for
<a href="https://expr-lang.org/assets/files/Study%20of%20virtual%20machine%20implementation%20for%20embedded%20languages%20in%20Go%20programming%20language-5ca4f7f4a2aa33c8ef862f1a0e9d53e9.pdf" target="_blank" class="">download here</a>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="benchmark-performance-of-various-virtual-machines">Benchmark Performance of Various Virtual Machines<a href="https://expr-lang.org/blog/exploring-virtual-machines-for-embedded-languages-in-go#benchmark-performance-of-various-virtual-machines" class="hash-link" aria-label="Direct link to Benchmark Performance of Various Virtual Machines" title="Direct link to Benchmark Performance of Various Virtual Machines" translate="no">​</a></h3>
<p>Below is a graph illustrating the performance of various virtual machines based on different benchmarks such as Sum from
1 to 200, Alternating Sum from 1 to 200, String Concatenation, String Comparison &amp; Logic Operations, and Sum of External
Variables.</p>
<p><img decoding="async" loading="lazy" alt="Benchmark Comparison of Different Virtual Machines in Go.png" src="https://expr-lang.org/assets/images/Benchmark%20Comparison%20of%20Different%20Virtual%20Machines%20in%20Go-c6c358dc05c7a5d1bf046225b94879fc.png" width="1071" height="604" class="img_ev3q"></p>
<p>The graph shows the execution time (in nanoseconds) for each benchmark across different types of virtual machines:</p>
<ul>
<li class="">Tree Traversal VM</li>
<li class="">Single Stack VM</li>
<li class="">Multiple Stack VM</li>
<li class="">Reflective VM</li>
<li class="">Register-based VM</li>
</ul>
<p>Each benchmark provides a comparative view of how each VM type performs under specific conditions.</p>
<p>For instance, the Tree Traversal VM shows higher execution times across most benchmarks, indicating it is less efficient
compared to other VM types. On the other hand, the Register-based VM consistently shows the lowest execution times,
suggesting it is the most efficient among the evaluated VMs.</p>
<p>This visual comparison highlights the strengths and weaknesses of each VM type, helping developers choose the most
suitable VM for their specific embedded language requirements.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="impact-on-the-development-of-the-expr-language">Impact on the Development of the Expr Language<a href="https://expr-lang.org/blog/exploring-virtual-machines-for-embedded-languages-in-go#impact-on-the-development-of-the-expr-language" class="hash-link" aria-label="Direct link to Impact on the Development of the Expr Language" title="Direct link to Impact on the Development of the Expr Language" translate="no">​</a></h2>
<p>Maria’s research has had a significant impact on our work on the Expr language. By thoroughly evaluating the performance
of different virtual machines, we were able to identify the most efficient approaches for implementing the core of Expr.
Specifically, the insights gained from the performance of stack-based and register-based VMs guided us in optimizing our
execution engine, resulting in faster and more reliable expression evaluation.</p>
<p>Moreover, the use of GCP for performance monitoring and analysis has influenced our ongoing development practices,
ensuring that Expr remains not only powerful but also highly efficient. As a result, users of the Expr language can
expect improved performance in real-world applications, particularly in scenarios requiring high throughput and low
latency.</p>]]></content>
        <author>
            <name>Anton Medvedev</name>
            <uri>https://github.com/antonmedv</uri>
        </author>
        <author>
            <name>Maria Chizhova</name>
            <uri>https://github.com/MariaChizhova</uri>
        </author>
        <category label="expr" term="expr"/>
        <category label="golang" term="golang"/>
        <category label="virtual-machine" term="virtual-machine"/>
        <category label="google" term="google"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Prime Numbers with Expr]]></title>
        <id>https://expr-lang.org/blog/prime-numbers-with-expr</id>
        <link href="https://expr-lang.org/blog/prime-numbers-with-expr"/>
        <updated>2024-02-29T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[prime-numbers-with-expr.webp]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="prime-numbers-with-expr.webp" src="https://expr-lang.org/assets/images/prime-numbers-with-expr-9c02ee658aeaf2fc69713178836ba144.webp" width="1600" height="914" class="img_ev3q"></p>
<p>Welcome to an adventurous dive into the world of prime numbers, guided by none other than Expr, the sleek and flexible
expressions language designed for Go. Whether you're safeguarding your business rules or simply indulging in the
mathematical elegance of primes, Expr is your trusty sidekick. Today, we're embarking on a quest to uncover prime
numbers in ways that are as engaging as they are enlightening. So, grab your math hat (yes, that's a thing now), and
let's get started!</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="prime-check-is-my-number-a-lone-wolf">Prime Check: Is My Number a Lone Wolf?<a href="https://expr-lang.org/blog/prime-numbers-with-expr#prime-check-is-my-number-a-lone-wolf" class="hash-link" aria-label="Direct link to Prime Check: Is My Number a Lone Wolf?" title="Direct link to Prime Check: Is My Number a Lone Wolf?" translate="no">​</a></h2>
<p>First off, let's tackle the burning question: "Is my number prime?" Imagine you're at a party, and 27 walks in. You
whisper to Expr, "Hey, is 27 part of the prime clique?" Expr, always ready, responds with a slick one-liner:</p>
<div class="language-expr codeBlockContainer_Ckt0 theme-code-block" style="--prism-background-color:hsl(230, 1%, 98%);--prism-color:hsl(230, 8%, 24%)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-expr codeBlock_bY9V thin-scrollbar" style="background-color:hsl(230, 1%, 98%);color:hsl(230, 8%, 24%)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token keyword" style="color:hsl(301, 63%, 40%)">let</span><span class="token plain"> </span><span class="token constant" style="color:hsl(35, 99%, 36%)">N</span><span class="token plain"> </span><span class="token operator" style="color:hsl(221, 87%, 60%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(35, 99%, 36%)">27</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">;</span><span class="token plain"> </span><span class="token keyword" style="color:hsl(301, 63%, 40%)">none</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">(</span><span class="token number" style="color:hsl(35, 99%, 36%)">2.</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">.</span><span class="token constant" style="color:hsl(35, 99%, 36%)">N</span><span class="token operator" style="color:hsl(221, 87%, 60%)">-</span><span class="token number" style="color:hsl(35, 99%, 36%)">1</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"> </span><span class="token constant" style="color:hsl(35, 99%, 36%)">N</span><span class="token plain"> </span><span class="token operator" style="color:hsl(221, 87%, 60%)">%</span><span class="token plain"> # </span><span class="token operator" style="color:hsl(221, 87%, 60%)">==</span><span class="token plain"> </span><span class="token number" style="color:hsl(35, 99%, 36%)">0</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">)</span><br></span></code></pre></div></div>
<p>Here, Expr takes the number 27 and checks if none of the numbers from 2 to 26 can divide it without leaving a remainder.
It's like asking everyone at the party if they're best friends with 27 and finding out nobody is. Alas, 27 is not prime.
But worry not, the party goes on.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="prime-gathering-whos-coming-to-the-prime-party">Prime Gathering: Who's Coming to the Prime Party?<a href="https://expr-lang.org/blog/prime-numbers-with-expr#prime-gathering-whos-coming-to-the-prime-party" class="hash-link" aria-label="Direct link to Prime Gathering: Who's Coming to the Prime Party?" title="Direct link to Prime Gathering: Who's Coming to the Prime Party?" translate="no">​</a></h2>
<p>Next up, we're throwing a prime party and need to send invites to all prime numbers from 2 to 1000. How do we find these
exclusive guests? Expr to the rescue!</p>
<div class="language-expr codeBlockContainer_Ckt0 theme-code-block" style="--prism-background-color:hsl(230, 1%, 98%);--prism-color:hsl(230, 8%, 24%)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-expr codeBlock_bY9V thin-scrollbar" style="background-color:hsl(230, 1%, 98%);color:hsl(230, 8%, 24%)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token number" style="color:hsl(35, 99%, 36%)">2.</span><span class="token number" style="color:hsl(35, 99%, 36%)">.1000</span><span class="token plain"> </span><span class="token operator" style="color:hsl(221, 87%, 60%)">|</span><span class="token plain"> </span><span class="token keyword" style="color:hsl(301, 63%, 40%)">filter</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">(</span><span class="token keyword" style="color:hsl(301, 63%, 40%)">let</span><span class="token plain"> </span><span class="token constant" style="color:hsl(35, 99%, 36%)">N</span><span class="token plain"> </span><span class="token operator" style="color:hsl(221, 87%, 60%)">=</span><span class="token plain"> #</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">;</span><span class="token plain"> </span><span class="token keyword" style="color:hsl(301, 63%, 40%)">none</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">(</span><span class="token number" style="color:hsl(35, 99%, 36%)">2.</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">.</span><span class="token constant" style="color:hsl(35, 99%, 36%)">N</span><span class="token operator" style="color:hsl(221, 87%, 60%)">-</span><span class="token number" style="color:hsl(35, 99%, 36%)">1</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"> </span><span class="token constant" style="color:hsl(35, 99%, 36%)">N</span><span class="token plain"> </span><span class="token operator" style="color:hsl(221, 87%, 60%)">%</span><span class="token plain"> # </span><span class="token operator" style="color:hsl(221, 87%, 60%)">==</span><span class="token plain"> </span><span class="token number" style="color:hsl(35, 99%, 36%)">0</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">)</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">)</span><br></span></code></pre></div></div>
<p>This nifty line asks Expr to hand out invites to numbers from 2 to 1000, but only if they pass the prime test. It's like
having a bouncer at the door checking if the guests have any friends from 2 to one less than themselves. If not, welcome
to the party!</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="eratosthenes-sieve-the-prime-filter-party-trick">Eratosthenes' Sieve: The Prime Filter Party Trick<a href="https://expr-lang.org/blog/prime-numbers-with-expr#eratosthenes-sieve-the-prime-filter-party-trick" class="hash-link" aria-label="Direct link to Eratosthenes' Sieve: The Prime Filter Party Trick" title="Direct link to Eratosthenes' Sieve: The Prime Filter Party Trick" translate="no">​</a></h2>
<p>Now, for the grand spectacle: Eratosthenes' sieve. This ancient algorithm is like the coolest party trick for finding
primes, and yes, Expr knows it too.</p>
<div class="language-expr codeBlockContainer_Ckt0 theme-code-block" style="--prism-background-color:hsl(230, 1%, 98%);--prism-color:hsl(230, 8%, 24%)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-expr codeBlock_bY9V thin-scrollbar" style="background-color:hsl(230, 1%, 98%);color:hsl(230, 8%, 24%)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token keyword" style="color:hsl(301, 63%, 40%)">let</span><span class="token plain"> numbers </span><span class="token operator" style="color:hsl(221, 87%, 60%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(35, 99%, 36%)">2.</span><span class="token number" style="color:hsl(35, 99%, 36%)">.1000</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">;</span><span class="token plain"> </span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain"></span><span class="token keyword" style="color:hsl(301, 63%, 40%)">reduce</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">(</span><span class="token plain">numbers</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">{</span><span class="token plain"> </span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(301, 63%, 40%)">let</span><span class="token plain"> n </span><span class="token operator" style="color:hsl(221, 87%, 60%)">=</span><span class="token plain"> #</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">;</span><span class="token plain"> </span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(301, 63%, 40%)">filter</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">(</span><span class="token plain">#acc</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"> # </span><span class="token operator" style="color:hsl(221, 87%, 60%)">==</span><span class="token plain"> n </span><span class="token operator" style="color:hsl(221, 87%, 60%)">||</span><span class="token plain"> # </span><span class="token operator" style="color:hsl(221, 87%, 60%)">%</span><span class="token plain"> n </span><span class="token operator" style="color:hsl(221, 87%, 60%)">!=</span><span class="token plain"> </span><span class="token number" style="color:hsl(35, 99%, 36%)">0</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">)</span><span class="token plain"> </span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">}</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"> numbers</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">)</span><br></span></code></pre></div></div>
<p>Here, we start with a list of numbers from 2 to 1000. Then, for each number, we filter out the non-primes by keeping
only the number itself or those that it can't evenly divide. It's like having a magic sieve that only lets through the
primes. Pure sorcery!</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-memory-budget-exprs-party-limit">The Memory Budget: Expr's Party Limit<a href="https://expr-lang.org/blog/prime-numbers-with-expr#the-memory-budget-exprs-party-limit" class="hash-link" aria-label="Direct link to The Memory Budget: Expr's Party Limit" title="Direct link to The Memory Budget: Expr's Party Limit" translate="no">​</a></h2>
<p>But oh, what's this? There's a limit to how big our party can get. Expr comes with a concept called "memory budget,"
ensuring that our prime-finding escapades don't get too wild. For example:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-background-color:hsl(230, 1%, 98%);--prism-color:hsl(230, 8%, 24%)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="background-color:hsl(230, 1%, 98%);color:hsl(230, 8%, 24%)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">runtime error: memory budget exceeded (1:39)</span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain"> | 2..1_000_000 | filter(let N = #; none(2..N-1, N % # == 0))</span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain"> | .......................................^</span><br></span></code></pre></div></div>
<p>Trying to invite every prime between 2 and 1,000,000? Expr might just stop you there with a polite, "Sorry, that's
beyond my memory budget." This ingenious feature prevents our prime quest from consuming more memory than allowed,
ensuring that our computational party doesn't crash the server.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-does-expr-calculate-this-budget">How Does Expr Calculate This Budget?<a href="https://expr-lang.org/blog/prime-numbers-with-expr#how-does-expr-calculate-this-budget" class="hash-link" aria-label="Direct link to How Does Expr Calculate This Budget?" title="Direct link to How Does Expr Calculate This Budget?" translate="no">​</a></h3>
<p>Every operation in Expr has a cost, and as we weave through our expressions, these costs accumulate. Think of it as Expr
having a certain amount of "computational currency" to spend on our tasks. If our expression's cost exceeds this budget,
Expr kindly asks us to tone down the party. It's like trying to order a 5-course meal on a 2-course budget—something's
got to give!</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="conclusion-prime-time-with-expr">Conclusion: Prime Time with Expr<a href="https://expr-lang.org/blog/prime-numbers-with-expr#conclusion-prime-time-with-expr" class="hash-link" aria-label="Direct link to Conclusion: Prime Time with Expr" title="Direct link to Conclusion: Prime Time with Expr" translate="no">​</a></h2>
<p>And there you have it, folks! A whirlwind tour of finding prime numbers with the flexible and mighty Expr. From
gate-crashing non-primes to hosting the most exclusive prime parties and managing our computational budget like a true
event planner, Expr proves to be an invaluable companion in the realm of expressions.</p>
<p>Remember, the next time you're pondering the primeness of numbers or any other mathematical marvel, just call on Expr.
It's your go-to for not just business rules but for unlocking the secrets of mathematics with elegance and a sprinkle of
fun.</p>
<p>So, keep exploring, keep questioning, and most importantly, keep enjoying the mathematical festivities with Expr. Who
knew prime numbers could be this much fun?</p>]]></content>
        <author>
            <name>Anton Medvedev</name>
            <uri>https://github.com/antonmedv</uri>
        </author>
        <category label="expr" term="expr"/>
        <category label="fun" term="fun"/>
        <category label="math" term="math"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[5 Years in the Making]]></title>
        <id>https://expr-lang.org/blog/five-years-in-making</id>
        <link href="https://expr-lang.org/blog/five-years-in-making"/>
        <updated>2024-01-09T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[5-years.webp]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="5-years.webp" src="https://expr-lang.org/assets/images/5-years-in-the-making-3027499b637d609ab55a2b323be17ba4.webp" width="1600" height="1000" class="img_ev3q"></p>
<p>It's been 5 years since I started working on Expr. It's been a long journey, and I'm excited to share some of the
highlights with you.</p>
<p><strong>Introduction</strong></p>
<p>Five years back, at <a href="https://aviasales.com/" target="_blank" rel="noopener noreferrer" class="">Aviasales</a>, we were transitioning our search engine from Python to Go. Our
task was to revamp our business rule engine, but we were stuck without the right language to script these complex rules.
I stumbled upon govaluate, but it was like finding a boat with holes – abandoned and not seaworthy for our needs.</p>
<p><strong>The Birth of a New Language</strong></p>
<div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-background-color:hsl(230, 1%, 98%);--prism-color:hsl(230, 8%, 24%)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar" style="background-color:hsl(230, 1%, 98%);color:hsl(230, 8%, 24%)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token operator" style="color:hsl(221, 87%, 60%)">&amp;</span><span class="token plain">ast</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">.</span><span class="token plain">BinaryNode</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">    Operator</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">:</span><span class="token plain"> </span><span class="token string" style="color:hsl(119, 34%, 47%)">"+"</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">    Left</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">:</span><span class="token plain"> </span><span class="token operator" style="color:hsl(221, 87%, 60%)">&amp;</span><span class="token plain">ast</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">.</span><span class="token plain">IntegerNode</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">{</span><span class="token number" style="color:hsl(35, 99%, 36%)">1</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">}</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">    Right</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">:</span><span class="token plain"> </span><span class="token operator" style="color:hsl(221, 87%, 60%)">&amp;</span><span class="token plain">ast</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">.</span><span class="token plain">BinaryNode</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">        Operator</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">:</span><span class="token plain"> </span><span class="token string" style="color:hsl(119, 34%, 47%)">"*"</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">        Left</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">:</span><span class="token plain"> </span><span class="token operator" style="color:hsl(221, 87%, 60%)">&amp;</span><span class="token plain">ast</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">.</span><span class="token plain">IntegerNode</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">{</span><span class="token number" style="color:hsl(35, 99%, 36%)">2</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">}</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">        Right</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">:</span><span class="token plain"> </span><span class="token operator" style="color:hsl(221, 87%, 60%)">&amp;</span><span class="token plain">ast</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">.</span><span class="token plain">IntegerNode</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">{</span><span class="token number" style="color:hsl(35, 99%, 36%)">3</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">}</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">}</span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(119, 34%, 47%)">}</span><br></span></code></pre></div></div>
<p>That's when I rolled up my sleeves. We needed a language that wasn't just about doing the job; it needed finesse –
features like <code>all()</code> and <code>none()</code> predicates that you now see in Expr. So, I started from scratch, with a simple idea
and <a href="https://www.antlr.org/" target="_blank" rel="noopener noreferrer" class="">ANTLR</a>, a parser generator, as my initial tools. This first language version was basic –
turning input into an AST and walking through this tree to get results. It was a humble start but it worked, and it
worked well.</p>
<p><strong>Evolving with Need</strong></p>
<p>As we stretched the capabilities of our new language, we quickly realized its initial simplicity had its limits. A
pivotal moment came when I decided to abandon the parser generator we were using. The reason? It wasn't just about its
cryptic error messages, which were more puzzling than helpful. A more pressing issue was a specific bug in ANTLR's Go
version, particularly on 32-bit machines. This limitation was a deal-breaker, as I envisioned Expr to be versatile,
running seamlessly across various platforms, not restricted by such technical constraints.</p>
<p>Faced with these challenges, I took matters into my own hands. I crafted a bespoke parser from scratch. This wasn't just
about fixing bugs or expanding compatibility; it was about creating something that resonated with users. My parser was
designed to be clear, concise, and above all, user-friendly. It was a game-changer, transforming error messages from
baffling codes into understandable, actionable insights. This shift significantly enhanced the language's usability and
marked a major milestone in its evolution, setting the stage for Expr to be a versatile and accessible tool across
diverse computing environments.</p>
<p><strong>Chasing Efficiency</strong></p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-background-color:hsl(230, 1%, 98%);--prism-color:hsl(230, 8%, 24%)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="background-color:hsl(230, 1%, 98%);color:hsl(230, 8%, 24%)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">0  OpPush      &lt;1&gt;</span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">1  OpPush      &lt;2&gt;</span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">2  OpPush      &lt;3&gt;</span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">3  OpMultiply</span><br></span><span class="token-line" style="color:hsl(230, 8%, 24%)"><span class="token plain">4  OpAdd</span><br></span></code></pre></div></div>
<p>Then came the need for speed. The solution was clear – a virtual machine. I crafted a compiler to turn our AST into
bytecode, and when I got this virtual machine running, it was like hitting the turbo button. Our language wasn't just
faster; it was lightning-fast, encouraging more complex and extensive use at work. And soon, it wasn't just us at
Aviasales using it – other companies started catching on, and my little project began to grow wings.</p>
<p><strong>Community Engagement and Growth</strong></p>
<p>Expr's journey has been a testament to the power of community and innovation. Beginning with blog posts and
presentations at conferences like <a class="" href="https://expr-lang.org/blog/expr-at-gowayfest-2018">this one</a>, Expr has captured the
attention of the programming world. Today, it's thrilling to see it being embraced by a diverse and growing community,
including developers and companies worldwide.</p>
<p>The impact of Expr has reached global proportions, with industry giants like Uber, ByteDance, GoDaddy, Philips,
and Google (<a href="http://google3/third_party/golang/expr" target="_blank" rel="noopener noreferrer" class="">google3/third_party/golang/expr</a>) integrating it into their ecosystems. This widespread
adoption underscores the language's versatility and effectiveness in addressing complex programming needs.</p>
<p>Feedback from this vibrant community has been a cornerstone of Expr's development. Feature requests and bug reports have
been particularly insightful, shedding light on how Expr is used in various contexts and what enhancements are most
desired by users. This direct input has been invaluable in steering the language's evolution.</p>
<p>In response to every bug report, I've created a unit test, ensuring that each issue, once resolved, stays fixed. This
commitment to quality and continuous improvement has been key in building trust and reliability within the Expr
community.</p>
<p><strong>Looking Ahead: The Future of Expr</strong></p>
<p>The journey of Expr is far from over. As it gains momentum, being used by renowned companies and developers, the future
looks bright and full of potential. My vision is to keep Expr dynamic, continually evolving to meet the changing demands
of the tech world.</p>
<p>The roadmap for Expr includes several exciting features that are currently in development. These upcoming enhancements
are designed to further solidify Expr's position as a powerful tool in the programming landscape, offering new
capabilities that I believe will be enthusiastically received by the community.</p>
<p>Expr's niche focus on the Golang community and business rule engines, coupled with its growing popularity in major tech
companies, positions it uniquely in the field of programming languages. As the technology landscape evolves, Expr is set
to evolve with it, meeting the challenges and embracing the opportunities that lie ahead in this specialized domain.</p>]]></content>
        <author>
            <name>Anton Medvedev</name>
            <uri>https://github.com/antonmedv</uri>
        </author>
        <category label="expr" term="expr"/>
        <category label="golang" term="golang"/>
        <category label="open-source" term="open-source"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Expr at GoWayFest 2019]]></title>
        <id>https://expr-lang.org/blog/expr-at-gowayfest-2019</id>
        <link href="https://expr-lang.org/blog/expr-at-gowayfest-2019"/>
        <updated>2019-07-06T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[GoWayFest]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="GoWayFest" src="https://expr-lang.org/assets/images/gowayfest-2019-intro-2c1028ed5db6f92b2f317f57019926ab.png" width="1200" height="630" class="img_ev3q"></p>
<p>In my lightning talk at GoWayFest 3.0, I delved into the complexities and necessities of developing our own bytecode
machine. I discussed the various reasons why my team and I at Aviasales decided to embark on this challenging yet
rewarding journey. From the desire for increased performance to the need for a highly customized solution tailored to
our specific use cases in Go, I covered the technical considerations and the value such an undertaking brings. I also
touched upon the importance of open-source work and community involvement in projects like this, which not only enrich
the project but also contribute to the larger ecosystem.</p>
<p><img decoding="async" loading="lazy" alt="Photo" src="https://expr-lang.org/assets/images/gowayfest-2019-4209819f259e847149670e89c269192c.jpg" width="750" height="606" class="img_ev3q"></p>]]></content>
        <author>
            <name>Anton Medvedev</name>
            <uri>https://github.com/antonmedv</uri>
        </author>
        <category label="expr" term="expr"/>
        <category label="conference" term="conference"/>
        <category label="golang" term="golang"/>
        <category label="open-source" term="open-source"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Expr at GoWayFest 2018]]></title>
        <id>https://expr-lang.org/blog/expr-at-gowayfest-2018</id>
        <link href="https://expr-lang.org/blog/expr-at-gowayfest-2018"/>
        <updated>2018-10-20T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[I was invited to speak at GoWayFest 2018 in Minsk, Belarus. It was my first time speaking at a]]></summary>
        <content type="html"><![CDATA[<video controls=""><source src="/assets/medias/how-to-write-an-expression-engine_by_anton-medvedev-gowayfest-2018-minsk-c2d9cea9518779af527a01ab0f4397ce.mp4"></video>
<p>I was invited to speak at GoWayFest 2018 in Minsk, Belarus. It was my first time speaking at a
conference, and I was excited to share my experience with the Go community. I spoke about how I built Expr, a
powerful expression language for Go.</p>
<p>It was a great experience, and I'm happy to share the video of my talk with you. I hope you enjoy it!</p>]]></content>
        <author>
            <name>Anton Medvedev</name>
            <uri>https://github.com/antonmedv</uri>
        </author>
        <category label="expr" term="expr"/>
        <category label="conference" term="conference"/>
        <category label="golang" term="golang"/>
        <category label="open-source" term="open-source"/>
    </entry>
</feed>