Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Golang Game Programming Question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 kd7tck   Members   -  Reputation: 715

Like
0Likes
Like

Posted 28 December 2012 - 09:41 PM

Recently I have considered using golang as the basis for a game runtime. I was tinkering with the idea of wrapping SFML into a Go library and linking in game modules written in GO.  I was wondering if anyone had any experience with golang and had any advice for me.

 

For example, is it a good idea to place the game loop on the C/C++ side, or keep it on the Go side?

 

I use <extern void go_func_name() __asm__ ("package_name.function_name");> as the basis for calling over into go. Are there more efficient ways of doing this? What if I do not know the name of the package/function at compile time?



Sponsor:

#2 Lightness1024   Members   -  Reputation: 737

Like
2Likes
Like

Posted 29 December 2012 - 12:54 AM

Even if C++ will be a bit faster for runtime generated code, because compilers are more mature, and it has more features that are often the optimal way of doing them when you absolutely have to use them. (it was a conclusion of google when benchmarking different languages)

I would not use performance as a criterion to separate code into both languages.

if you want to make a game in Go, just do everything in GO, why not ? at least you have the advantage of having a very fast compilation, a clean grammar that allows inteli-sense-like tools to work as excpected (and not broken like with C++). this could reveal important for project dev speed.



#3 starbasecitadel   Members   -  Reputation: 699

Like
0Likes
Like

Posted 29 December 2012 - 03:44 PM

Initially, I was using Lua (LuaJIT, and nginx/LuaJIT) for everything server-side, but was hitting way too many compatibility issues where 3rd party libraries weren't working with each other.

 

I switched to Go for the server-side, even including the webserver, and it is working like a charm.  The performance is extremely good (fairly close to C levels) but the big thing is productivity is high as it has all the newer language features and in general is well thought out.    Like any language, it has its nuances, and I'm still not really used to its different OO'ish mechanisms, but in general things "just work" including the easiest multitasking I've seen.  

  

While it doesn't have nearly the same depth of library as common languages like Java, Perl etc, I find that the few it has tend to be exactly the ones I need and are well thought out. Some of the most common ones (web serving, sockets, Templates) are built right into the main language library and are easy to use.



#4 kd7tck   Members   -  Reputation: 715

Like
0Likes
Like

Posted 30 December 2012 - 01:56 AM

Even if C++ will be a bit faster for runtime generated code, because compilers are more mature, and it has more features that are often the optimal way of doing them when you absolutely have to use them. (it was a conclusion of google when benchmarking different languages)

I would not use performance as a criterion to separate code into both languages.

if you want to make a game in Go, just do everything in GO, why not ? at least you have the advantage of having a very fast compilation, a clean grammar that allows inteli-sense-like tools to work as excpected (and not broken like with C++). this could reveal important for project dev speed.

 

I want the game logic done with Go packages linked in after the fact, and the runtime will be partly C and Go. I am not certain how to do all of it in Go.  It seems some things are easier with C libs linked in.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS