有 Java 版的 Coffeescript 吗?换句话说,X 被编译为 Java

发布于 2024-12-17 19:14:52 字数 1539 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

白日梦 2024-12-24 19:14:52

是的,Xtend。这是 Eclipse 人员为您带来的一种新语言: http://www.eclipse.org/xtend/

没有多重继承(这将是对 Java 语义的根本性改变),但是有很多语法糖,就像 CoffeeScript 一样。

另请查看 Mirah:http://www.mirah.org/

Yep, Xtend. It's a new language brought to you by the Eclipse folks: http://www.eclipse.org/xtend/

No multiple inheritance (that would be a fundamental change to Java semantics), but lots of syntactic sugar, just like CoffeeScript.

Also take a look at Mirah: http://www.mirah.org/

友谊不毕业 2024-12-24 19:14:52

如果您考虑一下,CoffeeScript 编译为 Javascript 意味着您可以将 CoffeeScript 本身用作 Java 语言。使用最新的 CoffeeScript (1.1.3),您可能需要直接使用 Rhino,因为它会触发当前 jdk 中的 JS 实现错误,但除此之外,您应该善于使用编译后的 js 文件与 Java 代码进行交互。 :)

If you think about it, CoffeeScript compiling to Javascript means you can use coffeescript itself as a Java language. With the latest CoffeeScript (1.1.3) you might need to use Rhino directly because it triggers a JS implementation bug in the current jdk, but outside of that, you should be good to use the compiled js files to interact with Java code. :)

追我者格杀勿论 2024-12-24 19:14:52

我为文本文件编写了一个预处理器,在缩进的地方引入了 {} 。我称之为:

它远非稳定,而且它没有解决您指出的 Coffeescript 提供的其他一些快捷方式,但它确实可以作为概念验证。

I wrote a pre-processor for text files that introduces {s and }s where there was indentation. I called it:

It is nowhere near stable, and it doesn't address some of the other shortcuts you point out that Coffeescript offers, but it does work as a proof-of-concept.

甜是你 2024-12-24 19:14:52

我编写了一个支持多重继承的 Java 转编译器(就像 CoffeeScript)。它有很多错误和限制,并且不允许许多灵活的格式选项,但它仍然存在,如果您检查它或从中创建一个分支来改进它,我会非常高兴。我可能会添加更多功能并修复许多错误,但就目前而言,它至少有效。

https://github.com/Philoprogrammer/Java-With-Multiple-Inheritance

I wrote a transcompiler (just like CoffeeScript) to Java that supports multiple inheritance. It is very buggy and limited and does not allow many flexible formatting options, but it is still there and I would be more than happy if you checked it out or made a branch from it to improve it. I will probably add more features and fix many of the bugs, but for now, it at least works.

https://github.com/Philoprogrammer/Java-With-Multiple-Inheritance

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