蔡志浩老師寫了一篇精練的華氏 451 度書評,讓我想起我也曾寫下粗淺但是類似的感想。
最近看著家裡的書櫃越來越滿,且現在二手書買賣的管道越來越方便,想著想著就掉入「為何要把書留在身邊」的沉思。但只要看到《華氏 451 度》這本書被提起,我就想到一個我還確定的結論:這本沒有完全讀懂其中深意的書,是絕對值得留在書架上的經典之作。
希望我有閒餘時間能再讀一次;希望能再讀之時,能有不同的感想。
用過 Firefox 等 Mozilla 系列瀏覽器的朋友,或許知道 Mozilla 瀏覽器都內建一份 about:mozilla 頁面。該頁以深紅色為底,節錄一本不存在的《Mozilla 之書》,以基督教聖經的語調講述 Mozilla 的歷史。
在 Netscape/Mozilla 的歷史中,about:mozilla 改版了 6 次。就如聖經一樣,都是用寓意的方式將網路的現狀,以及 Mozilla 挑戰與行動記錄下來。Wikipedia 的條目詳列了先前各個版本的原文與寓意。簡略來說:
目前的版本為章節 15:1,今年 1 月剛剛更新:
瑪門的雙生子發生了爭吵。他們的交戰使世界進入了一個新的黑暗,而野獸憎恨黑暗。於是它迅速的採取行動,變得更加強大,並不斷地前進和繁衍。野獸為黑暗帶來了火焰與光明。
關於這個章節的討論與寓意可以參考 Bug 上的討論。「瑪門的雙生子」比喻 Apple 與 Google 在手機作業系統上的競爭以及平台的私有化。Mozilla,即「野獸」,在新的時代則推出了 Firefox OS、Firefox for Android 以及高速釋出開發週期以面對新的挑戰。
I recently did some research on well-known Javascript module formats. Not sure why I missed this topic back in 2009, however some archeology revealed an conflicting reality:
For years, a lot of discussion on the difference of the formats surrounds the sync v.s. async nature of the format. jrblake, the author of the AMD spec and require.js, have already explicitly explain his argument on why he disagreed with the trade-offs made in the CommonJS module format.
However, I still ended up drawing the conclusion of my research — as of 2013, CommonJS modules is more welcomed to the developers than AMD modules. But why? In my humble opinion, of all the differences in design between CommonJS module and AMD module, this one stands out and made the difference: CommonJS module spec requires one scope per module. This in turn gives CommonJS modules the following behavior:
exports
object.window
object in browsers. This has significant implication — module scripts can never take global APIs for granted — one would have always explicitly require()
for it. On the other hand, one could never mess up with the dependency system by attaching fake fake APIs on the global object — everyone has to be honest to the dependency tree, and the loader.require()
‘d. This in turn provided an uniform experience for the developers, which is extremely helpful to new Javascript runtime/platforms, both on inventing one and on learning one. With that, it is not surprising almost every “new kid in town” adopts CommonJS modules, e.g. NodeJS, PhantomJS, and Mozilla Add-on SDK.eval()
(Yabble), but one would never stop script within from referencing variables on the outer scope s (except running your own Javascript runtime on top of the native Javascript runtime, I presume).For someone who write Javascript for the browsers most of the time (we all are I think), I hate to be the proponent of something that doesn’t work in the browser context. What’s good come out of CommonJS module spec is all begin with the decision to ditch the browser. Alternatively, the legacy limitation of the browser is just too heavy for AMD module format to carry — thus, the AMD format never propagates, beyond browser, so does the promise to Javascript modules debate to the developers — you should be able to write your code once and use it everywhere.
What is broken, for modern day needs, is the browser context, not AMD, which tried really hard to address it. What AMD proofed is that we need new language feature, or browser APIs, to cope what we are facing. Hopefully, the new ECMAScript Harmony module is being worked on in Gecko and will be landed soon. How Harmony module could deliver the promise is not the scope of this article; it would be a further pending research topic for me.
Javascript, 18 years after invention, a fundamental cornerstone is still missing for building a library repository, like what PEAR for PHP, CPAN for Perl, or RubyGems for Ruby. The momentum is there already, and it had been there, for a long time. npm could be considered the most promising one, however, again, the lack of a common module format limits the uses of the modules on the site.
It also limits people writing heavy client-side web applications — people is currently prevented to split their apps into modules agnostically of any frameworks. This is worse than PHP, in which the frameworks have already start working together on common standards, i.e. PSRs.
We are still eagerly waiting another universal Javascript module format, to ignite everything and to start realize all the possibilities. I remain optimistic on this issue given the wide acceptance of the language itself had attracted lots of talents. But, first step toward the solution at full speed is to admit there is one.