Skip to content

Commit

Permalink
Automated publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Dec 17, 2023
1 parent d2f1fed commit 6aa8631
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blog/2023-12-17-module-loading/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<span class="line"><span style="color:#f8f8f2"> ([a &amp; args]</span></span>
<span class="line"><span style="color:#f8f8f2"> :variadic))</span></span>
<span class="line"></span>
<span class="line"><span style="color:#f8f8f2">(</span><span style="color:#a6e22e">ambiguous</span><span style="color:#f8f8f2"> :a) </span><span style="color:#88846f">; =&gt; should be :fixed</span></span></code></pre><p>What jank was trying to do was call the variadic arity, with an empty seq for <code>args</code>, rather than to call the fixed arity. This is because both of them require one fixed argument first and the information I was storing for each function object was the required fixed args prior to variadic arg packing.<p>The equivalent function in Clojure JVM is <code>RestFn.getRequiredArity</code>, which returns the required fixed position arguments prior to the packed args. However, where Clojure JVM differs from jank is that TODO.<p>To actually solve this problem, we need to know three things:<ol><li>Is the function variadic?<li>Is there an ambiguous fixed overload?<li>How many fixed arguments are required before the packed args?</ol><p>We cannot perform the correct call without <em>all</em> of this information. Also, function calls in a functional programming language like Clojure are on the hottest of hot code paths, so I can't exactly add two more virtual functions to jank's <code>callable</code> interface to get this data. In truth, even keeping one function but putting all of this data in a struct proved too much of an impact on the performance. Thus, we encode the data more compactly.<p>jank now packs all of this into a single byte. Questions 1 and 2 each get a high bit and question 3 gets the 6 remaining bits (it only uses 4) to store the fixed arg count. So, this byte for our <code>ambiguous</code> function above would look like this:<pre class="shiki"style="background-color:#272822"><code><span class="line"><span style="color:#ae81ff">1</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">1</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">1</span></span>
<span class="line"><span style="color:#f8f8f2">(</span><span style="color:#a6e22e">ambiguous</span><span style="color:#f8f8f2"> :a) </span><span style="color:#88846f">; =&gt; should be :fixed</span></span></code></pre><p>What jank was trying to do was call the variadic arity, with an empty seq for <code>args</code>, rather than to call the fixed arity. This is because both of them require one fixed argument first and the information I was storing for each function object was the required fixed args prior to variadic arg packing.<p>The equivalent function in Clojure JVM is <code>RestFn.getRequiredArity</code>, which returns the required fixed position arguments prior to the packed args. However, where Clojure JVM differs from jank is that Clojure uses dynamic dispatch to solve this ambiguity whereas jank does its own overload matching, for performance reasons.<p>To actually solve this problem, we need to know three things:<ol><li>Is the function variadic?<li>Is there an ambiguous fixed overload?<li>How many fixed arguments are required before the packed args?</ol><p>We cannot perform the correct call without <em>all</em> of this information. Also, function calls in a functional programming language like Clojure are on the hottest of hot code paths, so I can't exactly add two more virtual functions to jank's <code>callable</code> interface to get this data. In truth, even keeping one function but putting all of this data in a struct proved too much of an impact on the performance. Thus, we encode the data more compactly.<p>jank now packs all of this into a single byte. Questions 1 and 2 each get a high bit and question 3 gets the 6 remaining bits (it only uses 4) to store the fixed arg count. So, this byte for our <code>ambiguous</code> function above would look like this:<pre class="shiki"style="background-color:#272822"><code><span class="line"><span style="color:#ae81ff">1</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">1</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">0</span><span style="color:#f8f8f2"> </span><span style="color:#ae81ff">1</span></span>
<span class="line"><span style="color:#f92672">^</span><span style="color:#f8f8f2"> </span><span style="color:#f92672">^</span><span style="color:#f8f8f2"> </span><span style="color:#f92672">^---------------</span></span>
<span class="line"><span style="color:#f92672">|</span><span style="color:#f8f8f2"> </span><span style="color:#f92672">|</span><span style="color:#f8f8f2"> </span><span style="color:#f92672">|</span></span>
<span class="line"><span style="color:#f92672">|</span><span style="color:#f8f8f2"> </span><span style="color:#f92672">|</span><span style="color:#88846f"> /* How many fixed arguments are required before the packed args? */</span></span>
Expand Down
2 changes: 1 addition & 1 deletion blog/feed.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<feed xmlns="http://www.w3.org/2005/Atom"><link href="https://jank-lang.org/blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://jank-lang.org/blog/" rel="alternate" type="text/html" /><updated>2023-12-17T18:57:27.685494900Z</updated><title>jank blog</title><id>https://jank-lang.org/blog/</id><entry><title type="html">jank development update - Load all the modules!</title><link href="https://jank-lang.org/blog/2023-12-17-module-loading" rel="alternate" title="jank development update - Load all the modules!" type="text/html" /><published>2023-12-17T00:00:00Z</published><updated>2023-12-17T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-12-17-module-loading</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;I&amp;apos;ve been quiet for the past couple of months, finishing up this work on jank&amp;apos;s module loading, class path handling, aliasing, and var referring. Along the way, I ran into some very interesting bugs and we&amp;apos;re in for a treat of technical detail in this holiday edition of jank development updates! A warm shout out to my &lt;a href=&quot;https://github.com/sponsors/jeaye&quot;&gt;Github sponsors&lt;/a&gt; and &lt;a href=&quot;https://www.clojuriststogether.org/&quot;&gt;Clojurists Together&lt;/a&gt; for sponsoring this work.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Module loading</title><link href="https://jank-lang.org/blog/2023-10-14-module-loading" rel="alternate" title="jank development update - Module loading" type="text/html" /><published>2023-10-14T00:00:00Z</published><updated>2023-10-14T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-10-14-module-loading</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;For the past month and a half, I&amp;apos;ve been building out jank&amp;apos;s support for &lt;code&gt;clojure.core/require&lt;/code&gt;, including everything from class path handling to compiling jank files to intermediate code written to the filesystem. This is a half-way report for the quarter. As a warm note, my work on jank this quarter is being sponsored by &lt;a href=&quot;https://www.clojuriststogether.org/&quot;&gt;Clojurists Together&lt;/a&gt;.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Object model results</title><link href="https://jank-lang.org/blog/2023-08-26-object-model" rel="alternate" title="jank development update - Object model results" type="text/html" /><published>2023-08-26T00:00:00Z</published><updated>2023-08-26T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-08-26-object-model</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;As summer draws to a close, in the Pacific Northwest, so too does my term of sponsored work focused on a faster object model for jank. Thanks so much to &lt;a href=&quot;https://www.clojuriststogether.org/&quot;&gt;Clojurists Together&lt;/a&gt; for funding jank&amp;apos;s development. The past quarter has been quite successful and I&amp;apos;m excited to share the results.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - A faster object model</title><link href="https://jank-lang.org/blog/2023-07-08-object-model" rel="alternate" title="jank development update - A faster object model" type="text/html" /><published>2023-07-08T00:00:00Z</published><updated>2023-07-08T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-07-08-object-model</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;This quarter, my work on jank is being sponsored by &lt;a href=&quot;https://www.clojuriststogether.org/&quot;&gt;Clojurists Together&lt;/a&gt;. The terms of the work are to research a new object model for jank, with the goal of making jank code faster across the board. This is a half-way report and I&amp;apos;m excited to share my results!&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Optimizing a ray tracer</title><link href="https://jank-lang.org/blog/2023-04-07-ray-tracing" rel="alternate" title="jank development update - Optimizing a ray tracer" type="text/html" /><published>2023-04-07T00:00:00Z</published><updated>2023-04-07T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-04-07-ray-tracing</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;After the &lt;a href=&quot;/blog/2023-01-13-optimizing-sequences&quot;&gt;last post&lt;/a&gt;, which focused on optimizing jank&amp;apos;s sequences, I wanted to get jank running a ray tracer I had previously written in Clojure. In this post, I document what was required to start ray tracing in jank and, more importantly, how I chased down the run time in a fierce battle with Clojure&amp;apos;s performance.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Optimizing sequences</title><link href="https://jank-lang.org/blog/2023-01-13-optimizing-sequences" rel="alternate" title="jank development update - Optimizing sequences" type="text/html" /><published>2023-01-13T00:00:00Z</published><updated>2023-01-13T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-01-13-optimizing-sequences</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;In this episode of jank&amp;apos;s development updates, we follow an exciting few weekends as I was digging deep into Clojure&amp;apos;s sequence implementation, building jank&amp;apos;s equivalent, and then benchmarking and profiling in a dizzying race to the bottom.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Lots of new changes</title><link href="https://jank-lang.org/blog/2022-12-08-progress-update" rel="alternate" title="jank development update - Lots of new changes" type="text/html" /><published>2022-12-08T00:00:00Z</published><updated>2022-12-08T00:00:00Z</updated><id>https://jank-lang.org/blog/2022-12-08-progress-update</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;I was previously giving updates only in the &lt;a href=&quot;https://clojurians.slack.com/archives/C03SRH97FDK&quot;&gt;#jank&lt;/a&gt; Slack channel, but some of these are getting large enough to warrant more prose. Thus, happily, I can announce that jank has a new blog and I have a &lt;i&gt;lot&lt;/i&gt; of new progress to report! Let&amp;apos;s get into the details.&lt;/p&gt;</summary></entry></feed>
<feed xmlns="http://www.w3.org/2005/Atom"><link href="https://jank-lang.org/blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://jank-lang.org/blog/" rel="alternate" type="text/html" /><updated>2023-12-17T18:57:47.795645308Z</updated><title>jank blog</title><id>https://jank-lang.org/blog/</id><entry><title type="html">jank development update - Load all the modules!</title><link href="https://jank-lang.org/blog/2023-12-17-module-loading" rel="alternate" title="jank development update - Load all the modules!" type="text/html" /><published>2023-12-17T00:00:00Z</published><updated>2023-12-17T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-12-17-module-loading</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;I&amp;apos;ve been quiet for the past couple of months, finishing up this work on jank&amp;apos;s module loading, class path handling, aliasing, and var referring. Along the way, I ran into some very interesting bugs and we&amp;apos;re in for a treat of technical detail in this holiday edition of jank development updates! A warm shout out to my &lt;a href=&quot;https://github.com/sponsors/jeaye&quot;&gt;Github sponsors&lt;/a&gt; and &lt;a href=&quot;https://www.clojuriststogether.org/&quot;&gt;Clojurists Together&lt;/a&gt; for sponsoring this work.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Module loading</title><link href="https://jank-lang.org/blog/2023-10-14-module-loading" rel="alternate" title="jank development update - Module loading" type="text/html" /><published>2023-10-14T00:00:00Z</published><updated>2023-10-14T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-10-14-module-loading</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;For the past month and a half, I&amp;apos;ve been building out jank&amp;apos;s support for &lt;code&gt;clojure.core/require&lt;/code&gt;, including everything from class path handling to compiling jank files to intermediate code written to the filesystem. This is a half-way report for the quarter. As a warm note, my work on jank this quarter is being sponsored by &lt;a href=&quot;https://www.clojuriststogether.org/&quot;&gt;Clojurists Together&lt;/a&gt;.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Object model results</title><link href="https://jank-lang.org/blog/2023-08-26-object-model" rel="alternate" title="jank development update - Object model results" type="text/html" /><published>2023-08-26T00:00:00Z</published><updated>2023-08-26T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-08-26-object-model</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;As summer draws to a close, in the Pacific Northwest, so too does my term of sponsored work focused on a faster object model for jank. Thanks so much to &lt;a href=&quot;https://www.clojuriststogether.org/&quot;&gt;Clojurists Together&lt;/a&gt; for funding jank&amp;apos;s development. The past quarter has been quite successful and I&amp;apos;m excited to share the results.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - A faster object model</title><link href="https://jank-lang.org/blog/2023-07-08-object-model" rel="alternate" title="jank development update - A faster object model" type="text/html" /><published>2023-07-08T00:00:00Z</published><updated>2023-07-08T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-07-08-object-model</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;This quarter, my work on jank is being sponsored by &lt;a href=&quot;https://www.clojuriststogether.org/&quot;&gt;Clojurists Together&lt;/a&gt;. The terms of the work are to research a new object model for jank, with the goal of making jank code faster across the board. This is a half-way report and I&amp;apos;m excited to share my results!&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Optimizing a ray tracer</title><link href="https://jank-lang.org/blog/2023-04-07-ray-tracing" rel="alternate" title="jank development update - Optimizing a ray tracer" type="text/html" /><published>2023-04-07T00:00:00Z</published><updated>2023-04-07T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-04-07-ray-tracing</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;After the &lt;a href=&quot;/blog/2023-01-13-optimizing-sequences&quot;&gt;last post&lt;/a&gt;, which focused on optimizing jank&amp;apos;s sequences, I wanted to get jank running a ray tracer I had previously written in Clojure. In this post, I document what was required to start ray tracing in jank and, more importantly, how I chased down the run time in a fierce battle with Clojure&amp;apos;s performance.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Optimizing sequences</title><link href="https://jank-lang.org/blog/2023-01-13-optimizing-sequences" rel="alternate" title="jank development update - Optimizing sequences" type="text/html" /><published>2023-01-13T00:00:00Z</published><updated>2023-01-13T00:00:00Z</updated><id>https://jank-lang.org/blog/2023-01-13-optimizing-sequences</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;In this episode of jank&amp;apos;s development updates, we follow an exciting few weekends as I was digging deep into Clojure&amp;apos;s sequence implementation, building jank&amp;apos;s equivalent, and then benchmarking and profiling in a dizzying race to the bottom.&lt;/p&gt;</summary></entry><entry><title type="html">jank development update - Lots of new changes</title><link href="https://jank-lang.org/blog/2022-12-08-progress-update" rel="alternate" title="jank development update - Lots of new changes" type="text/html" /><published>2022-12-08T00:00:00Z</published><updated>2022-12-08T00:00:00Z</updated><id>https://jank-lang.org/blog/2022-12-08-progress-update</id><author><name>Jeaye Wilkerson</name></author><summary type="html">&lt;p&gt;I was previously giving updates only in the &lt;a href=&quot;https://clojurians.slack.com/archives/C03SRH97FDK&quot;&gt;#jank&lt;/a&gt; Slack channel, but some of these are getting large enough to warrant more prose. Thus, happily, I can announce that jank has a new blog and I have a &lt;i&gt;lot&lt;/i&gt; of new progress to report! Let&amp;apos;s get into the details.&lt;/p&gt;</summary></entry></feed>

0 comments on commit 6aa8631

Please sign in to comment.