Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
æ°è£½åã®WEB UIãä½ããã¨ã«ãªãã¾ããã ãfunctionã£ã¦æ¸ãã®ãã«ããããCoffeeScriptã«ãã¾ããããã ãã§ãCoffeeScriptã£ã¦ããããããªã¯ã³ã³ãããªããï¼ã ãã¡ãã£ã¨å¾ ã¦ããããããES6ï¼ECMAScript6ãJavaScriptã®æ¬¡ææ¨æºãå¾è¿°ï¼ã使ããããã«ãªã£ã¦ãããããªããï¼ï¼ã ããæã£ã¦ES6ã調ã¹ã¾ãããããã£ã±ãCoffeeScriptã使ãã¹ãã ã¨ããçµè«ã«éãã¾ããã CoffeeScriptã¨ES6ã®ãããã CoffeeScriptã¯ããããAltJS é·æ ãfunctionã®ä»£ããã«->ãããã¼ã«ã«å¤æ°ã«varãä¸è¦ãã¨ãã£ãã¤ã±ã¦ãææ³ã使ãã¾ãã äºåã«JavaScriptã«ã³ã³ãã¤ã«ãã¦ä½¿ãã*1 Ruby on Railsã対å¿ãã¦ãããªã©ãããªãæ®åãã¦ããããã§ãã çæ äºåã³ã³ãã¤ã«ãå¿ è¦ãªã®ã§è£½åã®ã
CodeZineç·¨éé¨ã§ã¯ãç¾å ´ã§æ´»èºãããããããã¼ãã¹ã¿ã¼ã«ããããã®ã«ã³ãã¡ã¬ã³ã¹ãDevelopers Summitãããã¨ã³ã¸ãã¢ã®çããã¾ããã¼ã¹ãããããã®ã¤ãã³ããDevelopers Boostããªã©ããã¾ãã¾ãªã«ã³ãã¡ã¬ã³ã¹ãä¼ç»ã»éå¶ãã¦ãã¾ãã
åã¯coffeescriptã¯äººé¡ãããã°ã©ãã³ã°ã«ããã¦å è½ããããã«æã«å ¥ããæé«ã®ãããµãææ³ã ã¨æã£ã¦ãã¦ãããã殺ãããã«ã¯ãããªããã¨ããæ°æã¡ããããã§ães6/typed annotationãè·æãããã®æ代ã«ãµãããããã®ã«æ¹é ãããªãã¨ãããªãã¨ãæã£ã¦ãããæè¿ã ã¨ãæ£ç´coffeescriptæ¹é¢ã®ã¤ããã¼ã·ã§ã³ã¯ããã¾ããªãã ããããããã§ãã¡ãã£ã¨åã¾ã§typed-coffee-scriptãä½ã£ã¦ããã ãã©ãç¾ç¶ãã種ã®åé¡ãè¿ãã¦ãã¦ãéçºãåå¹´ã»ã©æ¢ã¾ã£ã¦ããããããã©ããããã¨ãããã¨ãèããçµæãå¥ã®åä»ãaltjsã«ä¹ããããããããã¨ããçºæ³ã«è³ã£ãã altjs on altjsã£ã¦ã©ããªã®ãã£ã¦ããåé¡ãããããåºæ¬çã«flowtypeãtypescriptães6~以éã¨ã®æ¨æºå追å¾ããæ¹åæ§ã§ããããã大ããªåé¡ã«ãªããã¨ã¯ãªããã¨èªè
ã¯ãããä¹ ãã¶ãã§ãã å æã¾ã§ã¨ãã«å³ããæå½ã«åç£ç¦ç¶æ ã ã£ãã®ã§éå¶ãµã¤ãå ±ã æ¾ç½®ç¶æ ã§ããã ãªããªãã¨ããµã¤ãã£ã³ã°ãªæ¥ã ã§ãé転æãããããããæ´¾æãªäº¤éäºæ ãèµ·ãããã®ã«ãéæ¡ããã¦ç¡ãã£ããã¨ã«ããããã¨ãè¡æçã§ããã è¨èãããããªãã¨ããçç±ã§è¦ã¬ãµããã¾ãããã©ããéã®åã£ã¦å大ã ãªãã£ã¦æãã¾ããï¼å°ä¸¦æ ã¨ããããã¨ãããã¾ããããåéãã¾ãã éå¶ãµã¤ãã¯æ¾ç½®ããçµæã§ã¢ã¯ã»ã¹æ°ä¸ããã¾ãããªã®ã§ãæ°ããã¢ã³ãããµã¤ãã§ãä½ããããªã¼ã¨èãã¦ã¾ãã
coffeescriptã®class syntaxã§çæãããã³ã¼ãã¨ãtypescriptã®ããã¯ããäºãã«ç¶æ¿ã§ããäºæãããã¨è¨ããã¦ããã æ¬å½ã«äºæãããã®ãã¡ããã¨èª¿ã¹ãªãã¨ãããªããªã¼ã¨å¸¸ã æã£ã¦ãã®ã§ã確èªããã æ¤è¨¼ã³ã¼ã coffeescript class A f: -> console.log 'super' class B extends A f: -> super console.log 'sub' b = new B b.f() typescript class A{ f() { console.log('super'); } } class B extends A { f(){ super.f(); console.log('sub'); } } var b = new B; b.f() ãã£ã¦ããã¨ã¯å ¨ãä¸ç· ãããã¼ ç¶æ¿ãè¡ãã¨ã©ã¡ãããããã«ç¶æ¿ç¨ã¦
http://discuss.atom.io/t/why-coffeescript/131 2 comments | 2 points | by noto â comment by noto | ç´1æéå å æ¥ GitHub ãçºè¡¨ãã¦ã¨ãã£ã¿ ATOM ã®ãã£ã¹ã«ãã·ã§ã³ã»ãã©ã¼ã©ã ã§ãªã CoffeeScript ã§æ¸ããã¦ãã¦ãEcmaScript 6 (ES6) ãããªãã®? node.js/V8 ãå©ç¨ãããã¹ã¯ãããã¢ããªã±ã¼ã·ã§ã³ãªã ES6 ãããã«ä½¿ãã»ã¼å®ç§ãªæ©ä¼ãªã®ã«ãã¨ããåé¡æèµ·ããããããã«ã¤ãã¦è°è«ããã£ãããã§ãã åæã¨ãã¦ãGitHub ã® JavaScript Styleguide ã« æ°ãã« JS ãæ¸ãæ㯠CoffeeScript ã§æ¸ãã㨠æ°ãã« .js ãã¡ã¤ã«ã追å ãããã¨ã¯é¿ããã㨠ã¨æ¸ããã¦ãã¦ãGitHub ã®ä¸ã®äººã¨ãã¦ã¯
CoffeeScriptã®é¢æ°ã¯æ示çã«returnããã¹ã | CreativeStyle æ¬å½ã«é ãã®ããããã確ããã¾ãããã é©å½ã«ã§ã£ã¡ãããã³ã¼ãã§ã f1 = -> for i in [1, 2, 3] for j in [4, 5, 6] i + j f2 = -> for i in [1, 2, 3] for j in [4, 5, 6] i + j return console.time "f1" for i in [1..100000] then f1() console.timeEnd "f1" console.time "f2" for i in [1..100000] then f2() console.timeEnd "f2" å®è¡ãã¦ã¿ã¾ã $ coffee hoge.coffee f1: 105ms f2: 4ms ç´26åéããã¨ãããã¨ããããã¾ãã
ãCoffeeScript ã SuperCollider ã¿ããã«å¦çãããã âªâªããã³ã³ã»ããã«éçºãã¦ãããã©ã¦ã¶é³é¿ããã°ã©ãã³ã°è¨èª CoffeeCollider ããªãªã¼ã¹ãã¾ãããé³é¿ããã°ã©ãã³ã°è¨èªã¨ãããã¨ã§ãã¨ã«ãã試ãã¦èãã¦ãããã®ãæã£åãæ©ãã以ä¸ã®ãªã³ã¯å 㧠"BOOT" 㨠"RUN" ããã°æ·±å¤ã£ã½ãé³ãé³´ãã¾ãã CoffeeCollider ã§ããªããªã®ï¼ SuperColliderã£ã¦ãªãã ï¼ã¨ãã人ã«ã¯ è¨èª & ã©ã¤ãã©ãª & å®è¡ç°å¢ ã¨ããæå³ã§ processing.js ã®é³æ¥½çã¨è¨ã£ãæ¹ãåããè¯ããããããªããã¨ã«ããé³ãã§ããé³ããã§ãªããã¨ã«ããé³ãåºãã¦ã»ããã¨ããæ°æã¡ã§ä½ã£ããæåã¯ããå æ¸ãªæ°æã¡ã§ãã£ã¦ããã®ã ãã©éä¸ããçµæ§ããã°ãã ãã¦ãæçµçã«ã¯ã«ã¬ã¼ãé£ã¹ã«ãã趣å³ãã§ãã¾ããã CoffeeScriptæ¡å¼µ
ããããJavaScriptã·ãªã¼ãºã§ãã mizchi/deftypes.js https://github.com/mizchi/deftypes.js 主ã«coffee-scriptç¨ã®DSLã§ãã以ä¸ãã¹ã¦coffeeã ãã©ã¦ã¶ <script src="https://raw.github.com/mizchi/deftypes.js/master/deftypes.js"></script> Deftypes(); //provide DSLNode npm install deftypes æ¦è¦ åãæ¸ãã¾ããæ®å¿µãªããåçãã§ãã¯ã§ãã Point = {x: Number, y: Number} p1 = def Point, {x:1, y:2} #=> {x: 1, y:2} p2 = def Point, {x:1, z:2} #=> type error def
ä½ã調ã¹ãã«ããæ¸ãããã³ã³ãã¤ã«ãéã£ãã®ã§ a ? 1 : 2 ããã§ããã®ããªï¼ã¨æã£ã¦ãããå ¨ç¶éãã¾ããã æ£ããã¯ããæ¸ãã¾ã if a then 1 else 2 ééã£ã¦ãæ¹ã¯ãæ¬å½ã«å ¨ç¶éãã®ã§ãèå³ãåã£ãã確èªãã¦ãã ããã ã¨ããããã1 : 2 ã®é¨å㯠{ 1 : 2 } ã¨ãã解éã«ãªã£ã¦ã¾ãã é åã«å¯¾ããå¤ã®åå¦å¤å®ã«ã¯ in ãã ãªãã¸ã§ã¯ãã«å¯¾ãããã¼ã®åå¦å¤å®ã«ã¯ of ã使ãã¾ãã coffee> 10 in [10] true coffee> 'x' of {x:1} true ä½ã¯ã¨ããããJS ã§ã® in ã Coffee ã§ã¯ of ã«ãªã£ã¦ããã®ãééãæãï¼ ããããé åã«å¯¾ãããã¼ã®åå¦å¤å®ã« of ã使ãããã¨ããã¨.. coffee> 1 of [0,0] true .. 使ããï¼ ãããããªãã¸ã§ã¯ãã«å¯¾ããå¤ã®åå¦å¤å®ã« i
æè¿CoffeeScriptã¨ãããã®ãç¥ã£ã¦å°ã調ã¹ã¦ã¿ãããæ¬å®¶ã®è¨èªãªãã¡ã¬ã³ã¹ããããªã«å¤ããªãã£ãã®ã§æ¥æ¬èªè¨³ã«ææ¦ãã¦ã¿ã¾ããã http://coffeescript.org/ CoffeeScriptã¨ã¯JavaScriptã«ã³ã³ãã¤ã«å¯è½ãªã·ã³ãã«ãªè¨èªã§ããã¯ã©ã¹ãã¼ã¹ã®ãªãã¸ã§ã¯ãæåãPython/Rubyãåèã«ããå å 表è¨ãæååå å¤æ°å±éãã¹ã¿ãã£ãã¯ã¹ã³ã¼ããªã©ãªã©ãããã¾ãã å ã«ãã¿ãã©ã·ããã¦ããã¨æ¥æ¬èªè¨³ã¯æ¢ã«å¥ã®æ¹ããã¦ãã¾ããï¼¼(^o^)ï¼ http://sites.google.com/site/sappariwiki/coffeescript ãããåã®æ¥æ¬èªè¨³ããå ¨ç¶ããããããï¼ã¶ã£ã¡ããè±èªã¯å¤§ã®è¦æãªã®ã§ã翻訳ããã¯ãããã©ééã£ã¦ãã¨ããã¯è²ã ããã¯ãã§ãã ã§ãã¾ãæè¡çãªããã¥ã¡ã³ãã®ç¿»è¨³ã«ææ¦ããã®ã¯ãæ°å¹´åã«åè·ã§RDP(R
é¢æ°ã«å¼æ°ã渡ãæ¬å¼§ (...) ã¯ä¸è¦ã print "coffee" ã®ããã«é¢æ°ãå¼ã¹ãããã ãå¼æ°ãç¡ãå ´åã¯ç©ºã®æ¬å¼§ ( ) ãå¿ è¦ã é¢æ°ãifæãswitchæãtry/catchæãªã©ã§ãããã¯ãä¸æ¬å¼§ {...} ã§å²ã代ããã«ãPythonã®ããã«ã¤ã³ãã³ããæãããã¨ã§ãããã¯ã表ç¾ããããªã®ã§ã¤ã³ãã³ãã¯è¶ éè¦ã ä»£å ¥
ãªã CoffeeScript ããã¡ã - å¬éãã«æ¶ãè¡ãå¶æã¬ã¼ã«ã¯â夢ç©èªã«ãªã¢ã«ãæ±ããªãã - subtechã«ã¤ãã¦ã ãããæ¬å½ã¯ãã®ã¿ã¤ãã«ã«ããã»ã© CoffeeScript æ¨ãã¦ããããã§ã¯ãªãã®ã§ãããã¾ããããã建åã§æ¸ãã¾ãã CoffeeScript ã®ã¡ãªãã ç°¡æ½ã«æ¸ãã ç°¡æ½ã§ããã¨ãããã¨ã¯ãã½ã¼ã¹ã³ã¼ãã«ããã¦ãæ¬è³ªã§ã¯ãªãé¨åãæ¸ããªãã¦ããã¨ãããã¨ã§ãéã«è¨ãã°å¿ è¦ãªãã¨ã ããæ¸ããã¦ããç¶æ ã«è¿ããªãã¾ããå°ãæ £ããã°ãããèªã¿ããããªã(ã¨æãã¾ã)ã JavaScript ã®ç½ ãåé¿ã§ãã var ãå¿ããå¤æ°ãã°ãã¼ãã«å¤æ°ã«ãªãã¨ããå¤æ°ã®ãã¤ã¹ãã£ã³ã°ã¨ãããªãã¸ã§ã¯ããªãã©ã«ã®æå¾ã®ã«ã³ãã¨ãã JavaScript ã® for in 㯠prototype ã辿ã£ã¦ãã¾ãåé¡ã¨ããJavaScript ã®ç価æ¼ç®åãææ§ããã¦
ã¡ã³ããã³ã¹
ãç¥ãã
é害
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}