RSSAmplifier

Blog

About ME on Jiacai Liu's personal website

Recent content in About ME on Jiacai Liu's personal website

en.liujiacai.netRSS feed ↗9 posts

Latest posts

My Thoughts on Bun's Rust Rewrite

Before we discuss Rewrite Bun in Rust , there is something that needs to be said—because no one else is saying it. Bun stands where it does today because of Zig. Jarred chose Zig back then not because it was 'cool,' but because Zig enabled a small team to rapidly prototype a high-performance JS runtime without a garbage collector or a heavy runtime. Zig's low friction, direct memory manipulation,…

Embed git commit in Zig programs

Whether you are writing a fancy database , or simple CLI program , it's always helpful to embed git commit into the binary. With it, you can know which exact lines of code is to be blamed when users throw you an unhappy backtrace. Previously I have done similar thing in Go, and it's fairly easy: 1 go build -ldflags = '-X main.Commit= $( git rev-parse HEAD ) ' And in you main.go , you have…

How to troubleshoot why tramp hang your Emacs

When I was playing with my Emacs configs today, a tramp related message suddenly appeared in minibuffer: 1 Tramp: Opening connection nil for dev using ssh... My Emacs also hang at the same moment since the dev 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. I have some experience in troubleshooting tramp…

Zig Build System

As the popularity of zig cc , more developers may realize Zig is not only a programming language, but also a toolchain to help maintaining C/C++/Zig project. Today I want to discuss one vital part of this toolchain: Zig's build system, build.zig the first non-trivial Zig program for newcomers. Note: This post is based on Zig 0.11.0-dev.2560+602029bb2. Step When we initialize project scaffold via…

What I learn by implementing argparser in Zig

I've been working on a Zig project in my spare time for the last few weeks: jiacai2050/simargs: A simple, opinionated, struct-based argument parser in Zig. Here I want to share the experience learned during the development of simargs . Since simargs 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's begin.…

Oh My GitHub 1.0 is out!

I'm glad to announce my package Oh My GitHub v1.0 is out. Besides bug fixes, it introduce a very practical feature: create pull request without leaving Emacs. AFAIK, there already exists a similar package called github-pullrequest does this job, but its interface is not very flexible, the PR's title and description is hard coded , and this will break template setup by owners if there exists one.…

Fix annoying max open files for Emacs

I don'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 this reddit thread , rpluim user mentioned: Emacs uses pselect, which is limited to FD_SETSIZE file descriptors, usually 1024. I suspect you've got one of the file-watching utilities…

How to maintain your Emacs configuration

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. This article will…

What you need to know before try Emacs

When it comes to Emacs, every programmer should have heard its name more or less. After all, Emacs has nearly forty years 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 'skilled' in Emacs. After spend honey moon with Emacs for four years , I think I can share what I learn from…