RSSAmplifier

Blog

Let over map merge

This personal blog describes about the ideas around Clojure/ClojureScript/Datomic

humorless.github.ioRSS feed ↗13 posts

Latest posts

Expert Clojure Workflows for AI Agents: Four Skills from Production Experience

When you let an AI agent write Clojure code, you expect it to leverage the language's superpowers—the REPL's interactivity, structural editing, format-preserving code manipulation, and the rich ecosystem of wrapper libraries. Instead, what you typically see is mediocre code written slowly, as the agent makes the same mistakes every developer learns to avoid. I discovered this the hard way. The…

Agent-Ready Stack

I keep seeing people share vibe-coded apps built on TypeScript/React + Supabase — seemingly the default recommendation from Lovable or Cursor. As a Clojure programmer, I can't stay quiet about this. In an era where AI agents are deeply embedded in the development workflow, that choice carries structural hidden costs that almost nobody is talking about. Context Window Is the Bottleneck, and…

Teaching Clojure programming class

When I told others that I am a Clojure programmer, they responded apathetically. Why so many people in Taiwan never heard of this great programming language? One day, an idea occurred to me that how about teaching some students? The advertisement I re-wrote my advertisement again and again. What kind of value proposition would be appreciated by my prospects? I actually did not know. At the end, I…

Using Datomic with disk cache and LU cache

The background of this post I began to use Datomic seriously in my project at work from February 2019. I encountered certain performance issues and I solved them through disk cache and LU cache. Analytical queries need pre-computation My project had several analytical queries which implemented the business rules. With Datomic expressive query power, it was very easy to implement queries that…

A Clojurian's idioms and patterns for ETL

Background I needed to do eight Excel ETLs at my project. At the beginning, I just implemented some of the ETLs without any design. I did not even implement schema validation, and then I felt the pain soon. After several re-writing, I abstracted out some idioms and patterns for ETL. Problems We need to import data from several Excel files into Datomic database. There are several concerns with the…

Lessons learned from the software consulting job

I live in Taiwan and I can not find Clojure jobs here. Although the first legal gay wedding in Asia took place here, it seems that the real programming language innovation still needs some evangelists to spread it. Therefore, I decide to create Clojure job by myself. In January this year, I had a chance to develop enterprise software for a big company, and I chose Clojure as my primary technical…

Using datomic with Luminus: Where to put our queries?

If we build a Luminus project with db option other than datomic, for example +postgres , the code arrangement is much more straight forward. Open the file resources/sql/queries.sql , and put sql query and sql transaction command in this file. Then, we can just require the xxx.db.core namespace, the db queries or commands are totally available. Where to put the db queries if we use db option as…

Clojure development environment by Vagrant

If you want to have a portable Clojure development environment and you use Vagrant, vim-fireplace, you may consider to try my Vagrantfile . git clone https://github.com/humorless/dotfiles cd dotfiles vagrant up Certain part of vagrantfile you may need to remove. if Vagrant.has plugin? "vagrant-timezone" config.timezone.value = "Asia/Taipei" end The beginning of this repo Several years before, I…

Using Datomic in my app

The background of this post I began to use Datomic seriously in my project at work from February 2019. Now, it is time to write down certain experience. When I just began, I found a lot of documents talking about how to use Datomic. However, I still found certain points worth to mention from my project. Query API and Pull API are enough When I just begin to write Datomic, soon I found post from…

REPL tips

從今年 2 月開始,接了一個公司內部應用軟體的專案開發,我用 clojure + luminus + datomic 來實作。不知不覺也就每天寫 clojure 的 REPL 近兩個月了。每天玩 REPL 之後,很快就發現一些過去我用 REPL 的盲點。 clojure.repl/pprint ">沒有善用 clojure.repl/pprint 沒有善用的主要原因,自然是因為在 fireplace.vim 的環境下,一開始我沒有特別做一些設定時,直接做 cpp, cqp 之類 REPL 操作,並不會有 pretty print 的輸出。後來,我總算是下定決心,把 leiningen profiles 設定好,加入了一個叫 vinyasa 的 leiningen dependency 設定好之後,就可以用 >pprint ... 來做 pretty print 。 1 2 ">沒有善用 1…

dependency injection with Clojure

寫 clojure 的時候,雖然套用了 REPL-driven development 的開發方式,已經相對可以讓大多數的函數很快地做過測試。但是,隨著要開發的專案愈來愈大,還是一樣需要用標準的寫法來寫單元測試 (unit test) 。有一個非正規的統計,如果是 Ruby on Rail 的專案,一般而言,90% 的函數都是有副作用的。然而, clojure 語言的專案,往往只有 40% 的函數帶有副作用。 即使是寫 clojure 語言,還是會遇到有 side effect 的函數,那比較好的寫法是怎麼樣呢? 我查了一下 stackoverflow 之後,很快就找到了一個很好用的函數 with-redefs 。 stackoverflow 上的答案大意如下: 由於 clojure 語言有 Dynamic binding 的特性,使用 with-redefs 就可以實現同樣的語意了。…

groupby

一開始是我在寫 4clojure 的練習題的時候,寫到了一個題目,要重新實現 clojure 語言的 groupby 函數。我糾結了好一陣子,又查了不少資料,才勉強用 reduce 寫出來。然而,最近卻在工作中,用上了 groupby 。 fn f k coll reduce fn c v update-in c k v fnil conj v {} coll 工作上遇到的問題是要重構同事寫的程式碼。程式碼做的事情是:「接受資料庫 dump 的 json 輸出,跑兩層很複雜的迴圈,對原始的資料做主鍵交換的處理,然後將資料存入 mysql 資料庫。」資料庫 dump 出來的 json 大概長成如下的樣子: "result": { "platform": "c01.i01", "ip list": { "ip": "192.168.0.1", "hostname": "ggyy6699" },…

pattern

patterns = programming with abstactions that are not powerful enough 先來引述一下 Paul Graham 的句子 When I see patterns in my programs, I consider it a sign of trouble. The shape of a program should reflect only the problem it needs to solve. Any other regularity in the code is a sign, to me at least, that I'm using abstractions that aren't powerful enough. Paul Graham - Revenge of the Nerds…