Multiplatform Support via Unified Go Codebase

at GDG Helsinki

7 May 2019

Timo Savola

CTO, Ninchat

Ninchat

2

Ninchat client library

3

Multiple platforms

4

Single codebase

5

GopherJS

6

NinchatClient.js

7

Go mobile


8

Go mobile binding generator

9

Ninchat mobile SDK

10

Mobile API binding restrictions

11

Example: String slice

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();

    // ...
}
12

iOS bitcode issue

13

Python module

14

Ninchat client library - future

15

Thank you

Timo Savola

CTO, Ninchat









Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Use the left and right arrow keys or click the left and right edges of the page to navigate between slides.
(Press 'H' or navigate to hide this message.)