Multiplatform Support via Unified Go Codebase
at GDG Helsinki
7 May 2019
Timo Savola
CTO, Ninchat
Timo Savola
CTO, Ninchat
github.com/golang/go/wiki/Mobile
type Strings struct{ a []string } func NewStrings() *Strings { return new(Strings) } func (ss *Strings) Append(val string) { ss.a = append(ss.a, val) } func (ss *Strings) Get(i int) string { return ss.a[i] } func (ss *Strings) Length() int { return len(ss.a) }
Generated Java:
public final class Strings implements Seq.Proxy { public Strings() { this.refnum = __NewStrings(); Seq.trackGoRef(refnum, this); } public native void append(String val); public native String get(long i); public native long length(); // ... }
github.com/golang/go/issues/22395#issuecomment-472638175
13go build -buildmode=c-archive
asyncio
API implemented manually on top of coregithub.com/ninchat/ninchat-python
14Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.