简体   繁体   English

在IBM i上,java编译器会“讲” ILE吗?

[英]On IBM i, will java compiler ever “speak” ILE?

On IBM i, will java compiler "speak" ILE? 在IBM i上,java编译器会“讲” ILE吗? Googling have found various code samples showing how RPG can call java methods, but can't find any reference to java being an ILE language. 谷歌搜索发现了各种代码示例,这些示例显示了RPG如何调用Java方法,但是找不到任何有关Java作为ILE语言的引用。 Are there any plans for this or is there a reason why java cannot be an ILE language on IBM i? 有没有为此的计划,或者有理由为什么Java不能成为IBM i上的ILE语言?

Making Java a full ILE language, in the same sense that RPG and ILE C are, would be a major undertaking, if it's feasible at all. 如果完全可行的话,使Java成为与RPG和ILE C相同的完整 ILE语言将是一项艰巨的任务。 ILE languages have the property that their compiled modules can be freely mixed and matched when linking into an ILE program. ILE语言具有以下特性: 链接到ILE程序时,可以自由混合和匹配其编译模块。 In other words, once you compile a module, you conceptually have an ILE module, and it's not very important which language was used in the source code for that module. 换句话说,一旦编译了模块,概念上就具有ILE模块,并且在该模块的源代码中使用哪种语言并不是很重要。 All you have to do is make sure all the function or procedure prototypes in the calling code are compatible with the corresponding prototypes in the called code. 您要做的就是确保调用代码中的所有函数或过程原型都与被调用代码中的相应原型兼容。

There was a project that attempted to do exactly this with Java in the Unix/Linux world, called the GNU Compiler for Java (GCJ) . 在Unix / Linux世界中,有一个项目试图用Java来做到这一点,这就是GNU Java编译器(GCJ) The idea was to compile Java modules into a binary form that was directly linkable by (for example) C++ code using GCC. 这个想法是将Java模块编译成二进制形式,该二进制形式可以使用GCC通过(例如)C ++代码直接链接。 It's unclear whether this ever reached "production quality", and as of this writing, GCJ is no longer part of GCC. 目前尚不清楚这是否达到了“生产质量”,并且在撰写本文时,GCJ不再是GCC的一部分。 So you could look at GCJ as both a proof of concept for a hypothetical ILE Java, and a cautionary tale against ILE Java. 因此,您可以将GCJ既视为假设的ILE Java的概念证明,又是针对ILE Java的告诫故事。

In either case, the effort required to make ILE Java happen is probably not justified by the relatively minor benefit. 在这两种情况下,实现ILE Java所需的工作可能都无法通过相对较小的好处来证明。 While you currently can't link Java code directly with ILE code, you can still call Java from RPG and call RPG from Java, which is good enough for most use cases. 尽管您目前无法直接 Java代码与ILE代码链接 ,但是仍然可以从RPG 调用 Java和从Java 调用 RPG,这对于大多数用例来说已经足够了。

What would be easier than a full-blown ILE Java is a native IBM i implementation of the JVM, built using ILE languages (the most obvious choices being ILE C or ILE C++), such that PASE is not used at all. 比使用成熟的ILE Java更容易的是使用 ILE语言(最明显的选择是ILE C或ILE C ++)构建的JVM的IBM i本机实现,因此根本不使用PASE。 But going this route would still require using the existing ways of calling Java from RPG and vice versa, so the benefit would be practically zero. 但是走这条路仍然需要使用现有的从RPG调用Java的方法,反之亦然,因此收益实际上为零。 And the effort of porting the JVM to ILE C++ is definitely greater than zero. 而且,将JVM移植到ILE C ++的努力肯定大于零。 Also keep in mind that IBM will probably want to update their JVM to more-or-less keep pace with Oracle's JVM, and this will be easier to do with a JVM implemented in PASE rather than a JVM implemented in ILE languages. 还请记住,IBM可能希望将其JVM更新为与Oracle的JVM差不多,并且使用PASE实现的JVM而不是使用ILE语言实现的JVM会更容易做到这一点。

Java on IBM i isn't an ILE language ... it actually runs in PASE (for more current releases). IBM i上的Java不是ILE语言,而是实际上以PASE运行(对于更多最新版本)。

RPG can invoke Java code by creating a JVM and running the java application. RPG可以通过创建JVM并运行Java应用程序来调用Java代码。

The normal way to invoke RPG code from Java is to use the ProgramCall or ProgramCallDocument classes. 从Java调用RPG代码的通常方法是使用ProgramCallProgramCallDocument类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM