EISA IN 10 MINUTESBelleve Invis
ASYNCS    Means ubobstructive    Getting important     – Ajax     – Resource management     – Node.js I/O    Hard to wr...
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 locali...
EXAMPLE: TASKS DEFINED IN A LIST, ACT IN ORDER var tasks = […]; var actTasks = function(tasks, deploy){     var current = ...
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 develop...
ORIGIN: GAME MAKING    Defining game data – Optimized syntax for DSL    Game flow – Asyncs    Large scale RPGs – Module...
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 ...
MASTER FLOW var flow = async {     ……     setTextures loadTextures!()     ……     gameClock.perk()     while true:         ...
HOW ABOUT USING TRADITIONAL WAY? var flow = function(){     loadTextures(textureLoaded) } var textureLoaded = function(tex...
TREND    ECMAScript Harmony     – Syntax extensions     – Semantic fixes    JavaScript-targeted languages     – From exi...
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 ...
Thank youAGO VOBIS GRATIAS
Upcoming SlideShare
Loading in...5
×

D2

743

Published on

E

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
743
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

D2

  1. 1. EISA IN 10 MINUTESBelleve Invis
  2. 2. ASYNCS  Means ubobstructive  Getting important – Ajax – Resource management – Node.js I/O  Hard to write in pure JavaScript
  3. 3. THREE SEQUENTIAL TASKS IN JAVASCRIPT taskA(function(){ taskB(function(){ taskC(function(){ finish() }) }) })
  4. 4. KEY PROBLEMS  Nested functions! – My screen is narrow  Hard with loops  Hard with abstraction  Code locality is broken
  5. 5. 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) });
  6. 6. THAT IN EISA var flow = async { for var task in tasks: wait! 0; task() end } flow()
  7. 7. EISA IS  A new language – So, no capacity requirements  JavaScript targeted  Designed for interactive developments – So, asyncs
  8. 8. ORIGIN: GAME MAKING  Defining game data – Optimized syntax for DSL  Game flow – Asyncs  Large scale RPGs – Module system  Now is general-use
  9. 9. DEMONSTRATION: 3D SCENE  http://typeof.net/lab/d2  Do not focus on the renderer
  10. 10. 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 };
  11. 11. MASTER FLOW var flow = async { …… setTextures loadTextures!() …… gameClock.perk() while true: renderFrame(); …… gameClock.wait!() end console.log Demo Finished }
  12. 12. HOW ABOUT USING TRADITIONAL WAY? var flow = function(){ loadTextures(textureLoaded) } var textureLoaded = function(textures){ …… gameClock.perk() gameLoop() } var gameLoop = function(){ renderFrame(); gameClock.wait(gameLoop) }
  13. 13. 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
  14. 14. FOCUS EISA  http://github.com/infinte/eisa  Fork Me!
  15. 15. Q&A  Belleve Invis – Born in 1992 – Now in USTC – be5invis@typeof.net – http://typeof.net  Eisa – Since 2010 – http://github/infinte/eisa
  16. 16. Thank youAGO VOBIS GRATIAS
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×