<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://primef.actor/feed.xml" rel="self" type="application/atom+xml" /><link href="https://primef.actor/" rel="alternate" type="text/html" /><updated>2026-02-21T22:00:17+01:00</updated><id>https://primef.actor/feed.xml</id><title type="html">Primefactor</title><subtitle>Personal blog</subtitle><entry><title type="html">I migrated my blog to Jekyll</title><link href="https://primef.actor/backend/2026/02/21/jekyll-migration.html" rel="alternate" type="text/html" title="I migrated my blog to Jekyll" /><published>2026-02-21T21:56:00+01:00</published><updated>2026-02-21T21:56:00+01:00</updated><id>https://primef.actor/backend/2026/02/21/jekyll-migration</id><content type="html" xml:base="https://primef.actor/backend/2026/02/21/jekyll-migration.html"><![CDATA[<p>Hello world! I migrated my blog from Chyrp running on PHP+MySql to Jekyll running on a Debian VPN!</p>]]></content><author><name></name></author><category term="backend" /><summary type="html"><![CDATA[Hello world! I migrated my blog from Chyrp running on PHP+MySql to Jekyll running on a Debian VPN!]]></summary></entry><entry><title type="html">Sum and Product Types</title><link href="https://primef.actor/programming/math/2024/08/30/sum-product-types.html" rel="alternate" type="text/html" title="Sum and Product Types" /><published>2024-08-30T18:33:49+02:00</published><updated>2024-08-30T18:33:49+02:00</updated><id>https://primef.actor/programming/math/2024/08/30/sum-product-types</id><content type="html" xml:base="https://primef.actor/programming/math/2024/08/30/sum-product-types.html"><![CDATA[<p>In this post we will discuss <strong>sum</strong> and <strong>product</strong> types. Consider the struct <code class="language-plaintext highlighter-rouge">X</code>, defined as</p>

<div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">struct</span> <span class="nc">X</span> <span class="p">{</span>
    <span class="n">A</span> <span class="n">a</span><span class="p">;</span>
    <span class="n">B</span> <span class="n">b</span><span class="p">;</span>
<span class="p">};</span>
</code></pre></div></div>

<p>Here, <code class="language-plaintext highlighter-rouge">A</code> and <code class="language-plaintext highlighter-rouge">B</code> are also types, but it does not matter what their declarations are.
What kind of values can an instance of type <code class="language-plaintext highlighter-rouge">X</code> take on?
To instantiate an object of type <code class="language-plaintext highlighter-rouge">X</code>, we need to supply an instance of type <code class="language-plaintext highlighter-rouge">A</code> <strong>and</strong> an instance of type <code class="language-plaintext highlighter-rouge">B</code>.
If the total number of different values that <code class="language-plaintext highlighter-rouge">A</code> can take on is denoted by \(|A|\),
and the total number of different values that <code class="language-plaintext highlighter-rouge">B</code> can take on is denoted by \(|B|\),
then the total number of values that <code class="language-plaintext highlighter-rouge">X</code> can take on is \(|X| = |A| \cdot |B|\).</p>

<p>Consider <code class="language-plaintext highlighter-rouge">Y</code> defined as</p>

<div class="language-c++ highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">using</span> <span class="n">Y</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">variant</span><span class="o">&lt;</span><span class="n">A</span><span class="p">,</span> <span class="n">B</span><span class="o">&gt;</span><span class="p">;</span>
</code></pre></div></div>

<p>What kind of values can an instance of type <code class="language-plaintext highlighter-rouge">Y</code> take on?
To instantiate an object of type <code class="language-plaintext highlighter-rouge">Y</code>, we need to supply an instance of type <code class="language-plaintext highlighter-rouge">A</code> <strong>or</strong> an instance of type <code class="language-plaintext highlighter-rouge">B</code>.
If the total number of different values that <code class="language-plaintext highlighter-rouge">A</code> can take on is denoted by \(|A|\),
and the total number of different values that <code class="language-plaintext highlighter-rouge">B</code> can take on is denoted by \(|B|\),
then the total number of values that <code class="language-plaintext highlighter-rouge">Y</code> can take on is \(|Y| = |A| + |B|\).</p>

<p>Because the total number of different values that <code class="language-plaintext highlighter-rouge">X</code> can take on is a product of its fields, we call <code class="language-plaintext highlighter-rouge">X</code> a <em>product type</em>.
In contrast, we call <code class="language-plaintext highlighter-rouge">Y</code> a <em>sum type</em>, because it can only take on as many values as the sum of its constituent types.</p>]]></content><author><name></name></author><category term="programming" /><category term="math" /><summary type="html"><![CDATA[In this post we will discuss sum and product types. Consider the struct X, defined as]]></summary></entry><entry><title type="html">Getting LLVM clang working on macOS 10.14.1</title><link href="https://primef.actor/llvm/clang/mojave/2019/03/08/getting-llvm-clang-working-on-macos-10141.html" rel="alternate" type="text/html" title="Getting LLVM clang working on macOS 10.14.1" /><published>2019-03-08T19:41:34+01:00</published><updated>2019-03-08T19:41:34+01:00</updated><id>https://primef.actor/llvm/clang/mojave/2019/03/08/getting-llvm-clang-working-on-macos-10141</id><content type="html" xml:base="https://primef.actor/llvm/clang/mojave/2019/03/08/getting-llvm-clang-working-on-macos-10141.html"><![CDATA[<p>To get LLVM clang working on macOS 10.14.1 (Mojave), install the developer
command-line tools:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>xcode-select <span class="nt">--install</span>
</code></pre></div></div>

<p>assuming you first installed Xcode from the App Store.</p>

<p>This has been the only thing required for ages to get LLVM working on macOS.
However for some reason things have changed on Mojave and we now have to install
essential headers like <code class="language-plaintext highlighter-rouge">wchar_t.h</code> in /usr/include with an extra step. Just run
this command and go through the installation wizard:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
</code></pre></div></div>]]></content><author><name></name></author><category term="llvm" /><category term="clang" /><category term="mojave" /><summary type="html"><![CDATA[To get LLVM clang working on macOS 10.14.1 (Mojave), install the developer command-line tools:]]></summary></entry></feed>