Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sorry, this comment is so incorrect that I have to ask, what are you basing it on?

You can create games today using Go without cgo, and there are numerous examples of shipped games of varying complexity and quality. I do this to ship the bgammon.org client to Windows, Linux and WebAssembly users, all compiled using a Linux system without any cgo.

https://ebitengine.org

https://github.com/sedyh/awesome-ebitengine#games



https://ebitengine.org/en/documents/install.html

For anything other than windows:

> Installing a C compiler

> A C compiler is required as Ebitengine uses not only Go but also C.

I mean, even on platforms without cgo, it's it working magically?

No; it's using https://github.com/ebitengine/purego, which is:

> A library for calling C functions from Go without Cgo.

Like... I mean.... okaaaay, it's not cgo, but it's basically cgo? ...but it's not cgo so you can say 'no cgo' on your banner page?

If you're calling c functions, it's not pure go.

If calls some C library, and it doesn't work on any other platform, its like 'pure go, single platform'.

hmm.

Seems kind of like... this is maybe not the right hammer for gamedev; or, perhaps, maybe not quite mature yet...

Certainly for someone in the 'solo dev pick your tools carefully' team, like the OP, I don't think this would be a good pick for people; even if they were deeply familiar with go.


Ebitengine author here.

PureGo is not fully used in Ebitengine for Linux, macOS, and so on yet. You still need Cgo for such environment.


It was based on my own experience (with e.g. sdl2) and, clearly, some ignorance.

I didn't mean to imply that cgo was an insurmountable barrier. But apparently it was a big enough deal for the authors of this engine that they copied over large parts of major API surface to Go to avoid it. Impressive.

However, AFAICT avoiding cgo means using unsafe tricks and trusting that struct layout will stay compatible. Nevertheless, it's a proven solution and as you say used by many already.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: