FAQ
A generator for calling Java from Go would have a lot of internal
similarities to gobind, but would require significant effort and
enough different code that I wouldn't call it an "update" to gobind,
rather a different tool that shares some common code.

If you want to do this on top of gobind, note that it is possible to
call a subset of Java from Go today with gobind. Define an interface
in Go:

type I interface {
     F()
     ...
}

func CallJavaFromGo(i I) {
     i.F()
}

then gobind will produce an abstract class. Define a subclass,
instantiate it, then pass the instance of your Java object to the
wrapped CallJavaFromGo function.

I believe someone experimented with a code generator for calling
arbitrary Java from Go written on top of gobind, but I cannot find it
right now.

d.

On Thu, Sep 17, 2015 at 7:19 AM, Manlio Perillo
wrote:
Hi.

Currently gobind generates Java and Go code used to call Go from Java,
however JNI can also be used to call Java from Go.
This is done in
https://github.com/golang/mobile/blob/master/asset/asset_android.go

What are the limitations of calling Java from Go?
Does the code in asset_android only works because the android NDK already
defines the AAssetManager type?

Is it possible to update gobind so that, starting from a Java class
definition/source file, it is able to generate a Go package containing
*high level* and convenient code to call Java?


Thanks Manlio

--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 9 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 17, '15 at 11:19a
activeSep 22, '15 at 3:02p
posts9
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase