I wrote a simple Go->C++ compiler to use for gameplay programming. Here's a demo of its use for my game project (along with an editor tool). I show the generated C++ in the end of the video. Compiler source code is ~1500 lines, link in video description. Will do a deeper public release soon!

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/golang

Our great sponsors
  • OPS - Build and Run Open Source Unikernels
  • Scout APM - Less time debugging, more time building
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • go2cpp

    A converter from Go to C++

    not sure exactly about OPs use case, but for Ebiten a go to c++ conversion was done for Nintendo Switch support -- https://github.com/hajimehoshi/go2cpp

  • entt

    Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

    Interop: With this compiler I have direct interop to existing C++ libraries and codebases. For example I use EnTT for the entity-component data storage in the game demo here, and I'm able to call to the C++ including Go's generic syntax translating to template calls. That's not as easy with Cgo (and also Cgo adds huge overhead)

  • OPS

    OPS - Build and Run Open Source Unikernels. Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.

  • asyncrun.vim

    :rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!

    That is indeed Vim! I use AsyncRun for the build in another buffer, and the refactoring is coc-go with coc.nvim.

  • coc-go

    Go language server extension using gopls for coc.nvim.

    That is indeed Vim! I use AsyncRun for the build in another buffer, and the refactoring is coc-go with coc.nvim.

  • coc.nvim

    Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.

    That is indeed Vim! I use AsyncRun for the build in another buffer, and the refactoring is coc-go with coc.nvim.

  • Azul3D

    Azul3D - A 3D game engine written in Go! (by azul3d)

    Interesting work Nikki, I've definitely considered going down this path once or twice with Azul3D in years past, cool to see you've gone much further with it than I ever did.

  • zig-wasm-test

    Re: Zig, yup Zig is actually among the closest to the design that I was looking for. I did a dive into using it from Wasm (https://github.com/nikki93/zig-wasm-test) including binding to UI like I do for my editor. Ultimately some issues I had were stability (at the time I then updated to a new Zig version and that broke things) and also some specific things like I want field attributes that I can reflect on in static reflection (they do have a proposal for this in their GitHub issues). I do think it's pretty close and viable, totally possible I stuck with it. It's also getting an official C compilation backend which is intetesting.

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts