Live data from Hacker News

Build Pong in Your Terminal with Go for Some Reason

earthly.dev

11–20 of 44 posts

Re: Build Pong in Your Terminal with Go for Some Reason

#11
post #10

The article is great, but the title here has been editorialized a bit. I'm not super familiar with HN, so what's the best way to get that fixed to match the actual article?

Send mail to hn@ycombinator.com :)

Note that this was submitted by the author, who's in the thread.

Re: Build Pong in Your Terminal with Go for Some Reason

#12
post #2

I've been trying to learn go by building Pong in my terminal. Here is part One where I create a bouncing ball.

    Well now we have a program that says “Hi!” until you press escape. For the loneliest among us, that may be enough. But we came here to build a game, so we’ll need some kind of animation.
Love the humor

Re: Build Pong in Your Terminal with Go for Some Reason

#13
This was one of my first projects as a kid with Visual Basic. But with working paddles and all!

I love Go and use it daily, but I wish we had anything similar to VB, even if it's just a helper UI builder. Being able to shape, position, and name objects visually, then modify attributes in code, is (to me) so much easier than doing it strictly in code. Does any such GUI builder exist? I don't necessarily want VB or a similar IDE, just a way to design using a GUI and program behind it.

Re: Build Pong in Your Terminal with Go for Some Reason

#14

This was one of my first projects as a kid with Visual Basic. But with working paddles and all! I love Go and use it daily, but I wish we had anything similar to VB, even if it's just a helper UI builder. Being able to shape, position, and name objects visually, then modify attributes in code, is (to me) so much easier than doing it strictly in code. Does any such GUI builder exist? I don't necessarily want VB or a s…

I have longed for such a thing as well, having used VB5&6 in my late teens to make countless games and utility apps.

Re: Build Pong in Your Terminal with Go for Some Reason

#15

I also have been using Go with Tcell recently. Making small games is how I have always learned new programming languages. I am coming off of a couple of years of playing with C to understand languages better, and free myself from the complex stacks that I use at work. I've been chatting with a highly-educated PL friend of mine about my language likes/dislikes, and he would always remark on really pragmatic choices Go…

I don't really buy into go (it's not my type of language), but I wanted to ask a genuine question: are there many semi-mainstream languages that don't have modules that _just work_, or an official plugin for VSCode that just works? I've never found that to be a "plus", as much as it is the bare minimum. and nowadays I don't see that many up and coming languages that miss out on it. Admittedly though the cross compila…

Most compiled languages have fractured build ecosystems, and may require some tricky invocation orders, external+not-included dependencies, or some funky flags depending on your compiler version. Or may just not work because you have the wrong compiler, missing their preferred build scripting runtime, etc.

NPM (packages) frequently go down, doesn't resolve packages, or just does something unexpected. Java has the Gradle/Maven split, C++ has a few extra common ones - Make/CMake, Autotools, Ninja, Meson, etc. Modern C# is the one that's got a similar scene to Go from what I've seen.

Go is simple and consistent. It adheres to the Zen of Python, particularly "There should be one– and preferably only one –obvious way to do it.", better than Python itself does (IMO). You check out a repo, you run go build, and 90% of the time you have a binary. A 5 line Python script could automate this process, good luck doing the same with Java or C++.

Re: Build Pong in Your Terminal with Go for Some Reason

#16

I also have been using Go with Tcell recently. Making small games is how I have always learned new programming languages. I am coming off of a couple of years of playing with C to understand languages better, and free myself from the complex stacks that I use at work. I've been chatting with a highly-educated PL friend of mine about my language likes/dislikes, and he would always remark on really pragmatic choices Go…

> after being configured by the single official Go plugin

Are you using a small or large code base? VSCode falls over at my job's monorepo. Goland has much better performance.

Re: Build Pong in Your Terminal with Go for Some Reason

#18

I also have been using Go with Tcell recently. Making small games is how I have always learned new programming languages. I am coming off of a couple of years of playing with C to understand languages better, and free myself from the complex stacks that I use at work. I've been chatting with a highly-educated PL friend of mine about my language likes/dislikes, and he would always remark on really pragmatic choices Go…

[deleted]

Re: Build Pong in Your Terminal with Go for Some Reason

#19

I also have been using Go with Tcell recently. Making small games is how I have always learned new programming languages. I am coming off of a couple of years of playing with C to understand languages better, and free myself from the complex stacks that I use at work. I've been chatting with a highly-educated PL friend of mine about my language likes/dislikes, and he would always remark on really pragmatic choices Go…

Re: perf for hobby gamedev, I basically agree for native builds, but lately I've felt like Wasm support seems key for hobby gamedev (so you can have more people play your game / without downloading it / it works directly on mobile too without dealing with app or play store). And Go perf in Wasm unfortunately is not so good (I was hitting big GC pauses when trying to make a game with Ebiten and large images).

I ended up writing a Go -> C++ compiler. Go's standard library parser/typechecker made it very doable. The games I've done with it don't use the GC at all but also don't manually manage memory -- they use an ECS api which helps. https://github.com/nikki93/gx -- the README links to development workflow video and complete example game code. I get the perf, interop/libs and portability of C/C++ but with Go's developer experience (well the build system involves C/C++ of course but I have something set up there that I now just use).

Re: Build Pong in Your Terminal with Go for Some Reason

#20

I also have been using Go with Tcell recently. Making small games is how I have always learned new programming languages. I am coming off of a couple of years of playing with C to understand languages better, and free myself from the complex stacks that I use at work. I've been chatting with a highly-educated PL friend of mine about my language likes/dislikes, and he would always remark on really pragmatic choices Go…

I've been working professionally in Go for almost a year now and I do agree Go is really pragmatic and is largely nice for just "getting stuff done".

However there is an absurd amount of nil checking which can be easy to miss and not always caught by the common linting tools. Once you use Result/Option types and proper enums with pattern matching that is expressive and safe, it wears on you that Go does not have this.

Post reply on HN