Google Go for Java platform?
Asked Answered
M

4

11

JVM provides great performance - it's on the one hand. Golang sounds like a new paradigm and extremely productive - on the other hand. If we could bring together the best of two worlds - JVM performance and golang productivity - we could get a lot of benefits. Does anyone know any project that provides golang implementation in java?

Manicdepressive answered 9/8, 2012 at 11:45 Comment(7)
Generally for a moving target you only want a Java port if it is done by the main team. Any "try to keep up"-port will be inferior.Bandeen
Currently, Go compiles to machine code. The JVM isn't going to be faster than that.Polymorphonuclear
@Polymorphonuclear well, actually... But I do agree that not all languages other than java perform so well on the JVM, so a JVM version of Go is not likely to improve performance vs gc/gccgoBrigette
Java may beat Go on some benchmarks, but that's not due to the JVM being inherently faster than native code. There may be advantages to running Go on a JVM, but speed really isn't one of them.Callup
Not entirely related: JNI bindings for Go github.com/abneptis/GoJVMExcruciate
Go 1.5 has an improved GC which should put the GC on parity or faster than the Java GC.Merritt
The JVM also generate native code so the question is who is better at it. Go has good integration with assembly while Java has JNI. The disadvantage with both those solutions is that assembly/JNI is very platform dependent. Assembly is mostly used for SIMD support and as SIMD is very different on different processors that's a problem. As for high level portable Go code it should run a lot faster on Java as garbage collect is at least twice as fast, on SPARC which has hardware assisted garbage collection that Go doesn't use. On IBM the JVM is twice as fast as Go with zAAP.Dmz
A
7

A quick search came up with

http://code.google.com/p/jgo/

This link suggest it's the main or only effort.

http://en.wikipedia.org/wiki/List_of_JVM_languages

Algebra answered 9/8, 2012 at 11:49 Comment(0)
K
6

It may be difficult to make a good JVM implementation of Go. Rob Pike, who is one of Go's creators, spoke about this on episode 0.0.3 of the Changelog podcast:

[timecode 17:05] For instance, it is quite difficult to implement Go's interface model using a JVM: you might have to add a bytecode to deal with some of the type stuff. So for some of these existing systems [(JVM and CLR)] it's not quite obvious how Go would run with them […]

Katz answered 9/8, 2012 at 19:53 Comment(1)
Umm, Scala has a vastly more expressive type system than Go.Overarm
M
1

You should check JGO website: http://jgo.herokuapp.com/

And the JGO Docs: http://jgo.herokuapp.com/api/

Muzz answered 11/7, 2015 at 19:49 Comment(2)
Im not sure this really answers the question, and link only answers are discouraged...Suppository
Plus JGo was previously mentioned. If the links in that previous answer are out of date they should be corrected there.Geneticist
I
0

A different route might be to use a JVM library which provides the most important features of Go, which are in my opinion and experience the lightweight Go-routines multiplexed on JVM threads, and channels for communication and synchronization.

There is one such library, Quasar, from Parallel Universe (see e.g. this blog post comparing Quasar and Go). Also, it works well with Kotlin, which is getting more popular now as an officially supported Android language, and providing much more compact (productive?) syntax than Java.

International answered 5/7, 2017 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.