On Mon, Feb 1, 2016 at 11:55 PM, Alexander Bertram <a...@bedatadriven.com> wrote: > You can basically tell the compiler to map a C struct to a given java class, > for example, mapping CRuby's VALUE to org.jruby.RubyBasicObject and import > > GimpleCompiler compiler = new GimpleCompiler(); > compiler.addRecordClass("__VALUE", RubyBasicObject.class); > compiler.addMethod("TYPE", CRuby.class, "TYPE"); > > You can then define: > > class CRuby { > public static int TYPE(RubyBasicObject obj) { > if(obj instance of RubyBoolean) return 1; > if(obj instance of RubyHash) return 2; > // etc... > } > }
Very nice! I'm eager to give this a try with a simple extension and see how it feels. > We monkey with the GNU R header files to make replace macros with function > declarations so they can mapped to JVM methods. Yeah we'd turn the weird ones into functions bound to JRuby operations too. I have been in transit all day so I did not get to read much... how does one get this gcc plugin installed? RubyGems are built when installed, so we'd need to be able to hook into gcc at that point. - Charlie -- You received this message because you are subscribed to the Google Groups "JVM Languages" group. To unsubscribe from this group and stop receiving emails from it, send an email to jvm-languages+unsubscr...@googlegroups.com. To post to this group, send email to jvm-languages@googlegroups.com. Visit this group at https://groups.google.com/group/jvm-languages. For more options, visit https://groups.google.com/d/optout.