Libgodc: Write Go Programs for Sega Dreamcast

(github.com)

76 points | by drpaneas 2 hours ago

7 comments

  • Imustaskforhelp 1 minute ago
    If someone is interested in running golang projects on niche hardware perhaps, one pro tip I can suggest but there is way to convert golang 100% into wasm (no js shim or anything required) and the only thing you would need is a wasm library

    You have to use https://stackoverflow.com/questions/76087007/golang-to-wasm-...

    # Source - https://stackoverflow.com/a # Posted by TachyonicBytes, modified by community. See post 'Timeline' for change history # Retrieved 2025-12-29, License - CC BY-SA 4.0

    go install golang.org/dl/gotip@latest gotip download GOOS=wasip1 GOARCH=wasm gotip build -o main.wasm

    I tried to do it and I can tell you that it works and it works for even the most latest versions of golang, all you need is a wasmengine which I suppose can be ubiquitous.

  • drpaneas 2 hours ago
    I built a Go runtime that runs on the Sega Dreamcast, the 1999 console with 16MB RAM and a 200MHz SH4 CPU.

    You can write games in Go with goroutines, channels, garbage collection, and all the language features you'd expect. It compiles using gccgo and runs on real hardware or emulators.

    The project includes 3 game examples Pong, Breakout and Platformer, input handling, audio support, and integrates with KallistiOS (the Dreamcast homebrew SDK).

    * Star Here: https://github.com/drpaneas/godc * Documentation: https://drpaneas.github.io/libgodc/ * Video Tutorial: https://youtu.be/ahMl0fUvzVA

    Happy to answer any questions about the implementation!

    • danhau 2 hours ago
      I just wanted to say how impressive your documentation is. I expected an average readme.md, but not only is your readme great (the performance table is wonderful), but the full documentation is awesome. It pretty much answers all questions I had. Nice job! I wish all projects were like this.

      I also dig the documentation / book styling.

      • drpaneas 15 minutes ago
        thanks @danhau, much appreciated, indeed documenting the process felt like another project of its own, so I am very happy to hear that :D
    • clktmr 1 hour ago
      Hey panos! I only had a short look at this for now, and it looks impressive! I'll have to dust off my Dreamcast and get this running.

      I looked at gccgo when porting the runtime to n64, but at the time it wasn't updated since go1.18. Can we use Go Generics on the Dreamcast? I see that gccgo is obviously needed to support SH4.

      • drpaneas 14 minutes ago
        Hey Timur, long time no see, I hope all is going well :) No, you cannot use generics, they are not yet supported by gccgo.
    • pjmlp 27 minutes ago
      This is kind of cool, kudos for the effort.
      • drpaneas 15 minutes ago
        you're very welcome :D Thanks!
  • phantasmish 2 hours ago
    > Replaces the standard Go runtime with one designed for the Dreamcast's constraints: memory 16MB RAM, CPU single-core SH-4, no operating system.

    24 total megabytes, with an M, of memory between system and video (another 8 there), single core 200mhz CPU, graphics chip runs at 100mhz. Shenmue runs on it.

    Glares at Teams.

    • giancarlostoro 1 hour ago
      It baffles me that Microsoft can build an entire OS, and build and rebuild GUI stacks, and they couldn't build the Teams UI using C#???
      • mfro 27 minutes ago
        If they built Teams with a C# UI framework, it'd have to be rebuilt 4 times by now.
    • gethly 49 minutes ago
      > CPU single-core

      This does not fare well for Go though.

    • perching_aix 1 hour ago
      Could implement a custom Teams client on top of that. My biggest concern would be TLS and media decoding, but could just proxy the traffic and roll a text only client.

      I mucked about with Microsoft Graph a bit before, didn't seem too bad.

  • AdmiralAsshat 25 minutes ago
    > Who is this for? > ... > Anyone who enjoys the challenge of severe constraints

    Remembering what a powerhouse the Dreamcast was when it came out, and how amazing games like Soul Caliber and Shenmue looked, it's hard to think of the Dreamcast hardware as "severely contained".

    • drpaneas 12 minutes ago
      yeah, been there, nostalgia hits hard. Dreamcast was a beast of its era, it even had Ethernet! Even the VMU was something extraordinary! Too bad SEGA had to cancel it :(
  • rpastuszak 17 minutes ago
    I love this. The documentation is great and I've even learned a thing or two about golang from it! The logo makes me want to port Icy Tower to DC.
    • drpaneas 13 minutes ago
      thanks @rpastuszak, much appreciated :D
  • donatj 58 minutes ago
    The "Effective Dreamcast Go" docs on this are fantastically well written. I've read much worse docs from major corporations.
    • drpaneas 1 minute ago
      Many thanks @dontaj much appreciated, indeed documenting the process felt like another project of its own, so I am very happy to hear that! The effective dreamcast Go was inspired from the old time classic https://go.dev/doc/effective_go :D
  • karel-3d 26 minutes ago
    I thought that gccgo supports only some old go version? Or subset of features? I will need to refresh my memory for sure
    • drpaneas 2 minutes ago
      I am using sh-elf-gccgo (GCC) 15.1.0 which is ok-ish I guess. But in general gccgo tries to be close to Go, but they do not implement all the features. e.g. generics are still missing for example.