Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
229 changes: 116 additions & 113 deletions content/posts/2024-09-13_growth.md

Large diffs are not rendered by default.

203 changes: 203 additions & 0 deletions content/posts/2024-09-13_growth.zh-TW.md

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions content/posts/2025-10-03_vibe_coding2.zh-TW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: "隨興開發聽起來很瞎"
date: 2025-10-03T00:00:00+08:00
draft: false
---

隨興開發(Vibe coding)聽起來很瞎。因為遊戲規則是開發者不能去看或動 AI 寫出來的程式。

也許那是我們才剛穿越到 2025 年,還不習慣這種做法。寫過程式的人,會在過去的經驗中必須了解程式碼的所有細節。或,真的嗎?

我發現我從來沒有管過編譯器下面的事。假設用 Python 寫了程式,看起來沒問題,執行起來沒什麼問題,我就覺得沒問題了,非常 Vibe。

一種原因是程式語言編譯後的錯誤,通常很罕見也很安靜,所以人們不怎麼檢查,出事也不怎麼嚴重。

直接問 AI 有什麼上過頭條的編譯器錯誤,他能給出最接近的答案是 1994 的 Pentium FDIV bug ,和編譯器無關。這個事件是數學系教授在研究數學時,發現有個除法一直算錯,追究下去發現是晶片的問題。

再對 AI 嚴加逼問之後,發現最近最有名的編譯器錯誤就發生在我們區塊鏈圈子。 2023 年,撰寫合約用的 Vyper 語言,因為編譯器的實作錯誤,用來避免重入攻擊的函式失去效果。駭客因此漏洞從 Defi 專案的合約竊取 7000 萬美金。

且不說編譯器這麼遙遠的主題。多少工程師是有辦法檢查每個專案依賴的套件?我能做到的就是看起來可疑的套件不要用。

或整個軟體開發上,為了減少開發者認知負擔,本身就需要重重抽象。套件是別人包好的,開發者可以在不需要知道背後的運作細節的情況使用它。函式也是,當人們寫一個 get_post_by_id ,不用知道背後的實作細解也大概可以想像這段程式的用途。

所以本來開發上就有某種程度的瞎,與適度的瞎。

瞎的部分是問題會發生的所在。想辦法補起來就好,但不一定總得靠人力。

從編譯器的思路出發,隨興開發就好像某種更高階的語言一樣。以往的程式語言,是模擬英文的感覺,但加上非常嚴格的語法,讓人們可以和電腦溝通。高階的程式語言需要經過層層翻譯,先變成比較低階的語言,再變成組合語言,再變成機器碼,叫石頭與磚頭開始工作。

現在則是我們用非常不精確的人話溝通。 AI 聽得懂,並翻譯成以往的程式語言。這整串流程只是多加了一個 AI 翻譯官。

1940 年代,人們最早是透過機器碼和組合語言和機器溝通的。早期的高階語言可以拉到 Fortran (1957) 或 LISP (1958) 。

最早的時候機器超貴,造價是年薪 100 倍( 1950 機器 100 萬美金,工程師年薪 1 萬美金),但現在工程師的年薪可以買 50~100 台筆電(2025 筆電 2000 美金,工程師年薪 10 萬美金)。因此早期的時候,可以花很多工時,用最接近機器的語言和機器溝通。現代工程師的時間比較貴,用人話才越有效率。
但人話又可以讓開發這件事情讓非工程師的人勝任。

Claude Code 開發者的專訪中,他說人們總說隨興開發讓從零到一這件事情變簡單了。他個人覺得是專案要上線前,往往需要放棄的那 2% 功能,現在可以不用倚賴工程師完成。

隨興開發在重塑人與機器的溝通,也在重塑人與人之間的合作方式。或也許單個人本身的合作方式也變了。

產品經理與開發者一直有某種利益衝突的關係。前者需要更多的功能上線,但後者需要為開發新功能帶來的後果負責,那包含開發的耗時與耗神、上線後的故障等。如果一直推了新功能然後又撤掉,開發團隊士氣會燃燒殆盡。

我自己寫程式的時候,一直要把想要的新功能與自己的耗時和疲勞權衡。但叫 AI 寫程式的時候,我可以一直推功能,一直欠技術債。產品經理腦不會和開發者腦打架。把開發的工作推給 AI 解決了那種利益衝突。

難道這代表隨興開發之下,真的不再用人眼去看以往的程式語言了嗎?不盡然。在高階語言開發之下,會需要動到低階語言的先例不是沒有。

人們常會在效能熱點的地方,換成人比較不好理解但高效能的低階語言實作。在區塊鏈圈子看到的是 Defi 或密碼學的數學會用省油的組合語言實作。低階語言效能高的原因其實是高階語言在翻譯下來的過程中,編譯器往往會以保守安全並犧牲效能的方式翻譯。但如果人們在熟悉業務邏輯的情況下撰寫低階語言,可以知道哪些不必要的步驟可以省略,達成節省運算的目的。

大約一年以前,我需要整合某個新密碼學套件,做某種面向使用者的應用。但因為當時 AI 對一個全新套件以及其密碼學並無理解。我就再把密碼學套件再包成數個符合業務邏輯的函式, AI 就能接手後面的工作了。用函式包裝程式的作法在和人協作的時候很標準,但在和 AI 協作時,好像是為了某種高階語言去用低階語言去最佳化的感覺。

我們的意念變成機器的行動的距離變近了。開發變得像《猴爪》小說一樣,要小心自己許的願望,並一直調整自己許的願望是什麼。

這樣想想就覺得還要開口和寫訊息和機器溝通好冗贅。我們需要魔法。
79 changes: 79 additions & 0 deletions content/posts/2025-10-07_lost_colony.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: "Review: Lost Colony by Tonio Andrade"
date: 2025-10-07
draft: false
---

{{< translation type="machine" from="Chinese" />}}

![](https://books.google.com/books/content?id=wGmYDwAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api)

I finished reading Tonio Andrade's [[Lost Colony: The Untold Story of China's First Great Victory over the West]](https://www.eslite.com/product/1001110932643195). The original was published in 2011, with the Chinese edition republished in 2017. Many Dutch names in it appear closer to colloquial pronunciations.

This book mainly tells the story of Koxinga's 1661 attack on the Dutch at Fort Zeelandia. Why did the author want to research this war? It turns out there's a major world history question to answer.

Why did relatively backward Western European countries come to dominate the globe in the 16th century? Traditional historians have proposed many different reasons: guns, property rights, economics, politics, social institutions, etc. But for every reason traditional historians propose, global historians counter with examples of others who had those factors but didn't dominate the globe.

Global historians believe the Europe-Asia divergence wasn't in 1492 when Columbus sailed, 1497 when da Gama rounded Africa, or 1600 when the English and Dutch East India Companies were established. They believe the so-called Great Divergence happened with industrialization in 1800, when Europe truly became decisively powerful.

One theory historians debate about Europe-Asia power is the "Military Revolution thesis." Frequent European wars created innovation: powerful guns, ships, troops, fortresses—these military innovations then sparked social institutional innovation.

The global history school calls itself historical revisionism. Both they and their opponents accept the Military Revolution thesis but reach different conclusions. Revisionists believe Europe indeed had some advantages, but not many. Anti-revisionists believe Europe became strong precisely because of the military revolution.

The 1661 war is a battlefield for debating the Military Revolution thesis. Anti-revisionists believe the Dutch occupied Taiwan due to their powerful technological strength.

Revisionists believe the Dutch could occupy Taiwan because China, Japan, and Korea let them, as everyone was busy—the Dutch seized the opportunity in a naval power vacuum. When the Ming needed Taiwan, they took it right away.

Tonio Andrade is a revisionist. Before writing Lost Colony, his previous book argued how easily Koxinga defeated the Dutch. But after examining Chinese and Dutch historical sources, he found this war wasn't as simple as he'd imagined.

Guns, the anti-revisionists' favorite, weren't simply a European advantage. The Ming had long mastered musket technology but found it impractical and chose not to use it.

The Ming, founded in 1368, was a gunpowder empire. They used cannons against neighbors, who then learned artillery. Those neighbors used artillery against other neighbors. Thus artillery spread westward.

Muskets fired slowly, so different peoples independently evolved volley fire tactics. The first rank fires then the second, while the first reloads behind, using multiple ranks to reduce reloading gaps. This volley fire demanded discipline to avoid breaking in chaotic battlefields.

After learning about muskets, the Ming found them impractical. Though accurate, efficiency dropped against human wave tactics. So Ming armies kept giant cannons but didn't use guns.

Koxinga's army bypassed Dutch defenses through a breach in the Luermen sandbar, camping in northern Tainan. They quickly besieged Fort Provintia (today's Chihkan Tower), forcing Jacob Valentine to surrender. Frederick Coyett, the Dutch governor at Fort Zeelandia, sent Thomas Pedel with 240 musketeers against Koxinga's thousands.

Koxinga deployed his elite Iron Men troops wearing iron armor and masks. Pedel had previously used hundreds of musketeers against six thousand in the Guo Huaiyi Rebellion without injury, so he underestimated this battle. When Koxinga's Iron Men were shot, replacements immediately filled gaps, maintaining formation. Pedel fell into a rear ambush, was routed, and died on the spot.

Dutch muskets didn't defeat Koxinga's army. Musketeer discipline wasn't superior to Koxinga's troops' discipline.

Andrade believes the Dutch indeed had special technology, and if Coyett hadn't made a series of wrong decisions, they might have defeated Koxinga.

The Dutch's main advantages were Renaissance star forts and ships.

The Koxinga facing Coyett was already a siege veteran of dozens of battles. Chinese cities are enormous, with walls wide enough for carriages. Fort Zeelandia was tiny compared to even rural Chinese fortresses. Yet it held Koxinga off for a year.

This was mainly because Renaissance star forts evolved for the artillery age. The fort could create crossfire, with artillery firing from different directions at any approach. Koxinga, raised on Sun Tzu's Art of War, considered sieges the worst strategy, so he first wrote many letters urging Dutch surrender. When he actually needed to siege, he threw massive manpower at it. Chinese walls quickly fell once breaches were found and packed with gunpowder.

Against star forts, one must build siege works nearby. Finally, a German drunkard who defected from the Dutch army taught Koxinga's forces this trick, prompting Coyett's surrender.

For ships, Dutch advantages were sailing against the wind and broadside cannons. Sailing against the wind let Dutch ships sail to Batavia for help when monsoon winds were unfavorable. Broadside cannons increased ships' firepower output. So in Zheng Zhilong's era, defeating Dutch ships required luring them deep inland then attacking with fire ships.

Beyond world history's big questions, this book's narrative is brilliant, with vivid character portrayals.

Coyett was basically a corporate drone who held meetings and left paper trails before doing anything. He worked meticulously, giving detailed instructions and leaving contingency plans.

His problem was discord with colleagues. When he initially anticipated possible invasion by Koxinga's forces, Batavia had actually reinforced defenses, but he drove away his colleague Van der Laan who led elite naval forces. When reinforcements under Jacob Caeuw finally arrived after holding out, he didn't trust them, leading to a disastrous counterattack. The Batavia governor also didn't trust him, leading to his eventual investigation, exile, and disgrace.

Koxinga had strategies trusting Dutch military defectors, but Coyett didn't trust the Chinese farmer defector Su. The author believes following Su's suggestion for naval blockade of Koxinga's supplies could indeed have starved Koxinga's forces.

Finally, He Bin. Why did Koxinga, while successfully fighting to restore the Ming and already at Nanjing's gates, suddenly attack Taiwan? Because He Bin told Koxinga that Taiwan had abundant provisions. When Koxinga arrived in Taiwan and found nothing, he had to order soldiers to farm.

He Bin's father served as Dutch interpreter and owned extensive lands.

At the time, businesspeople couldn't trust merchants' scales, fearing false weights, so many places established public scales. He Bin proposed building public scales to the Dutch.

The Dutch thought scale positions should be auctioned. Three Chinese bid, but He Bin somehow always got the position. The Dutch tax official was furious. Angry merchants sued He Bin, making his position untenable.

At the time, Koxinga implemented naval embargo to obtain food for counterattacking the Qing. Coyett, newly in position, wanted to restore trade and communicate with Koxinga. He Bin intermediated, telling the Dutch everything was arranged with Koxinga and the embargo would lift, while telling Koxinga the Dutch would pay tribute.

My impression reading this is that Taiwan keeps getting sold out by political-business brokers. And Koxinga's invasion based on false provisions intelligence is an example of Chinese miscalculation in invading Taiwan.

Finally, I don't know where to place this, but the book has a beautiful passage describing the Little Ice Age, here are excerpts: Spanish soldiers heard Philippine volcanoes erupting; astronomers in Korea, China, and Europe recorded sunspots; tree rings in northern Italy tightened from lowered temperatures, making seventeenth-century violins sound special. Mexico had no rain, the Nile dropped to its lowest level.

![](images/waaggebouw.jpg)

Image: Dutch using public scales and collecting goods tax from children at Fort Zeelandia, Tainan, Taiwan.
Loading