Re: Why mobile web apps are slow

Although the title broadly and vaguely referring to “mobile web apps”, Why mobile web apps are slow is actually a lengthy breakdown of JavaScript performance on mobile. tl;dr: too slow, and will stay relatively slow in feasible future.

Regretfully, because I was not formally trained as a computer scientist, I don’t have the necessary knowledge to judge whether or not the analysis of hardware architecture, garbage collection, or even interrupter development trends, are genuine or not. Nor I will try to be an web fanboy to pin the arthur as an Apple fanboy to repudiate what he just wrote. The question I would like to bring up is: Supposedly all of the analysis (and the conclusion) are true, what would the future holds for the Open Web, in post-PC world?

For the web to move away from JavaScript, there are currently two active proposals: Google Native Client (NaCl) and asm.js. NaCl comes with some trade-offs, like interpretability; asm.js on ARM is still in active development, and we will not know whether or not it would bring the same performance boost on x86.

Obviously, without JavaScript, the web as we (the front-end web developers) know it will cease to exist. It’s not necessary a bad thing though — while the web moving a way from a place I grew up, where everyone can find out the layout or logic of any website with view source, it had also involved to something much useful and powerful, embedded into everyone’s digital life more deeply. Yet, working on Mozilla payroll means there is no excuse to give up on the Open Web — even though I am not the person who make these decisions, thought experiments is always a fun thing to do.

So, maybe 10 years from now, website, or web apps would do this: Probe the CPU architecture of your hardware, drop the corresponding optimized asm.js or NaCl bytecode to your device, and render the entire screen with WebGL. There might even be Flash-like authoring tool for that, or even WebHAL — a library to abstract CPU/GPU differences. Think about what the Open Web gain or loose at that future.

As for JavaScript, in that future, people would have conversation like this comic (spooler alert below; thanks Kanru for the link):

— … Can’t remember its name. Today it’s mostly used just as a target language for compilers, but back in [the professor]’s days people actually used to write in it directly!

— Oh, that must be JavaScript!

Perhaps, just like Lisp at the time, a dynamic-typing language is still too advanced for hardware circa 2013.

Github Pull Request 進階操作速查

Github 發 Pull Request 已經幾乎成為貢獻開放原始碼專案的主流操作方法了。Github 的成功就是在於介面設計的相當順手,甚至是如果只是要修改單一檔案可以直接在線上編輯器完成。不過它的流程還是少了最後複雜的部分:在中大型專案,一個 Pull Request 雖然可以留言做 review,但是貢獻者需要一些進階的 git 指令操作能力才能完成 review 來來回回的修改。例如,以下是從 Yuren 那邊偷來的Gaia 在 Github 上面的 workflow:

Gaia Development workflow

因為這樣,我寫了一篇文件以 Pull Request 發出之後,和專案管理者往來會遇到的情境為脈絡,解釋貢獻者該怎麼操作才能順利完成貢獻流程:Github Pull Request 進階操作速查。既然是 Github 上的流程,放 gist 當然是理所當然 … 之後需求的話可以再轉到 repository。

PS: 當初寫的時候沒有搜尋,不過搜尋了才發現還真的沒有人寫過這個流程的中文說明(英文很多就是)。倒是 John Resig 寫了一個 npm package 可以讓專案管理者跳過 Github 的綠色按鈕直接 squash commit:pulley。我比較懶惰,如文章所述,我覺得寫 要求貢獻者照作比較快 😀

As a secret Opera Software fan…

Opera had it first!

I think it’s fair to admit that I am a secret Opera Software fan, especially on their ability to deliver many of the browser innovations (Opera had it first!) we see today and relative independence within the browser arena.

Yet, recently, posts are popping up, revealing inconvenient truth of the inner-working of the company, and confirm the reasons behind it’s rational move to Chromium. As a public trading company, it have grown increasingly intolerant to products that is unable to bring in new revenue. The company have also known for underpaying it’s loyal employees, substituting salary with a “vision of achieving greater good”.

Obviously, stay relevant in the browser arena is hard. Mozilla is working hard on that too, either with new technologies like asm.js or Servo, or newly gain influence from the new product Firefox OS. Mozilla is actively seeking talents from Opera too like Hallvord R. M. Steen, the author of the aforementioned post; because to them, as Hallvord puts it:

And maybe, just maybe Mozilla is an environment where ideas are still kings..?

I sincerely hope the above notion describing Mozilla is true, and stay true in the feasible future.