10 comments

  • drpaneas8 hours ago
    I built a Go runtime that runs on the Sega Dreamcast, the 1999 console with 16MB RAM and a 200MHz SH4 CPU.<p>You can write games in Go with goroutines, channels, garbage collection, and all the language features you&#x27;d expect. It compiles using gccgo and runs on real hardware or emulators.<p>The project includes 3 game examples Pong, Breakout and Platformer, input handling, audio support, and integrates with KallistiOS (the Dreamcast homebrew SDK).<p>* Star Here: <a href="https:&#x2F;&#x2F;github.com&#x2F;drpaneas&#x2F;godc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;drpaneas&#x2F;godc</a> * Documentation: <a href="https:&#x2F;&#x2F;drpaneas.github.io&#x2F;libgodc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;drpaneas.github.io&#x2F;libgodc&#x2F;</a> * Video Tutorial: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;ahMl0fUvzVA" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;ahMl0fUvzVA</a><p>Happy to answer any questions about the implementation!
    • danhau7 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.<p>I also dig the documentation &#x2F; book styling.
      • drpaneas5 hours 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
    • clktmr7 hours ago
      Hey panos! I only had a short look at this for now, and it looks impressive! I&#x27;ll have to dust off my Dreamcast and get this running.<p>I looked at gccgo when porting the runtime to n64, but at the time it wasn&#x27;t updated since go1.18. Can we use Go Generics on the Dreamcast? I see that gccgo is obviously needed to support SH4.
      • drpaneas5 hours 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.
    • simonw3 hours ago
      This is a beautiful thing to exist. Much respect for building this.
    • lagniappe5 hours ago
      You&#x27;ve made my entire WEEK! Thank you!
      • drpaneas4 hours ago
        You&#x27;ve put a smile on my face reading your comment, thank you for your feedback, happy holidays :D
    • pjmlp6 hours ago
      This is kind of cool, kudos for the effort.
      • drpaneas5 hours ago
        you&#x27;re very welcome :D Thanks!
  • phantasmish7 hours ago
    &gt; Replaces the standard Go runtime with one designed for the Dreamcast&#x27;s constraints: memory 16MB RAM, CPU single-core SH-4, no operating system.<p>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.<p><i>Glares at Teams</i>.
    • pjmlp5 hours ago
      I really don&#x27;t get how Teams gets developed, not even the worst offshoring projects I have been part of, have reached so low in quality.
    • giancarlostoro6 hours ago
      It baffles me that Microsoft can build an entire OS, and build and rebuild GUI stacks, and they couldn&#x27;t build the Teams UI using C#???
      • federiconafria5 hours ago
        Microsoft applications always look and behave as if they were ported to windows...
      • mfro6 hours ago
        If they built Teams with a C# UI framework, it&#x27;d have to be rebuilt 4 times by now.
    • bttf3 hours ago
      Would happily take work chat, video conferencing in network-enabled Shenmue over Teams, Slack any day
    • perching_aix7 hours 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.<p>I mucked about with Microsoft Graph a bit before, didn&#x27;t seem too bad.
    • gethly6 hours ago
      &gt; CPU single-core<p>This does not fare well for Go though.
      • jerf5 hours ago
        It runs fine. It is perhaps a bit pricey for a 200MHz system, I&#x27;d certainly focus on having only a few of them and doing most of my work by looping over some sort of user-defined tasklet (or, in other words, &quot;standard game architecture&quot;), but it&#x27;s not like Go requires multiple CPUs to work at all.
      • awesome_dude17 minutes ago
        Wouldn&#x27;t it suit Go over some other architecture, because of goroutines being in userspace, the single CPU is effectively multithreaded when using Go
      • c2xlZXB5Cg16 hours ago
        Paging Mythbusters
      • lagniappe5 hours ago
        Huh?
  • Imustaskforhelp5 hours 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<p>You have to use golang from source (see the stackoverflow page <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;76087007&#x2F;golang-to-wasm-compilation" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;76087007&#x2F;golang-to-wasm-...</a> )<p>go install golang.org&#x2F;dl&#x2F;gotip@latest gotip download GOOS=wasip1 GOARCH=wasm gotip build -o main.wasm<p>Although the way I did it is going into the gotip folder and then the binary folder which would contain the go compiler binary and then just use that path with<p>GOOS=wasip1 GOARCH=wasm ~&#x2F;sdk&#x2F;gotip&#x2F;bin&#x2F;go build -o main.wasm<p>Note that I forgot the exact path but it was similar to this but the point being that its super easy and simple :)<p>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.<p>I have built a solution where golang code gets converted to wasm and then we run a ssh server which then runs that wasm all in sandbox to create sandboxed mini golang servers :p I really love it although its a more so prototype than anything
    • gothink2 hours ago
      Looks like this is available (since Go 1.21 [0]), so no need to build from source anymore. Just did a quick &#x27;hello world&#x27; test to verify and it worked:<p><pre><code> GOOS=wasip1 GOARCH=wasm go build -o main.wasm main.go wasmtime main.wasm </code></pre> If you&#x27;re interested in wasm&#x2F;wasi and niche hardware with Go, you should check out TinyGo [1] if you haven&#x27;t already.<p>[0] <a href="https:&#x2F;&#x2F;go.dev&#x2F;blog&#x2F;wasi" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;blog&#x2F;wasi</a><p>[1] <a href="https:&#x2F;&#x2F;tinygo.org&#x2F;docs&#x2F;guides&#x2F;webassembly&#x2F;wasi&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tinygo.org&#x2F;docs&#x2F;guides&#x2F;webassembly&#x2F;wasi&#x2F;</a>
      • Imustaskforhelp1 hour ago
        Oh wow thanks for telling me, looks like I was using gotip&#x2F; source go for no reason but thanks for telling me this, this actually really simplifies a lot of things :p<p>Tinygo is really awesome but I have heard that it has its differences so software written for golang won&#x27;t really work ootb on tinygo and tinygo is really fascinating project too!<p>I have a question but is it possible to create golang compiler itself within wasm itself. I tried doing it but it didn&#x27;t really work out but I am curious if someone has thought of doing something like this or has already done it?
  • donatj6 hours ago
    The &quot;Effective Dreamcast Go&quot; docs on this are fantastically well written. I&#x27;ve read much worse docs from major corporations.
    • drpaneas5 hours 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 <a href="https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;effective_go" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;effective_go</a> :D
  • nasretdinov4 hours ago
    Nice project! Having just 16Mb of RAM does indeed sound like a real challenge for stock Go (not the TinyGo variant)! Even hello world is a couple megs, although I imagine Dreamcast isn&#x27;t 64-bit, so the instructions are probably much shorter. Interesting to see anything written in it :)
    • drpaneas4 hours ago
      Thanks :D How about porting Diablo? <a href="https:&#x2F;&#x2F;x.com&#x2F;PanosGeorgiadis&#x2F;status&#x2F;2005692695402955143" rel="nofollow">https:&#x2F;&#x2F;x.com&#x2F;PanosGeorgiadis&#x2F;status&#x2F;2005692695402955143</a>
  • AdmiralAsshat6 hours ago
    &gt; Who is this for? &gt; ... &gt; Anyone who enjoys the challenge of severe constraints<p>Remembering what a powerhouse the Dreamcast was when it came out, and how amazing games like Soul Caliber and Shenmue looked, it&#x27;s hard to think of the Dreamcast hardware as &quot;severely contained&quot;.
    • jerf5 hours ago
      I find it a bit weird that I find it intuitive how things like the Super Nintendo did their work, and how modern games and systems work, but comparing the hardware specs of the Dreamcast&#x2F;PS2&#x2F;XBox&#x2F;Gamecube era to the best of their output is where my intuition struggles the most. Not that the games of the era stand up to modern stuff, even when upscaled and texture-packed etc. in an emulator, but how they did it with so little oomph still amazes me.
      • tclancy2 hours ago
        For anyone interested in the general topic, highly recommend <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Racing_the_Beam" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Racing_the_Beam</a>
    • drpaneas5 hours 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 :(
  • rpastuszak5 hours ago
    I love this. The documentation is great and I&#x27;ve even learned a thing or two about golang from it! The logo makes me want to port Icy Tower to DC.
    • drpaneas5 hours ago
      thanks @rpastuszak, much appreciated :D
  • karel-3d6 hours ago
    I thought that gccgo supports only some old go version? Or subset of features? I will need to refresh my memory for sure
    • drpaneas5 hours 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.
      • pjmlp5 hours ago
        It appears stale to me, there seems no one is driving it any longer, and Ian Lance Taylor has moved on anyway.<p>Maybe eventually the same can be tried with TinyGo, just as an idea.
        • drpaneas4 hours ago
          problem is TinyGo uses LLVM, which doesn&#x27;t support SH-4. The only reason I went with gccgo is due to SH4 target. In any case, I learned a ton of things doing this project :D
  • steeve2 hours ago
    this is incredible