<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>About ME on Jiacai Liu's personal website</title><link>https://en.liujiacai.net/</link><description>Recent content in About ME on Jiacai Liu's personal website</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 25 May 2026 06:26:08 +0000</lastBuildDate><atom:link href="https://en.liujiacai.net/index.xml" rel="self" type="application/rss+xml"/><item><title>My Thoughts on Bun's Rust Rewrite</title><link>https://en.liujiacai.net/2026/05/16/bun-rust-port/</link><pubDate>Sat, 16 May 2026 11:59:54 +0800</pubDate><guid>https://en.liujiacai.net/2026/05/16/bun-rust-port/</guid><description>&lt;p&gt;
Before we discuss &lt;a href="https://github.com/oven-sh/bun/pull/30412"&gt;Rewrite Bun in Rust&lt;/a&gt;, there is something that needs to be said—because no one else is saying it.&lt;/p&gt;
&lt;p&gt;
Bun stands where it does today because of Zig.&lt;/p&gt;
&lt;p&gt;
&lt;figure&gt;
 
 &lt;img src="https://fs.liujiacai.net/cdn-img/zigcc/bun-rust-port.webp"
 
 
 /&gt;
 
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;
Jarred chose Zig back then not because it was &amp;#34;cool,&amp;#34; but because Zig enabled a small team to rapidly prototype a high-performance JS runtime without a garbage collector or a heavy runtime. Zig&amp;#39;s low friction, direct memory manipulation, and straightforward C interop were the core reasons Bun could punch above its weight on performance with an extremely small team in its early days. The architecture, data structures, and low-level design of Bun as it exists today were shaped by Zig.&lt;/p&gt;</description></item><item><title>Embed git commit in Zig programs</title><link>https://en.liujiacai.net/2023/06/29/embed-git-commit-in-zig/</link><pubDate>Thu, 29 Jun 2023 21:57:47 +0800</pubDate><guid>https://en.liujiacai.net/2023/06/29/embed-git-commit-in-zig/</guid><description>&lt;p&gt;
Whether you are writing a &lt;a href="https://github.com/tigerbeetledb/tigerbeetle/blob/9ff5f4a470ed6d66b4be535e689c39eee9f24993/build.zig#L14"&gt;fancy database&lt;/a&gt;, or simple &lt;a href="https://github.com/jiacai2050/zigcli/blob/286b07c14e9dcc9072aa3ffdfee80628f281439f/build.zig#L11"&gt;CLI program&lt;/a&gt;, it&amp;#39;s always helpful to embed git commit into the binary.&lt;/p&gt;
&lt;p&gt;
With it, you can know which exact lines of code is to be blamed when users throw you an unhappy backtrace.&lt;/p&gt;
&lt;p&gt;
Previously I have done similar thing in Go, and it&amp;#39;s fairly easy:&lt;/p&gt;
&lt;div class="src src-bash"&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;1&lt;/span&gt;&lt;span&gt;go build -ldflags&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#ba2121"&gt;&amp;#34;-X main.Commit=&lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;$(&lt;/span&gt;git rev-parse HEAD&lt;span style="color:#008000;font-weight:bold"&gt;)&lt;/span&gt;&lt;span style="color:#ba2121"&gt;&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And in you &lt;code class="verbatim"&gt;main.go&lt;/code&gt;, you have something like&lt;/p&gt;
&lt;div class="src src-go"&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;1&lt;/span&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;Commit&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b00040"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
How to do this in Zig? The answer is &lt;code class="verbatim"&gt;Step/Options.zig&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>How to troubleshoot why tramp hang your Emacs</title><link>https://en.liujiacai.net/2023/06/10/troubleshoot-tramp-hang/</link><pubDate>Sat, 10 Jun 2023 12:49:29 +0800</pubDate><guid>https://en.liujiacai.net/2023/06/10/troubleshoot-tramp-hang/</guid><description>&lt;p&gt;
When I was playing with my Emacs configs today, a tramp related message suddenly appeared in minibuffer:&lt;/p&gt;
&lt;div class="src src-bash"&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;1&lt;/span&gt;&lt;span&gt;Tramp: Opening connection nil &lt;span style="color:#008000;font-weight:bold"&gt;for&lt;/span&gt; dev using ssh...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;My Emacs also hang at the same moment since the &lt;code class="verbatim"&gt;dev&lt;/code&gt; host is out of reach. I haven’t used tramp for sometime,
so when I first saw this message, I was curious about which function trigger tramp.&lt;/p&gt;
&lt;p&gt;
I have some experience in troubleshooting tramp hang issue before, and I know that some seemingly unrelated functions will access the opened tramp buffer, such as: &lt;code class="verbatim"&gt;file-truename&lt;/code&gt;, but I have no opened tramp buffer at this time, so why tramp got triggered?&lt;/p&gt;</description></item><item><title>Zig Build System</title><link>https://en.liujiacai.net/2023/04/13/zig-build-system/</link><pubDate>Thu, 13 Apr 2023 20:49:17 +0800</pubDate><guid>https://en.liujiacai.net/2023/04/13/zig-build-system/</guid><description>&lt;p&gt;
As the popularity of &lt;a href="https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html"&gt;zig cc&lt;/a&gt;, more developers may realize Zig is not only a programming
language, but also a toolchain to help maintaining C/C++/Zig project.&lt;/p&gt;
&lt;p&gt;
Today I want to discuss one vital part of this toolchain: Zig&amp;#39;s build system, &lt;code class="verbatim"&gt;build.zig&lt;/code&gt; the first non-trivial Zig program for newcomers.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: This post is based on Zig 0.11.0-dev.2560+602029bb2.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div id="outline-container-headline-1" class="outline-2"&gt;
&lt;h2 id="headline-1"&gt;
Step
&lt;/h2&gt;
&lt;div id="outline-text-headline-1" class="outline-text-2"&gt;
&lt;p&gt;When we initialize project scaffold via &lt;code class="verbatim"&gt;zig init-exe&lt;/code&gt;, it will generate &lt;code class="verbatim"&gt;build.zig&lt;/code&gt; with detailed comments to help us understand what it does. The most frequent used commands are:&lt;/p&gt;</description></item><item><title>What I learn by implementing argparser in Zig</title><link>https://en.liujiacai.net/2022/12/14/argparser-in-zig/</link><pubDate>Wed, 14 Dec 2022 22:16:46 +0800</pubDate><guid>https://en.liujiacai.net/2022/12/14/argparser-in-zig/</guid><description>&lt;p&gt;
I&amp;#39;ve been working on a Zig project in my spare time for the last few weeks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/jiacai2050/simargs"&gt;jiacai2050/simargs: A simple, opinionated, struct-based argument parser in Zig.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here I want to share the experience learned during the development of &lt;code class="verbatim"&gt;simargs&lt;/code&gt;.
Since &lt;code class="verbatim"&gt;simargs&lt;/code&gt; is my second non-trivial project, and my experience of Zig is limited,
so welcome to point out any mistakes I made in this post. Let&amp;#39;s begin.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Disclaimer: As a 3-year Rust developer, I will compare Zig with Rust in some sections.&lt;/p&gt;</description></item><item><title>Oh My GitHub 1.0 is out!</title><link>https://en.liujiacai.net/2022/11/26/oh-my-github-1-0/</link><pubDate>Sat, 26 Nov 2022 16:51:13 +0800</pubDate><guid>https://en.liujiacai.net/2022/11/26/oh-my-github-1-0/</guid><description>&lt;p&gt;
I&amp;#39;m glad to announce my package &lt;a href="https://github.com/jiacai2050/oh-my-github"&gt;Oh My GitHub&lt;/a&gt; v1.0 is out. Besides bug fixes, it
introduce a very practical feature: create pull request without leaving Emacs.&lt;/p&gt;
&lt;p&gt;
AFAIK, there already exists a similar package called &lt;a href="https://github.com/jakoblind/github-pullrequest"&gt;github-pullrequest&lt;/a&gt; does this job, but
its interface is not very flexible, the PR&amp;#39;s title and description is &lt;a href="https://github.com/jakoblind/github-pullrequest/blob/6ae5c38b0fc15b638b5ba4490112d9822ce5e267/github-pullrequest.el#L79"&gt;hard
coded&lt;/a&gt;, and this will break &lt;a href="https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository"&gt;template&lt;/a&gt; setup by owners if there exists one.&lt;/p&gt;
&lt;p&gt;
In &lt;code class="verbatim"&gt;oh-my-github&lt;/code&gt;, &lt;code class="verbatim"&gt;M-x omg-pull-create&lt;/code&gt; will open an org-mode buffer to edit
&lt;a href="https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request"&gt;what a PR required&lt;/a&gt;:&lt;/p&gt;</description></item><item><title>Fix annoying max open files for Emacs</title><link>https://en.liujiacai.net/2022/09/03/emacs-maxopenfiles/</link><pubDate>Sat, 03 Sep 2022 15:18:27 +0800</pubDate><guid>https://en.liujiacai.net/2022/09/03/emacs-maxopenfiles/</guid><description>&lt;p&gt;
I don&amp;#39;t know which version to start with, the max open files of macOS has been changed to 1024, which is too small to develop with LSP in Emacs. And this problem cannot be simply solved by increasing ulimit. In &lt;a href="https://www.reddit.com/r/emacs/comments/mq2znn/comment/gudivjv/?utm_source=share&amp;amp;utm_medium=web2x&amp;amp;context=3"&gt;this reddit thread&lt;/a&gt;, rpluim user mentioned:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Emacs uses pselect, which is limited to FD_SETSIZE file descriptors, usually 1024. I suspect you&amp;#39;ve got one of the file-watching utilities enabled in emacs, which tends to use up a lot of file descriptors.&lt;/p&gt;</description></item><item><title>How to maintain your Emacs configuration</title><link>https://en.liujiacai.net/2021/05/21/emacs-package/</link><pubDate>Fri, 21 May 2021 07:08:54 +0800</pubDate><guid>https://en.liujiacai.net/2021/05/21/emacs-package/</guid><description>&lt;p&gt;
For Emacs users, optimizing their configuration is a fun thing, and it is also the best way to learn Emacs. Newbies are suggested to copy/paste configuration, which is the fastest and most effective way to learn. However, the configuration usually becomes more complicated and a little messy if still copy/paste after one year or two, more knowledge is required to master Emacs.&lt;/p&gt;
&lt;p&gt;
This article will introduce my experience in optimizing configuration, including mainly two part:&lt;/p&gt;</description></item><item><title>What you need to know before try Emacs</title><link>https://en.liujiacai.net/2020/11/29/why-emacs/</link><pubDate>Sun, 29 Nov 2020 09:06:19 +0800</pubDate><guid>https://en.liujiacai.net/2020/11/29/why-emacs/</guid><description>&lt;p&gt;
When it comes to Emacs, every programmer should have heard its name more or less. After all, Emacs has nearly &lt;a href="https://www.zdnet.com/article/the-10-oldest-significant-open-source-programs/"&gt;forty years&lt;/a&gt; of history. However, many users abandon Emacs before comfort with it due to the steep learning curve. I understand their frustration, I also made many attempts before &amp;#34;skilled&amp;#34; in Emacs.&lt;/p&gt;
&lt;p&gt;
After spend honey moon with Emacs for &lt;a href="https://github.com/jiacai2050/dotfiles/commit/43e9b4a314cd6b5607b675edac7f5e8a3b29a80b"&gt;four years&lt;/a&gt;, I think I can share what I learn from Emacs and shed some light for newcomers. This article will be divided into two parts:&lt;/p&gt;</description></item></channel></rss>