[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - Any possibility of supporting golang?

It is currently Tue Apr 24, 2018 12:51 pm Advanced search

Any possibility of supporting golang?

Code won't compile? Found a bug? Post here!

Any possibility of supporting golang?

Postby lavalamp » Wed Oct 06, 2010 9:16 pm

I've been writing things in google's new language "go" lately... is there any chance support for this language could be added?

http://golang.org
lavalamp
Colonel
 
Posts: 56
Joined: Wed Oct 06, 2010 9:10 pm

Re: Any possibility of supporting golang?

Postby amstan » Thu Oct 07, 2010 1:52 am

Do you have a starter package for it?
Alexandru M. Stan
Contest Organizer
User avatar
amstan
Contest Organizer
 
Posts: 691
Joined: Sun Jan 31, 2010 4:02 am
Location: Stoney Creek, Ontario

Re: Any possibility of supporting golang?

Postby lavalamp » Thu Oct 07, 2010 11:27 am

Done: http://bitbucket.org/lavalamp/pw_go_starter_package

(based off of the C++ starter package)

EDIT: attached .zip for your convenience
Attachments
go_starter_package.zip
(1.04 MiB) Downloaded 118 times
lavalamp
Colonel
 
Posts: 56
Joined: Wed Oct 06, 2010 9:10 pm

Re: Any possibility of supporting golang?

Postby lavalamp » Fri Oct 08, 2010 2:52 pm

I hope this is possible because I started writing a bot...

It shouldn't be much trouble, just install go and use whatever script you use to make the C++ ones.

Do you monitor the process to see if it makes multiple threads? If so you probably need to either (a) say no goroutines allowed (and change nothing) or (b) not monitor, but do a search and make sure the source does not include a call to "runtime.GOMAXPROCS(x)", or if it does it passes a 1 (which is the default). The go runtime will start a second thread only if 1) there is another goroutine and 2) the current goroutine is waiting for a blocking system call. The go runtime will ensure that only one (well, whatever you pass to GOMAXPROCS) thread is ever running at a time. (a) would obviously be easier for you but goroutines are important devices, so it'd be nice if you went with (b).

My starter package has a bug which I'll be correcting tonight or tomorrow morning. It works as long as the input comes all in one chunk.
lavalamp
Colonel
 
Posts: 56
Joined: Wed Oct 06, 2010 9:10 pm

Re: Any possibility of supporting golang?

Postby amstan » Fri Oct 08, 2010 9:48 pm

Our current sandbox does not allow real threads.

If golang simulates threads by running stuff one by one, that is fine(aka green threads). Python implements threads this way btw.
Alexandru M. Stan
Contest Organizer
User avatar
amstan
Contest Organizer
 
Posts: 691
Joined: Sun Jan 31, 2010 4:02 am
Location: Stoney Creek, Ontario

Re: Any possibility of supporting golang?

Postby lavalamp » Fri Oct 08, 2010 9:55 pm

I see, yeah that should still work fine as long as we don't do a blocking system call while there are waiting goroutines, which should be easy enough to stay away from given a task like this.

I haven't read on Python's threads but they are probably very similar.

So when can I upload my bot? :mrgreen:
lavalamp
Colonel
 
Posts: 56
Joined: Wed Oct 06, 2010 9:10 pm

Re: Any possibility of supporting golang?

Postby lavalamp » Sat Oct 09, 2010 3:10 pm

I updated the go starter package: http://bitbucket.org/lavalamp/pw_go_starter_package

I fixed a potential bug and added logging features. I won't upload the zip file unless you want me to, as it's easy enough to get it from bitbucket.
lavalamp
Colonel
 
Posts: 56
Joined: Wed Oct 06, 2010 9:10 pm

Re: Any possibility of supporting golang?

Postby Peccavi » Sun Oct 10, 2010 1:33 am

lavalamp, thank you for throwing this together! I had been wanting to try some stuff in Go, and this makes it a lot easier to start off.

I downloaded the starter package, and at first MyBot wouldn't compile for me. However, I just combined MyBot and PlanetWars into one .go file and it compiled fine.
Peccavi
Cadet
 
Posts: 1
Joined: Sat Oct 09, 2010 10:54 pm

Re: Any possibility of supporting golang?

Postby lavalamp » Sun Oct 10, 2010 2:47 am

No problem :)

You should just be able to run "make", the supplied makefile will compile them together already. You'll need a reasonably recent installation of go, as they changed the makefile system not too long ago.
lavalamp
Colonel
 
Posts: 56
Joined: Wed Oct 06, 2010 9:10 pm

Re: Any possibility of supporting golang?

Postby amstan » Sun Oct 10, 2010 4:53 am

Can you look on this issue, post a new comment. Maybe remind Jeff about it? He's the man to get this implemented.
Alexandru M. Stan
Contest Organizer
User avatar
amstan
Contest Organizer
 
Posts: 691
Joined: Sun Jan 31, 2010 4:02 am
Location: Stoney Creek, Ontario

Next

Return to Technical Issues

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron