{"json_modified": "2016-07-24T19:09:40.231383", "uuid": "f4416618-eaee-4150-8b2e-8b7584ae7d49", "title": "Rosetta", "url": "/en-US/docs/Mozilla/Add-ons/Code_snippets/Rosetta", "tags": ["Non-JavaScript", "JavaScript", "HTML", "HTMLScriptElement", "DOM", "C", "Programming Languages"], "translations": [{"uuid": "d4ed4cd7-8fc6-4401-ae2d-4dfa176efad5", "title": "Rosetta", "url": "/zh-CN/docs/Code_snippets/Rosetta", "tags": ["\u975eJavaScript", "\u7f16\u7a0b\u8bed\u8a00", "C", "HTML\u811a\u672c\u5143\u7d20"], "summary": "\u9ed8\u8ba4\u6765\u8bf4\uff0cECMAScript\u662fHTML\u7684\u552f\u4e00\u6807\u51c6\u811a\u672c\u8bed\u8a00\u3002\u56e0\u6b64\uff0c\u5f53\u4f60\u4f7f\u7528\u7684\u522b\u7684\u811a\u672c\u8bed\u8a00\u65f6\uff0c\u4f60\u53ef\u80fd\u4f1a\u671f\u671b\u5927\u90e8\u5206\u6d4f\u89c8\u5668\u4e0d\u4f1a\u8bc6\u522b\u8fd9\u4e2a\u8bed\u8a00\u3002\u00a0\u53e6\u5916\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u8bed\u8a00\u6765\u8bf4\uff08\u6bd4\u5982C\uff09\uff0c\u5f53\u5b83\u7684\u73af\u5883\u5e76\u4e0d\u50cf\u901a\u5e38\u90a3\u6837\u5bf9\u8d44\u6e90\u6709\u5b8c\u5168\u7684\u6743\u9650\u65f6\uff0c\u8be5\u8bed\u8a00\u7684\u67d0\u4e9b\u8bed\u4e49\u4e5f\u53d8\u5f97\u96be\u4ee5\u5b9a\u4e49\u2014\u2014\u4f8b\u5982\u8003\u8651\u5728HTML\u9875\u9762\u4e2dC\u6307\u9488\u7684\u610f\u4e49! \u867d\u7136\u5982\u6b64\uff0c\u901a\u8fc7\u7ed3\u5408\u73b0\u4ee3\u6d4f\u89c8\u5668\u4e0d\u65ad\u63d0\u5347\u7684\u8ba1\u7b97\u80fd\u529b\u548cECMAScript\u63a8\u51fa\u7684typed arrays\uff0c\u7406\u8bba\u4e0a\u6211\u4eec\u53ef\u4ee5\u5728\u7eafECMAScript\u4e2d\u5efa\u7acb\u5b8c\u6574\u7684\u865a\u62df\u673a\u3002\u56e0\u6b64\uff0c\u7406\u8bba\u4e0a\u6211\u4eec\u540c\u6837\u4e5f\u53ef\u4ee5\u7528ECMAScript\u6765\u5b9e\u73b0\u4e00\u4e2a\u5c0f\u4efb\u52a1\uff1a\u89e3\u6790\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\uff08\u5373\u521b\u5efa\u7f16\u8bd1\u5668\uff09\u3002", "localization_tags": [], "locale": "zh-CN", "last_edit": "2015-04-08T11:55:55", "review_tags": []}], "modified": "2016-07-24T19:09:40", "label": "Rosetta", "localization_tags": [], "locale": "en-US", "id": 130171, "last_edit": "2014-12-18T01:44:32", "summary": "By default, the only possible standardized scripting language for HTML is ECMAScript. Hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it. Also, regarding some languages (like C), it is even not well defined the meaning of part of their semantics in respect to a scope that is more restricted than the full access to the resources they usually deal with \u2013 imagine, for example, the meaning of a C pointer within a HTML page! Nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ECMAScript allow us, in theory, to build full virtual machines in pure ECMAScript. Therefore, it is also possible, in theory, to use ECMAScript for a smaller task: parsing exotic programming languages (i.e., creating compilers).", "sections": [{"id": "Beyond_ECMAScript", "title": "Beyond ECMAScript"}, {"id": "Library", "title": "Library"}, {"id": "A_C_compiler", "title": "A "}, {"id": "HTML_Example", "title": "HTML Example"}, {"id": "C_Example", "title": "C Example"}, {"id": "MIME_types", "title": "MIME types"}, {"id": "See_also", "title": "See also"}], "slug": "Mozilla/Add-ons/Code_snippets/Rosetta", "review_tags": []}