diff options
Diffstat (limited to 'articles/xerl-0.5-intermediate-module/index.html')
-rw-r--r-- | articles/xerl-0.5-intermediate-module/index.html | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/articles/xerl-0.5-intermediate-module/index.html b/articles/xerl-0.5-intermediate-module/index.html index c267f4f9..01bd8c20 100644 --- a/articles/xerl-0.5-intermediate-module/index.html +++ b/articles/xerl-0.5-intermediate-module/index.html @@ -75,7 +75,7 @@ <p>Today we will perform this work only on the atomic integer expression however, so we will not build any module at the end. We have a few more things to take care of before getting there. This does mean that we completely break compilation of modules though, so hopefully we can resolve that soon.</p> <p>This intermediate representation is in the form of a module which contains a single function: <code>run/0</code>. This function contains all the expressions from our Xerl source file.</p> <p>In the case of a Xerl source file only containing the integer <code>42</code>, we will obtain the following module ready to be executed:</p> -<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -87,7 +87,7 @@ http://www.gnu.org/software/src-highlite --> </div></div> <p>Running it will of course give us a result of <code>42</code>, the same we had when interpreting expressions.</p> <p>The resulting Core Erlang code looks like this:</p> -<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -107,7 +107,7 @@ http://www.gnu.org/software/src-highlite --> <p>We're going to use Core Erlang sequences for running the many expressions. Sequences work like <code>let</code>, except no value is actually bound. Perfect for our case, since we don't support binding values at this time anyway.</p> <p>Sequences have an argument and a body, both being Core Erlang expressions. The simplest way to have many expressions is to use a simple expression for the argument and a sequence for the rest of the expressions. When we encounter the last expression in the list, we do not create a sequence.</p> <p>The result is this very simple function:</p> -<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -119,7 +119,7 @@ http://www.gnu.org/software/src-highlite --> <b><font color="#000000">cerl:c_seq</font></b>(<font color="#009900">Arg</font>, <font color="#009900">Body</font>)<font color="#990000">.</font></tt></pre> </div></div> <p>In the case of our example above, a sequence will not be created, we only have one expression. If we were to have <code>42, 43, 44</code> in our Xerl source file, we would have a result equivalent to the following before optimization:</p> -<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -133,7 +133,7 @@ http://www.gnu.org/software/src-highlite --> </div></div> <p>And the result is of course <code>44</code>.</p> <p>The resulting Core Erlang code looks like this:</p> -<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> @@ -162,6 +162,10 @@ http://www.gnu.org/software/src-highlite --> + <li><a href="https://ninenines.eu/articles/cowboy-2.7.0/">Cowboy 2.7</a></li> + + + <li><a href="https://ninenines.eu/articles/gun-2.0.0-pre.1/">Gun 2.0 pre-release 1</a></li> |