<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Eric Bailey on Medium]]></title>
        <description><![CDATA[Stories by Eric Bailey on Medium]]></description>
        <link>https://medium.com/@yurrriq?source=rss-9431ada8e0bf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dquJvTmc7XU3Lf4LVXr4mw.jpeg</url>
            <title>Stories by Eric Bailey on Medium</title>
            <link>https://medium.com/@yurrriq?source=rss-9431ada8e0bf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:05:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yurrriq/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[lfe-rebar3/compile updates]]></title>
            <link>https://medium.com/@yurrriq/lfe-rebar3-compile-updates-2f27a739a2ed?source=rss-9431ada8e0bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f27a739a2ed</guid>
            <category><![CDATA[rebar3]]></category>
            <category><![CDATA[lfe]]></category>
            <category><![CDATA[erlang]]></category>
            <dc:creator><![CDATA[Eric Bailey]]></dc:creator>
            <pubDate>Mon, 22 Feb 2016 20:33:24 GMT</pubDate>
            <atom:updated>2016-02-22T20:33:24.200Z</atom:updated>
            <content:encoded><![CDATA[<p>Since much of my time these days is spent (or ‘writing ‘developing ‘evangelizing) <a href="http://lfe.io/">LFE</a>, it should come as no surprise that I use the <a href="https://github.com/lfe-rebar3/compile">rebar3 compiler plugin</a> extensively. In doing so, I noticed it always recompiles every .lfe file it finds, irrespective of the staleness of the corresponding .beam file. Having <a href="https://www.rebar3.org/docs/basic-usage#building">compiled</a> a fair amount of vanilla Erlang via rebar3, I knew it didn’t have to be that way.</p><p>To further my quest, <a href="https://github.com/tsloughter">tristan__</a> pointed me to <a href="https://github.com/rebar/rebar3/blob/beta-4/src/rebar_base_compiler.erl#L45-L48">run/7</a>, specifically its use of [check_last_mod]. Before I <a href="https://github.com/quasiquoting/lfe-compile">forked</a> <a href="https://github.com/lfe-rebar3/compile">lfe-rebar3/compile</a>, it was using <a href="https://github.com/rebar/rebar3/blob/beta-4/src/rebar_base_compiler.erl#L41-L43">run/4</a>, which does <strong>NOT</strong> make use of [check_last_mod], hence the unnecessary recompilation.</p><p><a href="https://github.com/lfe-rebar3/compile/blob/0.2.1/src/lr3_comp.erl#L74">lfe-rebar3/compile/src/lr3_comp.erl:74</a></p><pre>rebar_base_compiler:run(Opts, [], Files, DoCompile).</pre><p>After some experimentation, and <a href="https://www.rebar3.org/docs/dependencies#checkout-dependencies">_checkouts</a> symlinking tricks, I came up with an appropriate run/7 incantation and made <a href="https://github.com/lfe-rebar3/compile/pull/5">a pull request</a>.</p><p><a href="https://github.com/quasiquoting/lfe-compile/blob/0.3.0/src/lr3_comp.erl#L37-L39">quasiquoting/lfe-compile/src/lr3_comp.erl:37–39</a></p><pre>rebar_base_compiler:run(Config, FirstFiles, SourceDir, &quot;.lfe&quot;, TargetDir, &quot;.beam&quot;, fun compile/3).</pre><p>With those changes, rebar3 lfe compile will now skip unmodified .lfe files. Not only is this The Right Thing™ to do, but it should be <a href="https://xkcd.com/1205/">time saver</a> in the long run.</p><p>Here’s an example of the difference when compiling <a href="https://github.com/quasiquoting/lodox">Lodox</a>…</p><p>… using run/4 via <a href="https://github.com/lfe-rebar3/compile/releases/tag/0.2.1">0.2.1</a>:</p><pre>$ time rebar3 lfe compile</pre><pre>~~&gt; Compiling ./src/lodox-html-writer.lfe ... ~~&gt; Compiling ./src/lodox-p.lfe ... ~~&gt; Compiling ./src/lodox-parse.lfe ... ~~&gt; Compiling ./src/lodox-util.lfe ... ~~&gt; Compiling ./src/lodox.lfe ... ~~&gt; Compiling ./src/pandoc.lfe ... ~~&gt; Compiling ./test/unit-lodox-tests.lfe ... 1.39 real 1.14 user 0.24 sys</pre><p>… using run/7 via <a href="https://github.com/quasiquoting/lfe-compile/releases/tag/0.3.0">0.3.0</a>:</p><pre>$ time rebar3 lfe compile</pre><pre>0.94 real 0.73 user 0.20 sys</pre><p>A little more</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*0dvKsT-6bFo9YvSz.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*xEPcKoQsIX95WJX0.png" /></figure><p>microbenchmarking on a proprietary work project:</p><pre># run/4 3.58 real 3.02 user 0.58 sys # run/7 1.83 real 1.46 user 0.35 sys</pre><p><em>Originally published at </em><a href="http://blorg.ericb.me/2016/02/lfe-rebar3-compile-updates"><em>blorg.ericb.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f27a739a2ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>