是否有一种语言可以单向翻译成多种其他流行语言?

发布于 2025-01-08 07:30:40 字数 269 浏览 0 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一人独醉 2025-01-15 07:30:40

Haxe 怎么样? C++、Flash、JavaScript 等。

What about Haxe? C++, Flash, JavaScript, and more.

浮华 2025-01-15 07:30:40

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.

兮颜 2025-01-15 07:30:40

我认为您正在寻找的是 LLVM。此外,这个类似的问题可能是相关的。

I think what you're looking for is LLVM. Also, this similar question may be relevant.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文