Top Banner
The world of Javascript Rapee Suveeranont Web Technology
28

World of javascript

Jan 15, 2015

Download

Technology

An illustratration on javascript as an evolving platform.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: World of javascript

The world of

JavascriptRapee Suveeranont

Web Technology

Page 2: World of javascript

Falsepopular

belief

Page 3: World of javascript

SyntaxFeatures

Buzz word

It’s some kind of JAVA

Not in technological terms

CSmalltalkJAVA

No,

Page 4: World of javascript

Performance is poor

2008 – 2010 Javascript engine warIE 7 →9 = 140XFirefox 3 → 4 = 10X

No, Getting better and better,at even faster speed

Page 5: World of javascript

Performance is poor

Page 6: World of javascript

Run (only) in browser

Desktop, Mobile, Server,RIA, Widgets, DB, OS and

Documents

No,it also run in

Page 7: World of javascript

JavascriptToday

Page 8: World of javascript

We can do this,var http = require('http'); http.createServer(function (req, res) {

res.writeHead(200, {'Content-Type': 'text/plain'});res.end('Hello World¥n');

}).listen(8124, "127.0.0.1");console.log('Server running at http://127.0.0.1:8124/');

% node example.js Server running at http://127.0.0.1:8124/

Here comes a web server!

Page 9: World of javascript

Naked Javascript

Pure programming languageECMAScript

No standard libraryNot even document.write()

No package managementunlike PHP, Ruby, Python

Many engines of choiceRhino, TraceMonkey, Nitro, Chakra, Carakan

Page 10: World of javascript

Ecosystem

Page 11: World of javascript

Ecosystem

ECMAScript Language

Page 12: World of javascript

ECMAScript

JavascriptActionScript

Jscript.NET

QTScript

JScript

Javascript OSA

CajaWMLScript

Objective-J

Language

Dialect

Ecosystem

Page 13: World of javascript

Language

Dialect

EngineTraceMonkeyNitro

ChakraV8Carakan

Rhino

Ecosystem

Page 14: World of javascript

Language

Dialect

Engine

Platform

BrowserMobile Desktop

DocumentsDB OS

Widgets

RIA

Ecosystem

Page 15: World of javascript

Language

Dialect

Engine

Platform

Framework

Client jQuery, Mootools, prototypeYUI, Dojo, Ext, SproutCore

Server CommonJS, Node.js,Narwhal, Jaxer, AppJet

Mobile App Titanium,Phonegap

Ecosystem

Page 16: World of javascript

LanguageDialectEngine

Platform

Framework

OthersJSON etc.

MongoDBAJAX

CouchDB

Ecosystem

Page 17: World of javascript

At a glance

Page 18: World of javascript

JSON. BSON.

{'id': 99,'name': '高橋じゅん','address': [

{'country': 'JP', 'postcode': '144-0012'},{'country': 'TH', 'postcode': '10400'}

],'married': false

}

Very popular light, fast and readable

compact data format

JSON + byte array(binary)

Page 19: World of javascript

TitaniumNative iPhone/Android

Cross-platform Framework

Appcelerator

Page 20: World of javascript

Titanium

Titanium.UI.setBackgroundColor('#000');var tabGroup = Titanium.UI.createTabGroup({id:'tabGroup1'});var win1 = Titanium.UI.createWindow({id:'win1'});var tab1 = Titanium.UI.createTab({id:'tab1', window:win1});tabGroup.addTab(tab1);tabGroup.open();

// Display phone’s cameraTitanium.Media.showCamera({

success: function(event) { ... },overlay: overlay,showControls: false,mediaTypes: Ti.Media.MEDIA_TYPE_PHOTO,autohide: false

});

Create native UI with tabs

Open built-in camera

Page 21: World of javascript

Node.js

var net = require('net');net.createServer(function (socket) {

socket.write("Echo server¥r¥n"); socket.on("data", function (data) {

socket.write(data); });

}).listen(8124, "127.0.0.1");

Server-side applicationFile system, HTTP, SSL, Net, DNS, datagram, process

Open socket and listen to incoming data

Page 22: World of javascript

CommonJSSpecification of standard API for

non-web application:CLI, Server, GUI

APIs:ModulePackageSystemConsoleFilesystemHTTP ClientEncodings .. etc.

Page 23: World of javascript

MongoDBNoSQL database with native Javascript query

> db.foo.find({$where : function() {

return this.x == this.y; }

})

> db.eval(function(name) { return "Hello, “ + name;

}, ["Joe"])

SQL: WHERE x = y

OUTPUT: “Hello, Joe”

Page 24: World of javascript

Why now?

Page 25: World of javascript

It’s everywhere

WebHTML5+CSS+Javascript, RIA

PlatformDesktop, Mobile, Server, blah, blah, …

DevicePC, Netbook, Garakei, Smartphone, Tablet, Embedded

Page 26: World of javascript

They’re everywhere

Web DevelopersWeb Designers

Easy to learn, transfer skills, and move to new platform

Page 27: World of javascript

Cloud

Developers Designers

WebAppSmartphone DesktopRIA

Page 28: World of javascript

Thank you