summaryrefslogtreecommitdiffstats
path: root/articles
diff options
context:
space:
mode:
Diffstat (limited to 'articles')
-rw-r--r--articles/asciideck/index.html6
-rw-r--r--articles/cowboy-2.0.0-pre.4/index.html4
-rw-r--r--articles/cowboy-2.0.0-rc.1/index.html4
-rw-r--r--articles/cowboy-2.0.0-rc.2/index.html4
-rw-r--r--articles/cowboy-2.0.0/index.html4
-rw-r--r--articles/cowboy-2.1.0/index.html4
-rw-r--r--articles/cowboy-2.2.0/index.html4
-rw-r--r--articles/cowboy-2.3.0/index.html4
-rw-r--r--articles/cowboy-2.4.0/index.html4
-rw-r--r--articles/cowboy-2.5.0/index.html4
-rw-r--r--articles/cowboy-2.6.0/index.html4
-rw-r--r--articles/cowboy-2.7.0/index.html307
-rw-r--r--articles/cowboy2-qs/index.html6
-rw-r--r--articles/dont-let-it-crash/index.html4
-rw-r--r--articles/erlang-meetup-10-septembre-2019/index.html4
-rw-r--r--articles/erlang-scalability/index.html4
-rw-r--r--articles/erlang-validate-utf8/index.html18
-rw-r--r--articles/erlang.mk-and-relx/index.html34
-rw-r--r--articles/erlanger-playbook-september-2015-update/index.html4
-rw-r--r--articles/erlanger-playbook/index.html4
-rw-r--r--articles/farwest-funded/index.html4
-rw-r--r--articles/gun-1.0.0-rc.1/index.html4
-rw-r--r--articles/gun-1.0.0/index.html4
-rw-r--r--articles/gun-1.2.0/index.html4
-rw-r--r--articles/gun-1.3.0/index.html4
-rw-r--r--articles/gun-2.0.0-pre.1/index.html4
-rw-r--r--articles/index.html36
-rw-r--r--articles/index.xml12
-rw-r--r--articles/january-2014-status/index.html4
-rw-r--r--articles/joe_the_rubber_duck/index.html4
-rw-r--r--articles/merry-christmas-2018/index.html4
-rw-r--r--articles/ml-archives/index.html4
-rw-r--r--articles/on-open-source/index.html4
-rw-r--r--articles/page/2/index.html37
-rw-r--r--articles/page/3/index.html18
-rw-r--r--articles/ranch-1.3/index.html8
-rw-r--r--articles/ranch-1.6.0/index.html4
-rw-r--r--articles/ranch-1.7.0/index.html4
-rw-r--r--articles/ranch-2.0.0-rc.1/index.html4
-rw-r--r--articles/ranch-ftp/index.html26
-rw-r--r--articles/the-elephant-in-the-room/index.html4
-rw-r--r--articles/the-story-so-far/index.html4
-rw-r--r--articles/tictactoe/index.html10
-rw-r--r--articles/website-update/index.html4
-rw-r--r--articles/xerl-0.1-empty-modules/index.html16
-rw-r--r--articles/xerl-0.2-two-modules/index.html14
-rw-r--r--articles/xerl-0.3-atomic-expressions/index.html22
-rw-r--r--articles/xerl-0.4-expression-separator/index.html12
-rw-r--r--articles/xerl-0.5-intermediate-module/index.html14
49 files changed, 605 insertions, 119 deletions
diff --git a/articles/asciideck/index.html b/articles/asciideck/index.html
index d15bac27..0b83d8d2 100644
--- a/articles/asciideck/index.html
+++ b/articles/asciideck/index.html
@@ -75,7 +75,7 @@
<p>Asciideck has been tested against around 600 Asciidoc documents that I wrote. This website is now generated using Asciideck (Hugo will use the <a href="https://github.com/ninenines/asciideck/blob/master/scripts/asciidoc">asciidoc</a> script to generate HTML). But a lot of elements are not parsed properly, or are ignored by translator modules. It will take many more documents to get close to the original Asciidoc implementation in terms of features.</p>
<p>I wrote this project twice: first as an ugly prototype that generated man pages, and then I rewrote that using a different technique for parsing. I looked at a few different Asciidoc and Markdown implementations and found the Markdown code in Pandoc to be surprisingly readable despite being written in Haskell. I could not fully understand how it worked, but I could follow it based on my knowledge of the syntax.</p>
<p>I decided to write small functions that only contain the &quot;happy path&quot; for each possible blocks in an Asciidoc document. Take this function for example:</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 -->
@@ -110,6 +110,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>
diff --git a/articles/cowboy-2.0.0-pre.4/index.html b/articles/cowboy-2.0.0-pre.4/index.html
index 68546c82..2d3dbef6 100644
--- a/articles/cowboy-2.0.0-pre.4/index.html
+++ b/articles/cowboy-2.0.0-pre.4/index.html
@@ -129,6 +129,10 @@
+ <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>
diff --git a/articles/cowboy-2.0.0-rc.1/index.html b/articles/cowboy-2.0.0-rc.1/index.html
index b7b675f8..84a3f66c 100644
--- a/articles/cowboy-2.0.0-rc.1/index.html
+++ b/articles/cowboy-2.0.0-rc.1/index.html
@@ -100,6 +100,10 @@
+ <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>
diff --git a/articles/cowboy-2.0.0-rc.2/index.html b/articles/cowboy-2.0.0-rc.2/index.html
index ae11ebc1..19fcd601 100644
--- a/articles/cowboy-2.0.0-rc.2/index.html
+++ b/articles/cowboy-2.0.0-rc.2/index.html
@@ -93,6 +93,10 @@
+ <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>
diff --git a/articles/cowboy-2.0.0/index.html b/articles/cowboy-2.0.0/index.html
index 5b986030..caa49de2 100644
--- a/articles/cowboy-2.0.0/index.html
+++ b/articles/cowboy-2.0.0/index.html
@@ -99,6 +99,10 @@
+ <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>
diff --git a/articles/cowboy-2.1.0/index.html b/articles/cowboy-2.1.0/index.html
index 39381e67..038c361b 100644
--- a/articles/cowboy-2.1.0/index.html
+++ b/articles/cowboy-2.1.0/index.html
@@ -96,6 +96,10 @@
+ <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>
diff --git a/articles/cowboy-2.2.0/index.html b/articles/cowboy-2.2.0/index.html
index d7f4460e..5b30c33a 100644
--- a/articles/cowboy-2.2.0/index.html
+++ b/articles/cowboy-2.2.0/index.html
@@ -94,6 +94,10 @@
+ <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>
diff --git a/articles/cowboy-2.3.0/index.html b/articles/cowboy-2.3.0/index.html
index 5f62ef99..6169fd35 100644
--- a/articles/cowboy-2.3.0/index.html
+++ b/articles/cowboy-2.3.0/index.html
@@ -86,6 +86,10 @@
+ <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>
diff --git a/articles/cowboy-2.4.0/index.html b/articles/cowboy-2.4.0/index.html
index a8717317..3e81e80f 100644
--- a/articles/cowboy-2.4.0/index.html
+++ b/articles/cowboy-2.4.0/index.html
@@ -88,6 +88,10 @@
+ <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>
diff --git a/articles/cowboy-2.5.0/index.html b/articles/cowboy-2.5.0/index.html
index 1cc443a8..3bf0ae20 100644
--- a/articles/cowboy-2.5.0/index.html
+++ b/articles/cowboy-2.5.0/index.html
@@ -92,6 +92,10 @@
+ <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>
diff --git a/articles/cowboy-2.6.0/index.html b/articles/cowboy-2.6.0/index.html
index 5d563160..3ee0a481 100644
--- a/articles/cowboy-2.6.0/index.html
+++ b/articles/cowboy-2.6.0/index.html
@@ -89,6 +89,10 @@
+ <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>
diff --git a/articles/cowboy-2.7.0/index.html b/articles/cowboy-2.7.0/index.html
new file mode 100644
index 00000000..cb46aa20
--- /dev/null
+++ b/articles/cowboy-2.7.0/index.html
@@ -0,0 +1,307 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <title>Nine Nines: Cowboy 2.7</title>
+
+ <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+ <link href="/css/99s.css?r=6" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li class="active"><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents">
+<div class="container">
+<div class="row">
+<div class="span9 maincol">
+
+<article class="blog_item">
+<header>
+ <h1 class="lined-header"><span>Cowboy 2.7</span></h1>
+ <p class="date">
+ <span class="year">2019</span>
+ <span class="day-month">16 Oct</span>
+ </p>
+</header>
+
+<p>Cowboy <code>2.7.0</code> has been released!</p>
+<p>Cowboy 2.7 improves the HTTP/2 code with optimizations around the sending of DATA and WINDOW_UPDATE frames; graceful shutdown of the connection when the client is going away; and rate limiting mechanisms. New options and mechanisms have also been added to control the amount of memory Cowboy ends up using with both HTTP/1.1 and HTTP/2. Much of this work was done to address HTTP/2 CVEs about potential denial of service.</p>
+<p>In addition, many of the experimental features introduced in previous releases have been marked stable and are now documented. These include the commands-based Websocket handler interface; the metrics and tracer stream handlers; and the ability to change options on a per-stream basis (for example idle timeouts).</p>
+<p>This is the first Cowboy version that is compatible with the upcoming Ranch 2.0. Cowboy 2.7 will use Ranch 1.7.1 by default.</p>
+<p>Cowboy 2.0 requires Erlang/OTP 20 or above and is tested and supported on Linux, FreeBSD, macOS and Windows.</p>
+<p>A complete list of changes can be found in the migration guide: <a href="https://ninenines.eu/docs/en/cowboy/2.7/guide/migrating_from_2.6/">Migrating from Cowboy 2.6 to 2.7</a>.</p>
+<p>I have more free time available for consulting or for paid open source development at the moment. If you are interested, drop me an email at <a href="mailto:[email protected]">[email protected]</a>. I have gathered that there&apos;s interest in a pure Erlang GRPC implementation, and there&apos;s also QUIC and HTTP/3 that will be ready soon, for examples of projects I&apos;d be interested in working on.</p>
+<p>You can donate to this project via <a href="https://salt.bountysource.com/teams/ninenines">BountySource</a>. These funds are used to pay for additional servers for testing.</p>
+<p>As usual, feedback is appreciated, and issues or questions should be sent via Github tickets. Thanks!</p>
+
+
+</article>
+</div>
+
+<div class="span3 sidecol">
+<h3>More articles</h3>
+<ul id="articles-nav" class="extra_margin">
+
+
+
+
+ <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>
+
+
+
+ <li><a href="https://ninenines.eu/articles/erlang-meetup-10-septembre-2019/">Erlang meetup: 10 septembre 2019</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/ranch-2.0.0-rc.1/">Ranch 2.0 release candidate 1</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/joe_the_rubber_duck/">Joe Armstrong the rubber duck</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/merry-christmas-2018/">Merry Christmas 2018: A Recap</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.6.0/">Cowboy 2.6</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/ranch-1.7.0/">Ranch 1.7</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.5.0/">Cowboy 2.5</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/gun-1.3.0/">Gun 1.3</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/gun-1.2.0/">Gun 1.2</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/ranch-1.6.0/">Ranch 1.6</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/gun-1.0.0/">Gun 1.0</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/asciideck/">Asciideck: Asciidoc for Erlang</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/gun-1.0.0-rc.1/">Gun 1.0 release candidate 1</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.4.0/">Cowboy 2.4</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.3.0/">Cowboy 2.3</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.2.0/">Cowboy 2.2</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.1.0/">Cowboy 2.1</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.0.0/">Cowboy 2.0</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.0.0-rc.2/">Cowboy 2.0 release candidate 2</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.0.0-rc.1/">Cowboy 2.0 release candidate 1</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/the-elephant-in-the-room/">The elephant in the room</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/dont-let-it-crash/">Don&#39;t let it crash</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy-2.0.0-pre.4/">Cowboy 2.0 pre-release 4</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/ranch-1.3/">Ranch 1.3</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/ml-archives/">Mailing list archived</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/website-update/">Website update</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/erlanger-playbook-september-2015-update/">The Erlanger Playbook September 2015 Update</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/erlanger-playbook/">The Erlanger Playbook</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/erlang-validate-utf8/">Validating UTF-8 binaries with Erlang</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/on-open-source/">On open source</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/the-story-so-far/">The story so far</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/cowboy2-qs/">Cowboy 2.0 and query strings</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/january-2014-status/">January 2014 status</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/farwest-funded/">Farwest got funded!</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/erlang.mk-and-relx/">Build Erlang releases with Erlang.mk and Relx</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/xerl-0.5-intermediate-module/">Xerl: intermediate module</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/xerl-0.4-expression-separator/">Xerl: expression separator</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/erlang-scalability/">Erlang Scalability</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/xerl-0.3-atomic-expressions/">Xerl: atomic expressions</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/xerl-0.2-two-modules/">Xerl: two modules</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/xerl-0.1-empty-modules/">Xerl: empty modules</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/ranch-ftp/">Build an FTP Server with Ranch in 30 Minutes</a></li>
+
+
+
+ <li><a href="https://ninenines.eu/articles/tictactoe/">Erlang Tic Tac Toe</a></li>
+
+
+</ul>
+
+<h3>Feedback</h3>
+<p>Feel free to <a href="mailto:[email protected]">email us</a>
+if you found any mistake or need clarification on any of the
+articles.</p>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2018</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
diff --git a/articles/cowboy2-qs/index.html b/articles/cowboy2-qs/index.html
index 8286d7ee..55ebb3a6 100644
--- a/articles/cowboy2-qs/index.html
+++ b/articles/cowboy2-qs/index.html
@@ -95,7 +95,7 @@
<p>I feel that this three function interface provides everything one would need to comfortably write applications. You can get low level and get the query string directly; you can get a list of key/value binaries without any additional processing and do it on your own; or you can get a processed map that contains Erlang terms ready to be used.</p>
<p>I strongly believe that by democratizing the constraints to more than just bindings, but also to query string, cookies and other key/values in Cowboy, we can allow the developer to quickly and easily go from HTTP request to Erlang function calls. The constraints are reusable functions that can serve as guards against unwanted data, providing convenience in the process.</p>
<p>Your handlers will not look like an endless series of calls to get and convert the input data, they will instead be just one call at the beginning followed by the actual application logic, thanks to constraints and maps.</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 -->
@@ -130,6 +130,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>
diff --git a/articles/dont-let-it-crash/index.html b/articles/dont-let-it-crash/index.html
index 1e9e9110..39e5a005 100644
--- a/articles/dont-let-it-crash/index.html
+++ b/articles/dont-let-it-crash/index.html
@@ -105,6 +105,10 @@
+ <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>
diff --git a/articles/erlang-meetup-10-septembre-2019/index.html b/articles/erlang-meetup-10-septembre-2019/index.html
index f394df19..74575492 100644
--- a/articles/erlang-meetup-10-septembre-2019/index.html
+++ b/articles/erlang-meetup-10-septembre-2019/index.html
@@ -85,6 +85,10 @@
+ <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>
diff --git a/articles/erlang-scalability/index.html b/articles/erlang-scalability/index.html
index 92f7030f..b3809ce6 100644
--- a/articles/erlang-scalability/index.html
+++ b/articles/erlang-scalability/index.html
@@ -117,6 +117,10 @@
+ <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>
diff --git a/articles/erlang-validate-utf8/index.html b/articles/erlang-validate-utf8/index.html
index 9fa1529d..4569972f 100644
--- a/articles/erlang-validate-utf8/index.html
+++ b/articles/erlang-validate-utf8/index.html
@@ -73,7 +73,7 @@
change in the way the code validates UTF-8 data</a> (required for text and close frames as per the spec).</p>
<p>When looking into why the permessage-deflate tests in autobahntestsuite were taking such a long time, I found that autobahn is using an adaptation of the algorithm named <a href="http://bjoern.hoehrmann.de/utf-8/decoder/dfa/">Flexible
and Economical UTF-8 Decoder</a>. This is the C99 implementation:</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 -->
@@ -113,7 +113,7 @@ uint32_t inline
<font color="#FF0000">}</font></tt></pre>
</div></div>
<p>And this is the Erlang implementation I came up with:</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 -->
@@ -147,7 +147,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>Does it look similar to you? So how did we get there?</p>
<p>I started with a naive implementation of the original. First, we don&apos;t need the codepoint calculated and extracted for our validation function. We just want to know the data is valid, so we only need to calculate the next state. Then, the only thing we needed to be careful about was that tuples are 1-based, and that we need to stop processing the binary when we get the state 1 or when the binary is empty.</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 -->
@@ -161,7 +161,7 @@ http://www.gnu.org/software/src-highlite -->
<p>It was time to step into crazy land.</p>
<p>Erlang is very good at pattern matching, even more so than doing some arithmetic coupled by fetching elements from a tuple. So I decided I was going to write all possible clauses for all combinations of <code>C</code> and <code>State</code>. And by write I mean generate.</p>
<p>So I opened my Erlang shell, defined the variable <code>D</code> to be the tuple <code>?UTF8D</code> with its 400 elements, and then ran the following expression (after a bit of trial and error):</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 -->
@@ -175,7 +175,7 @@ http://www.gnu.org/software/src-highlite -->
<p>There was a little more work to be done on this generated code that I did using regular expressions. We need to recurse when the resulting state is not 1. We also need to stop when the binary is empty, making it the 2305th clause.</p>
<p>Still, 2305 is a lot. But hey, the code did work, and faster than the previous implementation too! But hey, perhaps I could find a way to reduce its size.</p>
<p>Removing all the clauses that return 1 and putting a catch-all clause at the end instead reduced the number to about 500, and showed that many clauses were similar:</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 -->
@@ -189,7 +189,7 @@ http://www.gnu.org/software/src-highlite -->
<b><font color="#000000">validate_utf8</font></b>(<font color="#990000">&lt;&lt;</font> <font color="#993399">7</font>, <font color="#009900">Rest</font><font color="#990000">/</font><font color="#FF6600">bits</font> <font color="#990000">&gt;&gt;</font>, <font color="#993399">0</font>) <font color="#990000">-&gt;</font> <b><font color="#000000">validate_utf8</font></b>(<font color="#009900">Rest</font>, <font color="#993399">0</font>);</tt></pre>
</div></div>
<p>But also:</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 -->
@@ -207,7 +207,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Patterns, my favorites!</p>
<p>A little more time was spent to edit the 500 or so clauses into smaller equivalents, testing that performance was not impacted, and comitting the result.</p>
<p>The patterns above can be found here in the resulting 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 -->
@@ -233,6 +233,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>
diff --git a/articles/erlang.mk-and-relx/index.html b/articles/erlang.mk-and-relx/index.html
index b231fb97..65f881a8 100644
--- a/articles/erlang.mk-and-relx/index.html
+++ b/articles/erlang.mk-and-relx/index.html
@@ -74,40 +74,16 @@
<p><a href="https://github.com/extend/erlang.mk">Erlang.mk</a> solves the first step. It is an include file for GNU Make. Just including it in a Makefile is enough to allow building your project, fetching and building dependencies, building documentation, performing static analysis and more.</p>
<p><a href="https://github.com/erlware/relx">Relx</a> solves the second step. It is a release creation tool, wrapped into a single executable file. It doesn&apos;t require a configuration file. And if you do need one, it will be a pretty small one.</p>
<p>Let&apos;s take a look at the smallest Erlang.mk powered Makefile. There is only one thing required: defining the project name.</p>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><font color="#009900">PROJECT =</font> my_project
-
-include erlang.mk</tt></pre>
+<div class="listingblock"><div class="content">source-highlight: could not find a language definition for make
</div></div>
<p>Simply doing this allows you to build your application by typing <code>make</code>, running tests using <code>make tests</code>, and more. It will even compile your <em>.dtl</em> files found in the <em>templates/</em> directory if you are using ErlyDTL!</p>
<p>Let&apos;s now take a look at a simplified version of the Makefile for this website. I only removed a few targets that were off-topic.</p>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><font color="#009900">PROJECT =</font> ninenines
-
-<font color="#009900">DEPS =</font> cowboy erlydtl
-<font color="#009900">dep_cowboy_commit =</font> 0.8.5
-<font color="#009900">dep_erlydtl_commit =</font> 4d0dc8fb
-
-<b><font color="#000080">.PHONY:</font></b> release clean-release
-
-<font color="#990000">release:</font> clean-release all projects
- relx -o rel<font color="#990000">/</font><font color="#009900">$(PROJECT)</font>
-
-<font color="#990000">clean-release:</font> clean-projects
- rm -rf rel<font color="#990000">/</font><font color="#009900">$(PROJECT)</font>
-
-include erlang.mk</tt></pre>
+<div class="listingblock"><div class="content">source-highlight: could not find a language definition for make
</div></div>
<p>You can see here how to define dependencies. First you list all the dependency names, then you have one line per dependency, giving the repository URL and the commit number, tag or branch you want.</p>
<p>Then you can see two targets defined, with <code>release</code> becoming the default target, because it was defined first. You can override the default target <code>all</code>, which builds the application and its dependencies, this way.</p>
<p>And as you can see, the <code>release</code> target uses Relx to build a release into the <em>rel/ninenines/</em> directory. Let&apos;s take a look at the configuration file for this release.</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 -->
@@ -143,6 +119,10 @@ cowboy-0.8.5 erlydtl-0.7.0 ninenines-0.2.0 stdlib-1.19.1</pre></div></div>
+ <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>
diff --git a/articles/erlanger-playbook-september-2015-update/index.html b/articles/erlanger-playbook-september-2015-update/index.html
index df5b004e..e7d1743c 100644
--- a/articles/erlanger-playbook-september-2015-update/index.html
+++ b/articles/erlanger-playbook-september-2015-update/index.html
@@ -88,6 +88,10 @@
+ <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>
diff --git a/articles/erlanger-playbook/index.html b/articles/erlanger-playbook/index.html
index 4fc7b789..a8f75a66 100644
--- a/articles/erlanger-playbook/index.html
+++ b/articles/erlanger-playbook/index.html
@@ -129,6 +129,10 @@
+ <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>
diff --git a/articles/farwest-funded/index.html b/articles/farwest-funded/index.html
index 7562df58..60872050 100644
--- a/articles/farwest-funded/index.html
+++ b/articles/farwest-funded/index.html
@@ -89,6 +89,10 @@
+ <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>
diff --git a/articles/gun-1.0.0-rc.1/index.html b/articles/gun-1.0.0-rc.1/index.html
index 2cb142a3..b61ec20b 100644
--- a/articles/gun-1.0.0-rc.1/index.html
+++ b/articles/gun-1.0.0-rc.1/index.html
@@ -90,6 +90,10 @@
+ <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>
diff --git a/articles/gun-1.0.0/index.html b/articles/gun-1.0.0/index.html
index 7ce8fc0d..4145f9e3 100644
--- a/articles/gun-1.0.0/index.html
+++ b/articles/gun-1.0.0/index.html
@@ -89,6 +89,10 @@
+ <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>
diff --git a/articles/gun-1.2.0/index.html b/articles/gun-1.2.0/index.html
index 478457b7..bd5f1f18 100644
--- a/articles/gun-1.2.0/index.html
+++ b/articles/gun-1.2.0/index.html
@@ -89,6 +89,10 @@
+ <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>
diff --git a/articles/gun-1.3.0/index.html b/articles/gun-1.3.0/index.html
index 9c7a8510..260eddeb 100644
--- a/articles/gun-1.3.0/index.html
+++ b/articles/gun-1.3.0/index.html
@@ -87,6 +87,10 @@
+ <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>
diff --git a/articles/gun-2.0.0-pre.1/index.html b/articles/gun-2.0.0-pre.1/index.html
index ef68e267..2c98be20 100644
--- a/articles/gun-2.0.0-pre.1/index.html
+++ b/articles/gun-2.0.0-pre.1/index.html
@@ -94,6 +94,10 @@
+ <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>
diff --git a/articles/index.html b/articles/index.html
index 2668b7e9..3130a7c8 100644
--- a/articles/index.html
+++ b/articles/index.html
@@ -67,6 +67,23 @@
<article class="blog_item">
<header>
+ <h2><a href="https://ninenines.eu/articles/cowboy-2.7.0/">Cowboy 2.7</a></h2>
+ <p class="date">
+ <span class="year">2019</span>
+ <span class="day-month">16 Oct</span>
+ </p>
+ </header>
+
+ <p>Cowboy 2.7.0 has been released!
+Cowboy 2.7 improves the HTTP/2 code with optimizations around the sending of DATA and WINDOW_UPDATE frames; graceful shutdown of the connection when the client is going away; and rate limiting mechanisms. New options and mechanisms have also been added to control the amount of memory Cowboy ends up using with both HTTP/1.1 and HTTP/2. Much of this work was done to address HTTP/2 CVEs about potential denial of service.</p>
+
+ <p style="text-align:right">
+ <a class="read_more" href="https://ninenines.eu/articles/cowboy-2.7.0/">Read More</a>
+ </p>
+ </article>
+
+ <article class="blog_item">
+ <header>
<h2><a href="https://ninenines.eu/articles/gun-2.0.0-pre.1/">Gun 2.0 pre-release 1</a></h2>
<p class="date">
<span class="year">2019</span>
@@ -418,25 +435,6 @@ HTTP/2 support! Websocket compression! Much simpler, cleaner interface. No mor
</p>
</article>
- <article class="blog_item">
- <header>
- <h2><a href="https://ninenines.eu/articles/cowboy-2.0.0-rc.2/">Cowboy 2.0 release candidate 2</a></h2>
- <p class="date">
- <span class="year">2017</span>
- <span class="day-month">23 Aug</span>
- </p>
- </header>
-
- <p>Cowboy 2.0.0-rc.2 has been released!
-This is the new recommended version of Cowboy. Its API should not change before release. While you probably should not use it in production yet, many do successfully. Use at your own risk.
-This new version contains fixes for the following issues:
-HTTP/2 server push was using the wrong header compression context. HTTP/2 flow control could end up queueing data in the wrong order when resuming the sending of data.</p>
-
- <p style="text-align:right">
- <a class="read_more" href="https://ninenines.eu/articles/cowboy-2.0.0-rc.2/">Read More</a>
- </p>
- </article>
-
<nav class="pagination" role="pagination">
diff --git a/articles/index.xml b/articles/index.xml
index 4bd4e9cb..1c18c554 100644
--- a/articles/index.xml
+++ b/articles/index.xml
@@ -6,12 +6,22 @@
<description>Recent content in Articles on Nine Nines</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
- <lastBuildDate>Fri, 27 Sep 2019 07:00:00 +0100</lastBuildDate>
+ <lastBuildDate>Wed, 16 Oct 2019 07:00:00 +0100</lastBuildDate>
<atom:link href="https://ninenines.eu/articles/index.xml" rel="self" type="application/rss+xml" />
<item>
+ <title>Cowboy 2.7</title>
+ <link>https://ninenines.eu/articles/cowboy-2.7.0/</link>
+ <pubDate>Wed, 16 Oct 2019 07:00:00 +0100</pubDate>
+
+ <guid>https://ninenines.eu/articles/cowboy-2.7.0/</guid>
+ <description>Cowboy 2.7.0 has been released!
+Cowboy 2.7 improves the HTTP/2 code with optimizations around the sending of DATA and WINDOW_UPDATE frames; graceful shutdown of the connection when the client is going away; and rate limiting mechanisms. New options and mechanisms have also been added to control the amount of memory Cowboy ends up using with both HTTP/1.1 and HTTP/2. Much of this work was done to address HTTP/2 CVEs about potential denial of service.</description>
+ </item>
+
+ <item>
<title>Gun 2.0 pre-release 1</title>
<link>https://ninenines.eu/articles/gun-2.0.0-pre.1/</link>
<pubDate>Fri, 27 Sep 2019 07:00:00 +0100</pubDate>
diff --git a/articles/january-2014-status/index.html b/articles/january-2014-status/index.html
index e67b3522..824fb081 100644
--- a/articles/january-2014-status/index.html
+++ b/articles/january-2014-status/index.html
@@ -115,6 +115,10 @@
+ <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>
diff --git a/articles/joe_the_rubber_duck/index.html b/articles/joe_the_rubber_duck/index.html
index fd767238..18470061 100644
--- a/articles/joe_the_rubber_duck/index.html
+++ b/articles/joe_the_rubber_duck/index.html
@@ -89,6 +89,10 @@
+ <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>
diff --git a/articles/merry-christmas-2018/index.html b/articles/merry-christmas-2018/index.html
index 7c08d7fb..7f014ee4 100644
--- a/articles/merry-christmas-2018/index.html
+++ b/articles/merry-christmas-2018/index.html
@@ -96,6 +96,10 @@
+ <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>
diff --git a/articles/ml-archives/index.html b/articles/ml-archives/index.html
index fdd34877..8f96ae18 100644
--- a/articles/ml-archives/index.html
+++ b/articles/ml-archives/index.html
@@ -86,6 +86,10 @@
+ <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>
diff --git a/articles/on-open-source/index.html b/articles/on-open-source/index.html
index 7a2b315e..b912f8fd 100644
--- a/articles/on-open-source/index.html
+++ b/articles/on-open-source/index.html
@@ -98,6 +98,10 @@ much left to look at today</a>. This was followed by a <a href="https://github.c
+ <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>
diff --git a/articles/page/2/index.html b/articles/page/2/index.html
index 53649b0d..f23343a5 100644
--- a/articles/page/2/index.html
+++ b/articles/page/2/index.html
@@ -67,6 +67,25 @@
<article class="blog_item">
<header>
+ <h2><a href="https://ninenines.eu/articles/cowboy-2.0.0-rc.2/">Cowboy 2.0 release candidate 2</a></h2>
+ <p class="date">
+ <span class="year">2017</span>
+ <span class="day-month">23 Aug</span>
+ </p>
+ </header>
+
+ <p>Cowboy 2.0.0-rc.2 has been released!
+This is the new recommended version of Cowboy. Its API should not change before release. While you probably should not use it in production yet, many do successfully. Use at your own risk.
+This new version contains fixes for the following issues:
+HTTP/2 server push was using the wrong header compression context. HTTP/2 flow control could end up queueing data in the wrong order when resuming the sending of data.</p>
+
+ <p style="text-align:right">
+ <a class="read_more" href="https://ninenines.eu/articles/cowboy-2.0.0-rc.2/">Read More</a>
+ </p>
+ </article>
+
+ <article class="blog_item">
+ <header>
<h2><a href="https://ninenines.eu/articles/cowboy-2.0.0-rc.1/">Cowboy 2.0 release candidate 1</a></h2>
<p class="date">
<span class="year">2017</span>
@@ -406,24 +425,6 @@ This will be in the form of a series of hints, which may or may not be accompani
</p>
</article>
- <article class="blog_item">
- <header>
- <h2><a href="https://ninenines.eu/articles/xerl-0.3-atomic-expressions/">Xerl: atomic expressions</a></h2>
- <p class="date">
- <span class="year">2013</span>
- <span class="day-month">18 Feb</span>
- </p>
- </header>
-
- <p>We will be adding atomic integer expressions to our language. These look as follow in Erlang:
-42. And the result of this expression is of course 42.
-We will be running this expression at compile time, since we don&apos;t have the means to run code at runtime yet. This will of course result in no module being compiled, but that&apos;s OK, it will allow us to discuss a few important things we&apos;ll have to plan for later on.</p>
-
- <p style="text-align:right">
- <a class="read_more" href="https://ninenines.eu/articles/xerl-0.3-atomic-expressions/">Read More</a>
- </p>
- </article>
-
<nav class="pagination" role="pagination">
diff --git a/articles/page/3/index.html b/articles/page/3/index.html
index 110cd5ef..9022153f 100644
--- a/articles/page/3/index.html
+++ b/articles/page/3/index.html
@@ -67,6 +67,24 @@
<article class="blog_item">
<header>
+ <h2><a href="https://ninenines.eu/articles/xerl-0.3-atomic-expressions/">Xerl: atomic expressions</a></h2>
+ <p class="date">
+ <span class="year">2013</span>
+ <span class="day-month">18 Feb</span>
+ </p>
+ </header>
+
+ <p>We will be adding atomic integer expressions to our language. These look as follow in Erlang:
+42. And the result of this expression is of course 42.
+We will be running this expression at compile time, since we don&apos;t have the means to run code at runtime yet. This will of course result in no module being compiled, but that&apos;s OK, it will allow us to discuss a few important things we&apos;ll have to plan for later on.</p>
+
+ <p style="text-align:right">
+ <a class="read_more" href="https://ninenines.eu/articles/xerl-0.3-atomic-expressions/">Read More</a>
+ </p>
+ </article>
+
+ <article class="blog_item">
+ <header>
<h2><a href="https://ninenines.eu/articles/xerl-0.2-two-modules/">Xerl: two modules</a></h2>
<p class="date">
<span class="year">2013</span>
diff --git a/articles/ranch-1.3/index.html b/articles/ranch-1.3/index.html
index d8811cbc..26dd32e6 100644
--- a/articles/ranch-1.3/index.html
+++ b/articles/ranch-1.3/index.html
@@ -90,7 +90,7 @@
</ul>
<p>They are updated at the same time so there is no real difference.</p>
<p>The most recent Ranch commit is now always signed. You can import the <a href="https://pgp.mit.edu/pks/lookup?op=vindex&amp;fingerprint=on&amp;exact=on&amp;search=0xF19F189CECC7439699CEDD7A6EF7A77066CCCC8A">signing key for Loïc Hoguin</a> with:</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 -->
@@ -98,7 +98,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>The primary key fingerprint is <code>F19F 189C ECC7 4396 99CE DD7A 6EF7 A770 66CC CC8A</code>.</p>
<p>When verifying signatures in git, the following should appear:</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 -->
@@ -127,6 +127,10 @@ Primary key fingerprint<font color="#990000">:</font> F19F 189C ECC7 <font color
+ <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>
diff --git a/articles/ranch-1.6.0/index.html b/articles/ranch-1.6.0/index.html
index 717c9ec5..d6ed2a21 100644
--- a/articles/ranch-1.6.0/index.html
+++ b/articles/ranch-1.6.0/index.html
@@ -89,6 +89,10 @@
+ <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>
diff --git a/articles/ranch-1.7.0/index.html b/articles/ranch-1.7.0/index.html
index 398295ed..14e76341 100644
--- a/articles/ranch-1.7.0/index.html
+++ b/articles/ranch-1.7.0/index.html
@@ -88,6 +88,10 @@
+ <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>
diff --git a/articles/ranch-2.0.0-rc.1/index.html b/articles/ranch-2.0.0-rc.1/index.html
index d3b726ca..14d70ca1 100644
--- a/articles/ranch-2.0.0-rc.1/index.html
+++ b/articles/ranch-2.0.0-rc.1/index.html
@@ -97,6 +97,10 @@
+ <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>
diff --git a/articles/ranch-ftp/index.html b/articles/ranch-ftp/index.html
index a694711d..576c6def 100644
--- a/articles/ranch-ftp/index.html
+++ b/articles/ranch-ftp/index.html
@@ -72,7 +72,7 @@
<p>Last week I was speaking at the <a href="http://www.erlang-factory.com/conference/London2012/speakers/LoicHoguin">London Erlang Factory Lite</a> where I presented a live demonstration of building an FTP server using <a href="http://ninenines.eu/docs/en/ranch/HEAD/README">Ranch</a>. As there was no slide, you should use this article as a reference instead.</p>
<p>The goal of this article is to showcase how to use Ranch for writing a network protocol implementation, how Ranch gets out of the way to let you write the code that matters, and the common techniques used when writing servers.</p>
<p>Let&apos;s start by creating an empty project. Create a new directory and then open a terminal into that directory. The first step is to add Ranch as a dependency. Create the <code>rebar.config</code> file and add the following 3 lines.</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 -->
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>This makes your application depend on the last Ranch version available on the <em>master</em> branch. This is fine for development, however when you start pushing your application to production you will want to revisit this file to hardcode the exact version you are using, to make sure you run the same version of dependencies in production.</p>
<p>You can now fetch the dependencies.</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 -->
@@ -94,14 +94,14 @@ Cloning into <font color="#FF0000">'ranch'</font><font color="#990000">...</font
</div></div>
<p>This will create a <em>deps/</em> folder containing Ranch.</p>
<p>We don&apos;t actually need anything else to write the protocol code. We could make an application for it, but this isn&apos;t the purpose of this article so let&apos;s just move on to writing the protocol itself. Create the file <em>ranch_ftp_protocol.erl</em> and open it in your favorite editor.</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 -->
<pre><tt>$ vim ranch_ftp_protocol<font color="#990000">.</font>erl</tt></pre>
</div></div>
<p>Let&apos;s start with a blank protocol module.</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 -->
<p>When Ranch receives a connection, it will call the <code>start_link/4</code> function with the listener&apos;s pid, socket, transport module to be used, and the options we define when starting the listener. We don&apos;t need options for the purpose of this article, so we don&apos;t pass them to the process we are creating.</p>
<p>Let&apos;s open a shell and start a Ranch listener to begin accepting connections. We only need to call one function. You should probably open it in another terminal and keep it open for convenience. If you quit the shell you will have to repeat the commands to proceed.</p>
<p>Also note that you need to type <code>c(ranch_ftp_protocol).</code> to recompile and reload the code for the protocol. You do not need to restart any process however.</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 -->
@@ -128,7 +128,7 @@ Erlang R15B02 <font color="#990000">(</font>erts-<font color="#993399">5.9</font
Eshell V5<font color="#990000">.</font><font color="#993399">9.2</font> <font color="#990000">(</font>abort with <font color="#990000">^</font>G<font color="#990000">)</font></tt></pre>
</div></div>
-<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 -->
@@ -141,7 +141,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>This starts a listener named <code>my_ftp</code> that runs your very own <code>ranch_ftp_protocol</code> over TCP, listening on port <code>2121</code>. The last argument is the options given to the protocol that we ignored earlier.</p>
<p>To try your code, you can use the following command. It should be able to connect, the server will print a message in the console, and then the client will print an error.</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 -->
@@ -149,7 +149,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>Let&apos;s move on to actually writing the protocol.</p>
<p>Once you have created the new process and returned the pid, Ranch will give ownership of the socket to you. This requires a synchronization step though.</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 -->
@@ -159,7 +159,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>Now that you acknowledged the new connection, you can use it safely.</p>
<p>When an FTP server accepts a connection, it starts by sending a welcome message which can be one or more lines starting with the code <code>200</code>. Then the server will wait for the client to authenticate the user, and if the authentication went successfully, which it will always do for the purpose of this article, it will reply with a <code>230</code> code.</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 -->
@@ -177,7 +177,7 @@ http://www.gnu.org/software/src-highlite -->
<p>As you can see we don&apos;t need complex parsing code. We can simply match on the binary in the argument!</p>
<p>Next we need to loop receiving data commands and optionally execute them, if we want our server to become useful.</p>
<p>We will replace the <code>ok.</code> line with the call to the following function. The new function is recursive, each call receiving data from the socket and sending a response. For now we will send an error response for all commands the client sends.</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 -->
@@ -196,7 +196,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>With this we are almost ready to start implementing commands. But with code like this we might have errors if the client doesn&apos;t send just one command per packet, or if the packets arrive too fast, or if a command is split over multiple packets.</p>
<p>To solve this, we need to use a buffer. Each time we receive data, we will append to the buffer, and then check if we have received a command fully before running it. The code could look similar to the following.</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 -->
@@ -229,6 +229,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>
diff --git a/articles/the-elephant-in-the-room/index.html b/articles/the-elephant-in-the-room/index.html
index 992b8f34..b8f6cbda 100644
--- a/articles/the-elephant-in-the-room/index.html
+++ b/articles/the-elephant-in-the-room/index.html
@@ -111,6 +111,10 @@
+ <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>
diff --git a/articles/the-story-so-far/index.html b/articles/the-story-so-far/index.html
index b562aee2..73afcaa4 100644
--- a/articles/the-story-so-far/index.html
+++ b/articles/the-story-so-far/index.html
@@ -102,6 +102,10 @@
+ <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>
diff --git a/articles/tictactoe/index.html b/articles/tictactoe/index.html
index c7a10a36..85fbb025 100644
--- a/articles/tictactoe/index.html
+++ b/articles/tictactoe/index.html
@@ -74,7 +74,7 @@
<p>Writing an algorithm to check for victory sounds easy, right? It&apos;s easily tested, considering there&apos;s only 8 possible winning rows (3 horizontal, 3 vertical and 2 diagonal).</p>
<p>In Erlang though, you probably wouldn&apos;t want an algorithm. Erlang has this cool feature called pattern matching which will allow us to completely avoid writing the algorithm by instead letting us match directly on the solutions.</p>
<p>Let&apos;s first create a board. A board is a list of 3 rows each containing 3 columns. It can also be thought of as a tuple containing 9 elements. A tuple is easier to manipulate so this is what we are going to use. Each position can either contain an <code>x</code>, an <code>o</code>, or be <code>undefined</code>.</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 -->
@@ -84,7 +84,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#000080">undefined</font>, <font color="#000080">undefined</font>, <font color="#000080">undefined</font>}<font color="#990000">.</font></tt></pre>
</div></div>
<p>Now that we have a board, if we want to play, we need a function that will allow players to, you know, actually play their moves. Rows and columns are numbered 1 to 3 so we need a little math to correctly deduce the element&apos;s position.</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 -->
@@ -93,7 +93,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>This function returns the board with the element modified. Of course, as you probably noticed, we aren&apos;t checking that the arguments are correct, or that the element was already set. This is left as an exercise to the reader.</p>
<p>After playing the move, we need to check whether someone won. That&apos;s where you&apos;d write an algorithm, and that&apos;s where I wouldn&apos;t. Let&apos;s just pattern match all of them!</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 -->
@@ -134,6 +134,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>
diff --git a/articles/website-update/index.html b/articles/website-update/index.html
index 0fff01f0..5ae7571e 100644
--- a/articles/website-update/index.html
+++ b/articles/website-update/index.html
@@ -91,6 +91,10 @@
+ <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>
diff --git a/articles/xerl-0.1-empty-modules/index.html b/articles/xerl-0.1-empty-modules/index.html
index 0bfb60cf..03da2930 100644
--- a/articles/xerl-0.1-empty-modules/index.html
+++ b/articles/xerl-0.1-empty-modules/index.html
@@ -74,7 +74,7 @@
<p>We are just starting, so let&apos;s no go ahead of ourselves here. We&apos;ll begin with writing the code allowing us to compile an empty module.</p>
<p>We will compile to Core Erlang: this is one of the many intermediate step your Erlang code compiles to before it becomes BEAM machine code. Core Erlang is a very neat language for machine generated code, and we will learn many things about it.</p>
<p>Today we will only focus on compiling the following code:</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 -->
@@ -86,7 +86,7 @@ http://www.gnu.org/software/src-highlite -->
<p>We will use <em>leex</em> for the lexer. This lexer uses .xrl files which are then compiled to .erl files that you can then compile to BEAM. The file is divided in three parts: definitions, rules and Erlang code. Definitions and Erlang code are obvious; rules are what concerns us.</p>
<p>We only need two things: atoms and whitespaces. Atoms are a lowercase letter followed by any letter, number, _ or @. Whitespace is either a space, an horizontal tab, \r or \n. There exists other kinds of whitespaces but we simply do not allow them in the Xerl language.</p>
<p>Rules consist of a regular expression followed by Erlang code. The latter must return a token representation or the atom <code>skip_token</code>.</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 -->
@@ -101,7 +101,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>The first rule matches an atom, which is converted to either a special representation for reserved words, or an atom tuple. The <code>TokenChars</code> variable represents the match as a string, and the <code>TokenLine</code> variable contains the line number. <a href="https://github.com/extend/xerl/blob/0.1/src/xerl_lexer.xrl">View the complete file</a>.</p>
<p>We obtain the following result from the lexer:</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 -->
@@ -109,7 +109,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>The second step is to parse this list of tokens to add semantic meaning and generate what is called an <em>abstract syntax tree</em>. We will be using the <em>yecc</em> parser generator for this. This time it will take .yrl files but the process is the same as before. The file is a little more complex than for the lexer, we need to define at the very least terminals, nonterminals and root symbols, the grammar itself, and optionally some Erlang code.</p>
<p>To compile our module, we need a few things. First, everything is an expression. We thus need list of expressions and individual expressions. We will support a single expression for now, the <code>mod</code> expression which defines a module. And that&apos;s it! We end up with the following grammar:</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 -->
@@ -123,7 +123,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p><a href="https://github.com/extend/xerl/blob/0.1/src/xerl_parser.yrl">View the complete file</a>.</p>
<p>We obtain the following result from the parser:</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 -->
@@ -135,7 +135,7 @@ http://www.gnu.org/software/src-highlite -->
<p>There&apos;s one important thing to do when generating Core Erlang AST for a module: create the <code>module_info/{0,1}</code> functions. Indeed, these are added to Erlang before it becomes Core Erlang, and so we need to replicate this ourselves. Do not be concerned however, as this only takes a few lines of extra code.</p>
<p>As you can see by <a href="https://github.com/extend/xerl/blob/0.1/src/xerl_codegen.erl">looking at the complete file</a>, the code generator echoes the grammar we defined in the parser, and simply applies the appropriate Core Erlang functions for each expressions.</p>
<p>We obtain the following pretty-printed Core Erlang generated code:</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 -->
@@ -169,6 +169,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>
diff --git a/articles/xerl-0.2-two-modules/index.html b/articles/xerl-0.2-two-modules/index.html
index a6071cbf..e2da8c4b 100644
--- a/articles/xerl-0.2-two-modules/index.html
+++ b/articles/xerl-0.2-two-modules/index.html
@@ -72,7 +72,7 @@
<p>Everything is an expression.</p>
<p>This sentence carries profound meaning. We will invoke it many times over the course of these articles.</p>
<p>If everything is an expression, then the language shouldn&apos;t have any problem with me defining two modules in the same source file.</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 -->
@@ -85,7 +85,7 @@ http://www.gnu.org/software/src-highlite -->
<b><font color="#0000FF">end</font></b></tt></pre>
</div></div>
<p>Likewise, it shouldn&apos;t have any problem with me defining a module inside another module.</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 -->
@@ -102,7 +102,7 @@ http://www.gnu.org/software/src-highlite -->
<p>If everything is an expression, does that mean this will allow me to create modules at runtime using the same syntax? Yes, but let&apos;s not get ahead of ourselves yet.</p>
<p>For now we will just iterate over the AST, and will compile a module for each <code>mod</code> found. Modules cannot contain expressions yet, so there&apos;s no need to recurse over it at this point. This should solve the compilation of our first snippet.</p>
<p>The <code>compile/1</code> function becomes:</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 -->
@@ -126,7 +126,7 @@ http://www.gnu.org/software/src-highlite -->
<b><font color="#000000">execute</font></b>(<font color="#009900">Filename</font>, <font color="#009900">Tail</font>, [<font color="#009900">Name</font>|<font color="#009900">Modules</font>])<font color="#990000">.</font></tt></pre>
</div></div>
<p>Running this compiler over the first snippet yields the following result:</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 -->
@@ -159,7 +159,7 @@ http://www.gnu.org/software/src-highlite -->
{<font color="#FF6600">ok</font>,[<font color="#FF6600">first_module</font>,<font color="#FF6600">second_module</font>]}</tt></pre>
</div></div>
<p>Everything looks fine. And we can check that the two modules have been loaded into the VM:</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 -->
@@ -197,6 +197,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>
diff --git a/articles/xerl-0.3-atomic-expressions/index.html b/articles/xerl-0.3-atomic-expressions/index.html
index e7c6ab25..086c0de3 100644
--- a/articles/xerl-0.3-atomic-expressions/index.html
+++ b/articles/xerl-0.3-atomic-expressions/index.html
@@ -70,7 +70,7 @@
</header>
<p>We will be adding atomic integer expressions to our language. These look as follow in Erlang:</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 -->
@@ -79,28 +79,28 @@ http://www.gnu.org/software/src-highlite -->
<p>And the result of this expression is of course 42.</p>
<p>We will be running this expression at compile time, since we don&apos;t have the means to run code at runtime yet. This will of course result in no module being compiled, but that&apos;s OK, it will allow us to discuss a few important things we&apos;ll have to plan for later on.</p>
<p>First, we must of course accept integers in the tokenizer.</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 -->
<pre><tt>{<font color="#009900">D</font>}<font color="#990000">+</font> <font color="#990000">:</font> {<font color="#FF6600">token</font>, {<b><font color="#000080">integer</font></b>, <font color="#009900">TokenLine</font>, <b><font color="#000080">list_to_integer</font></b>(<font color="#009900">TokenChars</font>)}}<font color="#990000">.</font></tt></pre>
</div></div>
<p>We must then accept atomic integer expressions in the parser. This is a simple change. The integer token is terminal so we need to add it to the list of terminals, and then we only need to add it as a possible expression.</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 -->
<pre><tt><font color="#FF6600">expr</font> <font color="#990000">-&gt;</font> <font color="#FF6600">integer</font> <font color="#990000">:</font> <font color="#FF6600">'$1'</font><font color="#990000">.</font></tt></pre>
</div></div>
<p>A file containing only the number 42 (with no terminating dot) will give the following result when parsing it. This is incidentally the same result as when tokenizing.</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 -->
<pre><tt>[{<b><font color="#000080">integer</font></b>,<font color="#993399">1</font>,<font color="#993399">42</font>}]</tt></pre>
</div></div>
<p>We must then evaluate it. We&apos;re going to interpret it for now. Since the result of this expression is not stored in a variable, we are going to simply print it on the screen and discard it.</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 -->
@@ -117,28 +117,28 @@ http://www.gnu.org/software/src-highlite -->
</li>
</ul>
<p>This is what happens when we create a file that contains two integers on two separate lines:</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 -->
<pre><tt>[{<b><font color="#000080">integer</font></b>,<font color="#993399">1</font>,<font color="#993399">42</font>},{<b><font color="#000080">integer</font></b>,<font color="#993399">2</font>,<font color="#993399">43</font>}]</tt></pre>
</div></div>
<p>And on the same lines:</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 -->
<pre><tt>[{<b><font color="#000080">integer</font></b>,<font color="#993399">1</font>,<font color="#993399">42</font>},{<b><font color="#000080">integer</font></b>,<font color="#993399">1</font>,<font color="#993399">43</font>}]</tt></pre>
</div></div>
<p>Does this mean we do not need separators between expressions? Not quite. The <code>+</code> and <code>-</code> operators are an example of why we can&apos;t have nice things. They are ambiguous. They have two different meanings: make an atomic integer positive or negative, or perform an addition or a substraction between two integers. Without a separator you won&apos;t be able to know if the following snippet is one or two expressions:</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 -->
<pre><tt><font color="#993399">42</font> <font color="#990000">-</font> <font color="#993399">12</font></tt></pre>
</div></div>
<p>Can we use the line ending as an expression separator then? Some languages make whitespace important, often the line separator becomes the expression separator. I do not think this is the best idea, it can lead to errors. For example the following snippet would be two expressions:</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 -->
@@ -166,6 +166,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>
diff --git a/articles/xerl-0.4-expression-separator/index.html b/articles/xerl-0.4-expression-separator/index.html
index 7c5d12af..14209b2a 100644
--- a/articles/xerl-0.4-expression-separator/index.html
+++ b/articles/xerl-0.4-expression-separator/index.html
@@ -71,14 +71,14 @@
<p>As promised we are adding an expression separator this time. This will be short and easy.</p>
<p>In the tokenizer we only need to add a line recognizing the comma as a valid token.</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 -->
<pre><tt>, <font color="#990000">:</font> {<font color="#FF6600">token</font>, {<font color="#FF6600">','</font>, <font color="#009900">TokenLine</font>}}<font color="#990000">.</font></tt></pre>
</div></div>
<p>Then we need to change the following lines in the parser:</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 -->
@@ -86,7 +86,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#FF6600">exprs</font> <font color="#990000">-&gt;</font> <font color="#FF6600">expr</font> <font color="#FF6600">exprs</font> <font color="#990000">:</font> [<font color="#FF6600">'$1'</font> | <font color="#FF6600">'$2'</font>]<font color="#990000">.</font></tt></pre>
</div></div>
<p>And add a comma between the expressions on the second line:</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 -->
@@ -94,7 +94,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#FF6600">exprs</font> <font color="#990000">-&gt;</font> <font color="#FF6600">expr</font> <font color="#FF6600">','</font> <font color="#FF6600">exprs</font> <font color="#990000">:</font> [<font color="#FF6600">'$1'</font> | <font color="#FF6600">'$3'</font>]<font color="#990000">.</font></tt></pre>
</div></div>
<p>That takes care of everything except the optional trailing comma at the end of our lists of expressions. We just need an additional rule to take care of 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 -->
@@ -118,6 +118,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>
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&apos;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&apos;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>