基于 JVM 的语言,没有语言运行时
有谁知道一些替代的 JVM 语言,无论它多么晦涩难懂,它可以编译为普通的旧 Java 字节码,而不需要语言运行时。
我需要这个来尝试开发 Android 应用程序而无需启动或尺寸损失。 Scala、Clojure 和 Groovy 都需要随应用程序一起分发自己的运行时库,因此它们超出了本问题的范围。
唯一声称能够满足这一目标的语言是 Charles Nutter 的 Mirah,但我无法让它工作视窗。
编辑:为了澄清一点,我知道任何语言都必须有运行时库。显然,我正在寻找一种除了 JRE 之外不需要额外运行时的语言,或者至少是非常有限的运行时。
Does anyone know of some alternative JVM language, however obscure it might be, which can compile to plain old java bytecode, without the need of a language runtime.
I need this in order to try to develop android applications without startup or size penalty. Scala, Clojure and Groovy all require its own runtime library distributed with the application, so they are out of the scope of this question.
The only one language which claims to satisfy this goal is Charles Nutter's Mirah, but I couldn't make it to work on windows.
EDIT: To clarify a bit, I know any language has to have runtime library. Obviously, what I am looking for is a language that has no additional runtime required besides JRE, or at least very limited one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想不到(也许是 Mirah,它是实验性的,我猜至少需要一些额外的课程)。每种语言都需要一个运行时来完成您想要执行的任务。
唯一的区别是您的设备上已有多少可用类。
如果您开发 Java 并且仅使用设备上已有的库,您的应用程序将非常小。
虽然这可能不是解决您的问题的最佳方法,但您是否考虑过使用 ProGuard?
ProGuard 可以删除特定程序中未使用的运行时部分。
如果速度和时间确实很重要,另一种方法是使用 NDK (C/C++)。
There is none I can think of (maybe Mirah, which is experimental and will need at least some additional classes I guess). Every language needs a runtime for the task you want to do.
The only difference is how much usable classes are already on your device.
If you develop Java and only use the libraries which are already on the device, your application will be quite small.
While it may not be the best approach to your problem, do you have considered using ProGuard?
ProGuard can remove parts of a runtime which are not used in your specific program.
Another approach if speed and time is really critical would be going with the NDK (C/C++) instead.
Xtend 有一个超薄的库(100kb),直接委托给 JDK 和 Guava。
Xtend has a super slim library (100kb) which directly delegates to JDK and Guava.