<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title>(blog . (coldboot . org))</title><id>https://blog.coldboot.org/feed.xml</id><subtitle>Recent Posts</subtitle><updated>2026-03-10T06:46:02Z</updated><link href="https://blog.coldboot.org/feed.xml" rel="self" /><link href="https://blog.coldboot.org" /><entry><title>Fixing Programmatic Tool Calling With Types</title><id>https://blog.coldboot.org/fixing-programmatic-tool-calling-with-types.html</id><author><name>Sarthak Shah</name><email>shahsarthakw@gmail.com</email></author><updated>2026-03-10T13:37:00Z</updated><link href="https://blog.coldboot.org/fixing-programmatic-tool-calling-with-types.html" rel="alternate" /><content type="html">&lt;p&gt;
Anthropic recently introduced &lt;a href=&quot;https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling&quot;&gt;Programmatic Tool Calling&lt;/a&gt;, which lets Large Language Models write Python programs to orchestrate multiple tool calls with loops, conditionals, and error handling. It is a very powerful method to have an agent run a huge number of tool calls without filling up its context window, and also avoid the latency of the usual call-one-tool-at-a-time loop.
&lt;/p&gt;&lt;p&gt;
This approach works great in demos, however it runs into a number of issues in production, and they all have the same root cause: Python is &lt;i&gt;too expressive&lt;/i&gt; for this job. I created a small, &lt;i&gt;restricted&lt;/i&gt; programming language called &lt;a href=&quot;https://github.com/matchcase/lambda-tool&quot;&gt;λ-Tool&lt;/a&gt; in OCaml to solve this problem, and it catches four common tool calling issues at &lt;b&gt;compile time&lt;/b&gt;, before a single tool call is made.
&lt;/p&gt;&lt;div id=&quot;outline-container-orgcedef29&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgcedef29&quot;&gt;The Issues&lt;/h2&gt;
&lt;div id=&quot;text-orgcedef29&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
Say you have a support agent. A customer writes in: &amp;quot;I was charged twice.&amp;quot; The LLM looks up the account, issues a refund, sends a reply. Here's the Python code it generates:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-python&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;account&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; lookup_account(&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;ticket.customer_id&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #a0a0cf;&quot;&gt;refund&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; issue_refund(&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;account_id&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: account[&lt;/span&gt;&lt;span style=&quot;color: #f9f9dededede;&quot;&gt;&amp;quot;id&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;],
    &lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;amount&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: account[&lt;/span&gt;&lt;span style=&quot;color: #f9f9dededede;&quot;&gt;&amp;quot;last_charge_cents&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;]&lt;/span&gt;
&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #a0a0cf;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; send_reply(&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;to&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: account[&lt;/span&gt;&lt;span style=&quot;color: #f9f9dededede;&quot;&gt;&amp;quot;email&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;],
    &lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;body&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: f&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;Refund of $&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;refund[&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;'amount'&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;] / &lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;:.2f&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt; processed. &amp;quot;&lt;/span&gt;
            &lt;span style=&quot;color: #b5ccad;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;Transaction: &lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;refund[&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;'tx_id'&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;&lt;/span&gt;
&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
This passes the sandbox. Every test succeeds. And yet, it has &lt;i&gt;at least&lt;/i&gt; three bugs:
&lt;/p&gt;

&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;&lt;b&gt;Wrong field&lt;/b&gt;
The account record has &lt;code&gt;subscription_tier&lt;/code&gt;. The LLM writes &lt;code&gt;account[&amp;quot;plan&amp;quot;]&lt;/code&gt; somewhere in the conditional logic. The mock returns a dict with everything the test expects, so the &lt;code&gt;KeyError&lt;/code&gt; never fires. In production it crashes, but only after side effects have already happened.&lt;/li&gt;

&lt;li&gt;&lt;b&gt;Double write&lt;/b&gt;
&lt;code&gt;issue_refund&lt;/code&gt; succeeds but the response times out. The LLM's error handling retries the call. The refund went through on the first attempt. Now the customer has been refunded twice.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-python&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;:
    &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;refund&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; issue_refund(&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;account_id&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: acct_id, &lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;amount&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;4999&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #a0a0cf;&quot;&gt;except&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;TimeoutError&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;:
    &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;refund&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; issue_refund(&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;account_id&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: acct_id, &lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;amount&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;4999&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;&lt;b&gt;Unhandled failure&lt;/b&gt;
The reply gets sent even when the refund fails, because &lt;code&gt;send_reply&lt;/code&gt; isn't conditional on &lt;code&gt;issue_refund&lt;/code&gt; succeeding. The customer gets an email saying &amp;quot;your refund has been processed&amp;quot; when it hasn't.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
The same bugs show up everywhere LLMs compose tools. An incident response bot retries a deployment rollback on timeout, re-deploying the broken version. A meeting bot creates a Jira ticket, the call fails, but sends a Slack message referencing the ticket key anyway. Wrong fields, unhandled errors, unsafe retry, unbounded loops.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgb87e0b4&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgb87e0b4&quot;&gt;λ-Tool&lt;/h2&gt;
&lt;div id=&quot;text-orgb87e0b4&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
&lt;a href=&quot;https://github.com/matchcase/lambda-tool&quot;&gt;λ-Tool&lt;/a&gt; makes these four bugs compile-time type errors; the LLM generates λ-Tool code instead of Python, then a type checker verifies the code before any tool runs. If the code is wrong, the LLM gets a type error, fixes it, and resubmits. Nothing executed, so the retry is free.
&lt;/p&gt;

&lt;p&gt;
Here's the same support agent in λ-Tool:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-ocaml&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;tool lookup_account: &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; -{&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Read&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;}-&amp;gt; {&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;id: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;, subscription_tier: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;,
                                       email: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;, last_charge_cents: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Int&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;};
tool issue_refund: {&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;account_id: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;, amount: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Int&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #a0a0cf;&quot;&gt;-{&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Write&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;}-&amp;gt; {&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;tx_id: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;};
tool send_reply: {&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;to&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;, body: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #a0a0cf;&quot;&gt;-{&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Write&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;}-&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;Unit&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;;

&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; exec tool lookup_account &lt;/span&gt;&lt;span style=&quot;color: #f3a0a0;&quot;&gt;&amp;quot;cust_12345&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #a0a0cf;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #e4b8c6;&quot;&gt;Ok&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;account&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #e4b8c6;&quot;&gt;=&amp;gt;
    &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt; exec tool issue_refund {&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;account_id = account.id,
                                   amount = account.last_charge_cents&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #e4b8c6;&quot;&gt;{&lt;/span&gt;
      &lt;span style=&quot;color: #b5ccad;&quot;&gt;Ok&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt;refund&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #b5ccad;&quot;&gt;=&amp;gt;
        &lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt; exec tool send_reply {&lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt;to&lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt; = account.email,
                                     body = refund.tx_id&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #b5ccad;&quot;&gt;{&lt;/span&gt;
          &lt;span style=&quot;color: #f3bdbd;&quot;&gt;Ok&lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d1c0bb;&quot;&gt;u&lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #f3bdbd;&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #f9f9dededede;&quot;&gt;&amp;quot;refund processed and customer notified&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt;,
          &lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt;Err&lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d1c0bb;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #f3bdbd;&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #f9f9dededede;&quot;&gt;&amp;quot;refund succeeded but notification failed&amp;quot;&lt;/span&gt;
        &lt;span style=&quot;color: #b5ccad;&quot;&gt;},
      &lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;Err&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #f3bdbd;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #b5ccad;&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;refund failed, customer not refunded&amp;quot;&lt;/span&gt;
    &lt;span style=&quot;color: #e4b8c6;&quot;&gt;},
  &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Err&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #e4b8c6;&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #f271dc5be362;&quot;&gt;&amp;quot;account lookup failed&amp;quot;&lt;/span&gt;
&lt;span style=&quot;color: #a0a0cf;&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Every tool declares its input type, output type, and effects (&lt;code&gt;Read&lt;/code&gt;, &lt;code&gt;Write&lt;/code&gt;). The types are how the checker knows what fields exist. If the LLM writes &lt;code&gt;account.plan&lt;/code&gt;, it gets:
&lt;/p&gt;
&lt;pre id=&quot;org1219d03&quot; class=&quot;example&quot;&gt;
Field 'plan' not found in record type
  {id: String, subscription_tier: String, email: String, last_charge_cents: Int}
&lt;/pre&gt;

&lt;p&gt;
Every &lt;code&gt;exec&lt;/code&gt; returns a &lt;code&gt;Result&lt;/code&gt;. The only way to use it is &lt;code&gt;match ... { Ok(x) =&amp;gt; ..., Err(e) =&amp;gt; ... }&lt;/code&gt;. The type checker rejects any program that uses a Result without matching both branches. &lt;code&gt;send_reply&lt;/code&gt; is nested inside &lt;code&gt;Ok(refund)&lt;/code&gt;, so it only runs if the refund succeeded. In the &lt;code&gt;Err&lt;/code&gt; branch, &lt;code&gt;refund&lt;/code&gt; doesn't exist as a variable, so the LLM can't reference data from a failed call.
&lt;/p&gt;

&lt;p&gt;
There is no retry mechanism. &lt;code&gt;exec tool issue_refund ...&lt;/code&gt; evaluates exactly once, and the language has no &lt;code&gt;try/except&lt;/code&gt;, no &lt;code&gt;while&lt;/code&gt;, no recursion. You can't write a retry loop because the syntax doesn't &lt;i&gt;allow&lt;/i&gt; it.
&lt;/p&gt;

&lt;p&gt;
Iteration is bounded: &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, &lt;code&gt;fold&lt;/code&gt; over finite lists; these require pure callbacks. Trying to call a tool inside &lt;code&gt;map&lt;/code&gt; is a type error:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-ocaml&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;tool charge: {&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;id: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Int&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;, amount: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Int&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #a0a0cf;&quot;&gt;-{&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Write&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;}-&amp;gt; {&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;tx_id: &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;};

map (&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;fn o: {&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;id: &lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;Int&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;, amount: &lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;Int&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a9c99f;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;=&amp;gt; exec tool charge o&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #a0a0cf;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;id = 1, amount = 100&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;]&lt;/span&gt;
&lt;span style=&quot;color: #a0a0cf;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;* &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Effect violation: allowed {}&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;but got {&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;Write&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Effectful iteration uses &lt;code&gt;traverse&lt;/code&gt;, which short-circuits on the first error and forces Result handling:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-ocaml&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; traverse (&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;fn o: {&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;id: &lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;Int&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;, amount: &lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;Int&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a9c99f;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;=&amp;gt;
    exec tool charge o
  &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #a0a0cf;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;id = 1, amount = 100&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: #a0a0cf;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #e4b8c6;&quot;&gt;Ok&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;receipts&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #e4b8c6;&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #f271dc5be362;&quot;&gt;&amp;quot;done&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;,
  &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Err&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #e4b8c6;&quot;&gt;=&amp;gt; e
&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Unlike Python-based Programmatic Tool Calling implementations, λ-Tool does not require a sandbox because the restrictiveness &lt;i&gt;is&lt;/i&gt; the sandbox.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org29dbcb9&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org29dbcb9&quot;&gt;Why Types&lt;/h2&gt;
&lt;div id=&quot;text-org29dbcb9&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
The idea of restricting a language to prevent errors goes back to Alonzo Church, who &lt;a href=&quot;https://plato.stanford.edu/entries/type-theory-church/&quot;&gt;added types to his lambda calculus&lt;/a&gt; in 1940 specifically to forbid nonsense like applying a number to a number. The typed version could express fewer programs, and yet that was the point: the programs you lose are exactly the ones you don't want. Robin Milner took this further with ML, adding type inference and mandatory pattern matching, so the compiler could prove you'd handled every case before the code ran. The &lt;a href=&quot;https://cs3110.github.io/textbook/chapters/adv/curry-howard.html&quot;&gt;Curry-Howard correspondence&lt;/a&gt; formalized why this works: types are propositions, programs are proofs, and a type checker is a proof checker. When λ-Tool rejects a program that doesn't handle &lt;code&gt;Err&lt;/code&gt;, it's rejecting an incomplete proof.
&lt;/p&gt;

&lt;p&gt;
Each of λ-Tool's four guarantees comes from a specific result in this lineage. Row types, from Didier Rémy's work extending ML records in the early 90s, give us field safety: &lt;code&gt;{id: String, email: String}&lt;/code&gt; means exactly those fields, and accessing anything else is a compile-time error. Mandatory Result matching is just ML's exhaustive pattern matching applied to tool calls, and bounded iteration (no &lt;code&gt;while&lt;/code&gt;, no recursion) gives guaranteed termination.
&lt;/p&gt;

&lt;p&gt;
The double-write problem, on the other hand, needed something newer. Jean-Yves Girard's &lt;a href=&quot;https://ncatlab.org/nlab/show/linear+logic&quot;&gt;linear logic&lt;/a&gt; introduced the idea that a fact can be used exactly once: when you use it, it's consumed. λ-Tool's &lt;code&gt;!T&lt;/code&gt; annotation applies this to values:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-ocaml&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;fn token: &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; =&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; = token &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; = token &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; a
&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;* &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;Linearity violation for 'token': used 2 times (&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;must be exactly once&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
A refund token, an API nonce, a deployment rollback: these are resources that should be consumed exactly once. Linear types enforce that at compile time.
&lt;/p&gt;

&lt;p&gt;
Jane Street routes hundreds of billions of dollars through OCaml, a direct descendant of ML, because its type system catches at compile time what would be runtime crashes in Python. λ-Tool applies the same tradition to the problem of tool composition by language models.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org81e237d&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org81e237d&quot;&gt;Results&lt;/h2&gt;
&lt;div id=&quot;text-org81e237d&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
I ran both Claude Sonnet and Haiku against 8 PTC tasks, generating both Python and λ-Tool. Both models generated valid λ-Tool on the first try over 94% of the time. The remaining ~4% were parse errors, caught instantly before any tool runs.
&lt;/p&gt;

&lt;p&gt;
In this experiment, every λ-Tool program that parsed also typed correctly, and every program that typed correctly executed without errors. The Python programs all ran without exceptions too, but that's the problem: several of them contained silent double-write bugs that the sandbox didn't catch. λ-Tool rejected the same patterns at compile time.
&lt;/p&gt;

&lt;p&gt;
The full experiment setup and results are in the &lt;a href=&quot;https://github.com/matchcase/lambda-tool/raw/main/paper/main.pdf&quot;&gt;paper&lt;/a&gt;.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org8324efb&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org8324efb&quot;&gt;Implementation&lt;/h2&gt;
&lt;div id=&quot;text-org8324efb&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
&lt;a href=&quot;https://github.com/matchcase/lambda-tool&quot;&gt;λ-Tool&lt;/a&gt; is ~2,500 lines of OCaml, containing a lexer, parser, bidirectional type checker, and interpreter. The type checker has 178 tests across three suites, plus 200,000 QCheck-generated random well-typed programs, with zero counterexamples of the type system's guarantees.
&lt;/p&gt;

&lt;p&gt;
The &lt;a href=&quot;https://github.com/matchcase/lambda-tool-python&quot;&gt;Python package&lt;/a&gt; wraps the OCaml CLI:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-python&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; lambda_tool &lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; LambdaTool

&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;lt&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; = LambdaTool()&lt;/span&gt;

&lt;span style=&quot;color: #a0a0cf;&quot;&gt;# Type-check -- no execution, no side effects&lt;/span&gt;
&lt;span style=&quot;color: #a0a0cf;&quot;&gt;check&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; = lt.typecheck(&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #a0a0cf;&quot;&gt;# Execute with real tool implementations&lt;/span&gt;
&lt;span style=&quot;color: #a0a0cf;&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt; = lt.run(&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;code, executors={&lt;/span&gt;
    &lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;lookup_account&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: real_account_api,
    &lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;issue_refund&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: real_refund_api,
    &lt;/span&gt;&lt;span style=&quot;color: #dadae665d6d6;&quot;&gt;&amp;quot;send_reply&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #b5ccad;&quot;&gt;: real_email_api,
&lt;/span&gt;&lt;span style=&quot;color: #e4b8c6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #a0a0cf;&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;a href=&quot;https://github.com/matchcase/minilambda&quot;&gt;minilambda&lt;/a&gt; is a basic (~200 LoC) demo agent that uses this Python package for tool calling. Claude generates λ-Tool code, the type checker verifies it, the interpreter executes it with real Python callbacks. It processes a batch of orders, which includes charging cards and sending receipts, with a simulated ~30% card decline rate. The type system forces Claude to handle the failures, because the code won't compile otherwise.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgc5ca6fe&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgc5ca6fe&quot;&gt;Links&lt;/h2&gt;
&lt;div id=&quot;text-orgc5ca6fe&quot; class=&quot;outline-text-2&quot;&gt;
&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/matchcase/lambda-tool&quot;&gt;λ-Tool&lt;/a&gt;: OCaml type checker and interpreter&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/matchcase/lambda-tool-python&quot;&gt;lambda-tool-python&lt;/a&gt;: Python package&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/matchcase/minilambda&quot;&gt;minilambda&lt;/a&gt;: minimal working agent&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/matchcase/lambda-tool/raw/main/paper/main.pdf&quot;&gt;Paper&lt;/a&gt;: full type system and proofs&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/matchcase/lambda-tool/blob/main/skill.md&quot;&gt;skill.md&lt;/a&gt;: the prompt that teaches Claude to generate λ-Tool code&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org2f1e3d2&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org2f1e3d2&quot;&gt;About Me&lt;/h2&gt;
&lt;div id=&quot;text-org2f1e3d2&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
My name is &lt;a href=&quot;https://coldboot.org&quot;&gt;Sarthak&lt;/a&gt; and I like using cross-disciplinary techniques to solve interesting problems. The ivory tower has many spires, and I like building bridges that connect them. If you have something interesting that you would like me to work on, please feel free to &lt;a href=&quot;mailto:shahsarthakw@gmail.com&quot;&gt;reach out&lt;/a&gt;.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</content></entry><entry><title>Parameterized Packages: The Project Completion Update</title><id>https://blog.coldboot.org/parameterized-packages-the-project-completion-update.html</id><author><name>Sarthak Shah</name><email>shahsarthakw@gmail.com</email></author><updated>2023-09-18T13:37:00Z</updated><link href="https://blog.coldboot.org/parameterized-packages-the-project-completion-update.html" rel="alternate" /><content type="html">&lt;p&gt;
This post is a small completion update for my &lt;a href=&quot;https://summerofcode.withgoogle.com/programs/2023/projects/heQYLzrz&quot;&gt;GSoC project&lt;/a&gt; on adding Parameterized Packages to &lt;a href=&quot;https://guix.gnu.org&quot;&gt;GNU Guix&lt;/a&gt;.
You can find the source code for the same on the main &lt;a href=&quot;https://notabug.org/cel7t/guix-parameters&quot;&gt;notabug&lt;/a&gt; repository or on the &lt;a href=&quot;https://github.com/matchcase/guix-parameters/&quot;&gt;github&lt;/a&gt; mirror.
This post is broken into two parts; the first is a simple overview of the uses of parameters and the second answers some commonly asked questions.
&lt;/p&gt;&lt;div id=&quot;outline-container-org0fe00da&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org0fe00da&quot;&gt;What is Package Parameterization?&lt;/h2&gt;
&lt;div id=&quot;text-org0fe00da&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
In its current state, Package Parameterization makes it possible to add compile-time options to any Guix package, regardless of whether it was defined with support for a given compile-time option or not. This makes it a very powerful tool for hackers seeking to extend their packages in unorthodox and interesting ways. &lt;b&gt;But that's not all!&lt;/b&gt; Parameters can be used to make any kind of changes to package definitions conditionally, making them very useful substitutes for unimplemented &lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/Package-Transformation-Options.html&quot;&gt;package transformation options&lt;/a&gt; in a lot of cases.
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org7f2c9fa&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org7f2c9fa&quot;&gt;What are compile-time options?&lt;/h3&gt;
&lt;div id=&quot;text-org7f2c9fa&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
Compile-time options are package features that can be selected only when a package is being compiled from source. Most binary-based GNU/Linux distributions pick these options for the users, often selecting options that the user might not need while leaving out some options that they might really need. These become especially relevant in the context of High-Performance Computing and computing on alternate ISAs, where greater flexibility with compile-time options is greatly needed.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgc3f2940&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgc3f2940&quot;&gt;What makes Package Parameterization special?&lt;/h2&gt;
&lt;div id=&quot;text-orgc3f2940&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
The strength of package parameterization lies in the fact that users will now be able to create &lt;i&gt;generic compile-time options&lt;/i&gt; that they will be able to apply to any number of packages they like. It's almost akin to being able to create custom package transformation options, with the caveat that only an enumerated set of options will be available for choosing.
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org3843239&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org3843239&quot;&gt;Generic Compile-time Options&lt;/h3&gt;
&lt;div id=&quot;text-org3843239&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
The compile-time options created by parameters will be &lt;i&gt;generic&lt;/i&gt; if the author chooses to write a &lt;i&gt;global parameter&lt;/i&gt; for a given parameterization. This means that if, for example, I write a global parameter that enables text-to-speech support, it will work on &lt;i&gt;any&lt;/i&gt; package that satisfies this parameter's predicate.
The predicate is a user-defined function that returns &lt;code&gt;#t&lt;/code&gt; or &lt;code&gt;#f&lt;/code&gt; after checking a number of things about the package passed to it like the package's build system, inputs or arguments among other things. This helps prevent the usage of parameters on packages that they are not compatible with.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgee9ade8&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgee9ade8&quot;&gt;What does this look like in action?&lt;/h2&gt;
&lt;div id=&quot;text-orgee9ade8&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
I have demonstrated this in great detail in &lt;a href=&quot;https://blog.coldboot.org/parameterized-packages-the-second-update.html&quot;&gt;this&lt;/a&gt; post, for a quick example please head to the section where I've parameterized a bunch of variants of Emacs (&amp;quot;What does using parameters look like?&amp;quot;).
All of the examples in the post work and you can try them out by applying the &lt;a href=&quot;https://notabug.org/cel7t/guix-parameters/raw/master/parameterization.patch&quot;&gt;parameterization patch&lt;/a&gt; to a local copy of Guix.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orga133e2b&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orga133e2b&quot;&gt;Reasons for trying Package Parameters&lt;/h2&gt;
&lt;div id=&quot;text-orga133e2b&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
In no particular order, here are some good reasons why you should try using Package Parameters
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgd9a1a56&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orgd9a1a56&quot;&gt;1. Speeding up packages that you use very often&lt;/h3&gt;
&lt;div id=&quot;text-orgd9a1a56&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
To maintain stability and ensure that packages work across a wide variety of devices, Guix usually does not build packages with a lot of compile-time speed optimizations. However, with parameterization it is possible to speed up packages that you use very often for a much smoother and faster computing experience.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgbe2192d&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orgbe2192d&quot;&gt;2. Easily creating and accessing multiple variants for packages&lt;/h3&gt;
&lt;div id=&quot;text-orgbe2192d&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
Parameters make it easy to succinctly write packages with multiple variants and switch between them with the &lt;code&gt;--with-parameter&lt;/code&gt; transform.
It is also possible to take an existing package and add a number of variants to it, like in the Emacs example mentioned in the previous heading.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgd3ccb63&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orgd3ccb63&quot;&gt;3. Applying compile-time customizations to a number of packages&lt;/h3&gt;
&lt;div id=&quot;text-orgd3ccb63&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
Using global parameters, it's possible to have common parameterized options across a huge number of packages. This makes it easy to use parameterized variants of packages without having to rewrite each of them with the compile-time option you want to use.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgcfe2ef6&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orgcfe2ef6&quot;&gt;4. Learning more about your packages&lt;/h3&gt;
&lt;div id=&quot;text-orgcfe2ef6&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
This last reason is a bit opinionated, but I think that you get to learn a lot more about how the packages you're using work when you tweak them like this. It makes you mindful of all the packages that you are using, and sometimes even helps you discover new things about them that you otherwise wouldn't know about!
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgfaa74f9&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgfaa74f9&quot;&gt;Answers to some commonly asked questions&lt;/h2&gt;
&lt;div id=&quot;text-orgfaa74f9&quot; class=&quot;outline-text-2&quot;&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org9493e0b&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org9493e0b&quot;&gt;Changes in the Syntax&lt;/h3&gt;
&lt;div id=&quot;text-org9493e0b&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
The main point of confusion so far has been the &lt;i&gt;syntax&lt;/i&gt; for package parameterization, which has gone through a couple of changes over time.
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org879d658&quot; class=&quot;outline-4&quot;&gt;
&lt;h4 id=&quot;org879d658&quot;&gt;The Parameter List&lt;/h4&gt;
&lt;div id=&quot;text-org879d658&quot; class=&quot;outline-text-4&quot;&gt;
&lt;p&gt;
The parameter list is a fundamental component of this project.
At any place that accepts a list of parameters, the user passes a parameter list.
Parameter lists are lists of the form &lt;code&gt;((parameter value) (parameter-2 value-2) ...)&lt;/code&gt;
The first value in the cell is the symbol of the parameter, and the second value in the cell is the value of the parameter.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org826a939&quot; class=&quot;outline-4&quot;&gt;
&lt;h4 id=&quot;org826a939&quot;&gt;Negation and &lt;code&gt;!&lt;/code&gt;&lt;/h4&gt;
&lt;div id=&quot;text-org826a939&quot; class=&quot;outline-text-4&quot;&gt;
&lt;p&gt;
Previously, we were using &lt;code&gt;!&lt;/code&gt; to denote the negation of a parameter.
&lt;b&gt;This has been removed in newer versions&lt;/b&gt;.
The rationale behind this removal is that &lt;code&gt;!&lt;/code&gt; does not clearly denote negation, and having arbitrary restrictions behind what kind of symbols are allowed and what kind are not would again cause confusion.
Instead, we now use &lt;code&gt;#:off&lt;/code&gt; to denote the &lt;i&gt;negative&lt;/i&gt; value for any given parameter.
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #cf9f7f; font-style: italic;&quot;&gt;;; &lt;/span&gt;&lt;span style=&quot;color: #cf9f7f; font-style: italic;&quot;&gt;old style&lt;/span&gt;
&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;parameter-if (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;a val&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #6f9e77;&quot;&gt;b!&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #c6a6b3;&quot;&gt;do-thing&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #cf9f7f; font-style: italic;&quot;&gt;;; &lt;/span&gt;&lt;span style=&quot;color: #cf9f7f; font-style: italic;&quot;&gt;new style&lt;/span&gt;
&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;parameter-if (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;a val&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;b &lt;/span&gt;&lt;span style=&quot;color: #d4878a; font-weight: bold;&quot;&gt;#:off&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #c6a6b3;&quot;&gt;do-thing&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orga6aa05a&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orga6aa05a&quot;&gt;Handling of Global Parameters&lt;/h3&gt;
&lt;div id=&quot;text-orga6aa05a&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
This topic is still under debate, but for now I have opted to use a &lt;i&gt;separate namespace&lt;/i&gt; for global parameters. I'm accomplishing this with the help of a global hash-table.
This is for two main reasons:
&lt;/p&gt;
&lt;ol class=&quot;org-ol&quot;&gt;
&lt;li&gt;We can guarantee that global parameters are unique by adding checks for uniqueness in the global parameter definition macro&lt;/li&gt;
&lt;li&gt;Parameter names can stay small inside the various parameter lists in the parameter-spec&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Furthermore, a lot of the existing processing functions work on unique symbols denoting the parameters and not the parameters themselves, so a massive rewrite would be necessary if we want to pass them parameters instead.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org39adff6&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org39adff6&quot;&gt;Support for setting Global Parameter Values&lt;/h3&gt;
&lt;div id=&quot;text-org39adff6&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
Due to the very alpha state of parameterization, this has not yet been implemented. However parameters are a package transformation option and can be used just like any other package transformation option, so it's possible to create manifest files with parameterization for the packages a user is using.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgb234df6&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orgb234df6&quot;&gt;Documentation and Tests?&lt;/h3&gt;
&lt;div id=&quot;text-orgb234df6&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
I have not written texinfo documentation or unit tests for Package Parameterization yet as they're expected to change considerably in the process of being merged into master.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgb2cd078&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orgb2cd078&quot;&gt;When will Parameters be merged to master?&lt;/h3&gt;
&lt;div id=&quot;text-orgb2cd078&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
While Package Parameterization itself works great, among other things a host of tools for writing parameterized packages more easily and measuring the complexity of parameterized packages are necessary before this project is merged to master. In the meantime, I would really appreciate feedback and bug reports on the current parameterized packages patch. It can be added to a source install of Guix with a &lt;a href=&quot;https://notabug.org/cel7t/guix-parameters/raw/master/parameterization.patch&quot;&gt;simple patch&lt;/a&gt; that does not affect any other component of Guix. Please raise issues on the &lt;a href=&quot;https://notabug.org/cel7t/guix-parameters&quot;&gt;notabug repository&lt;/a&gt; or send me an &lt;a href=&quot;mailto:shahsarthakw@gmail.com&quot;&gt;email&lt;/a&gt; if you encounter any issues with this patch, it would greatly help with development.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org21c90a9&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org21c90a9&quot;&gt;Installing the patch&lt;/h3&gt;
&lt;div id=&quot;text-org21c90a9&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
To install the patch, you will need to build a git copy of Guix. You can find instructions to do the same &lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/Building-from-Git.html&quot;&gt;here&lt;/a&gt;.
After building Guix from git, copy the patch into the directory and run &lt;code&gt;git apply parameterization.patch&lt;/code&gt; to apply it to the source.
Using &lt;code&gt;./pre-inst-env&lt;/code&gt; (see &lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/Running-Guix-Before-It-Is-Installed.html&quot;&gt;Running Guix Before It Is Installed&lt;/a&gt;) now should give you access to parameters.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org18e2d6d&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org18e2d6d&quot;&gt;Thanks&lt;/h2&gt;
&lt;div id=&quot;text-org18e2d6d&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
I owe a great deal of credit for this project to my mentors Pjotr Prins and Gabor Boskovits as their guidance was instrumental to its completion. I would also like to thank Ludovic Courtes, Arun Isaac and Efraim Flashner for their feedback and suggestions, which shaped this project into something much more beautiful than what I had originally envisioned. I also learned a lot about writing good Scheme code in the process, and I'm very thankful to Arun Isaac in particular for his detailed and insightful explanations about good practices for writing Scheme code. I also really appreciate the Guix community's enthusiastic and helpful comments on this project, which motivated me to keep working on it.
&lt;/p&gt;

&lt;p&gt;
Thank you and Happy Hacking!
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</content></entry><entry><title>Parameterized Packages: The Second Update</title><id>https://blog.coldboot.org/parameterized-packages-the-second-update.html</id><author><name>Sarthak Shah</name><email>shahsarthakw@gmail.com</email></author><updated>2023-08-03T13:37:00Z</updated><link href="https://blog.coldboot.org/parameterized-packages-the-second-update.html" rel="alternate" /><content type="html">&lt;p&gt;
This is the third entry in my series of blog posts about adding Parameterized Packages to &lt;a href=&quot;https://guix.gnu.org/&quot;&gt;GNU Guix&lt;/a&gt; for my &lt;a href=&quot;https://summerofcode.withgoogle.com/programs/2023/projects/heQYLzrz&quot;&gt;Google Summer of Code project&lt;/a&gt;. Parameterization here refers to making it possible for packages to be built with &lt;i&gt;compile-time options&lt;/i&gt;, and I have gone over the reasons and benefits for doing so in detail in the &lt;a href=&quot;https://blog.coldboot.org/an-introduction-to-parameterized-packages.html&quot;&gt;first post about Parameterized Packages&lt;/a&gt;.
&lt;/p&gt;&lt;p&gt;
In the &lt;a href=&quot;https://blog.coldboot.org/parameterized-packages-an-update.html&quot;&gt;last update&lt;/a&gt; I talked about implementing support for &lt;i&gt;boolean&lt;/i&gt;, &lt;i&gt;non-negative&lt;/i&gt; parameters. In this update, I've implemented negation, enumeration and a few other features that will make parameters considerably more powerful!
&lt;/p&gt;&lt;div id=&quot;outline-container-org5766ce6&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org5766ce6&quot;&gt;What's New&lt;/h2&gt;
&lt;div id=&quot;text-org5766ce6&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
A brief summary of additions is
&lt;/p&gt;
&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;Parametric Variants&lt;/li&gt;
&lt;li&gt;Parameter Dependencies&lt;/li&gt;
&lt;li&gt;'Negation' for parameter types&lt;/li&gt;
&lt;li&gt;Enumerated Types&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org3825d94&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org3825d94&quot;&gt;Parametric Variants&lt;/h3&gt;
&lt;div id=&quot;text-org3825d94&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
To make global parameters useful, it is necessary to be able to change the contents of a package in ways that &lt;a href=&quot;https://guix.gnu.org/manual/devel/en/html_node/Package-Transformation-Options.html&quot;&gt;Package Transformations&lt;/a&gt; might not be able to by themselves. Additionally, users might find themselves in situations where they wish to perform different operations for different values of an enumerated type.
&lt;/p&gt;

&lt;p&gt;
&amp;quot;Parametric Variants&amp;quot; refers to matching against enumerated values and using methods of &lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/Defining-Package-Variants.html&quot;&gt;Defining Package Variants&lt;/a&gt;, such as package transforms, &lt;code&gt;modify-inputs&lt;/code&gt; and procedures that return packages. Parameters now can use any of these methods instead of just using transformations.
&lt;/p&gt;

&lt;p&gt;
For a better understanding of them, please look at any of the examples using the &lt;code&gt;variant-match&lt;/code&gt; macro.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org450fd04&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org450fd04&quot;&gt;Parameter Dependencies&lt;/h3&gt;
&lt;div id=&quot;text-org450fd04&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
It's possible that enabling a parameter might require enabling another parameter or a package.
For such situations, I've added a new &lt;code&gt;dependencies&lt;/code&gt; field to the parameter record that lets users specify parameters or packages a given parameter depends on. You can also fine-tune values for the parameter and the parameters in dependencies.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org4042377&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org4042377&quot;&gt;Negation and Enumeration&lt;/h3&gt;
&lt;div id=&quot;text-org4042377&quot; class=&quot;outline-text-3&quot;&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org7edbe2c&quot; class=&quot;outline-4&quot;&gt;
&lt;h4 id=&quot;org7edbe2c&quot;&gt;Enumeration&lt;/h4&gt;
&lt;div id=&quot;text-org7edbe2c&quot; class=&quot;outline-text-4&quot;&gt;
&lt;p&gt;
In the previous version, parameters could only be in two states: &lt;code&gt;on&lt;/code&gt; and &lt;code&gt;off&lt;/code&gt;.
This version makes it possible for parameters to take &lt;b&gt;multiple states&lt;/b&gt;, as long as the user specifies all the possible states.
This has a huge number of uses- for example, here's a parameter type for locales:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3; font-weight: bold;&quot;&gt;define&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;locale-parameter-type&lt;/span&gt;
&lt;span style=&quot;color: #c6a6b3;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;parameter-type&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;   (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;name 'locale-type&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;accepted-values&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;    '(&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;ca_ES cs_CZ da_DK de_DE&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;            el_GR en_AU en_CA en_GB&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;            en_US es_AR es_CL es_ES&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;            es_MX fi_FI fr_BE fr_CA&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;            fr_CH fr_FR ga_IE it_IT&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;            ja_JP ko_KR nb_NO nl_NL&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;            pl_PL pt_PT ro_RO ru_RU&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;            sv_SE tr_TR uk_UA vi_VN&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;            zh_CN&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;negation #f&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;default 'en_US&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;description &lt;/span&gt;&lt;span style=&quot;color: #ea69c3c3c544;&quot;&gt;&amp;quot;Type for Locales&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;&lt;a id=&quot;org17af5f1&quot;&gt;&lt;/a&gt;Explanation&lt;br /&gt;
&lt;div id=&quot;text-org17af5f1&quot; class=&quot;outline-text-5&quot;&gt;
&lt;p&gt;
&lt;code&gt;parameter-type&lt;/code&gt; is the record type for parameter types.
Please note that &lt;b&gt;parameter types&lt;/b&gt; are different from &lt;b&gt;parameters&lt;/b&gt;.
Parameter types are similar to variable types (character, boolean, symbol etc.) and parameters are similar to variables as they possess a type.
The fields of this record are
&lt;/p&gt;
&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;&lt;code&gt;name&lt;/code&gt; which must be a symbol
Unlike parameters, parameter-types are identified by the symbol bound by &lt;code&gt;define&lt;/code&gt; (here &lt;code&gt;locale-parameter-type&lt;/code&gt;) instead of their &lt;code&gt;name&lt;/code&gt; field. The &lt;code&gt;name&lt;/code&gt; field is purely for the sake of the Guix UI, while the bound name is what is used to utilize a record in a parameter.
So to use this record in a parameter record, you would put &lt;code&gt;locale-parameter-type&lt;/code&gt; in its &lt;code&gt;type&lt;/code&gt; field.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;accepted-values&lt;/code&gt; which must be a list of symbols with &lt;i&gt;at least&lt;/i&gt; two elements.
This represents the entire set of values parameters belonging to this parameter type can take.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;
&lt;code&gt;negation&lt;/code&gt; which returns the 'negative' element.
By default this is the first element of &lt;code&gt;accepted-values&lt;/code&gt;, and if it is set to &lt;code&gt;#f&lt;/code&gt; like here then negation is not supported for that parameter. It will throw an error if a user tries negating the parameter.
Users can negate a parameter in a parameter list by using the &lt;code&gt;#:off&lt;/code&gt; keyword:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;list ... (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;parameter-name &lt;/span&gt;&lt;span style=&quot;color: #6f9e77; font-weight: bold;&quot;&gt;#:off&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #c6a6b3;&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Normally, you would place a &lt;i&gt;value&lt;/i&gt; from &lt;code&gt;accepted-values&lt;/code&gt; in the right part of the cell, however, &lt;code&gt;#:off&lt;/code&gt; gives the 'negative' value for all parameters that support negation.
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;default&lt;/code&gt; is a value taken by the parameter if the keyword &lt;code&gt;#:default&lt;/code&gt; is used on it.
This works similar to negation, but you put &lt;code&gt;#:default&lt;/code&gt; instead of a &lt;code&gt;#:negation&lt;/code&gt; in the right part of the cell. In the case of &lt;code&gt;default&lt;/code&gt;, its default value is the second element of &lt;code&gt;accepted-values&lt;/code&gt; if &lt;code&gt;negation&lt;/code&gt; is not set to &lt;code&gt;#f&lt;/code&gt;, and the first element otherwise.
In our example, it is set to &lt;code&gt;'en_US&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;description&lt;/code&gt; which provides a description of the parameter type.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgf9cde02&quot; class=&quot;outline-4&quot;&gt;
&lt;h4 id=&quot;orgf9cde02&quot;&gt;Negation&lt;/h4&gt;
&lt;div id=&quot;text-orgf9cde02&quot; class=&quot;outline-text-4&quot;&gt;
&lt;p&gt;
&lt;i&gt;Negation&lt;/i&gt; refers to being able to specify the opposite value for a parameter.
If it is set to anything but &lt;code&gt;#f&lt;/code&gt; for a given &lt;code&gt;parameter-type&lt;/code&gt; record, any &lt;code&gt;package&lt;/code&gt; record belonging to that &lt;code&gt;parameter-type&lt;/code&gt; takes on that value when set to the special keyword &lt;code&gt;#:off&lt;/code&gt;.
Here's an example that uses it to run the &lt;code&gt;without-tests&lt;/code&gt; transform on a package whenever the &lt;code&gt;boolean&lt;/code&gt; parameter &lt;code&gt;tests&lt;/code&gt; is set to &lt;code&gt;#:off&lt;/code&gt;.
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;define-global-parameter&lt;/span&gt;
&lt;span style=&quot;color: #c6a6b3;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;package-parameter&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;   (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;name 'tests&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;variants&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;parameter-variant-match&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;     (&lt;/span&gt;&lt;span style=&quot;color: #bbcde3; font-weight: bold;&quot;&gt;#:off&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #bbcde3; font-weight: bold;&quot;&gt;#:transform&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;without-tests &lt;/span&gt;&lt;span style=&quot;color: #6eb0eb; font-weight: bold;&quot;&gt;#:package-name&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;description &lt;/span&gt;&lt;span style=&quot;color: #ea69c3c3c544;&quot;&gt;&amp;quot;Toggle for tests&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;predicate #t&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;&lt;a id=&quot;org7cea65f&quot;&gt;&lt;/a&gt;Explanation&lt;br /&gt;
&lt;div id=&quot;text-org7cea65f&quot; class=&quot;outline-text-5&quot;&gt;
&lt;p&gt;
&lt;code&gt;define-global-parameter&lt;/code&gt; is a macro that takes a parameter record and makes it global.
This means that it can be referred to in any parameter definition, and that its &lt;code&gt;name&lt;/code&gt; is guaranteed to be unique among all global parameters.
&lt;code&gt;package-parameter&lt;/code&gt; is the record type for parameters. Please note that the record is &lt;b&gt;not&lt;/b&gt; called &lt;code&gt;parameter&lt;/code&gt;, as it refers to something else entirely in Guile Scheme.
The record accepts values for the fields &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;type&lt;/code&gt;, &lt;code&gt;variants&lt;/code&gt;, &lt;code&gt;predicate&lt;/code&gt; and &lt;code&gt;description&lt;/code&gt;.
&lt;/p&gt;
&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;&lt;code&gt;name&lt;/code&gt; is a symbol, similar to &lt;code&gt;parameter-type&lt;/code&gt;'s &lt;code&gt;name&lt;/code&gt; field.
However unlike &lt;code&gt;parameter-type&lt;/code&gt;'s &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;package-parameter&lt;/code&gt;'s &lt;code&gt;name&lt;/code&gt; is very significant.
We do not refer to parameters by any Scheme binding (through something like &lt;code&gt;define&lt;/code&gt; or &lt;code&gt;let&lt;/code&gt;), as it could lead to unexpected errors in logic validation fields.
Parameters are only referred to by their &lt;code&gt;name&lt;/code&gt; field, which is always unique for global parameters. If a global and local parameter share names, the local parameter is given preference. If two local parameters with the same name are added, an error will be signaled.
The user can hence rest assured that in the context of any given package, each &lt;code&gt;name&lt;/code&gt; has a unique meaning.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;type&lt;/code&gt; is the &lt;code&gt;parameter-type&lt;/code&gt; to use as the basis for the parameter.
By default, it is set to &lt;code&gt;boolean&lt;/code&gt; which consists of the states &lt;code&gt;on&lt;/code&gt; and &lt;code&gt;off&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;variants&lt;/code&gt; is an associative list that assigns transforms, procedures, valid build systems etc. to parameter values.
This replaces the &lt;code&gt;transforms&lt;/code&gt; field from the last post.
Users are expected &lt;i&gt;not&lt;/i&gt; to write the alist themselves, but to instead use the &lt;code&gt;parameter-variant-match&lt;/code&gt; macro that generates an alist based on a specification as seen here.
This macro is somewhat similar to the &lt;code&gt;build-system/transform-match&lt;/code&gt; macro from the last post.
Users can also use &lt;code&gt;parameter-variant&lt;/code&gt; if they want to match a single value.
&lt;code&gt;#:off&lt;/code&gt; matches the 'negative' value for &lt;i&gt;any&lt;/i&gt; parameter, and &lt;code&gt;_&lt;/code&gt; matches all non-negative values.
It is possible to match multiple values by putting them in a list like &lt;code&gt;(_ #:off)&lt;/code&gt;.
Note that here it would have been possible to use the &lt;i&gt;symbol&lt;/i&gt; &lt;code&gt;off&lt;/code&gt; instead of the special keyword &lt;code&gt;#:off&lt;/code&gt;, as our parameter belongs to the &lt;code&gt;boolean&lt;/code&gt; type and its negative value is &lt;code&gt;off&lt;/code&gt;. But it is a good idea to use &lt;code&gt;#:off&lt;/code&gt; as it always matches against the negative symbol, regardless of the &lt;code&gt;parameter-type&lt;/code&gt;'s accepted values.
Users can also specify the build system the value should match, as seen in the &lt;code&gt;gcc-oflag&lt;/code&gt; parameter in the Bonus Examples section.
This is not all there is to the magic of &lt;code&gt;parameter-variant-match&lt;/code&gt;;
to make parameterization more useful, it lets users get the package name, the package and the value of the parameter the statement matched against.
These are accessed through &lt;a href=&quot;https://www.gnu.org/software/guile/manual/html_node/Keywords.html&quot;&gt;keywords&lt;/a&gt;, such as the &lt;code&gt;#:package-name&lt;/code&gt; keyword in this argument.
Have a look at the &lt;code&gt;gcc-oflag&lt;/code&gt; and &lt;code&gt;static-lib&lt;/code&gt; parameters in &lt;a href=&quot;#org6ceb6ea&quot;&gt;Bonus Examples&lt;/a&gt; to learn more!&lt;/li&gt;
&lt;li&gt;&lt;code&gt;predicate&lt;/code&gt; is set to &lt;code&gt;#f&lt;/code&gt; by default.
&lt;code&gt;#f&lt;/code&gt; means that the given parameter can only be used when its been mentioned in a package's &lt;code&gt;parameter-spec&lt;/code&gt;.
Setting this to &lt;code&gt;#t&lt;/code&gt; means that a &lt;i&gt;global&lt;/i&gt; parameter can be applied to packages that do not have it in their spec. &lt;b&gt;This is extremely dangerous and should only be used for extremely generic parameters&lt;/b&gt;.
Otherwise, the user may set this to any lambda that takes a &lt;code&gt;package&lt;/code&gt; record as its argument and returns &lt;code&gt;#t&lt;/code&gt; or &lt;code&gt;#f&lt;/code&gt;. The global parameter will be applied if this lambda returns &lt;code&gt;#t&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;
&lt;code&gt;dependencies&lt;/code&gt; is a list of parameters and packages that a given parameter depends on. The list is punctuated by keywords to indicate parameter and package dependencies, with &lt;code&gt;#:parameter&lt;/code&gt; and &lt;code&gt;#:package&lt;/code&gt; respectively. If no keywords are given, the arguments are assumed to be parameters.
&lt;b&gt;Package dependencies have not been implemented yet.&lt;/b&gt;
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;dependencies&lt;/span&gt;
&lt;span style=&quot;color: #c6a6b3;&quot;&gt;`(&lt;/span&gt;&lt;span style=&quot;color: #6f9e77; font-weight: bold;&quot;&gt;#:parameter&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt; a b ...&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #6f9e77; font-weight: bold;&quot;&gt;#:package&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt; git ,(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;package (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color: #e867d958cf4e;&quot;&gt;&amp;quot;some-package&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #d4878a;&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #6f9e77;&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;description&lt;/code&gt; is a simple description of the parameter.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org91caaaf&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org91caaaf&quot;&gt;What does using parameters look like?&lt;/h2&gt;
&lt;div id=&quot;text-org91caaaf&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
Here is an example use-case for parameterization, which packages Emacs' &lt;code&gt;next&lt;/code&gt;, &lt;code&gt;pgtk&lt;/code&gt;, &lt;code&gt;xwidgets&lt;/code&gt;, &lt;code&gt;wide-int&lt;/code&gt; and &lt;code&gt;no-x&lt;/code&gt; variants in one package and also makes it possible to mix and match compatible variants.
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgcc96939&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orgcc96939&quot;&gt;Usage&lt;/h3&gt;
&lt;div id=&quot;text-orgcc96939&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
The usage format for parameters is the same as that for other package transforms- you specify them through the CLI. In the future, it will also be possible to have a global set of transforms.
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-bash&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;guix install emacs-parameterized &lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;\&lt;/span&gt;
&lt;span style=&quot;color: #7a94df;&quot;&gt;     --with-parameter=emacs-parameterized=&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;pgtk&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;=on &lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;\&lt;/span&gt;
&lt;span style=&quot;color: #7a94df;&quot;&gt;     --with-parameter=emacs-parameterized=tree-sitter=on &lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;\&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgf6e509d&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orgf6e509d&quot;&gt;Underlying Code&lt;/h3&gt;
&lt;div id=&quot;text-orgf6e509d&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
&lt;b&gt;EDIT 9/18/2023:&lt;/b&gt; as the &lt;code&gt;package&lt;/code&gt; record's &lt;code&gt;source&lt;/code&gt; field is not thunked, I'm instead using a &lt;code&gt;#:lambda&lt;/code&gt; inside the &lt;code&gt;next&lt;/code&gt; package parameter to change it.
&lt;/p&gt;

&lt;p&gt;
Under the hood, this is what the implementation looks like.
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;package-with-parameters&lt;/span&gt;
&lt;span style=&quot;color: #c6a6b3;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;parameter-spec&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;local&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;list&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;     (&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;package-parameter &lt;/span&gt;
&lt;span style=&quot;color: #bbcde3;&quot;&gt;      (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;name 'next&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;variants&lt;/span&gt;
&lt;span style=&quot;color: #6eb0eb;&quot;&gt;       (&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;parameter-variant-match&lt;/span&gt;
&lt;span style=&quot;color: #d6a7c4;&quot;&gt;        (&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;_&lt;/span&gt;
&lt;span style=&quot;color: #3cae42;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;color: #3cae42; font-weight: bold;&quot;&gt;#:lambda&lt;/span&gt;
&lt;span style=&quot;color: #3cae42;&quot;&gt;         (&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6; font-weight: bold;&quot;&gt;lambda&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #d69b21;&quot;&gt;pkg&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;)&lt;/span&gt;
           &lt;span style=&quot;color: #ebb4b6;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d69b21;&quot;&gt;package&lt;/span&gt;
&lt;span style=&quot;color: #d69b21;&quot;&gt;            (&lt;/span&gt;&lt;span style=&quot;color: #a0c1cb;&quot;&gt;inherit pkg&lt;/span&gt;&lt;span style=&quot;color: #d69b21;&quot;&gt;)&lt;/span&gt;
            &lt;span style=&quot;color: #d69b21;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a0c1cb;&quot;&gt;version &lt;/span&gt;&lt;span style=&quot;color: #d04fe0e0e5e4;&quot;&gt;&amp;quot;29.0.92&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #d69b21;&quot;&gt;)&lt;/span&gt;
            &lt;span style=&quot;color: #d69b21;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a0c1cb;&quot;&gt;source&lt;/span&gt;
&lt;span style=&quot;color: #a0c1cb;&quot;&gt;             (&lt;/span&gt;&lt;span style=&quot;color: #d6dbe9;&quot;&gt;origin&lt;/span&gt;
&lt;span style=&quot;color: #d6dbe9;&quot;&gt;              (&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;inherit (&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;package-source pkg&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6dbe9;&quot;&gt;)&lt;/span&gt;
              &lt;span style=&quot;color: #d6dbe9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;method git-fetch&lt;/span&gt;&lt;span style=&quot;color: #d6dbe9;&quot;&gt;)&lt;/span&gt;
              &lt;span style=&quot;color: #d6dbe9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;uri&lt;/span&gt;
&lt;span style=&quot;color: #ebebeb;&quot;&gt;               (&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;git-reference&lt;/span&gt;
&lt;span style=&quot;color: #adadad;&quot;&gt;                (&lt;/span&gt;&lt;span style=&quot;color: #e4d9d9;&quot;&gt;url &lt;/span&gt;&lt;span style=&quot;color: #f271ecececec;&quot;&gt;&amp;quot;https://git.savannah.gnu.org/git/emacs.git/&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;)&lt;/span&gt;
                &lt;span style=&quot;color: #adadad;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e4d9d9;&quot;&gt;commit (&lt;/span&gt;&lt;span style=&quot;color: #eae9e8;&quot;&gt;string-append &lt;/span&gt;&lt;span style=&quot;color: #f574f4f3f473;&quot;&gt;&amp;quot;emacs-&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #eae9e8;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #e4d9d9;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6dbe9;&quot;&gt;)&lt;/span&gt;
              &lt;span style=&quot;color: #d6dbe9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;file-name&lt;/span&gt;
&lt;span style=&quot;color: #ebebeb;&quot;&gt;               (&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;git-file-name (&lt;/span&gt;&lt;span style=&quot;color: #e4d9d9;&quot;&gt;package-name pkg&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #adadad;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6dbe9;&quot;&gt;)&lt;/span&gt;
              &lt;span style=&quot;color: #d6dbe9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;patches&lt;/span&gt;
&lt;span style=&quot;color: #ebebeb;&quot;&gt;               (&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;parameter-if &lt;/span&gt;&lt;span style=&quot;color: #adadad; font-weight: bold;&quot;&gt;#:package&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt; pkg (&lt;/span&gt;&lt;span style=&quot;color: #e4d9d9;&quot;&gt;pgtk&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;)&lt;/span&gt;
                             &lt;span style=&quot;color: #adadad;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e4d9d9;&quot;&gt;search-patches&lt;/span&gt;
&lt;span style=&quot;color: #e4d9d9;&quot;&gt;                              &lt;/span&gt;&lt;span style=&quot;color: #f271ecececec;&quot;&gt;&amp;quot;emacs-exec-path.patch&amp;quot;&lt;/span&gt;
                              &lt;span style=&quot;color: #f271ecececec;&quot;&gt;&amp;quot;emacs-fix-scheme-indent-function.patch&amp;quot;&lt;/span&gt;
                              &lt;span style=&quot;color: #f271ecececec;&quot;&gt;&amp;quot;emacs-native-comp-driver-options.patch&amp;quot;&lt;/span&gt;
                              &lt;span style=&quot;color: #f271ecececec;&quot;&gt;&amp;quot;emacs-pgtk-super-key-fix.patch&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;)&lt;/span&gt;
                             &lt;span style=&quot;color: #adadad;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e4d9d9;&quot;&gt;search-patches&lt;/span&gt;
&lt;span style=&quot;color: #e4d9d9;&quot;&gt;                              &lt;/span&gt;&lt;span style=&quot;color: #f271ecececec;&quot;&gt;&amp;quot;emacs-exec-path.patch&amp;quot;&lt;/span&gt;
                              &lt;span style=&quot;color: #f271ecececec;&quot;&gt;&amp;quot;emacs-fix-scheme-indent-function.patch&amp;quot;&lt;/span&gt;
                              &lt;span style=&quot;color: #f271ecececec;&quot;&gt;&amp;quot;emacs-native-comp-driver-options.patch&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6dbe9;&quot;&gt;)&lt;/span&gt;
              &lt;span style=&quot;color: #d6dbe9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;sha256&lt;/span&gt;
&lt;span style=&quot;color: #ebebeb;&quot;&gt;               (&lt;/span&gt;&lt;span style=&quot;color: #adadad;&quot;&gt;base32&lt;/span&gt;
&lt;span style=&quot;color: #adadad;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;color: #d6d6d6d6d6d6;&quot;&gt;&amp;quot;1h3p325859svcy43iv7wr27dp68049j9d44jq5akcynqdkxz4jjn&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #ebebeb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6dbe9;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #a0c1cb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d69b21;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
     &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;package-parameter (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;name 'tree-sitter&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
                        &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;dependencies '(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
     &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;package-parameter&lt;/span&gt;
&lt;span style=&quot;color: #bbcde3;&quot;&gt;      (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;name 'pgtk&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;variants&lt;/span&gt;
&lt;span style=&quot;color: #6eb0eb;&quot;&gt;       (&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;parameter-variant-match&lt;/span&gt;
&lt;span style=&quot;color: #d6a7c4;&quot;&gt;        (&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;_ &lt;/span&gt;&lt;span style=&quot;color: #3cae42; font-weight: bold;&quot;&gt;#:transform&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;with-configure-flag&lt;/span&gt;
&lt;span style=&quot;color: #ebb4b6;&quot;&gt;                        &lt;/span&gt;&lt;span style=&quot;color: #ebb4b6; font-weight: bold;&quot;&gt;#:package-name&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f5f4da59db5a;&quot;&gt;&amp;quot;=--with-pgtk&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;dependencies '(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;tree-sitter x11&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
     &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;package-parameter&lt;/span&gt;
&lt;span style=&quot;color: #bbcde3;&quot;&gt;      (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;name 'xwidgets&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;variants&lt;/span&gt;
&lt;span style=&quot;color: #6eb0eb;&quot;&gt;       (&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;parameter-variant-match&lt;/span&gt;
&lt;span style=&quot;color: #d6a7c4;&quot;&gt;        (&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;_ &lt;/span&gt;&lt;span style=&quot;color: #3cae42; font-weight: bold;&quot;&gt;#:transform&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;with-configure-flag&lt;/span&gt;
&lt;span style=&quot;color: #ebb4b6;&quot;&gt;                        &lt;/span&gt;&lt;span style=&quot;color: #ebb4b6; font-weight: bold;&quot;&gt;#:package-name&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f5f4da59db5a;&quot;&gt;&amp;quot;=--with-xwidgets&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
     &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;package-parameter&lt;/span&gt;
&lt;span style=&quot;color: #bbcde3;&quot;&gt;      (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;name 'wide-int&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;variants&lt;/span&gt;
&lt;span style=&quot;color: #6eb0eb;&quot;&gt;       (&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;parameter-variant-match&lt;/span&gt;
&lt;span style=&quot;color: #d6a7c4;&quot;&gt;        (&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;_ &lt;/span&gt;&lt;span style=&quot;color: #3cae42; font-weight: bold;&quot;&gt;#:transform&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;with-configure-flag&lt;/span&gt;
&lt;span style=&quot;color: #ebb4b6;&quot;&gt;                        &lt;/span&gt;&lt;span style=&quot;color: #ebb4b6; font-weight: bold;&quot;&gt;#:package-name&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f5f4da59db5a;&quot;&gt;&amp;quot;=--with-wide-int&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
  &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;one-of '(&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;_ (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;x11 &lt;/span&gt;&lt;span style=&quot;color: #6eb0eb; font-weight: bold;&quot;&gt;#:off&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #bbcde3;&quot;&gt;pgtk&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
            &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;_ (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;x11 &lt;/span&gt;&lt;span style=&quot;color: #6eb0eb; font-weight: bold;&quot;&gt;#:off&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #bbcde3;&quot;&gt;xwidgets&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;]&lt;/span&gt;
 &lt;span style=&quot;color: #c6a6b3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;inherit emacs&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: #c6a6b3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color: #b7b7cf4ebbbb;&quot;&gt;&amp;quot;emacs-parameterized&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: #c6a6b3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;arguments&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;parameter-substitute-keyword-arguments &lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;   (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;package-arguments emacs&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #d4878a;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;x11 &lt;/span&gt;&lt;span style=&quot;color: #6eb0eb; font-weight: bold;&quot;&gt;#:off&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #d0b29e;&quot;&gt;'(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4; font-weight: bold;&quot;&gt;#:configure-flags&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt; flags #~'()&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;
       &lt;span style=&quot;color: #6eb0eb;&quot;&gt;#~(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;delete &lt;/span&gt;&lt;span style=&quot;color: #eb6ad3d3e261;&quot;&gt;&amp;quot;--with-cairo&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #d6a7c4;&quot;&gt;#$flags&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4; font-weight: bold;&quot;&gt;#:modules&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt; _&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;%emacs-modules build-system&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4; font-weight: bold;&quot;&gt;#:phases&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt; phases&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;
       &lt;span style=&quot;color: #6eb0eb;&quot;&gt;#~(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;modify-phases #$phases&lt;/span&gt;
&lt;span style=&quot;color: #d6a7c4;&quot;&gt;                        (&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;delete 'restore-emacs-pdmp&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;
                        &lt;span style=&quot;color: #d6a7c4;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;delete 'strip-double-wrap&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;]&lt;/span&gt;
   &lt;span style=&quot;color: #d4878a;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3; font-weight: bold;&quot;&gt;#:all&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;xwidgets on&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;pgtk &lt;/span&gt;&lt;span style=&quot;color: #6eb0eb; font-weight: bold;&quot;&gt;#:off&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #d0b29e;&quot;&gt;'(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4; font-weight: bold;&quot;&gt;#:configure-flags&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt; flags #~'()&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;
       &lt;span style=&quot;color: #6eb0eb;&quot;&gt;#~(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;cons &lt;/span&gt;&lt;span style=&quot;color: #eb6ad3d3e261;&quot;&gt;&amp;quot;--with-xwidgets&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #d6a7c4;&quot;&gt;#$flags&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4; font-weight: bold;&quot;&gt;#:modules&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt; _&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;%emacs-modules build-system&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4; font-weight: bold;&quot;&gt;#:phases&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt; phases&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;
       &lt;span style=&quot;color: #6eb0eb;&quot;&gt;#~(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;modify-phases #$phases&lt;/span&gt;
&lt;span style=&quot;color: #d6a7c4;&quot;&gt;                        (&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;delete 'restore-emacs-pdmp&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;
                        &lt;span style=&quot;color: #d6a7c4;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;delete 'strip-double-wrap&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: #c6a6b3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;inputs&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;parameter-modify-inputs&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;   [&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;prepend sqlite&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;]&lt;/span&gt;
   &lt;span style=&quot;color: #d4878a;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;tree-sitter&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;prepend tree-sitter&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;]&lt;/span&gt;
   &lt;span style=&quot;color: #d4878a;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;xwidgets&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;prepend gsettings-desktop-schemas&lt;/span&gt;
&lt;span style=&quot;color: #bbcde3;&quot;&gt;                        webkitgtk-with-libsoup2&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;]&lt;/span&gt;
   &lt;span style=&quot;color: #d4878a;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;x11 &lt;/span&gt;&lt;span style=&quot;color: #6eb0eb; font-weight: bold;&quot;&gt;#:off&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;delete &lt;/span&gt;&lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;libx11&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;gtk+&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;libxft&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;libtiff&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;giflib&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;libjpeg&amp;quot;&lt;/span&gt;
            &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;imagemagick&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;libpng&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;librsvg&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;libxpm&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;libice&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;libsm&amp;quot;&lt;/span&gt;
            &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;cairo&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;pango&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;harfbuzz&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;libotf&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;m17n-lib&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;dbus&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org01c4f8b&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org01c4f8b&quot;&gt;Step-by-step Explanation&lt;/h3&gt;
&lt;div id=&quot;text-org01c4f8b&quot; class=&quot;outline-text-3&quot;&gt;
&lt;ol class=&quot;org-ol&quot;&gt;
&lt;li&gt;&lt;code&gt;package-with-parameters&lt;/code&gt;:
This macro takes a &lt;code&gt;parameter-spec&lt;/code&gt; as its first argument and applies the parameter specification to the package in its body. The &lt;i&gt;default parameters&lt;/i&gt; are then activated within the package.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;parameter-spec&lt;/code&gt;:
This record type contains all of the logic necessary to declare and resolve parameters for a package. This normally goes inside the &lt;code&gt;properties&lt;/code&gt; field of the &lt;code&gt;package&lt;/code&gt; record.
In the previous post, it was necessary to put this record inside the properties, but now &lt;code&gt;package-with-parameters&lt;/code&gt; handles that for us.
The parameter specification record contains various fields, all of which are optional.
I have gone over the fields in detail in the &lt;a href=&quot;https://blog.coldboot.org/parameterized-packages-an-update.html&quot;&gt;previous blog post&lt;/a&gt;, hence I will not explain all of them in detail here.
The only big change is that &lt;code&gt;one-of&lt;/code&gt; now has a functionality wherein if you start a list within it with &lt;code&gt;_&lt;/code&gt;, you can have a case where none of the values in it are positive. Otherwise, it throws an error as one and only one value is expected to be positive.
Also notice the usage of &lt;code&gt;#:off&lt;/code&gt; to indicate negation.
We have also not declared &lt;code&gt;x11&lt;/code&gt;, which will hence be treated as a global parameter. In general global parameters must either have their &lt;code&gt;predicate&lt;/code&gt; set to something that returns &lt;code&gt;#t&lt;/code&gt; or be present &lt;i&gt;anywhere&lt;/i&gt; in the &lt;code&gt;parameter-spec&lt;/code&gt; to be applicable. Users are advised to put them in the &lt;code&gt;optional&lt;/code&gt; field, as it was created with this use case in mind.&lt;/li&gt;
&lt;li&gt;local parameter &lt;code&gt;next&lt;/code&gt;:
The local parameter &lt;code&gt;next&lt;/code&gt; has an interesting &lt;code&gt;#:lambda&lt;/code&gt; statement inside it. This statement takes the current &lt;code&gt;package&lt;/code&gt; record as an argument and returns a new &lt;code&gt;package&lt;/code&gt; record, which is then used in its place. This is an extremely powerful method for changing otherwise unchangeable options, such as the ones here; because the &lt;code&gt;version&lt;/code&gt; and &lt;code&gt;source&lt;/code&gt; fields are not thunked, this is the only way of modifying them. The &lt;code&gt;#:lambda&lt;/code&gt;'s functions can be passed 0, 1 or 2 arguments. In the case that it asks for 1 argument, the current &lt;code&gt;package&lt;/code&gt; record is passed. If it asks for 2, the current &lt;code&gt;package&lt;/code&gt; record along with the given parameter's value are passed. In all cases, the function is expected to return a &lt;code&gt;package&lt;/code&gt; record that will then be taken as the new current &lt;code&gt;package&lt;/code&gt; record.&lt;/li&gt;
&lt;li&gt;package body:
Within the package body, we have the usual fields you would expect.
&lt;code&gt;(inherit emacs)&lt;/code&gt; signifies that this package inherits all of emacs' base fields, and the rest of the fields are overrides of that.
Please note that the &lt;code&gt;name&lt;/code&gt; field cannot be influenced by parameters as it is not &lt;code&gt;thunked&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;parameter-match&lt;/code&gt;:
&lt;b&gt;note: this has been substituted by parameter-substitute-keyword-arguments in the latest edit&lt;/b&gt;
This is an extremely useful macro that matches &lt;i&gt;all&lt;/i&gt; the parameter lists that has any positive parameters. It is also possible to require all the parameters in a list to be positive by using &lt;code&gt;#:all&lt;/code&gt;. Please keep in mind that it does not short-circuit by default like &lt;code&gt;cond&lt;/code&gt;. It will keep matching parameters until all the lists have been combed through. A short-circuiting version exists in the form of &lt;code&gt;parameter-match-case&lt;/code&gt;. I've gone over the functionality offered by this macro in detail in the &lt;a href=&quot;https://blog.coldboot.org/parameterized-packages-an-update.html&quot;&gt;previous blog post&lt;/a&gt;, however it has one small improvement:
all conditionals now support checking if a parameter is set to a particular value instead of just checking if it is positive or not. This is very useful for enumerated types, where you might for example want to disable some features if and only if a parameter is set to the second positive value. To illustrate this, if you wanted to check whether a parameter &lt;code&gt;y&lt;/code&gt; is set to &lt;code&gt;v1&lt;/code&gt; or if the parameter list &lt;code&gt;z&lt;/code&gt; is &lt;i&gt;non-negative&lt;/i&gt;, the list would be &lt;code&gt;((y v1) z)&lt;/code&gt;.
You can also use this to check for the default or negative value, with &lt;code&gt;(parameter-name #:default)&lt;/code&gt; and &lt;code&gt;(parameter-name #:off)&lt;/code&gt; respectively. &lt;code&gt;_&lt;/code&gt; is a similar special symbol which matches all &lt;i&gt;non-negative&lt;/i&gt; values, but it is not necessary to use it since the parameter name by itself, say &lt;code&gt;parameter-name&lt;/code&gt; is the same as &lt;code&gt;(parameter-name _)&lt;/code&gt;.
We can see this in the &lt;code&gt;((y v1) z)&lt;/code&gt; example above, where &lt;code&gt;z&lt;/code&gt; is matching all non-negative values of &lt;code&gt;z&lt;/code&gt; even though we did not specify it as &lt;code&gt;(z _)&lt;/code&gt;.
You can also use this in all of the fields in &lt;code&gt;parameter-spec&lt;/code&gt; that require you to specify parameters. The parameter value list syntax is the same everywhere.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;parameter-substitute-keyword-arguments&lt;/code&gt; and &lt;code&gt;parameter-modify-inputs&lt;/code&gt;:
As explained in the previous blog post, because &lt;code&gt;modify-inputs&lt;/code&gt; is a macro, we cannot use &lt;code&gt;parameter-match&lt;/code&gt; within it. To counter this, I have written &lt;code&gt;parameter-modify-inputs&lt;/code&gt; that behaves a lot like if &lt;code&gt;modify-inputs&lt;/code&gt; had a &lt;code&gt;parameter-match&lt;/code&gt; macro within it. I have similarly written &lt;code&gt;parameter-substitute-keyword-arguments&lt;/code&gt; for another commonly used macro called &lt;code&gt;substitute-keyword-arguments&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
I have gone over the rest of the conditionals in the  &lt;a href=&quot;https://blog.coldboot.org/parameterized-packages-an-update.html&quot;&gt;previous blog post&lt;/a&gt; too, they remain more or less the same with the exception that we use &lt;code&gt;#:all&lt;/code&gt; inside lists instead of &lt;code&gt;all&lt;/code&gt; like last time. This is to make it obvious at a glance that &lt;code&gt;#:all&lt;/code&gt; is not a parameter like the rest of the list.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org6ceb6ea&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org6ceb6ea&quot;&gt;Bonus Examples&lt;/h2&gt;
&lt;div id=&quot;text-org6ceb6ea&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
Here are some bonus examples for enumerated parameters:
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org5cca620&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org5cca620&quot;&gt;GCC Optimization Flags&lt;/h3&gt;
&lt;div id=&quot;text-org5cca620&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
&lt;code&gt;gcc&lt;/code&gt; has a set of &lt;a href=&quot;https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html&quot;&gt;optimization flags&lt;/a&gt; that can be used to make programs faster or smaller at the expense of stability.
This is a very basic attempt at adding that functionality to the &lt;code&gt;gnu-build-system&lt;/code&gt; through the &lt;code&gt;CFLAGS&lt;/code&gt; make-flag.
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;package-parameter&lt;/span&gt;
&lt;span style=&quot;color: #c6a6b3;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;name 'gcc-oflag&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: #c6a6b3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;type&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;parameter-type&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;   (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;name '_&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #d4878a;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;accepted-values '(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;-O0 -O1 -O2 -O3 -Os -Ofast -Og -Oz&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #d4878a;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;negation #f&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: #c6a6b3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;variants&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;parameter-variant-match&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;   (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;_ &lt;/span&gt;&lt;span style=&quot;color: #d0b29e; font-weight: bold;&quot;&gt;#:build-system&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt; gnu-build-system&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color: #d0b29e; font-weight: bold;&quot;&gt;#:lambda&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;      (&lt;/span&gt;&lt;span style=&quot;color: #bbcde3; font-weight: bold;&quot;&gt;lambda&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;pkg parameter-value&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
        &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;package&lt;/span&gt;
&lt;span style=&quot;color: #6eb0eb;&quot;&gt;         (&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;inherit pkg&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;
         &lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;arguments&lt;/span&gt;
&lt;span style=&quot;color: #d6a7c4;&quot;&gt;          (&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;substitute-keyword-arguments&lt;/span&gt;
&lt;span style=&quot;color: #3cae42;&quot;&gt;           (&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;package-arguments package&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;)&lt;/span&gt;
           &lt;span style=&quot;color: #3cae42;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d69b21; font-weight: bold;&quot;&gt;#:make-flags&lt;/span&gt;&lt;span style=&quot;color: #d69b21;&quot;&gt; flags #~'()&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;)&lt;/span&gt;
            &lt;span style=&quot;color: #ebb4b6;&quot;&gt;#~(&lt;/span&gt;&lt;span style=&quot;color: #d69b21;&quot;&gt;append&lt;/span&gt;
&lt;span style=&quot;color: #d69b21;&quot;&gt;               #$flags&lt;/span&gt;
&lt;span style=&quot;color: #d69b21;&quot;&gt;               (&lt;/span&gt;&lt;span style=&quot;color: #a0c1cb;&quot;&gt;list (&lt;/span&gt;&lt;span style=&quot;color: #d6dbe9;&quot;&gt;string-append &lt;/span&gt;&lt;span style=&quot;color: #eb6aededf4f3;&quot;&gt;&amp;quot;CFLAGS=&amp;quot;&lt;/span&gt;
                                    &lt;span style=&quot;color: #d6dbe9;&quot;&gt;parameter-value&lt;/span&gt;&lt;span style=&quot;color: #a0c1cb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d69b21;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org87ee5e9&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org87ee5e9&quot;&gt;Static Libraries&lt;/h3&gt;
&lt;div id=&quot;text-org87ee5e9&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
In &lt;a href=&quot;https://hpc.guix.info/&quot;&gt;High-Performance Computing&lt;/a&gt;, it's often necessary to produce static builds of packages to share them with others. This parameter is a basic attempt at making it possible to do so with any given library.
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;package-parameter&lt;/span&gt;
&lt;span style=&quot;color: #c6a6b3;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;name 'static-lib&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: #c6a6b3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;variants&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;parameter-variant-match&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;   (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;_ &lt;/span&gt;&lt;span style=&quot;color: #d0b29e; font-weight: bold;&quot;&gt;#:transform&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;      (&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;with-configure-flag &lt;/span&gt;&lt;span style=&quot;color: #bbcde3; font-weight: bold;&quot;&gt;#:package-name&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;=--disable-shared&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
      &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;with-configure-flag &lt;/span&gt;&lt;span style=&quot;color: #bbcde3; font-weight: bold;&quot;&gt;#:package-name&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;=--enable-static&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org579a516&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org579a516&quot;&gt;Sneak Peak: A RESTful API for Parameterization&lt;/h3&gt;
&lt;div id=&quot;text-org579a516&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
I recently made a &lt;a href=&quot;https://emacs.ch/@cel7t/110695688332787396&quot;&gt;post on Mastodon&lt;/a&gt; that claimed that the real advantage of Guix is that it's extensible with &lt;a href=&quot;https://www.gnu.org/software/guile/&quot;&gt;Guile Scheme&lt;/a&gt;. To back up this claim, once parameters have been merged to trunk I'll be writing a set of tutorials on hacking Guix with Guile Scheme.
One of these planned tutorials is going to be about writing a &lt;b&gt;RESTful API&lt;/b&gt; using Guile that'll allow users to request a package with specific parameters.
Here is what the &lt;code&gt;POST&lt;/code&gt; request for this API may look like:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-JSON&quot;&gt;POST /test HTTP/1.1
Host: guix.example
Accept: application/json
Content-Type: application/json
Content-Length: 194

{
  &amp;quot;User&amp;quot; : &amp;quot;guix-hacker&amp;quot;,
  &amp;quot;Package&amp;quot; : &amp;quot;emacs&amp;quot;,
  &amp;quot;Parameters&amp;quot; : [
      { &amp;quot;Parameter&amp;quot; : &amp;quot;next&amp;quot;,
        &amp;quot;Value&amp;quot; : &amp;quot;on&amp;quot;},
      { &amp;quot;Parameter&amp;quot; : &amp;quot;tree-sitter&amp;quot;,
        &amp;quot;Value&amp;quot; : &amp;quot;off&amp;quot;}
      ]
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org31a552e&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org31a552e&quot;&gt;Future work&lt;/h2&gt;
&lt;div id=&quot;text-org31a552e&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
Here I have demonstrated a basic DSL that is more-or-less just S-expressions. There is however scope for making it a lot more convenient to use parameters, and thus there are plans on building a convenience syntax on top of this simple one.
One example is using &lt;code&gt;~parameter-name&lt;/code&gt; to indicate the negation of a parameter. However, syntax like this may not be obvious to everyone at a glance, which is why we have decided to make a convenience DSL with these features only after heavy deliberation and discussion.
&lt;/p&gt;

&lt;p&gt;
The next few updates will focus on the UI for Parameterization. The primary goals for the UI are to make it easy to discover parameterization options, tell what type a parameter is and to figure out parameter combinations that work for a given package.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org97c2394&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org97c2394&quot;&gt;Closing Thoughts&lt;/h2&gt;
&lt;div id=&quot;text-org97c2394&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
As can be seen with the Parameterized Emacs example in this post, parameterization will make it possible to join a large number of variations of packages and &lt;b&gt;reduce&lt;/b&gt; the amount of code requiring maintenance. One of the aims of this project is to also create procedures that test parameter combinations and measure the combinatorial complexity brought about by parameterization, which should make testing parameteric variants easy too.
&lt;/p&gt;

&lt;p&gt;
I expect parameterization to be particularly useful for running Guix on exotic hardware (such as static minimalistic targets) or on High-Performance Computing Systems (specific architecture optimizations) and make it generally easy to tailor a lot of packages for a particular system's requirements.
&lt;/p&gt;

&lt;p&gt;
This update marks the completion of this Google Summer of Code project's midterms. I'd like to thank my mentors Pjotr Prins and Gábor Boskovit as well as Ludovic Courtès, Arun Isaac and Efraim Flashner for their guidance and help, without which I don't think I'd have been able to reach this milestone. I'm also very grateful to the many wonderful people in the Guix community that provided me with a lot of useful advice and suggestions.
&lt;/p&gt;

&lt;p&gt;
Stay tuned for updates, and happy hacking!
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</content></entry><entry><title>Parameterized Packages: An Update</title><id>https://blog.coldboot.org/parameterized-packages-an-update.html</id><author><name>Sarthak Shah</name><email>shahsarthakw@gmail.com</email></author><updated>2023-06-22T13:40:00Z</updated><link href="https://blog.coldboot.org/parameterized-packages-an-update.html" rel="alternate" /><content type="html">&lt;p&gt;
I started work on adding &lt;a href=&quot;https://guix.gnu.org/blog/2023/parameterized-packages-for-gnu-guix/&quot;&gt;Parameterized Packages&lt;/a&gt; to GNU Guix 3 weeks ago, and this post is a short status update on the things I've done so far.
&lt;/p&gt;&lt;div id=&quot;outline-container-orgf4517e7&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgf4517e7&quot;&gt;&lt;span class=&quot;section-number-2&quot;&gt;1.&lt;/span&gt; Summary of additions&lt;/h2&gt;
&lt;div id=&quot;text-1&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
I have written
&lt;/p&gt;
&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;Record types for parameters&lt;/li&gt;
&lt;li&gt;Processors for boolean, non-negative parameters&lt;/li&gt;
&lt;li&gt;Macros for using parameters inside package definitions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I started my work by writing draft parsers that acted on S-expressions, before moving on to records.
The parameterization process follows 3 phases:
&lt;/p&gt;
&lt;ol class=&quot;org-ol&quot;&gt;
&lt;li&gt;Reading values from the parameter-spec record&lt;/li&gt;
&lt;li&gt;Resolving the values against user-input, and returning a final parameter list&lt;/li&gt;
&lt;li&gt;Applying transforms and macros in accordance with the final parameter list&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The parsers can currently resolve &lt;b&gt;boolean&lt;/b&gt; and &lt;b&gt;non-negative&lt;/b&gt; parameters.
This means that parameters can either be &lt;b&gt;on&lt;/b&gt; or &lt;b&gt;off&lt;/b&gt;, and the parser does &lt;b&gt;not&lt;/b&gt; automatically assume that &lt;i&gt;parameter!&lt;/i&gt; implies &lt;code&gt;(not parameter)&lt;/code&gt;. I am now working on adding support for enumerable parameters (i.e. parameters with multiple values which are not just on and off) and adding support for negation of boolean parameters.
I next wrote Guix-style &lt;a href=&quot;https://www.gnu.org/software/mit-scheme/documentation/stable/mit-scheme-ref/define_002drecord_002dtype-_0028SRFI-9_0029.html&quot;&gt;record types&lt;/a&gt; for parameters, parameter types and parameter specification. I also wrote sanitizers and macros to make it convenient to input values in these records, as the code otherwise gets a bit boilerplate-y.
I then ported the previously written parsers to these newly made records, and also wrote a few macros that let you use parameters inside special &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;cond&lt;/code&gt;-style expressions inside the package definition to have conditional options for fields depending on if one or all of the required parameters are switched on.
Next I wrote a macro &lt;code&gt;package-with-parameters&lt;/code&gt; that returns a package definition with the default parameter transforms applied. This means that if by default my package uses two parameters &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;, the macro will return the package with both their parameter transforms applied to it.
Lastly, I wrote a modified &lt;code&gt;modify-inputs&lt;/code&gt; macro that accepts parameters as conditions for the traditional modify inputs actions.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgb8edb35&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgb8edb35&quot;&gt;&lt;span class=&quot;section-number-2&quot;&gt;2.&lt;/span&gt; Illustrative example&lt;/h2&gt;
&lt;div id=&quot;text-2&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
&lt;b&gt;EDIT 9/18/2023:&lt;/b&gt; The example has been updated to match the latest syntax.
The following code builds Guile from the git source.
Please keep in mind that the syntax is still heavily subject to change, however the underlying mechanisms will remain consistent.
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3; font-weight: bold;&quot;&gt;define-public&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;guile-parameterized&lt;/span&gt;
&lt;span style=&quot;color: #c6a6b3;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;package-with-parameters&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;   (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;parameter-spec&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;local&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;        (&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;list&lt;/span&gt;
&lt;span style=&quot;color: #bbcde3;&quot;&gt;         (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;package-parameter&lt;/span&gt;
&lt;span style=&quot;color: #6eb0eb;&quot;&gt;          (&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color: #eb6ad3d3e261;&quot;&gt;&amp;quot;git&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;
          &lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;variant &lt;/span&gt;
&lt;span style=&quot;color: #d6a7c4;&quot;&gt;           (&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;parameter-variant-match&lt;/span&gt;
&lt;span style=&quot;color: #3cae42;&quot;&gt;            (&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;_ (&lt;/span&gt;&lt;span style=&quot;color: #d69b21;&quot;&gt;with-git-url &lt;/span&gt;&lt;span style=&quot;color: #d69b21; font-weight: bold;&quot;&gt;#:package-name&lt;/span&gt;
&lt;span style=&quot;color: #d69b21;&quot;&gt;                             &lt;/span&gt;&lt;span style=&quot;color: #eb6acdcd9090;&quot;&gt;&amp;quot;https://git.savannah.gnu.org/git/guile.git&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #ebb4b6;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #3cae42;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #d4878a;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;defaults '(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;git off&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;inherit guile-3.0&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color: #ea69c3c3c544;&quot;&gt;&amp;quot;guile-parameterized&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;inputs (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;parameter-modify-inputs (&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;package-inputs guile-3.0&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
                                    &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;git on&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;append autoconf&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;append automake&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;append libtool&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;append gnu-gettext&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;append flex&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;append gperf&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;append texinfo&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
   &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;arguments (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;append&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;               (&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;parameter-if (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d6a7c4;&quot;&gt;git on&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
                             &lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;list &lt;/span&gt;&lt;span style=&quot;color: #6eb0eb; font-weight: bold;&quot;&gt;#:make-flags&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt; #~'(&lt;/span&gt;&lt;span style=&quot;color: #eb6ad3d3e261;&quot;&gt;&amp;quot;VERBOSE=1&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;
                             &lt;span style=&quot;color: #bbcde3;&quot;&gt;'()&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;
               &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;package-arguments guile-3.0&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
The &lt;code&gt;package-with-parameters&lt;/code&gt; macro takes in a &lt;code&gt;parameter-spec&lt;/code&gt; and a &lt;code&gt;package&lt;/code&gt; definition and gets the default parameter alist from it, and applies transformations according to it.
Here we're defining a version of guile that inherits guile code and adds a &lt;code&gt;parameter-spec&lt;/code&gt; property.
Inside the &lt;code&gt;parameter-spec&lt;/code&gt; definition, we start by defining &lt;code&gt;local&lt;/code&gt; parameters. These parameters are only available to the package, and override any global parameters with the same name.
This overriding feature will make parameter specifications resilient to globalization of previously local parameters, and also make it possible to globally declare what local parameters you'd like to access across packages.
The name field of the parameter record accepts both strings and symbols, but when referring to a parameter in other fields one must use a symbol.
The variants field is explained in further detail in the &lt;a href=&quot;https://blog.coldboot.org/parameterized-packages-the-second-update.html&quot;&gt;next blog post&lt;/a&gt;.
The transforms follow the usual cons cell syntax used when &lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/Defining-Package-Variants.html&quot;&gt;defining package variants&lt;/a&gt;.
Next we have the &lt;code&gt;defaults&lt;/code&gt; field, which takes a list of parameters which are expected to be switched on by default.
Some fields of the parameter-spec record omitted from this example are:
&lt;/p&gt;
&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;&lt;code&gt;optional&lt;/code&gt;, for declaring global parameters that can optionally be used&lt;/li&gt;
&lt;li&gt;&lt;code&gt;one-of&lt;/code&gt;, which is a list of lists of parameters of which only one can be used per list&lt;/li&gt;
&lt;li&gt;&lt;code&gt;required&lt;/code&gt;, which is a list of parameters that are &lt;b&gt;absolutely&lt;/b&gt; required. It exists mostly for global parameters&lt;/li&gt;
&lt;li&gt;&lt;code&gt;canonical&lt;/code&gt;, which contains &lt;i&gt;canonical combinations&lt;/i&gt;, a proposed feature for solving the substitute problem&lt;/li&gt;
&lt;li&gt;&lt;code&gt;parameter-alist&lt;/code&gt;, (not meant to be modified by the user) contains the final list of active parameters and their values, on or off.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
These all come together to make it possible to define an arbitrary combination of parameters in arbitrary states and test them against the parameter-spec to see if they work and apply them if they do.
The &lt;code&gt;package-with-parameters&lt;/code&gt; macro is proof of this working, it calculates transforms pertaining to default values and applies them to the &lt;code&gt;package&lt;/code&gt; record defined inside it based on the contents of the &lt;code&gt;parameter-spec&lt;/code&gt;.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org32da485&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org32da485&quot;&gt;&lt;span class=&quot;section-number-2&quot;&gt;3.&lt;/span&gt; Parametric Conditionals&lt;/h2&gt;
&lt;div id=&quot;text-3&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
I have written a number of conditional macros that check if a given parameter is set to on in the &lt;code&gt;parameter-alist&lt;/code&gt; and update the &lt;code&gt;package&lt;/code&gt; record appropriately.
&lt;code&gt;parameter-if&lt;/code&gt; and &lt;code&gt;parameter-modify-inputs&lt;/code&gt; have been used in the example above, and below is an explanation of how they work:
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org8842226&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org8842226&quot;&gt;&lt;span class=&quot;section-number-3&quot;&gt;3.1.&lt;/span&gt; parameter-if&lt;/h3&gt;
&lt;div id=&quot;text-3-1&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
&lt;code&gt;parameter-if&lt;/code&gt; takes a parameter or a list of parameters and checks if any of them are on.
If they are, it returns the first expression, but if all of them are off, it returns either nothing or the second expression. It behaves similarly to Guile's &lt;code&gt;if&lt;/code&gt; macro.
It is being used in this snippet from the &lt;code&gt;guile-parameterized&lt;/code&gt; example:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #cf9f7f; font-style: italic;&quot;&gt;;; &lt;/span&gt;&lt;span style=&quot;color: #cf9f7f; font-style: italic;&quot;&gt;inside package definition&lt;/span&gt;
&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;arguments (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;append&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;            (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;parameter-if (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;git on&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;
                          &lt;span style=&quot;color: #d4878a;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;list &lt;/span&gt;&lt;span style=&quot;color: #d0b29e; font-weight: bold;&quot;&gt;#:make-flags&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt; #~'(&lt;/span&gt;&lt;span style=&quot;color: #dddde6e6f1f1;&quot;&gt;&amp;quot;VERBOSE=1&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;
                          &lt;span style=&quot;color: #d4878a;&quot;&gt;'()&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
            &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;package-arguments guile-3.0&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Here, the arguments field is given a list formed by appending &lt;code&gt;#:make-flags&lt;/code&gt; with the value &lt;code&gt;&amp;quot;VERBOSE=1&amp;quot;&lt;/code&gt; if the parameter &lt;code&gt;git&lt;/code&gt; is set to &lt;code&gt;on&lt;/code&gt;, or appending an empty list &lt;code&gt;'()&lt;/code&gt; otherwise.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-org8a1a196&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;org8a1a196&quot;&gt;&lt;span class=&quot;section-number-3&quot;&gt;3.2.&lt;/span&gt; parameter-match&lt;/h3&gt;
&lt;div id=&quot;text-3-2&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
&lt;code&gt;parameter-match&lt;/code&gt; is somewhat similar to Guile's &lt;code&gt;cond&lt;/code&gt;, but also very different.
It takes in a set of lists of the form &lt;code&gt;((parameters ...) clauses ...)&lt;/code&gt;, wherein if any in the list of parameters is set to on, the clauses are executed. This behavior is not short-circuiting, and the other lists are checked once one is evaluated regardless of the result.
A list may be prefixed with &lt;code&gt;#:all&lt;/code&gt; if all parameters are required to be switched on.
Also, a &lt;code&gt;_&lt;/code&gt; can be used to always match.
For example, the &lt;code&gt;parameter-if&lt;/code&gt; example above can be rewritten with &lt;code&gt;parameter-match&lt;/code&gt; like this:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;arguments (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;append&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;            (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;parameter-match&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;             (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;git on&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #d0b29e;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;list &lt;/span&gt;&lt;span style=&quot;color: #bbcde3; font-weight: bold;&quot;&gt;#:make-flags&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt; #~'(&lt;/span&gt;&lt;span style=&quot;color: #b736d857f5f4;&quot;&gt;&amp;quot;VERBOSE=1&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;
             &lt;span style=&quot;color: #d4878a;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;_ '()&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
            &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;package-arguments guile-3.0&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;code&gt;parameter-match&lt;/code&gt; has a variant called &lt;code&gt;parameter-match-case&lt;/code&gt; which is the same as &lt;code&gt;parameter/match&lt;/code&gt;, but it short-circuits when a matching list is found.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-orgd201f2a&quot; class=&quot;outline-3&quot;&gt;
&lt;h3 id=&quot;orgd201f2a&quot;&gt;&lt;span class=&quot;section-number-3&quot;&gt;3.3.&lt;/span&gt; parameter/modify-inputs&lt;/h3&gt;
&lt;div id=&quot;text-3-3&quot; class=&quot;outline-text-3&quot;&gt;
&lt;p&gt;
The &lt;code&gt;modify-inputs&lt;/code&gt; macro is used very frequently when defining package variants, but due to it being a macro we cannot use &lt;code&gt;parameter-match&lt;/code&gt; inside it to pick arguments.
To this end, I have defined a new macro called &lt;code&gt;parameter-modify-inputs&lt;/code&gt; that takes in a list of parameters and a corresponding list of arguments to &lt;code&gt;modify-inputs&lt;/code&gt; that can be used instead of it.
&lt;code&gt;_&lt;/code&gt; can be used to always execute the clauses, and &lt;code&gt;#:all&lt;/code&gt; may be used to require all parameters to be positive.
In the example package above, it has been used like this:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #cf9f7f; font-style: italic;&quot;&gt;;; &lt;/span&gt;&lt;span style=&quot;color: #cf9f7f; font-style: italic;&quot;&gt;inside the package definition&lt;/span&gt;
&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;parameter-modify-inputs (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;package-inputs guile-3.0&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;
                                    &lt;span style=&quot;color: #c6a6b3;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;git on&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;append autoconf&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;append automake&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;append libtool&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;append gnu-gettext&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;append flex&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;append gperf&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
                                     &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;append texinfo&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Here, if the parameter &lt;code&gt;git&lt;/code&gt; is switched on, &lt;code&gt;autoconf&lt;/code&gt;, &lt;code&gt;automake&lt;/code&gt;, &lt;code&gt;libtool&lt;/code&gt;, &lt;code&gt;gnu-gettext&lt;/code&gt;, &lt;code&gt;flex&lt;/code&gt;, &lt;code&gt;gperf&lt;/code&gt; and &lt;code&gt;texinfo&lt;/code&gt; are added to the package's inputs. This is quite useful as these inputs are required for building guile from its git source.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org865aa74&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org865aa74&quot;&gt;&lt;span class=&quot;section-number-2&quot;&gt;4.&lt;/span&gt; Global Parameters&lt;/h2&gt;
&lt;div id=&quot;text-4&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
The handling of global parameters is an important topic that needs more discussion.
Right now, the idea is to require all global parameters to be defined in one file and to access them through a hash-table called &lt;code&gt;%global-parameters&lt;/code&gt;.
This is to ensure that global parameter symbols are both short and unique.
To make the process of adding values to this hash-table easier, I've written a macro called &lt;code&gt;define-global-parameter&lt;/code&gt; that takes a parameter definition and makes it global.
For example, if I wanted to define a global parameter that disables tests for &lt;code&gt;guile-3.0&lt;/code&gt;, I can do it like this:
&lt;/p&gt;
&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;define-global-parameter&lt;/span&gt;
&lt;span style=&quot;color: #c6a6b3;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;package-parameter&lt;/span&gt;
&lt;span style=&quot;color: #6f9e77;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color: #ea69c3c3c544;&quot;&gt;&amp;quot;guile-3.0-tests!&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;description &lt;/span&gt;&lt;span style=&quot;color: #ea69c3c3c544;&quot;&gt;&amp;quot;Disables tests for Guile 3.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #6f9e77;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;variants&lt;/span&gt;
&lt;span style=&quot;color: #d4878a;&quot;&gt;     (&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;parameter-variant-match&lt;/span&gt;
&lt;span style=&quot;color: #d0b29e;&quot;&gt;      (&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;_ (&lt;/span&gt;&lt;span style=&quot;color: #6eb0eb;&quot;&gt;without-tests . &lt;/span&gt;&lt;span style=&quot;color: #b736d857f5f4;&quot;&gt;&amp;quot;guile-3.0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #bbcde3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d0b29e;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d4878a;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #6f9e77;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #c6a6b3;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #7a94df;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Now any package that uses this global transform will have &lt;code&gt;guile-3.0&lt;/code&gt;'s tests disabled.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org95401e1&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org95401e1&quot;&gt;&lt;span class=&quot;section-number-2&quot;&gt;5.&lt;/span&gt; Results&lt;/h2&gt;
&lt;div id=&quot;text-5&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
It is now possible to define a package with parameters and change the parameter-alist to use the parameters.
Next, I'll be working on parsing negated and enumerated parameters, along with adding support for modify-inputs and package-rewriting in the parameter record itself.
&lt;/p&gt;

&lt;p&gt;
EDIT: This work has been done, and can be seen in the &lt;a href=&quot;https://blog.coldboot.org/parameterized-packages-the-second-update.html&quot;&gt;next blog post&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Stay tuned for updates, and happy hacking!
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</content></entry><entry><title>Running a Patched DWM on GNU Guix</title><id>https://blog.coldboot.org/running-a-patched-dwm-on-gnu-guix.html</id><author><name>Sarthak Shah</name><email>shahsarthakw@gmail.com</email></author><updated>2023-06-12T13:37:00Z</updated><link href="https://blog.coldboot.org/running-a-patched-dwm-on-gnu-guix.html" rel="alternate" /><content type="html">&lt;p&gt;
If like me you use a lot of patches with dwm, you probably use &lt;a href=&quot;https://github.com/bakkeby/dwm-flexipatch&quot;&gt;dwm-flexipatch&lt;/a&gt; for configuring dwm. You probably also have an existing build of dwm with a lot of customizations in &lt;code&gt;config.def.h&lt;/code&gt;. Research online might lead you to the conclusion that you need to set up a git repository and a guix channel with your dwm folder to make it work, but that's not necessary at all. In this post I'll go over how I got my dwm-flexipatch build to work on GNU Guix without any of that.
&lt;/p&gt;&lt;p&gt;
We want to start by making a directory for our dwm folder and build file.
&lt;/p&gt;&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-bash&quot;&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;mkdir DWM_MODULE&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;
Next, copy your dwm folder here.
&lt;/p&gt;&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-bash&quot;&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;cp -r /path/to/dwm DWM_MODULE/&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;
Now, this step is &lt;b&gt;very important&lt;/b&gt;:
run &lt;code&gt;make clean&lt;/code&gt; once in the dwm folder, otherwise guix will run into a RUNPATH error during the build phase.
&lt;/p&gt;&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-bash&quot;&gt;&lt;span style=&quot;color: #00a692; font-weight: bold;&quot;&gt;cd&lt;/span&gt;&lt;span style=&quot;color: #00a692;&quot;&gt; DWM_MODULE/dwm&lt;/span&gt;
&lt;span style=&quot;color: #00a692;&quot;&gt;make clean&lt;/span&gt;
&lt;span style=&quot;color: #00a692; font-weight: bold;&quot;&gt;cd&lt;/span&gt;&lt;span style=&quot;color: #00a692;&quot;&gt; ..&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;
And finally, inside the &lt;code&gt;DWM_MODULE&lt;/code&gt; directory create a file named &lt;code&gt;USER-dwm.scm&lt;/code&gt;, where USER can be your username or anything else.
Then put this in the file:
&lt;/p&gt;&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e589e9; font-weight: bold;&quot;&gt;define-module&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;USER-dwm&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #00a692;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e589e9; font-weight: bold;&quot;&gt;use-modules&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;gnu packages suckless&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;)&lt;/span&gt;
             &lt;span style=&quot;color: #e589e9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;gnu packages xorg&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;)&lt;/span&gt;
             &lt;span style=&quot;color: #e589e9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;gnu packages image&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;)&lt;/span&gt;
             &lt;span style=&quot;color: #e589e9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;guix gexp&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;)&lt;/span&gt;
             &lt;span style=&quot;color: #e589e9;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;guix packages&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #00a692;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e589e9; font-weight: bold;&quot;&gt;define-public&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;USER-dwm&lt;/span&gt;
&lt;span style=&quot;color: #e589e9;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;package&lt;/span&gt;
&lt;span style=&quot;color: #bc9afc;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #a3b3e0;&quot;&gt;inherit dwm&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #bc9afc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a3b3e0;&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color: #d1d1d9d9f06f;&quot;&gt;&amp;quot;USER-dwm&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #bc9afc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a3b3e0;&quot;&gt;inputs (&lt;/span&gt;&lt;span style=&quot;color: #09ad99;&quot;&gt;modify-inputs (&lt;/span&gt;&lt;span style=&quot;color: #e7ade9;&quot;&gt;package-inputs dwm&lt;/span&gt;&lt;span style=&quot;color: #09ad99;&quot;&gt;)&lt;/span&gt;
              &lt;span style=&quot;color: #09ad99;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e7ade9;&quot;&gt;append libxcb&lt;/span&gt;&lt;span style=&quot;color: #09ad99;&quot;&gt;)&lt;/span&gt;
              &lt;span style=&quot;color: #09ad99;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e7ade9;&quot;&gt;append imlib2&lt;/span&gt;&lt;span style=&quot;color: #09ad99;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #a3b3e0;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: #bc9afc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a3b3e0;&quot;&gt;source (&lt;/span&gt;&lt;span style=&quot;color: #09ad99;&quot;&gt;local-file &lt;/span&gt;&lt;span style=&quot;color: #8484d6d6cccc;&quot;&gt;&amp;quot;dwm&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #09ad99; font-weight: bold;&quot;&gt;#:recursive?&lt;/span&gt;&lt;span style=&quot;color: #09ad99;&quot;&gt; #t&lt;/span&gt;&lt;span style=&quot;color: #a3b3e0;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #00a692;&quot;&gt;USER-dwm&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;
Here I have added &lt;code&gt;libxcb&lt;/code&gt; and &lt;code&gt;imlib2&lt;/code&gt; to inputs as I have patches requiring them.
If you are using a patch requiring some other library, you can add it by putting another &lt;code&gt;(append libname)&lt;/code&gt; statement in the &lt;code&gt;modify-inputs&lt;/code&gt; expression.
The &lt;code&gt;source&lt;/code&gt; expression searches for a folder named &lt;code&gt;dwm&lt;/code&gt; in the file's pwd and uses its contents as the package's source.
Running &lt;code&gt;guix package -f USER-dwm.scm&lt;/code&gt; will now install your flexipatched dwm.
If you want to add this to your system configuration, modify your &lt;code&gt;config.scm&lt;/code&gt; like this:
&lt;/p&gt;&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-scheme&quot;&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e589e9; font-weight: bold;&quot;&gt;use-modules&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;USER-dwm&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #e589e9;&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;)&lt;/span&gt;

&lt;span style=&quot;color: #00a692;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;operating-system&lt;/span&gt;
&lt;span style=&quot;color: #e589e9;&quot;&gt;  ...&lt;/span&gt;
&lt;span style=&quot;color: #e589e9;&quot;&gt;  (&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;packages (&lt;/span&gt;&lt;span style=&quot;color: #a3b3e0;&quot;&gt;list USER-dwm ...&lt;/span&gt;&lt;span style=&quot;color: #bc9afc;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #e589e9;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;
And now, reconfigure the system with the following command:
&lt;/p&gt;&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-bash&quot;&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;guix system reconfigure /path/to/config.scm -L $&lt;/span&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;HOME&lt;/span&gt;&lt;span style=&quot;color: #00a692;&quot;&gt;/DWM_MODULE&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;
If you don't want to run the reconfigure command with &lt;code&gt;-L&lt;/code&gt; every time, add &lt;code&gt;$HOME/DWM_MODULE&lt;/code&gt; to &lt;code&gt;GUIX_PACKAGE_PATH&lt;/code&gt;.
&lt;/p&gt;&lt;p&gt;
Here's a customary screencap:
&lt;img src=&quot;../images/dwm-screenshot.png&quot; alt=&quot;dwm-screenshot.png&quot; /&gt;
&lt;/p&gt;</content></entry><entry><title>An Introduction to Parameterized Packages</title><id>https://blog.coldboot.org/an-introduction-to-parameterized-packages.html</id><author><name>Sarthak Shah</name><email>shahsarthakw@gmail.com</email></author><updated>2023-05-09T02:40:00Z</updated><link href="https://blog.coldboot.org/an-introduction-to-parameterized-packages.html" rel="alternate" /><content type="html">&lt;p&gt;
I will be working on bringing Parameterized Packages to &lt;a href=&quot;https://guix.gnu.org&quot;&gt;GNU Guix&lt;/a&gt; this summer as a part of the &lt;a href=&quot;https://summerofcode.withgoogle.com/&quot;&gt;Google Summer of Code&lt;/a&gt; program under the mentorship of Pjotr Prins and Gábor Boskovits.
This post will go over the basic ideas behind Parameterized Packages, their benefits and how I am planning on implementing them.
&lt;/p&gt;&lt;div id=&quot;outline-container-org4f88bad&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org4f88bad&quot;&gt;What are Parameterized Packages?&lt;/h2&gt;
&lt;div id=&quot;text-org4f88bad&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
Parameterized packages will provide users with a simple way to configure many aspects of packages, à la Gentoo USE flags.
&lt;/p&gt;

&lt;p&gt;
GNU Guix is the only GNU/Linux distribution capable of achieving a &lt;a href=&quot;https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/&quot;&gt;full-source bootstrap&lt;/a&gt;, and this comes with many unique advantages.
Every package in Guix can be built from source, and as a result it is possible to configure a wide variety of options for each package that just aren't exposed on binary-based distributions using &lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/Package-Transformation-Options.html&quot;&gt;Package Transformations&lt;/a&gt;. While package transformations are extremely powerful, they require some experience with packaging software for Guix and are generally expected to be used by power users for applications such as &lt;a href=&quot;https://hpc.guix.info&quot;&gt;High-Performance Computing&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Parameterized Packages aim to not only bring the benefits of package transformations to all users, but to also make it possible to globally specify some aspects to include or exclude from packages similar to &lt;a href=&quot;https://wiki.gentoo.org/wiki/USE_flag&quot;&gt;Gentoo's USE flags&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Some of the benefits of Parameterized Packages are:
&lt;/p&gt;
&lt;ol class=&quot;org-ol&quot;&gt;
&lt;li&gt;Significantly smaller binaries&lt;/li&gt;
&lt;li&gt;More fine-grained control over the entire system&lt;/li&gt;
&lt;li&gt;Access to additional features only accessible through compile-time options&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Among many more.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgb15b0f5&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgb15b0f5&quot;&gt;Example Usage&lt;/h2&gt;
&lt;div id=&quot;text-orgb15b0f5&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
(Edited - 15th Sep 2023)
To avoid confusion, I have removed the example from this section.
Owing to community feedback, the syntax for parameterization has changed a lot from the original draft.
To see a concrete example of parameters in action, please see the &lt;a href=&quot;https://blog.coldboot.org/parameterized-packages-the-second-update.html&quot;&gt;second update&lt;/a&gt;.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgb1eb1cc&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgb1eb1cc&quot;&gt;What if a package record does not contain the parameter value?&lt;/h2&gt;
&lt;div id=&quot;text-orgb1eb1cc&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
In the instance that parameter values are not specified, the package will be used in its default state by all of the packages depending on it. &lt;i&gt;In general,&lt;/i&gt; parameters propogate to dependencies if a valid configuration can be acheived with them, and if this is not possible the default state of the package is used. This will help with the gradual adoption of package parameters, as not every package will have to specify parameters and at the same time the packages specifying parameters will be able to use them even if their dependencies do not have the given parameter.
&lt;/p&gt;


&lt;p&gt;
One awesome feature of this arrangement is that a user could have two packages with conflicting parameters but they would both work on the system thanks to Guix building both versions of dependencies. This would &lt;b&gt;not&lt;/b&gt; work on imperative package managers with similar functionality. For example if a music player application depends on mpd built with pulseaudio while another depends on it built with jack, Guix will create two versions of mpd, one built with each so that both of these packages may coexist.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgbab4505&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgbab4505&quot;&gt;More on parameter symbols&lt;/h2&gt;
&lt;div id=&quot;text-orgbab4505&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
&lt;i&gt;Fairly generic&lt;/i&gt; options such as x11, gcc-oflag or locale will be accepted as global parameters. Most global parameters will have pre-defined &lt;i&gt;standard transforms&lt;/i&gt; for every build system they are valid for. Note that having too many parameters in a given package's definition will lead to combinatorial explosion of states, and thus it is best to limit the number of parameters to a manageable amount.
I will be attempting to add 10~20 global parameters after finishing this project.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org1b88c5f&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org1b88c5f&quot;&gt;Conclusion&lt;/h2&gt;
&lt;div id=&quot;text-org1b88c5f&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
Parameterized Packages have the potential to add more functionality to GNU Guix for all users, however they will require the &lt;b&gt;feedback&lt;/b&gt; and support of the entire Guix community. I would immensely appreciate any kind of suggestions and comments in the new thread on Parameterized Packages which can be found in the mailing list, especially suggestions on what parameter symbols users would like to use.
&lt;/p&gt;

&lt;p&gt;
Happy Hacking!
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</content></entry><entry><title>The First Week of January 2023</title><id>https://blog.coldboot.org/the-first-week-of-january-2023.html</id><author><name>Sarthak Shah</name><email>shahsarthakw@gmail.com</email></author><updated>2023-01-10T13:37:00Z</updated><link href="https://blog.coldboot.org/the-first-week-of-january-2023.html" rel="alternate" /><content type="html">&lt;p&gt;
I decided to start writing a blog to talk about my ventures in programming and system administration to document my progress and motivate me to do more. This entry covers what I did in the first week of January, 2023.
&lt;/p&gt;&lt;div id=&quot;outline-container-org9b2e3f1&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org9b2e3f1&quot;&gt;Torus Wrapper&lt;/h2&gt;
&lt;div id=&quot;text-org9b2e3f1&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
One of the projects I poured a bunch of time into was &lt;a href=&quot;https://github.com/matchcase/TorusWrapper&quot;&gt;Torus Wrapper&lt;/a&gt;, which was an effort to wrap transparent PNGs into tiles that can be tiled to make tiling wallpapers, tiling game assets, et cetera. A high-level overview of how this is done is that the program takes in a transparent png, finds the &lt;b&gt;biggest&lt;/b&gt; rectangle &lt;i&gt;inside&lt;/i&gt; it and then wraps the parts not fitting in the rectangle atop it. Here's an example of a tile created with it:
&lt;img src=&quot;../images/tile.png&quot; alt=&quot;tile.png&quot; /&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org4728e6a&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org4728e6a&quot;&gt;&lt;i&gt;Lots&lt;/i&gt; of Websites&lt;/h2&gt;
&lt;div id=&quot;text-org4728e6a&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
I worked on a &lt;i&gt;lot&lt;/i&gt; of websites during this break; &lt;a href=&quot;https://untyped.ml&quot;&gt;my personal site&lt;/a&gt;, &lt;a href=&quot;https://bits-sos.ml&quot;&gt;BITS SOS' site&lt;/a&gt; and the Journal Club's new website.
I used static site generators to build BITS SOS and JC's sites, as they provide a simple way to theme huge websites; however, these are not free of hiccups.
Themes often come configured wrong and can cause CSS and images to not load if the paths are not set right. Luckily, there were no other major problems setting up either of them with &lt;a href=&quot;https://gohugo.io&quot;&gt;HUGO&lt;/a&gt;.
For my personal site, I wrote the main site in &lt;a href=&quot;https://clojurescript.org&quot;&gt;ClojureScript&lt;/a&gt; (with &lt;a href=&quot;https://github.com/reagent-project/reagent&quot;&gt;Reagent&lt;/a&gt;) and the blog site in &lt;a href=&quot;https://docs.racket-lang.org/frog/index.html&quot;&gt;Frog&lt;/a&gt;. The blog (this site) is based on &lt;a href=&quot;https://blog.racket-lang.org&quot;&gt;Racket lang's blog&lt;/a&gt;.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-orgb804b0e&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgb804b0e&quot;&gt;Tiny Improvements to my R6RS Infix Calculator&lt;/h2&gt;
&lt;div id=&quot;text-orgb804b0e&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
I abstracted away a lot of the recursion in my &lt;a href=&quot;https://github.com/matchcase/R6RS-Calculator&quot;&gt;R6RS infix expression calculator&lt;/a&gt; by defining a new macro to handle functions that iterate over a carry-forwarded list and adding the Clojure thread-first macro (-&amp;gt;). I planned on implementing something called the &lt;i&gt;Nestedness Theorem&lt;/i&gt;, which is that &lt;i&gt;the rightmost open paren is always safe to evaluate&lt;/i&gt;. However, my current approach is more-or-less similar to this, hence I did not rewrite it. I also added additional error checking; the program now checks if parens are balanced.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div id=&quot;outline-container-org13e1126&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org13e1126&quot;&gt;Adding a DDNS to my Home Server&lt;/h2&gt;
&lt;div id=&quot;text-org13e1126&quot; class=&quot;outline-text-2&quot;&gt;
&lt;p&gt;
I was previously connecting to my home server through a static IP, however I realized that my usage needs could be met with a dynamic IP using a dynamic DNS. I thus set up a DDNS on the server and bound its internal IP to ensure that I could boot into it after it rebooted. Home servers are excellent for maintaining private remote project repositories, hosting messenger bots or services like IRC bouncers and testing out dynamic websites.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</content></entry></feed>