官术网_书友最值得收藏!

What is CoffeeScript?

CoffeeScript is a programming language. Like most programming languages, it offers control structures to describe the logic of our application, simple data types to store and manipulate information, and functions to encapsulate sections of program execution.

What makes CoffeeScript special is the way it is compiled. When most languages are compiled, they are translated into machine code—low-level instructions to the computer's processor. CoffeeScript is different: when compiled, it is instead translated into JavaScript. We write CoffeeScript code, give it to the CoffeeScript compiler and receive JavaScript code as output. This output can then be passed to anything that consumes JavaScript, such as a browser, or a standalone JavaScript interpreter.

This technique, dubbed transcompilation, allows us to use an alternative language on platforms that only directly support JavaScript. Client-side web development is the most prominent example, since JavaScript is the only supported general-purpose scripting solution on most web browsers. Other platforms such as Node.js and Rhino also offer useful features, but expect JavaScript input. JavaScript is nothing if not prolific, and CoffeeScript allows us to make use of all that existing tooling, but to write our code in a different language.

主站蜘蛛池模板: 常德市| 江永县| 大英县| 鹿邑县| 桃源县| 德州市| 广昌县| 衢州市| 凌源市| 仙居县| 乌拉特中旗| 崇礼县| 封开县| 邓州市| 兴安盟| 湟中县| 武定县| 黔西县| 五指山市| 大邑县| 延吉市| 景谷| 梅州市| 门头沟区| 贡觉县| 扎鲁特旗| 普定县| 普陀区| 青神县| 南宫市| 铜川市| 偏关县| 东乡县| 六枝特区| 龙江县| 平度市| 靖西县| 石棉县| 行唐县| 裕民县| 图木舒克市|