GCJ
![]() | |
The GNU Project | |
1998 | |
| |
Unix-like | |
类型 | Compiler |
许可协议 | GNU GPL |
网站 | gcc |
GNU Java编译
GCJ
历史
[编辑]GCJ
性能
[编辑]Compiled Native Interface
[编辑]Compiled Native Interface (CNI),
两种方式 的 比 较
[编辑]CNI
“ | ” |
CNI
public class Int
{
public int i;
public Int(int i) { this.i = i; }
public static Int zero = new Int(0);
}
于是就可以这样
#include <gcj/cni.h>
#include <Int>
Int *mult(Int *p, int k)
{
if (k == 0)
return Int::zero; // 静 态成员访问
return new Int(p->i * k);
}
另见
[编辑]- Excelsior JET (另一个Java实现)
- IcedTea
- Kaffe
- SableVM
- JamVM
- Apache Harmony
- Jikes
- GraalVM - GraalVM
的 本地 映像 功 能 使用 了 预编译技术,这使得 它可以生成 类文件 可 执行的 二 进制文 件 。 自由 的 Java实现- Kotlin - Kotlin/Native
是 一 种将Kotlin语言编译为本地 可 执行二进制文件而无需JVM的 技 术。它包括 一 个基于LLVM的 后 端 和本 地 Kotlin库实现两个部分 。
备注
[编辑]- ^ 这句话的
意思 是 ,CNI的 理念 是 在 编译层面使 Java和 C++做到尽 量 兼 容 ,而这需要 Java和 C++的 编译器 的 某 些标准 一致 。GNU计划刚好既 实现了 Java编译器 ,又 实现了 C++编译器 ,因 此很容易 在 编译器 层面对其进行调整,使 其更易 用 ,性能 更 高 。
参考 资料
[编辑]- ^ Anthony Green, Cygnus Solutions. GCJ announcement. [2020-08-07]. (
原始 内容 存 档于2017-07-11). - ^ GCC Releases - GNU Project.
- ^ Archived copy. [2010-04-22]. (
原始 内容 存 档于2007-05-09). - ^ Campbell, Bill. Introduction to Compiler Construction in a Java World. CRC Press Taylor & Francis Group. 2013 [2014-02-06]. ISBN 978-1-4398-6088-5. (
原始 内容 存 档于2020-08-12). - ^
存 档副本 . [2020-08-07]. (原始 内容 存 档于2020-09-04). - ^
存 档副本 . [2020-08-07]. (原始 内容 存 档于2016-08-20). - ^ gcj to use Eclipse compiler as a front end. 2007-01-08 [2007-05-20]. (
原始 内容 存 档于2007-05-09). - ^ GCC Frequently Asked Questions - GNU Project - Free Software Foundation (FSF). gcc.gnu.org. [2020-08-01]. (
原始 内容 存 档于2020-06-12). - ^ GCC Looks To Turn Off Java, Replace With Go Or ADA. [2020-08-07]. (
原始 内容 存 档于2020-07-25). - ^ Andrew Haley. [gcc] Revision 240661. 2016-09-30 [2020-08-07]. (
原始 内容 存 档于2019-06-16). - ^ Tromey, Tom. The Deletion of gcj. The Cliffs of Inanity. 2016-10-02 [2016-10-03]. (
原始 内容 存 档于2020-07-25). - ^ GCC 7 Release Series: Changes, New Features, and Fixes. [2017-05-09]. (
原始 内容 存 档于2020-09-02). - ^ GCJ: The GNU Static Java Compiler (PDF). [2009-08-02]. (
原始 内容 (PDF)存 档于2011-06-07). - ^ The GCJ FAQ - GNU Project - Free Software Foundation (FSF). [2020-08-07]. (
原始 内容 存 档于2016-10-20). - ^ 这个
例 子来 源 于 https://gcc.gnu.org/onlinedocs/gcj/Objects-and-Classes.html#Objects-and-Classes (页面存 档备份,存 于互联网档案 馆)
外部 链接
[编辑]- Official website. GCC. GNU. 2007-03-30 [2012-08-29]. (
原始 内容 存 档于2007-05-09). - GCJ
手 册 . [2012-08-29]. (原始 内容 存 档于2012-08-17). - About CNI. GCJ Manual. [2012-08-29]. (
原始 内容 存 档于2012-08-29). - Wielaard, Mark. GCJ - past, present, and future. LWN. 2005-04-06. (
原始 内容 存 档于2019-08-02).
|