是否有一种语言可以单向翻译成多种其他流行语言?
CoffeeScript 被转换为 JavaScript,Groovy 被转换为 Java。
是否有一种语言的设计目的是允许其功能转换为多种语言?
人们可以编写可用作库的字符串操作或 HTML 片段生成,但如果在另一种语言中发现类似的需求,则需要翻译该库的功能。
是否有这样一种语言已经包含两个或多个翻译目标?
我最感兴趣的是 Java、JavaScript、Perl。
我会对 C/C++ 感兴趣,但前提是有保护措施来防止创建缓冲区溢出漏洞。
CoffeeScript gets converted to JavaScript, Groovy to Java.
Is there a language that was designed to allow its functions to be converted into multiple languages?
One could write string manipulation or HTML snippet generation that could be used as a library, but if a similar requirement is found in another language, the functions of that library would need to be translated.
Is there such a language that includes two or more translation targets already?
I am mostly interested in Java, JavaScript, Perl.
I would be interested in C/C++, but only if there were safeguards to prevent buffer overflow vulnerabilities from being created.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Haxe 怎么样? C++、Flash、JavaScript 等。
What about Haxe? C++, Flash, JavaScript, and more.
UML - 统一建模语言,有多种可以转换为 C++、Java 等的工具。然而,这并不是真正的“语言”,如 C 或 Java。都是图表。
我对其他语言了解不多,但是当使用
javac
中的正确标志进行编译时,Java 字节码包含调试信息,例如行号、变量名称和(我认为)注释。未混淆的 Java 字节码可以反编译为可读性很好的源代码。UML - Unified Modeling Language, has several tools that can translate into C++, Java, and others. That's not really a "language" like C or Java, however. It's all diagrams.
I don't know much about other languages, but the Java bytecode, when the compiled with the right flags in
javac
, contains debugging information like line numbers, variable names, and (I think) comments. Unobfuscated Java bytecode can be decompiled into pretty readable source code.我认为您正在寻找的是 LLVM。此外,这个类似的问题可能是相关的。
I think what you're looking for is LLVM. Also, this similar question may be relevant.