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!
I also dig the documentation / book styling.
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.
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.
I mucked about with Microsoft Graph a bit before, didn't seem too bad.
This does not fare well for Go though.
You have to use golang from source (see the stackoverflow page https://stackoverflow.com/questions/76087007/golang-to-wasm-... )
go install golang.org/dl/gotip@latest gotip download GOOS=wasip1 GOARCH=wasm gotip build -o main.wasm
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
GOOS=wasip1 GOARCH=wasm ~/sdk/gotip/bin/go build -o main.wasm
Note that I forgot the exact path but it was similar to this but the point being that its super easy and simple :)
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.
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
GOOS=wasip1 GOARCH=wasm go build -o main.wasm main.go
wasmtime main.wasm
If you're interested in wasm/wasi and niche hardware with Go, you should check out TinyGo [1] if you haven't already.Tinygo is really awesome but I have heard that it has its differences so software written for golang won't really work ootb on tinygo and tinygo is really fascinating project too!
I have a question but is it possible to create golang compiler itself within wasm itself. I tried doing it but it didn't really work out but I am curious if someone has thought of doing something like this or has already done it?
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".
Maybe eventually the same can be tried with TinyGo, just as an idea.