D2
Upcoming SlideShare
Loading in...5
×
 

D2

on

  • 870 views

E

E

Statistics

Views

Total Views
870
Views on SlideShare
867
Embed Views
3

Actions

Likes
0
Downloads
25
Comments
0

1 Embed 3

http://www.d2forum.org 3

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

D2 D2 Presentation Transcript

  • EISA IN 10 MINUTESBelleve Invis
  • ASYNCS  Means ubobstructive  Getting important – Ajax – Resource management – Node.js I/O  Hard to write in pure JavaScript
  • THREE SEQUENTIAL TASKS IN JAVASCRIPT taskA(function(){ taskB(function(){ taskC(function(){ finish() }) }) })
  • KEY PROBLEMS  Nested functions! – My screen is narrow  Hard with loops  Hard with abstraction  Code locality is broken
  • EXAMPLE: TASKS DEFINED IN A LIST, ACT IN ORDER var tasks = […]; var actTasks = function(tasks, deploy){ var current = 0; var act = function(){ tasks[current](); current ++; if(tasks[current]) deploy(act) } deploy(act) } actTasks(tasks, function(f){ setTimeout(f, 1) });
  • THAT IN EISA var flow = async { for var task in tasks: wait! 0; task() end } flow()
  • EISA IS  A new language – So, no capacity requirements  JavaScript targeted  Designed for interactive developments – So, asyncs
  • ORIGIN: GAME MAKING  Defining game data – Optimized syntax for DSL  Game flow – Asyncs  Large scale RPGs – Module system  Now is general-use
  • DEMONSTRATION: 3D SCENE  http://typeof.net/lab/d2  Do not focus on the renderer
  • DEMO IN ACTION var loadImage(src, callback): …… img.onload = function(){ callback img } img.src = src end var loadTextures = async {|callback| var texture = getTextureData loadImage! images/texture.png …… if callback: callback { texture: texture, heightMap: heightMap } end };
  • MASTER FLOW var flow = async { …… setTextures loadTextures!() …… gameClock.perk() while true: renderFrame(); …… gameClock.wait!() end console.log Demo Finished }
  • HOW ABOUT USING TRADITIONAL WAY? var flow = function(){ loadTextures(textureLoaded) } var textureLoaded = function(textures){ …… gameClock.perk() gameLoop() } var gameLoop = function(){ renderFrame(); gameClock.wait(gameLoop) }
  • TREND  ECMAScript Harmony – Syntax extensions – Semantic fixes  JavaScript-targeted languages – From existing languages, e.g. GWT – New-created languages, e.g. CoffeeScript  JavaScript modulation – Necessaria – module system in Eisa
  • FOCUS EISA  http://github.com/infinte/eisa  Fork Me!
  • Q&A  Belleve Invis – Born in 1992 – Now in USTC – be5invis@typeof.net – http://typeof.net  Eisa – Since 2010 – http://github/infinte/eisa
  • Thank youAGO VOBIS GRATIAS