Widget

Node.js And Websocket API
Technical Docs Nov 11, 2010
0

1. What Makes V8 special?

  • V8 JavaScript VM is used in Google Chrome developed by small Google team in Denmark. V8 is a open source.
  • JavaScript-Engine Von Google
  • No JIT, all JavaScript is compiled to assembler
  • Hidden classes optimization from self
  • V8 does not dynamically lookup access properties. Instead it uses hidden classes that are created behind the scene
  • Improved Garbage Collector
  • Stop the world, generational, accurate, garbage collector
  • V8 is independent of Google chrome.
  • Limitation- No byte code language, no threads, no processes.

2 Node.js

Node.js is an evented I/O framework for the V8 JavaScript engine. It is intended for writing scalable network programs such as web Servers
Node.js is similar in purpose to Twisted for Python, Perl Object Environment for Perl and EventMachine for Ruby. Unlike most JavaScript, it is not executed in a web browser, but it is rather related to server-side JavaScript. Node.js implements some CommonJS specifications.

Features

  • A system built on top of V8
  • Features like
    • Non-blocking I/O
    • Ability to do system calls
    • HTTP libraries
    • Module system
    • The non-blocking nature makes node.js a good fit for comet and next generation real time applications.

Example using node.js and WebSocket

To share ideas in a real time to sketch in a web application. The following screen is a run to share ideas in a real time to sketch in a web application. Web App contains various functions to color, thickness, pens, erasers and Undo/Redo.

Sketch Picture Example