Alex Tzeng
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# 鐵人賽第八天 # 不只是瀏覽器!JavaScript 征服世界的第一步 - Node.js # 前言 我們終於進入 Node.js 這個主題了,真是令人興奮 如果回頭看看 JavaScript 的發展 其實整個過程可以說是 Web 標準、程式語言演進的鎖影 # Node.js 介紹 在實際進入 Node.js 前 我想先介紹 Ryan Dahl ,也是就是 Node.js 最早的開發者 許多人都早有耳聞 io.js 一系列的 drama 不過對於 Node.js 最早是怎麼開始的,就沒聽過了! # Ryan Dahl Node.js 這個 Project 最早是在 2009 年開始進行的 他的第一個開發者 Ryan Dahl 原本並不是一個 CS(資工)學生,或是跟資訊有關的人 而是一個在紐約讀數學的研究生,正讀到他研究所的第三年 那時候他覺得每天做的事情都只是在紙上寫寫寫 在一天結束之後,看著自己的成果(一團紙) 會開始覺得做這些重複的事情根本沒意義(Ryan Dahl: 雖然 Programming 也一樣) Ryan Dahl: 可是數學跟寫程式不太一樣,你寫了一整天程式,至少有個網站可以秀出來 但是數學!數學基本上真的沒什麼好秀的 所以那時候他覺得十分的痛苦 他就決定休學、試著做做其他事 # 休學後 他就買了一張火車單程票去南美、身上大概只有幾百鎂 有趣的是,那時候在美國是夏天 可是他到南美,他沒想到 7 月,超級冷啊! 所以一開始過很糟糕 後來他碰到了另一個開發者,是寫 PHP 的 Ryan Dahl 其實以前有寫過些程式,所以他想,網站,應該他也行吧 這就是他最早開始寫 Web 的由來 在 2006 年時,RoR(Ruby on Rails) 剛開始獲得許多關注 不過他卻覺得網站伺服器架起來,都讓人很失望的慢 他仔細的去探究底層,他在當時覺得是 Ruby 本身的問題 因為像是 Python、Ruby 這些直譯式語言 在早期,他們對於 multi threading (多執行緒) 都沒辦法做得很好 基本上在直譯後的程式碼,其實都是 blocking single thread 的 代表你就算開了 thread(執行緒),他其實在底層,還是做了很多 lock,不讓你讓兩個程式同時執行 (Note: 這是 2006 年,Ruby 和 Python 基本上到現在都變得非常不同了) 那時候有一群人想試著改善 Rails,但是後來碰到 Ruby 當時的實作架構,所以無功而返 但是其中 Ryan Dahl 認識一個人,改變了他對 Web Server 的理解 最早的 Web Server ,只是用來讓你看 HTML 檔案的 基本上就是在你家的機器上放一坨 CGI + PHP檔案 + APACHE 設定檔 + HTML 你可以把它想成只是把你電腦上的檔案系統給別人看而已 但是那時候,RAILS改良協會的其中一人 他試著把 HTTP 連接的部分,寫成一個函式庫 他們定義的 Web Server 是這樣的 「Web Server 是,而且僅僅是。一種用來 "回應" 一個"請求"的程式」 基本上這完全改變了人們的想法 你想讀檔案回傳?那完全 OK 但是那只是 Web Server 的額外工作 Web Server 本身,就是指處理 Request 和 Response 的那隻程式 後來,過了一小段時間 AJAX 開始變得火紅了起來 網路上人們開始試著上傳「檔案」,像是圖片、電影 這其實是在 2006 年當時很難以想像的,因為大家都認為 HTTP 是純文字協定 不會拿來傳文字以外的東西 結果那時候有個小技巧,Ryan Dahl 看到了 那就是上傳圖片/影片時,他的 Progress Bar(進度條) (因為上傳圖片都要很久,他覺得進度條超級重要的) 他想說,哇靠,這個到底是怎麼做的 後來研究後發現,在當時 他們是 HOW DID THAT WORK PROGRESS BAR?! START UPLOADING ORIGINAL MAKING SMALL AJAX REQUEST TO HANDLE PROGRESS BAR CHECK FILE UPLOAD! THIS CHNAGE EVRYTHING INTERACTIVE NODE PRIM TRY TO SOLVE THE PROGRESS BAR HIT WAIT TO REPONSE IT WAS HEAVY LONG POLLING SERVER SLOW REPLEY RUBY PROJECT FOR PROGRESS BAR CAN"T MAKE IT FAST ADD LINE OF RUBY 5% SLOWER OK BACK TO C MOST BEATUFUL IN PLAIN C MODULE OH IT ACTUALL WORKS BCS ITS UNFAMILIRAR TO WEB DEV PYTHON HASKELL WAHT IF GO COMPLETE NON LOKCING ALL SINGLE THREAD? WILL THAT WORKS BCS IT LANGS ALL HAVE LOCKS FRIEND IDEA OH SHIT JAVASCRIPT ALOT JAVASCIRPT V8 this is the language 2008 pefrect anoy function for Ui closuree no anotions lib, no file javascript is only functions no sockets no operation system non-blocking server work for six month jsconf eu in nov 2009 the conf is perfect I was extreme scared linux plug in video driver suck switc mac a hour long talk blind blab tlak can i just go? what if just walk out prep a demo a node IRC server crappy work?! holy shit 400 lines js 2009 IRC server with js?! it's not a pure language suddenly there's IRC out of money stop or funding? company project 20%, or sell it but its a open source proj we really like node can we use node to build our data center SF work node core 14 ppl isacc, creator of npm

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully