Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualkunos

Posted 08 December 2012 - 12:09 PM

Ya I am playing with it in my spare time... it's by far my favorite language.
I don't understand what you mean for "dynamic types".. Go has no dynamic types, it's a very simple language statically typed... actually it is very strict about types, requiring explicit casts everywhere. Maybe you are confused by interfaces and duck typing.. but those aren't strictly "dynamic" features... most of them are evaluated at compile time.
Memory management is not very different from C like languages, so, from a performance point of view, the same rules are valid.. avoid creating things on the heap if you can... that's about it... the best way to optimize on a GC is to avoid triggering it.

Performance wise, from my tests on Windows (game oriented stuff like graph traversals and basic math) is in the same ballpark with C# using the standard go compiler. On Linux you can use the gccgo compiler built over the gcc complier and that's pretty damn fast... and runtime performances are only going to get better due the nature of the language.

For gamedev, Go is severely limited in expressing elegant math code.. it doesn't have operator overloading nor function overloading.. thus you're back writing things like:

result := mymath.AddFloat3(&v1 , &v2)

Instead of:

auto result=v1 +v2;

Things get worse with complex formulas:

auto new_pos=pos+vel * dt + (acc * 0.5f * dt *dt);

You'd have to break that down in go operation by operation if pos, vel and acc are vectors.

This gets really annoying when you write math intensive code... but you get lots of good stuff from the language such as goroutines and channels, so it's the goods and the bads are balancing out.

#1kunos

Posted 08 December 2012 - 12:01 PM

Ya I am playing with it in my spare time... it's by far my favorite language.
I don't understand what you mean for "dynamic types".. Go has no dynamic types, it's a very simple language statically typed... actually it is very strict about types, requiring explicit casts everywhere. Maybe you are confused by interfaces and duck typing.. but those aren't strictly "dynamic" features... most of them are evaluated at compile time.
Memory management is not very different from C like languages, so, from a performance point of view, the same rules are valid.. avoid creating things on the heap if you can... that's about it... the best way to optimize on a GC is to avoid triggering it.

Performance wise, from my tests on Windows (game oriented stuff like graph traversals and basic math) is in the same ballpark with C# using the standard go compiler. On Linux you can use the gccgo compiler built over the gcc complier and that's pretty damn fast... and runtime performances are only going to get better due the nature of the language.

For gamedev, Go is severely limited in expressing elegant math code.. it doesn't have operator overloading nor function overloading.. thus you're back writing things like:

result := mymath.AddFloat3(&v1 , &v2)

Instead of:

auto result=v1 +v2;

This gets really annoying when you write math intensive code... but you get lots of good stuff from the language such as goroutines and channels, so it's the goods and the bads are balancing out.

PARTNERS