Live data from Hacker News

Using Go for Mobile Apps

davidsobsessions.com

21–27 of 27 posts

Re: Using Go for Mobile Apps

#21
post #15
post #12

The author uses Flutter for UI, Golang binary for the app backend, and uses channels passing serialized protobuf messages between them. Since adding a new API call requires changes in multiple places, they ended up defining a "god message" which has a oneof with all possible options: message CarrotAPI { oneof api { Function1API function1 = 10; Function2API function2 = 11; } } message Function1API { message Request {}…

I don’t get it. Why not just use dart for the app backend? I understand not using it on the server because it’s not mature there.

HN upvotes

Re: Using Go for Mobile Apps

#22
Is there any chance now that we have AI to also have API bindings from iOS/android to Go? That was a deal breaker last time I’ve used go for mobile apps. Somehow you were left with no choice but a kind of electronic/web view app.

Re: Using Go for Mobile Apps

#23

Given that even on Linux DNS resolution in Go can be quite... interesting without CGO being enabled, honestly it's hardly surprising that on iOS it would also be quite challenging. I imagine that one more interesting thing to consider is that on iOS you can't fork() or spawn sub-processes, so your Go mobile app is indeed running simultaneously as a Go binary and the UI, and there probably can exist countless interact…

Who enables CGO just for DNS resolution? That is not a thing for a long time, you just reminded me of that. Sure, if you have some complex config instead of a simple default, you would want to use libc and getaddrinfo, that is on you. What other issues are there? Go simple uses the network protocol for DNS, and it reads just resolve.conf; it does not care about LDAP or NSS or whatever there is.

Me. You know nuclei is written in go? Sometimes you need resolution consistency between eg. A port scanner and nuclei. You build and test this on your infra, but then you need to deploy on a heavily proxied network and you find issues. Is this your fault? Yes. Because you use golang. (Note: I use golang for almost everything, and this is something it is not documented enough - I am aware of this and have been bitten in the ass by this more than once)

Re: Using Go for Mobile Apps

#25
post #20
post #17

I can highly recommend Rust for this. The same Rust engine powering web app (WASM + React), iOS (SwiftUI), Android (Kotlin Compose) and desktop (Tauri). https://github.com/koofr/vault

Honestly nowadays Swift seems a better fit IMHO, though it is probably a matter of taste.

Also for WASM? It's just not really there compared to Rust's wasm bindgen.

Re: Using Go for Mobile Apps

#26
post #25
post #20

Earlier quoted context omitted.

Honestly nowadays Swift seems a better fit IMHO, though it is probably a matter of taste.

Also for WASM? It's just not really there compared to Rust's wasm bindgen.

Ah WASM I don’t really know. I know they are actively working on it[1], but I could not tell you where they’re at exactly, especially compared to bindgen. I wanted to try some time ago, but it really was not ready, and now I don’t have the time anymore (:

[1] https://github.com/swiftwasm/WasmKit

Post reply on HN