Live data from Hacker News

Solod: Go can be a better C

solod.dev

11–20 of 188 posts

Re: Solod: Go can be a better C

#11
i've been using Go on backend now all the time.

Wish something like this existed instead i am stuck with flutter and react native on Mobile.

When will a time come when i can use some functional languages like Haskell or a plain boring language like Go for making apps with OTA ability for mobiles.

As vibe coding takes over, app store approval will become slowerer and OTA is really great when you need to make quick changes!

You can OTA each day and do base app release to store once each week.

i think this maybe the space where very little work is being done.

Re: Solod: Go can be a better C

#12

i've been using Go on backend now all the time. Wish something like this existed instead i am stuck with flutter and react native on Mobile. When will a time come when i can use some functional languages like Haskell or a plain boring language like Go for making apps with OTA ability for mobiles. As vibe coding takes over, app store approval will become slowerer and OTA is really great when you need to make quick cha…

Not sure of your exact constraints but is something like this useful?

https://hyperview.org/

Re: Solod: Go can be a better C

#13

I've been using Go and Raylib to make a game lately and I really don't have a problem with garbage collection. It's so fast that it's not having an impact on my frame rate. I was a little worried at the start because nobody would normally consider Go for games, but I did a bunch of tests and found it's just no big deal. (I'm focused on game play and not interested in pushing hardware to its limits.)

I’ve been considering using Odin and Raylib for this because of its similarities to Go, but using Go itself is appealing. Do you have any good resources for what you’ve learned, or is it an unexplored frontier?

I don't know If I can be very helpful, I'm using gen2brain's binding [1].

I started about a year ago asking the AI very beginner questions about Go and 3d math. I think it did steer me down some wrong path sometimes and of course I did some dumb things myself too. I'm not using Agents, just asking questions about features, then writing the code myself by hand.

I really like the power of the tools and the constraints of the language in Go. It's been fun so far.

[1] https://github.com/gen2brain/raylib-go

It's interesting you would mention Odin because I spend a fair amount of time playing with it as well. It was easy to get started and fun. Fast, easy to iterate. The reason I moved away was not the language itself, but I felt it was too much Ginger Bills baby. Oh, and managing memory is no fun. I want to make game play, not think about allocations :)

Re: Solod: Go can be a better C

#14

I've been using Go and Raylib to make a game lately and I really don't have a problem with garbage collection. It's so fast that it's not having an impact on my frame rate. I was a little worried at the start because nobody would normally consider Go for games, but I did a bunch of tests and found it's just no big deal. (I'm focused on game play and not interested in pushing hardware to its limits.)

I’ve been considering using Odin and Raylib for this because of its similarities to Go, but using Go itself is appealing. Do you have any good resources for what you’ve learned, or is it an unexplored frontier?

I’ve used Odin and Raylib for some prototypes, and it’s terrific!

Re: Solod: Go can be a better C

#15
post #8
post #3

How does it deal with pointers if everything is stack based? You can't really return a pointer to something on the stack because it could get overwritten between when you return it and when you access it.

Exactly as well as C does, it seems. func newPerson() *Person { p := Person{Name: "Alice", Age: 30} return &p } becomes static main_Person* newPerson(void) { main_Person p = (main_Person){.Name = so_str("Alice"), .Age = 30}; return &p; } Quoting the FAQ: "So itself has few safeguards other than the default Go type checking. It will panic on out-of-bounds array access, but it won't stop you from returning a dangling p…

Yeah that's not great. It's easy to be faster than go if you haven't thought about memory management yet. I bet go with GOGC=off is faster than plain go too.

Re: Solod: Go can be a better C

#18

It cannot be a better C. You cannot implement exceptions in it using set jump for example, but the biggest problem is memory management. You can't implement your own arena allocator in golang.

I've drastically sped up commercial shipping C code by implementing arena allocators and Go is my daily driver and it's not clear to me why you're making this claim.

Re: Solod: Go can be a better C

#19
It cannot. C is a wonderful language that makes me smile every time I pick it up. A truly universal tool that lets you go wherever your heart desires. Go is a prison designed to enforce a bleak uniformity on all of it's users. For only by painting everything a uniform gray can we ensure we are all equal.

Re: Solod: Go can be a better C

#20

It cannot be a better C. You cannot implement exceptions in it using set jump for example, but the biggest problem is memory management. You can't implement your own arena allocator in golang.

To be fair, you don't need to implement exceptions in golang because they already exist in the language, they're just called panics
Post reply on HN