Transpiling 2d physics engine from C to Go

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

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • cxgo

    Tool for transpiling C to Go.

  • Today I remembered for some random reason that Go compiler was initially written in C and then was mostly transpiled into Go. So, I was curious, which projects exist to do something like this. And after some googling I've found very interesting project called cxgo.

  • Physac

    2D physics header-only library for videogames developed in C using raylib library.

  • To test this, I decided to try to convert something useful and found a small header-only 2D physics engine called physac.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Ebiten

    Ebitengine - A dead simple 2D game engine for Go

  • Apparently, it was pretty easy! After some small fixes it started working. So, I added ebiten to see how it works in practice. And finally, I created a small wasm demo. It was harder, because of some strange bugs, which I could fix by getting rid of unsafe from transplited code. But it wasn't too much hard (actually - nothing, comparing to writing physics engine from scratch).

  • physac-go

    Small demo of using physac 2d physics engine in golang

  • Apparently, it was pretty easy! After some small fixes it started working. So, I added ebiten to see how it works in practice. And finally, I created a small wasm demo. It was harder, because of some strange bugs, which I could fix by getting rid of unsafe from transplited code. But it wasn't too much hard (actually - nothing, comparing to writing physics engine from scratch).

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