Googleã®Dartã使ã£ã¦ã¿ã
JavaScriptããããã使ãããã¸ã§ã¯ãã®ç¾ç¶
JavaScriptãã¬ã³ã¬ã³æ¸ããªãã¨ãããªãWebã¢ããªã¯ããã¸ãã¹ãã¸ãã¯ãJavaServletã§æ¸ãã¦ï¼ä»ã®è¨èªã§ããããã©ï¼ãJSPã¸è»¢éãã¦ï¼ä»ã®è¨èªã§ããã³ãã¬ã¼ãã¨ã使ãã¨æããã©ï¼ãJavaScriptãã¯ã©ã¤ã¢ã³ãã«éã£ã¦ãã¯ã©ã¤ã¢ã³ãã§ã¯ãHTMLï¼CSSã§ãã¸ã¥ã¢ã«ãã¬ã¤ã¢ã¦ãããã¦ãJavaScriptããã¸ã¥ã¢ã«ãåãããããAJAXã§ã¾ããµã¼ãã«ãªã¯ã¨ã¹ãããããAJAXã®ã¬ã¹ãã³ã¹ã§ã¾ããã¸ã¥ã¢ã«ãå¤ãã£ãããä¾ãã°ã¬ã¤ã¢ã¦ãã«ãã°ããã£ãå ´åãJavaServletãã¿ãããJSPãã¿ãããHTMLãCSSã¿ãããJavaScriptã®å®è¡ã«ã¨ã©ã¼ããªãã確èªããããAJAXã§å¾ãããã¬ã¹ãã³ã¹ã®å
容ãã¿ããã¨ãããªãéçºç°å¢ã¨ãã¦ã«ãªã¹ã§ãããä¸èªç¶ãªè¨³ã§ãã
ãã¨ãJavaScriptã®ã³ã¼ãéãå¤ãã¦ãã¼ã éçºã¨ãã ã¨ãã³ã¼ãã£ã³ã°ã«ã¼ã«ããã£ã¡ã決ãã¦ãã½ã¼ã¹ã³ã¼ãã¬ãã¥ã¼ãããªãã¨ãã¡ããã¡ããªã³ã¼ããæ¸ã人ãç¾ããããã¾ããã¯ã©ã¹å®ç¾©ã®æ¸ãæ¹ãã¿ããªãã©ãã©ã ã£ãããã³ã³ã¹ãã©ã¯ã¿ä»¥å¤ã§ã¡ã³ãå¤æ°ãåæã«è¿½å ããã¦ãããã
//ã¨ããããããã«ç½®ãã¦ãã
ã¿ãããªã³ã¡ã³ãã¨å
±ã«ã½ã¼ã¹ã³ã¼ãã®ä¸ã»ã©ã«ã¡ã³ãå¤æ°ãå¢ãããã¦ãããããã¨ãããæ»ãã§ããï¼ã¨å«ã³ãããªã訳ã§ãã
ããããJavaScriptã®ãããªéçãªåããªãè¨èªã¯ãIDEã®è£éãå¹ããªãã£ãããåç
§æ¤ç´¢ããªãã£ãããå®è¡æã«ãªããªãã¨å¤æ°åãã¡ã½ããåãå
¥åãééãããã¨ãåãããªãã£ãããååå¤æ´ã®ãªãã¡ã¯ã¿ãªã³ã°ãå¹ããªãã£ããã¨ãå¹çãæªãã®ã§å¥½ãã§ã¯ããã¾ããã
次ã«ä½ãWebã¢ããªã¯ãJavaScriptã«ä»£ããè¨èªã§éçºããããªã¨æãããã£ã¨ã代ãããã®ãæ¤è¨ãã¦ã©ãããã¦ãã¾ãããDart, Haxe, TypeScript ã®3ã¤ãã¦ã©ãããã¦ããã®ã ãã©ãHaxeã¯èª¿æ»æ¸ã¿ã§ä¸é¨ã®ããã¸ã§ã¯ãã§ä½¿ç¨ãå§ãã¦ãã¾ãï¼æ°ãåãããHaxeã®ã¨ã³ããªãæ¸ãã¾ãï¼ã
ä»åã¯ãGoogleã®Dartã使ã£ã¦ã¿ãã®ã§ãã®ã¬ãã¼ãã
Dartè¨èªã®ç¹å¾´
æ¨å¹´ç§ã«ãå®å®æ¿ã®Dart Editorãåºã¾ããã
Dart Editor + Dart SDKã¯ã http://www.dartlang.org/ ãããããã¦ã³ãã¼ãã§ãã¾ããDartã®ç¹å¾´ã¯ã
- ãã¹ã¯ãããWebãã¢ãã¤ã«Webããµã¼ãç¨ã¨å¤ç¨é
- DartVMã§ãåãããããJavaScriptã¸ã³ã³ãã¤ã«ãã¦ãåããã
- ç°¡ç´ ã§ãå¹çãããã¹ã±ã¼ã©ãã«
- åãããããã¦ãèªã¿ãããææ³
- Dartè¨èªã¯ãã©ã¤ãã©ãªãããã±ã¼ã¸ããã¼ã¸ã£ãã¨ãã£ã¿ããªã¼ãã³ã½ã¼ã¹
- éçºå¹çãä¸ããPubããã±ã¼ã¸ããã¼ã¸ã£
- DartVMã¯é«éãJavaScriptã¨ã³ã¸ã³ã®V8ã®åé
ã¨ããæãã§ããDartVMãã¤ãã£ãã§åãããã®ã¯ãå½é¢ãµã¼ããµã¤ãã§ä½¿ãã¨ãã§ããããæ®éã¯ãdart2jsã§JavaScriptã«å¤æãã¦Webãã©ã¦ã¶ã®ä¸ã§ä½¿ãã®ãæ®éã§ãããã
主ãªè¨èªä»æ§
è¨èªä»æ§ã®ç¹å¾´ã¨ãã¦ã¯ã
- ã¯ã©ã¹ï¼prototype baseã¯è²ã åé¡ããããã¨ããã¨ããã§ãã
- ã¯ã©ã¹ã®å¤ã®ãããã¬ãã«é¢æ°ï¼Javaã¨éã£ã¦ã¯ã©ã¹ã®å¤ã«ãé¢æ°æ¸ãããã¨
- ãªãã·ã§ã³å¼æ°ï¼çç¥å¯è½å¼æ°ãC++ã®ããã«å¼æ°ãªã¹ãã®å¾ãã®æ¹ãçç¥ããæ¹æ³ã¨ãååä»ãå¼æ°ã«ãã¦ã©ããçç¥ãã¦ããã2éãããã
- æååã¤ã³ã¿ã¼ãã¬ã¼ã·ã§ã³ï¼Perlã®ãããª"Hello, ${name}"ã¿ãããªç½®æã§ãã
- ãã«ãã©ã¤ã³æååï¼Perlã®ãã¢ããã¥ã¡ã³ã($s=<<END;)ã¿ãããªæååãªãã©ã«ã§ãã
- åçã¡ã½ãããã³ããªã³ã°ï¼å®è¡æã«ã¡ã½ãããããã確èªããï¼éçã«ãã§ãã¯ãã¦ã»ããã®ã ãï¼
- ã«ã¹ã±ã¼ãæ¼ç®å(..)ï¼VBãJavaScriptã®withã¿ãããªãã®ã§ãã
- ãªãã·ã§ãã«ãªåï¼å°ããªã¢ããªããã£ã¨æ¸ãã¨ãã¯åãæ¸ããªããã¡ããã¨ããã¢ããªã¯ãåãæ¸ãï¼ç§ã¯å³å¯ãªåã欲ããï¼
- ã¬ãã·ã«ã«ã¹ã³ã¼ãï¼ã¡ããã¨{}ã®ãããã¯ãèå¥åã®ã¹ã³ã¼ãã§ãããã¯ãã¼ã¸ã£ã対å¿ãã¦ãããããã¼ã«ã«å¤æ°ãã£ããã£ããã¦ãããã¨ãã¾ãJavaScriptã ããç°å¸¸ã ã¨ã¯æããã
- ã©ã¤ãã©ãªï¼ã©ã¤ãã©ãªã使ãã¨ããä½ãã¨ããåãæ¿ãã¨ãã®ä¿®æ£ä¸è¦ãPubã¨ãããªã¼ãã³ãªãªãã¸ããªãããªããæ軽ã§ä¾¿å©
- Isolateï¼ã¢ã¤ã½ã¬ã¼ãï¼ï¼ãã«ãã¹ã¬ããã§ã¡ã¢ãªãå ±æãã¦ç®¡çããã®ã¯ãéçºããããã°ã大å¤ãIsolateå士ã¯ããäºãã®ã¡ã¢ãªã«ã¢ã¯ã»ã¹ã§ããªãã®ã§å®å ¨
ã¨ããæããã¾ãã¢ãã³ãªè¨èªä»æ§ã§ããã使ã£ã¦ã¿ãææ³ã¨ãã¦ã¯ããã¯ãC++ãJavaã好ããªåã¨ãã¦ã¯ã¡ã½ããããããã©ãããåçã«å¤æããã®ãè¾ãããä¸å¿ãDart Editorã§é»è²ãä¸ç·ãã§ã¦è¦åãã§ãã¨ãããããã©ã
ãã¨ã¯ãã¡ã½ããã®ãªã¼ãã¼ãã¼ããã§ããªããJavaScript風ã«ããã®ãããªãã·ã§ãã«ãªåã®ãããããªã¼ãã¼ãã¼ããããã¨ã½ã¼ã¹ãèªã¿ã«ããã¨ããæå³ãªã®ããJavaScriptã«ã³ã³ãã¤ã«ããã¨ãã«ç¾ãããªããããã
ãã¨ã¯ãintãåæå¤ã代å
¥ãã¦ããªãã¨ãã¯ãnullã«ãªã£ãããããããã¡ãã£ã¨æ°ã«ãªã£ãã¨ããã
classã®ä¾
// å½¢ç¶ã¤ã³ã¿ã¼ãã§ã¼ã¹ abstract class Shape {// abstractã使ãã num perimeter();// numåã¯ãintåã¨doubleåã®superã¯ã©ã¹ } // ç©å½¢ã¯ã©ã¹ class Rectangle implements Shape {//implementsã§Shapeã¤ã³ã¿ã¼ãã§ã¼ã¹ãå®è£ final num height, width; //finalã¯åæå¤ä»£å ¥ã®ã¿å¯è½ã§ä»¥éå¤æ´ä¸å¯ Rectangle(this.height, this.width); // ã³ã³ãã¯ãã³ã³ã¹ãã©ã¯ã¿è¡¨è¨ãå¼æ°ã§ã¡ã³ãã¼å¤æ°ãä»£å ¥ããã¨ããæå³ã num perimeter() => 2*height + 2*width; // é¢æ°ã®çç¥è¡¨è¨ãé¢æ°æ¬ä½ãåæã®ã¨ãã¯ããã®ããã«çç¥ã§ããã } // æ£æ¹å½¢ã¯ã©ã¹ class Square extends Rectangle {// extendsã§ç©å½¢ãç¶æ¿ï¼ç¶æ¿ã¯1ã¤ã¾ã§ï¼ Square(num size) : super(size, size);//ã³ã³ã¹ãã©ã¯ã¿ã§è¦ªã¯ã©ã¹ã®ã³ã³ã¹ãã©ã¯ã¿ãå¼ã¶ã¨ãã¯C++風ã«ã³ãã³ã使ããsuperã¨ããäºç´èªã使ãã¨ããã¯Java風ã }
ã¾ããããè¦ãã ãã§ãã¢ãã³ãªæãã§ããã
Dart Editorã®ç¹å¾´
IDEã§ããDart Editorã®ç¹å¾´ã¯ã
- ã³ã¼ãè£å®ï¼ã¡ã³ãå¤æ°ãã¡ã½ããåãè£å®ããã
- ãªãã¡ã¯ã¿ãªã³ã°æ©è½ï¼ãªãã¼ã ã¨ã
- ã¢ã¦ãã©ã¤ã³ãã¥ã¼ï¼ã¯ã©ã¹ã®ã¡ã³ãå¤æ°ãã¡ã½ãããããªã¼è¡¨ç¤º
- ãããã¬ã¼ï¼ãã¬ã¤ã¯ãã¤ã³ããå¤æ°ãè¦ããã¹ãããå®è¡
- éç解æï¼ã¡ã³ãå¤æ°ãããªãã¨ããä»£å ¥ãã¦ãªãã¨ãéç解æã§è¦åãã§ã
- å¼ã³åºãå æ¤ç´¢ï¼å¼ã³åºãå æ¤ç´¢ã§ããã«ããã表示ã§ãã
ã¨ããæãã
使ã£ã¦ã¿ãææ³ã¨ãã¦ã¯ãã³ã¼ãè£å®ãå¹ããªããªããã¨ããã£ã¦Dart Editorãåèµ·åãããç´ã£ãã¨ãããªãã¡ã¯ã¿ãªã³ã°ã®ãªãã¼ã ã¯ãã©ã¤ãã©ãªãè¶
ãã¦ã¯ç¡çãªã®ããå¹ããªãã¨ãããã£ããã¨ããå¼ã³åºãå
æ¤ç´¢ã¯1度ãåããªãã£ãããªã©æ®æ®µæ¸ãã¦ããJavaã®å®å¿æã«æ¯ã¹ãã¨å¿ãã¨ãªãã
ä½ã£ã¦ã¿ãã¢ããª
3æéãããã§ä½ã£ã¦ã¿ãã¢ããªãä¸è¨ãhtmlãã¡ã¤ã«ãã»ã¼æ¸ãããcssãã¡ã¤ã«ãã»ã¼æ¸ãããã³ã¼ãã§ã¦ã¤ã³ãã¦ãä½ã£ãããã³ã³ããã¼ã«ãé
ç½®ãããããWindow Toolkitã£ã½ããã®ãã¯ã©ã¤ã¢ã³ãå´ã¯ãhtml,cssã®ã³ã¼ãã¯æ¸ããã«dartã ãæ¸ãã¦ããµã¼ããµã¤ããcssãhtmlã¯ã»ã¨ãã©åºåããã«jsonã¨ãã ããåºåããã·ã¹ãã ãã¤ã¡ã¼ã¸ãããã®ã
ãªããPubã¨ãããªã¼ãã³ãªãªãã¸ããªãããpubã³ãã³ãã¨ããã©ã¤ãã©ãªããã¼ã¸ã£ããããä»ã®äººãä½ã£ãã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ããããã¢ãããã¼ãããããèªåã®ä½ã£ãã©ã¤ãã©ãªãã¢ãããã¼ãããã®ã¯ã¨ã¦ãç°¡åãããããpub installã³ãã³ãã§ãèªåãæ¸ãã¦ããã©ã¤ãã©ãªãåé¤ãããã¨ãããã¹ããã¦ãã¾ãã¾ããï¼ããã¦ãªã¬ãªã¬Window Toolkitä½ãç´ãï¼ãpubã«é¢ãã¦ã¯ã¾ã 調æ»ä¸è¶³ãªã®ã§ãã¿ãªããèªåã®ã©ã¤ãã©ãªãä½ã£ã¦ããå ´åã¯ãpubã³ãã³ãã®ä½¿ç¨åã«ã¯ããã¯ã¢ãããã¾ãããã
#dartããã°ãã調æ»ãããã次ã¯TypeScriptã調æ»äºå®ã
ââ
ã¢ããªåè¨éçºãWebã·ã¹ãã åè¨éçºãè¡ã£ã¦ãã¾ãã以ä¸èªç¤¾è£½åã
URL:ibisMail Freeã®ãã¦ã³ãã¼ããã¬ãã¥ã¼ã¯こちら
URL:ibisMail for iPhoneã®ãã¦ã³ãã¼ããã¬ãã¥ã¼ã¯こちら
URL:ibisMail for iPadã®ãã¦ã³ãã¼ããã¬ãã¥ã¼ã¯こちら
URL:ibisPaintã®ãã¦ã³ãã¼ããã¬ãã¥ã¼ã¯こちら ãµã¤ãã¯ãibispaint.com
ãæè¦ãè¦æã¯Twitterãã: @kamiyan