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

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.

主站蜘蛛池模板: 大宁县| 旬阳县| 社旗县| 远安县| 教育| 呼和浩特市| 阆中市| 水城县| 保德县| 隆昌县| 德化县| 清丰县| 肇州县| 东海县| 延川县| 汝城县| 鄂托克前旗| 淮安市| 西贡区| 安化县| 绩溪县| 石屏县| 法库县| 慈利县| 金华市| 普洱| 长沙市| 同心县| 富裕县| 行唐县| 马龙县| 怀安县| 金门县| 临澧县| 开远市| 晋州市| 乌兰浩特市| 淮阳县| 上高县| 台山市| 文成县|