--- Log opened Fri Jun 18 00:00:09 2010 --- Day changed Fri Jun 18 2010 00:00 <+iant> I can't think of a way to do that 00:00 -!- pfroehlich [~chatzilla@c-98-204-215-206.hsd1.md.comcast.net] has joined #go-nuts 00:01 -!- carllerche [~carllerch@enginey-9.border1.sfo002.pnap.net] has quit [Quit: carllerche] 00:05 -!- nettok [~quassel@200.119.168.179] has joined #go-nuts 00:05 -!- root_ [~root@vaxjo7.165.cust.blixtvik.net] has joined #go-nuts 00:08 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined #go-nuts 00:10 < exch> perhaps a cue to introduce 'a, b := (int32, os.Error)(myFunc())' to the mailing list 00:14 < vrtical> Is there some sort of prize for the ugliest way to save four bytes? :-) 00:17 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Ping timeout: 265 seconds] 00:17 < exch> save them to what? 00:17 < exch> Also, I think it's a chocolate chip cookie 00:18 < vrtical> save them from the compiler optimising them away, of course :-) 00:19 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined #go-nuts 00:21 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined #go-nuts 00:23 -!- root_ [~root@vaxjo7.165.cust.blixtvik.net] has quit [Quit: leaving] 00:27 -!- b00m_chef__ [~watr@216-21-143-134.ip.van.radiant.net] has quit [Ping timeout: 258 seconds] 00:42 -!- artefon [~thiago@189.107.149.191] has quit [Quit: bye] 00:43 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has joined #go-nuts 00:45 -!- Eko [~eko@BeaverNet-161.caltech.edu] has joined #go-nuts 00:45 -!- ita [~waf@kde/developer/tnagy] has quit [Quit: Konversation terminated!] 00:46 -!- Eko [~eko@BeaverNet-161.caltech.edu] has quit [Client Quit] 00:47 -!- dju [dju@fsf/member/dju] has quit [Quit: Quitte] 00:49 -!- Gracenotes [~person@wikipedia/Gracenotes] has quit [Remote host closed the connection] 00:53 -!- plexdev [~plexdev@arthur.espians.com] has joined #go-nuts 00:58 -!- yashi [~yashi@dns1.atmark-techno.com] has joined #go-nuts 01:00 -!- mikespook [~mikespook@58.61.202.207] has quit [Ping timeout: 240 seconds] 01:00 -!- mikespook [~mikespook@219.137.75.54] has joined #go-nuts 01:01 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts 01:07 -!- yashi [~yashi@dns1.atmark-techno.com] has quit [Remote host closed the connection] 01:10 -!- perdiy [~perdix@sxemacs/devel/perdix] has joined #go-nuts 01:12 -!- perdix [~perdix@sxemacs/devel/perdix] has quit [Ping timeout: 265 seconds] 01:22 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has quit [Read error: Connection reset by peer] 01:23 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has joined #go-nuts 01:23 -!- mramige [~mark@h195.146.82.166.ip.windstream.net] has quit [Quit: Ex-Chat] 01:30 -!- yashi [~yashi@dns1.atmark-techno.com] has joined #go-nuts 01:30 -!- Gracenotes [~person@wikipedia/Gracenotes] has joined #go-nuts 01:33 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Ping timeout: 248 seconds] 01:36 -!- keet [~o@unaffiliated/keet] has joined #go-nuts 01:38 -!- keet [~o@unaffiliated/keet] has quit [Client Quit] 01:38 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined #go-nuts 01:42 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has quit [Read error: Connection reset by peer] 01:42 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has joined #go-nuts 02:06 -!- millertimek1a2m3 [~adam@64.134.151.129] has joined #go-nuts 02:06 < millertimek1a2m3> hey I tried copying the go.vim into the ~/.vim/syntax and it didn't work 02:06 < millertimek1a2m3> can anyone tell me what I might be doing wrong? 02:08 -!- eikenberry [~jae@ivanova.zhar.net] has joined #go-nuts 02:09 -!- pfroehlich [~chatzilla@c-98-204-215-206.hsd1.md.comcast.net] has quit [Quit: ChatZilla 0.9.86 [Firefox 3.6.3/20100401074458]] 02:13 < millertimek1a2m3> anyone? 02:15 -!- bmizerany [~bmizerany@dsl081-064-072.sfo1.dsl.speakeasy.net] has quit [Remote host closed the connection] 02:16 < bjarneh> .vimrc -> au BufRead,BufNewFile *.go setfiletype go 02:20 < bjarneh> millertimek1a2m3 : try to source that file also if that did not work, 02:21 < bjarneh> if has("eval") source ~/.vim/syntax/go.vim endif 02:22 < millertimek1a2m3> do you want me to put that in ~/.vimrc? 02:22 < vrtical> millertimek1a2m3: I got vim hilighting working, but it took some faffing about. 02:23 < millertimek1a2m3> vrtical, really? because the purpose of the .vim is to be able to just drop it in and then it works... 02:23 < vrtical> in my ~/.vim directory, there are two directories, ftdetect and syntax 02:23 < millertimek1a2m3> ftdetect! 02:23 < millertimek1a2m3> that's probably what it is 02:23 < vrtical> each of these has a go.vim file in it, and these two files are different 02:24 < millertimek1a2m3> because gvim doesn't know what file type the test.go is in order to use the highlighting 02:24 < millertimek1a2m3> ok... 02:24 < vrtical> My ~/.vimrc has nothing about go, I think it is just installing these files. 02:24 < millertimek1a2m3> vrtical, ok, so where can I get each file? 02:24 < millertimek1a2m3> because i know one is included 02:25 < vrtical> syntax/go.vim is the file from the go tree. 02:25 < millertimek1a2m3> and you're saying theres a go.vim file in both the ~/.vim/syntax and ~/.vim/ftdetect 02:25 < vrtical> ftdetect/go.vim is a one-liner: au BufRead,BufNewFile *.go set filetype=go 02:25 < millertimek1a2m3> ah! 02:25 < millertimek1a2m3> thanks 02:27 < vrtical> You're welcome, hope it works for you. 02:27 < millertimek1a2m3> ok hold on like... 02:27 < millertimek1a2m3> 2 secs please 02:28 < millertimek1a2m3> vrtical... please read over the oneliner you gave me 02:28 < millertimek1a2m3> make sure that's exactly right 02:29 < millertimek1a2m3> because I'm not all brainy about the gvim syntax 02:29 < bjarneh> millertimek1a2m3: yes i wanted you to put those in your .vimrc, parhaps it's not needed... 02:30 < bjarneh> millertimek1a2m3: you have syntax enabled? and get syntax-highlighting for other languages right? 02:31 < millertimek1a2m3> bjarneh, worded of that question wasn't so good 02:31 < millertimek1a2m3> wording* 02:31 < millertimek1a2m3> vrtical, hello? 02:32 < eikenberry> millertimek1a2m3. That looks right. 02:32 < eikenberry> I know vim well. 02:32 < millertimek1a2m3> eikenberry, i put it in like this 02:32 < millertimek1a2m3> au BufRead,BufNewFile *.go set filetype=go 02:32 < millertimek1a2m3> is that right? because it's not doing syntax automatically? 02:33 < eikenberry> You have syntax highlighting enabled? 02:33 < millertimek1a2m3> meant "." 02:33 < millertimek1a2m3> yes 02:33 < millertimek1a2m3> with that line 02:33 < eikenberry> Hmm... 02:33 < millertimek1a2m3> in my ~/.vim/ftdetect/go.vim 02:34 < millertimek1a2m3> it doesn't do it automatically 02:34 < eikenberry> Ok, small change to try. 02:34 < millertimek1a2m3> but, if i do the manual 02:34 < millertimek1a2m3> :set filetype=go it works 02:34 < eikenberry> "set filetype=go" change to "setfiletype go" 02:34 < eikenberry> So that would be: au BufRead,BufNewFile *.go setfiletype go 02:35 < millertimek1a2m3> still not doing it for me 02:36 < millertimek1a2m3> why not something like a test to see if the file ends in .go, and if it does, execute :set filetype=go 02:36 < eikenberry> odd. and you have the syntax file in ~/.vim/syntax/go.vim 02:36 < millertimek1a2m3> yes 02:36 < eikenberry> millertimek1a2m3. That's basically what that does. 02:37 < vrtical> millertimek1a2m3: that was a paste of my file, and it seems to work for me. You do have 'syntax on' in your ~/.vimrc, you said? 02:37 < millertimek1a2m3> i was guessing, but just reading it doesn't really suggest that 02:37 < millertimek1a2m3> well, no i don't have :syntax on in my ~/.vimrc, but it does the syntax automatically for C++ files... 02:37 < millertimek1a2m3> wait a sec... 02:38 < millertimek1a2m3> yes it does it automatically 02:38 < millertimek1a2m3> i'll put the syntax on thing in my .vimrc though 02:38 < vrtical> just syntax on, no : 02:39 < millertimek1a2m3> ok 02:39 < millertimek1a2m3> alright it works man 02:40 < bjarneh> :-) 02:40 < millertimek1a2m3> how come someone doesn't submit a revision in the go repo to make this addition? 02:40 < millertimek1a2m3> do you think i can? 02:41 < Ginto8> well you'd have to send the maintainers some email about your modification tree 02:42 < millertimek1a2m3> i'll just send a request on the mailing list for the addition 02:43 < millertimek1a2m3> but this is awesome, i'm about to start experimenting with Go every day 02:44 < bjarneh> the syntax file for vim has some 'bugs', it forces exponential behaviour on indentation and so on... (select entire file -> indent region, and see your computer struggle) 02:49 -!- millertimek1a2m3 [~adam@64.134.151.129] has quit [Ping timeout: 260 seconds] 03:01 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 260 seconds] 03:02 -!- tav_ [~tav@78.149.190.227] has joined #go-nuts 03:03 -!- tav [~tav@2001:0:53aa:64c:0:3ffb:b16a:411c] has quit [Read error: Connection reset by peer] 03:05 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has quit [Ping timeout: 265 seconds] 03:05 -!- kingfishr [~kingfishr@c-24-130-147-77.hsd1.ca.comcast.net] has quit [Ping timeout: 265 seconds] 03:11 -!- Xera^ [~brit@87-194-208-246.bethere.co.uk] has quit [Quit: ( www.nnscript.com :: NoNameScript 4.21 :: www.esnation.com )] 03:11 -!- kingfishr [~kingfishr@c-24-130-147-77.hsd1.ca.comcast.net] has joined #go-nuts 03:13 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has joined #go-nuts 03:30 -!- ikke [~ikke@unaffiliated/ikkebr] has quit [] 03:33 -!- bjarneh [~bjarneh@135.80-203-19.nextgentel.com] has left #go-nuts [] 03:33 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 240 seconds] 03:35 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts 03:35 -!- lloyda2 [~adam@pool-71-125-159-59.cmdnnj.east.verizon.net] has quit [Quit: WeeChat 0.3.0] 03:38 -!- path[l] [UPP@120.138.102.50] has quit [Quit: path[l]] 03:43 -!- aho [~nya@f052029058.adsl.alicedsl.de] has quit [Quit: EXEC_over.METHOD_SUBLIMATION] 04:13 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 265 seconds] 04:17 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts 04:21 -!- nettok [~quassel@200.119.168.179] has quit [Ping timeout: 264 seconds] 04:21 -!- nettok [~quassel@200.119.168.179] has joined #go-nuts 04:22 -!- path[l] [UPP@120.138.102.50] has joined #go-nuts 04:32 -!- General13372 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined #go-nuts 04:36 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has quit [Ping timeout: 272 seconds] 04:40 -!- emmanueloga [~emmanuelo@190.247.41.202] has joined #go-nuts 04:43 -!- bjarneh [~bjarneh@1x-193-157-196-25.uio.no] has joined #go-nuts 04:50 -!- Eko [~eko@DHCP-159-138.caltech.edu] has joined #go-nuts 04:55 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 240 seconds] 05:01 -!- scm [justme@d071093.adsl.hansenet.de] has quit [Ping timeout: 265 seconds] 05:02 -!- scm [justme@d039122.adsl.hansenet.de] has joined #go-nuts 05:09 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit: This computer has gone to sleep] 05:24 -!- adu [~ajr@pool-71-191-173-125.washdc.fios.verizon.net] has joined #go-nuts 05:27 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts 05:28 -!- rsaarelm [~rsaarelm@cs181128175.pp.htv.fi] has quit [Ping timeout: 258 seconds] 05:28 -!- rsaarelm [~rsaarelm@cs181128175.pp.htv.fi] has joined #go-nuts 05:32 -!- gospch [~gospch@unaffiliated/gospch] has joined #go-nuts 05:32 -!- ExtraSpice [~ExtraSpic@78-62-86-161.static.zebra.lt] has joined #go-nuts 05:33 -!- eikenberry [~jae@ivanova.zhar.net] has quit [Quit: End of line.] 05:35 -!- Project_2501 [~Marvin@82.84.97.61] has joined #go-nuts 05:36 -!- kashia_ [~Kashia@port-92-200-115-3.dynamic.qsc.de] has joined #go-nuts 05:36 -!- Kashia [~Kashia@port-92-200-118-227.dynamic.qsc.de] has quit [Ping timeout: 272 seconds] 05:40 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 05:42 -!- iant [~iant@216.239.45.130] has quit [Ping timeout: 240 seconds] 05:45 -!- gospch [~gospch@unaffiliated/gospch] has quit [Remote host closed the connection] 05:50 -!- gpv [~gpv@59.92.112.224] has joined #go-nuts 05:58 -!- gpv [~gpv@59.92.112.224] has quit [Quit: Leaving] 05:58 -!- rhelmer [~rhelmer@adsl-69-107-86-90.dsl.pltn13.pacbell.net] has joined #go-nuts 06:09 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has quit [Quit: Verlassend] 06:14 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Ping timeout: 240 seconds] 06:24 -!- nettok [~quassel@200.119.168.179] has quit [Read error: Connection reset by peer] 06:25 -!- weatherkid [~name@unaffiliated/weatherkid] has joined #go-nuts 06:25 < weatherkid> Anyone alive? 06:26 < manveru> weatherkid: oi 06:27 < weatherkid> manveru, how would i go about creating a socket? 06:27 < weatherkid> like to freenode (building a irc bot) 06:28 -!- Kylarr [Kyle@122-148-63-115.static.dsl.dodo.com.au] has joined #go-nuts 06:30 -!- fedler [~fedler@173.183.33.135] has joined #go-nuts 06:30 < bjarneh> weatherkid: have you checked this out? (I haven't but the name and description seems useful for your purpose) http://code.google.com/p/go-bot 06:31 -!- mikespook [~mikespook@219.137.75.54] has quit [Quit: Leaving.] 06:33 -!- fedler [~fedler@173.183.33.135] has left #go-nuts [] 06:33 -!- faXx [~code@p0pslyna.vth.sgsnet.se] has quit [Ping timeout: 276 seconds] 06:34 -!- fedler [~fedler@173.183.33.135] has joined #go-nuts 06:36 -!- wrtp [~rog@92.17.21.107] has joined #go-nuts 06:36 -!- mikespook [~mikespook@219.137.75.54] has joined #go-nuts 06:37 -!- fedler [~fedler@173.183.33.135] has left #go-nuts [] 06:39 < manveru> weatherkid: http://golang.org/pkg/net/#Conn.Dial 06:40 < manveru> weatherkid: with the returned Conn you can Read and Write 06:41 < weatherkid> thanks!!!!! 06:41 < manveru> for a purely reactive bot you probably should SetReadTimeout so you don't have to poll often and save lots of CPU 06:43 < manveru> to parse the IRC messages you will find http://golang.org/pkg/strings/ very useful 06:47 -!- fedler [~fedler@173.183.33.135] has joined #go-nuts 06:50 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts 06:52 < weatherkid> manveru, how would i setup a nick and have it join a channel? raw commands? 06:54 < weatherkid> wait, i think i figured it out. a const variable? 06:59 -!- path[l] [UPP@120.138.102.50] has quit [Quit: path[l]] 07:01 -!- fedler [~fedler@173.183.33.135] has left #go-nuts [] 07:02 < manveru> weatherkid: there are a number of ways 07:02 < weatherkid> yah 07:03 < manveru> you could model your bot as a struct that has the properties for nick/server/channels... 07:03 < manveru> you can parse these values from the commandline with the flag package 07:04 < manveru> you can also make them package variables 07:05 < manveru> that would prevent you from running more than one connection inside your process though 07:10 -!- tvw [~tv@e176004235.adsl.alicedsl.de] has joined #go-nuts 07:22 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has joined #go-nuts 07:26 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has quit [Client Quit] 07:31 -!- mbarkhau [~koloss@dslb-084-059-163-201.pools.arcor-ip.net] has joined #go-nuts 07:36 -!- ikaros [~ikaros@g226197181.adsl.alicedsl.de] has joined #go-nuts 07:36 -!- ikaros [~ikaros@g226197181.adsl.alicedsl.de] has quit [Remote host closed the connection] 07:38 -!- ikaros [~ikaros@g226197181.adsl.alicedsl.de] has joined #go-nuts 07:45 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has joined #go-nuts 07:49 -!- kashia_ [~Kashia@port-92-200-115-3.dynamic.qsc.de] has quit [Quit: This computer has gone to sleep] 07:51 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined #go-nuts 07:51 -!- sahid [~sahid@lev92-4-88-164-132-26.fbx.proxad.net] has joined #go-nuts 07:52 -!- General13372 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has quit [Read error: Operation timed out] 07:56 -!- nettok [~quassel@200.119.168.179] has joined #go-nuts 07:58 -!- path[l] [~path@59.162.86.164] has joined #go-nuts 08:00 -!- ita [~waf@136.214.221.87.dynamic.jazztel.es] has joined #go-nuts 08:00 -!- ita [~waf@136.214.221.87.dynamic.jazztel.es] has quit [Changing host] 08:00 -!- ita [~waf@kde/developer/tnagy] has joined #go-nuts 08:03 < sahid> test 08:04 -!- alkavan [~alkavan@77.125.2.64] has joined #go-nuts 08:05 -!- Surma [~bzfsurma@gooseberry.zib.de] has joined #go-nuts 08:21 -!- alkavan [~alkavan@77.125.2.64] has quit [Quit: Leaving] 08:22 -!- fedler [~fedler@173.183.33.135] has joined #go-nuts 08:22 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org] 08:23 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 08:24 -!- rlab [~Miranda@91.200.158.34] has quit [Client Quit] 08:24 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 08:24 -!- rlab [~Miranda@91.200.158.34] has quit [Client Quit] 08:24 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 08:26 -!- fedler [~fedler@173.183.33.135] has quit [Quit: fedler] 08:26 -!- Kylarr [Kyle@122-148-63-115.static.dsl.dodo.com.au] has left #go-nuts [] 08:30 -!- bjarneh [~bjarneh@1x-193-157-196-25.uio.no] has left #go-nuts [] 08:35 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has joined #go-nuts 08:35 -!- photron [~photron@port-92-201-100-15.dynamic.qsc.de] has joined #go-nuts 08:58 -!- crashR [~crasher@codextreme.pck.nerim.net] has joined #go-nuts 09:06 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has quit [Quit: slashus2] 09:11 -!- Fish [~Fish@bus77-2-82-244-150-190.fbx.proxad.net] has joined #go-nuts 09:11 < mpl> I don't get it. why is os.Mkdir making my program stop when the dir already exists? shouldn't it just return an os.Error ? 09:13 -!- Zoopee [alsbergt@zoopee.org] has joined #go-nuts 09:21 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 240 seconds] 09:27 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined #go-nuts 09:30 -!- MizardX [~MizardX@unaffiliated/mizardx] has joined #go-nuts 09:37 -!- mikespook [~mikespook@219.137.75.54] has quit [Quit: Leaving.] 09:40 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts 09:45 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts 09:55 -!- Shyde [~shyde@HSI-KBW-078-043-070-132.hsi4.kabel-badenwuerttemberg.de] has joined #go-nuts 10:02 -!- ikaros [~ikaros@g226197181.adsl.alicedsl.de] has quit [Quit: Leave the magic to Houdini] 10:07 -!- Surma [~bzfsurma@gooseberry.zib.de] has quit [Quit: Leaving.] 10:08 < vrtical> mpl: the obvious answer is that that shouldn't happen. A minimal example returns the error 'file exists'. 10:09 < vrtical> I once spent a while debugging a C program that crashed on closing a file. It turned out there was a pointer error elsewhere in the code, which I guess was trashing the file structure in memory somehow. But you'd expect this not to happen in go :-) 10:28 -!- nettok [~quassel@200.119.168.179] has quit [Ping timeout: 272 seconds] 10:39 -!- soul9 [~none@unaffiliated/johnnybuoy] has quit [Ping timeout: 265 seconds] 10:40 -!- soul9 [~none@unaffiliated/johnnybuoy] has joined #go-nuts 10:48 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts 10:57 -!- ita [~waf@kde/developer/tnagy] has quit [Remote host closed the connection] 10:57 < mpl> vrtical: well here it does return EEXIST, but it also makes my program terminate, I don't understand why. 11:01 -!- alehorst [~alehorst@201.22.31.2.dynamic.adsl.gvt.net.br] has quit [Remote host closed the connection] 11:05 -!- adu [~ajr@pool-71-191-173-125.washdc.fios.verizon.net] has quit [Quit: adu] 11:09 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 240 seconds] 11:11 -!- cmarcelo [~cmarcelo@200.184.118.130] has joined #go-nuts 11:11 -!- cmarcelo [~cmarcelo@200.184.118.130] has quit [Changing host] 11:11 -!- cmarcelo [~cmarcelo@enlightenment/developer/cmarcelo] has joined #go-nuts 11:13 -!- alehorst [~alehorst@201.22.31.2.dynamic.adsl.gvt.net.br] has joined #go-nuts 11:24 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts 11:36 -!- Ideal [~Ideal@port-45-adslby-pool40.infonet.by] has joined #go-nuts 11:37 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org] 11:42 < Ideal> Hi, what is the simplest way would be to enumerate all hosts within ip/netmask ? 11:42 < Ideal> ipv4 11:43 < Ideal> i'm kinda newbie.. 11:47 -!- artefon [~thiago@usuarios175.dcc.ufmg.br] has joined #go-nuts 11:49 < pizza_> Ideal: grab some paper and a pencil and get started 11:53 < Ideal> pizza_: i see, okay :). 11:54 < Ideal> i just wondered maybe there is already some package for that 11:56 < pizza_> oh, well why didn't you say so. 11:56 < Ideal> well, thats maybe i meant by the simplest 11:58 < jessta> mpl: that shouldn't happen, are you sure it's not something else killing the program? getting a stack trace? 12:04 -!- rv2733 [~rv2733@c-98-242-168-49.hsd1.fl.comcast.net] has joined #go-nuts 12:26 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 264 seconds] 12:29 -!- visof [~visof@unaffiliated/visof] has quit [Ping timeout: 265 seconds] 12:33 -!- surma [~surma@91-64-25-119-dynip.superkabel.de] has joined #go-nuts 12:40 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts 12:44 -!- keet [~o@unaffiliated/keet] has joined #go-nuts 12:48 -!- keet [~o@unaffiliated/keet] has quit [Client Quit] 12:51 -!- nighty^ [~nighty@x122091.ppp.asahi-net.or.jp] has joined #go-nuts 13:09 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts 13:09 -!- mode/#go-nuts [+v iant] by ChanServ 13:11 < Ideal> is possible to get value of []byte as int like this somehow "var i *int = (*int)(&ipBytes); *i" (this one doesn't work) ? 13:13 < Ideal> the way i'm doing it now is by shifting each byte in array and summing all of them, but maybe that would be a simpler and nicer way.. 13:14 < nsf> it is possible, yes, you need to use unsafe.Pointer for that 13:14 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping timeout: 245 seconds] 13:14 < Ideal> thank you :) 13:15 < nsf> iptr := (*int)(unsafe.Pointer(&ipBytes[0])) 13:15 < nsf> something like that 13:15 < nsf> but I'm not sure 13:15 < Ideal> nice, i'll try :) 13:15 < vrtical> Surely frowned upon in the Go community to use unsafe for something so prosaic? 13:15 < nsf> well, some people just can't live without pointers 13:16 < nsf> and I personally think it's stupid to remove pointers from a systems language 13:16 < nsf> but we'll see how it turns out 13:16 < nsf> oops, I mean pointer arithmetic 13:16 < nsf> pointers are here 13:17 < Ideal> well, i'm open to more Go-ish way to do that if there is one 13:17 < rsaarelm> encoding.binary.Read. 13:18 < nsf> I think currently the Go-ish way is slow :) but it's premature optimization and all that 13:18 < Ideal> rsaarelm: i'll look, thanks :) 13:18 < Ideal> nsf: heh.. 13:20 < nsf> also I understand that it's all about safety and preventing programmers from doing errors 13:20 < nsf> maybe I just don't have enough experience to understand that it is very important 13:20 < rsaarelm> "var i int; reader := bytes.NewBuffer(ipBytes); binary.Read(reader, binary.BigEndian, &i)" might work. 13:20 < Ideal> rsaarelm: looks cool, like exactly what i need. thank you :) 13:21 < rsaarelm> Yeah, took me a while to find the encoding.binary pkg, and it helped a lot with deserialization code. 13:21 < Ideal> nice :) 13:23 -!- lost4815162342 [~chatzilla@222.73.189.44] has joined #go-nuts 13:25 -!- smw [~smw@pool-96-232-88-231.nycmny.fios.verizon.net] has quit [Ping timeout: 265 seconds] 13:25 -!- visof [~visof@unaffiliated/visof] has quit [Ping timeout: 260 seconds] 13:27 -!- Adys [~Adys@unaffiliated/adys] has quit [Ping timeout: 276 seconds] 13:32 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined #go-nuts 13:38 -!- lure [~chatzilla@222.73.189.44] has quit [Ping timeout: 245 seconds] 13:38 -!- ikaros [~ikaros@g226197181.adsl.alicedsl.de] has joined #go-nuts 13:41 < wrtp> Ideal: your lowest overhead way (while still remaining safe) is probably binary.BigEndian.Uint32(&ipBytes) 13:42 < wrtp> but if performance isn't an issue, just use encoding/binary, as rsaarelm suggests 13:42 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Read error: No route to host] 13:43 -!- path[l] [~path@59.162.86.164] has quit [Quit: path[l]] 13:43 -!- path[l] [~path@122.182.0.38] has joined #go-nuts 13:45 -!- lure [~chatzilla@222.73.189.45] has joined #go-nuts 13:46 < Ideal> wrtp: thanks, this version works fine while i've been still making to work that version with reader.. performance isn't much an issue here for now 13:48 -!- Tiger_ [~chatzilla@222.73.189.45] has joined #go-nuts 13:51 -!- lure [~chatzilla@222.73.189.45] has quit [Ping timeout: 240 seconds] 13:54 * nsf writes a tetris game in Go, where each block is being drawn using opengl's glBegin/glEnd.. it looks like a good way to test cgo call performance :D 13:54 < nsf> [nsf @ waytogo]$ ./test 13:54 < nsf> Number of cgo calls: 26143423 13:55 < nsf> And I should say CPU% shows that there is a certain overhead really :( (well, there was a discussion about that in ML) 13:55 -!- Adys_ [~Adys@unaffiliated/adys] has joined #go-nuts 13:57 -!- rv2733 [~rv2733@c-98-242-168-49.hsd1.fl.comcast.net] has quit [Quit: Leaving] 13:57 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit: This computer has gone to sleep] 13:57 < vrtical> io.ReadAll() is used in the Go Course pdfs - that's a function that has been removed, right? 13:58 < nsf> it's in io/ioutils 13:58 < nsf> or it's called ioutil 13:58 < nsf> check the docs on the web 14:00 < vrtical> nsf: thanks. 14:05 -!- Ideal [~Ideal@port-45-adslby-pool40.infonet.by] has quit [Quit: Ideal] 14:06 -!- Ideal [~Ideal@port-45-adslby-pool40.infonet.by] has joined #go-nuts 14:07 < Ideal> out of curiosity - why it writes 1(as expected) with i being uint32 and 0 if it's just int ? 14:07 < Ideal> http://dpaste.com/208865/ 14:09 -!- iant [~iant@67.218.106.147] has joined #go-nuts 14:09 -!- mode/#go-nuts [+v iant] by ChanServ 14:09 < skelterjohn> well, uint32 and int are different types, fundamentally 14:09 < skelterjohn> they don't encode the same way for the same values 14:10 < Ideal> i see, okay, thanks.. 14:10 < skelterjohn> the difference, i believe, is that signed integers have a bit reserved for the sign 14:11 < skelterjohn> perhaps the single 1 in your data was the sign bit, so, it's positive zero, or something 14:11 <+iant> the range of int is -2147483648 to 2147483647 14:11 -!- cthom [~cthom@wsip-70-169-149-118.hr.hr.cox.net] has joined #go-nuts 14:12 <+iant> the range of uint32 is 0 to 4294967295 14:12 < Ideal> hm, seems like no matter values i put in ip array if i is int its still gives 0 14:12 <+iant> the values from 0 to 2147483647 are encoded with the same bits 14:12 < skelterjohn> is it accurate to say that if you convert a uint32 to int32 while maintaining the bytes, you just subtract 2^31? 14:12 < skelterjohn> ah 14:12 < skelterjohn> so, no 14:13 < skelterjohn> http://dpaste.com/208865/ is what we're referring to - ideal says that if you do that same byte sequence with int instead of uint32, it is a 0 instead of a 1 14:13 <+iant> It's accurate for values in the range 2147483648 to 4294967295 14:14 <+iant> that seems strange; I would expect that to return the same value for int and uint32 on a little-endian system like x86 14:15 < skelterjohn> i just ran that code with uint32 and int32 14:15 <+iant> hmmm, ideal is right, though 14:15 < skelterjohn> both are 1 14:15 < skelterjohn> and int is 0 14:15 < skelterjohn> that seems weird to me :) 14:15 <+iant> yeah, int32 is 1 and int is 0 14:16 <+iant> that's got to be wrong 14:16 < skelterjohn> i thought int = int32 on my system 14:16 < skelterjohn> int64 prints 0 14:16 < skelterjohn> so i guess int is int64 - i was wrong. 14:17 < skelterjohn> trying to use 4 bytes to fill an 8 byte data structure 14:17 <+iant> no, int is 32 bits 14:17 < skelterjohn> it's grabbing the other bytes from the ether 14:17 < skelterjohn> ok then 14:17 <+iant> something else is happening here 14:18 <+iant> the docs say you should only a fixed-size value for binary.Read (int8, uint8, int16, uint16, ...) but the behaviour still seems odd 14:19 < Ideal> and int is not a fixed-size ? 14:19 < skelterjohn> it can vary, in theory, based on the installation 14:19 < Ideal> yea.. 14:19 < skelterjohn> to be either int32 or int64 14:19 <+iant> it is, but it can have different sizes on different systems, so it would be unwise to use it with binary.Read 14:19 <+iant> wait a sec 14:19 <+iant> this program is ignoring the error 14:20 < skelterjohn> perhaps binary.Read checks the type against int32, int64, etc 14:20 < skelterjohn> and not against int 14:20 < skelterjohn> and does some default behavior 14:20 < skelterjohn> like filling it with 0 14:20 < skelterjohn> binary.Read: invalid type int 14:20 < skelterjohn> that's the error with int 14:21 <+iant> yeah 14:21 < skelterjohn> ok, everything makes sense 14:21 < skelterjohn> i wonder if it wouldn't be a good idea to force the programs to catch all return values 14:21 < skelterjohn> and you can put in _ if you want to ignore 14:21 < Ideal> ah, i see, thanks guys :) 14:21 < skelterjohn> if the program had done that, checking the error type would have been the obvious thing to do 14:22 < wrtp> skelterjohn: that would mean you couldn't "go" a function that returned something... 14:22 < wrtp> or defer it for that matter 14:22 < skelterjohn> i haven't it through, clearly :) 14:22 < skelterjohn> haven't thought it through, that is 14:23 -!- pfroehlich [~chatzilla@c-98-204-215-206.hsd1.md.comcast.net] has joined #go-nuts 14:31 -!- Xera^ [~brit@87-194-208-246.bethere.co.uk] has joined #go-nuts 14:32 -!- ender2070 [~ender2070@bas5-hamilton14-1279278974.dsl.bell.ca] has joined #go-nuts 14:34 -!- kanru [~kanru@61-228-150-156.dynamic.hinet.net] has joined #go-nuts 14:35 -!- Tiger_ [~chatzilla@222.73.189.45] has quit [Ping timeout: 276 seconds] 14:38 < vrtical> Guys, can I get some basic conceptual help here? There seems to be a big divide between string functions and things that operate on []byte. 14:39 < nsf> string == utf-8 encoded []byte 14:39 < nsf> sort of 14:39 < nsf> as far as I understand :) 14:40 < vrtical> It seems like either you use bufio.ReadString and the string and fmt functions, or you use the many functions that give you []byte and write them out as []byte. 14:40 < nsf> also strings are immutable 14:41 <+iant> vrtical: you can convert between string and []byte easily 14:43 < vrtical> and vice versa? 14:43 <+iant> yes 14:44 < Soultaker> iant: does that involve copying the string data or are these real casts? 14:44 <+iant> the data is copied 14:44 <+iant> because strings are immutable 14:45 < Soultaker> ah. it's unfortunate that there is no []byte const or something. 14:45 <+iant> that is pretty much the same as string, though 14:45 <+iant> but, yes, there are a different set of available functions 14:52 < vrtical> okay, I guess what I'm really trying to ask about is the canonical way to do textual I/O in go. 14:53 < vrtical> If you're copying bytes around, or mangling them with rot13 or whatever, you just work with them as bytes. 14:53 < vrtical> If you want to read a number from the terminal, you want to read in a string, right? 14:53 < skelterjohn> and then use strconv, yeah 14:53 <+iant> you can print a []byte as a string using fmt.Printf with %s 14:54 <+iant> so if you are fiddling bytes like rot13, I think the canonical way would be to use []byte 14:54 < vrtical> What would you guys use if you wanted to parse a load of foo=0.2, bar=0.3 sort of text? (say into a map[string]float) 14:55 <+iant> I think I would read a string and pass a slice to strconv 14:55 <+iant> biab 14:55 -!- iant [~iant@67.218.106.147] has quit [Quit: Leaving.] 14:58 -!- artefon [~thiago@usuarios175.dcc.ufmg.br] has quit [Quit: bye] 14:58 < Shyde> If I have some goroutines that don't block and get started right after each other, will the current scheduler actually cycle between them or run one after another? 14:58 -!- path[l] [~path@122.182.0.38] has quit [Quit: path[l]] 15:00 < skelterjohn> no guarantees, i believe 15:00 < skelterjohn> but a goroutine won't be swapped out unless it does one of a few things, like making a system call, doing io, or calling gosched() 15:01 < skelterjohn> swapped off a process, that is 15:01 < skelterjohn> your OS might swap the process out for another one, regardless of what the go runtime thinks 15:02 < Shyde> ok, I tried to pass them an ID and print that out and it does look like round robin then but I suspected only because of the syscalls for the print 15:02 < Shyde> thanks 15:02 < skelterjohn> that's entirely possible 15:03 < skelterjohn> and it is also possible that the runtime does do round robin, but i don't think the language spec guarantees it 15:03 < Shyde> I think I read it somewhere in the google group 15:04 < skelterjohn> it's probably easiest to have a queue of "ready" goroutines, and just take one off the top 15:05 -!- iant [~iant@nat/google/x-snlhsptipcuhzwwq] has joined #go-nuts 15:05 -!- mode/#go-nuts [+v iant] by ChanServ 15:05 < Shyde> I wanted to see how goroutines scale if I increase the number, but it isn't exactly a good comparison to pthreads etc. if the runtime doesn't swap them as often as an OS thread scheduler would do 15:05 < skelterjohn> that's a tricky comparison to make, really 15:06 < skelterjohn> but yeah, the OS might swap based on load or time-spent 15:06 < skelterjohn> i don't think the go runtime cares about that 15:07 < skelterjohn> for instance, if you have GOMAXPROCS as 1, and have two goroutines, it is possible to completely block out one by having the other not do anything to trigger a swap 15:07 < Shyde> yea I think that's what's happening in my simple benchmark 15:07 < Shyde> looks a lot like there's only the initialization overhead increasing with the number of goroutines 15:08 < skelterjohn> very low overhead 15:08 -!- Ideal [~Ideal@port-45-adslby-pool40.infonet.by] has quit [Quit: Ideal] 15:08 < Shyde> yes, pretty impressive :) 15:08 < skelterjohn> one of the early demos was having 100k goroutines in a chain, passing a message via channels 15:08 < skelterjohn> and it went from one end to the other very quickly 15:09 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.] 15:09 < vrtical> Do goroutines not get timeslices then? I kinda assumed the goroutine model was unix processes in miniature. 15:10 < skelterjohn> don't think so, not 15:10 < skelterjohn> *no 15:10 < skelterjohn> keep in mind, anything i say is a bit suspect, since i haven't delved into the matter in depth 15:10 <+iant> they don't now but it is possible that the implementation will change in the future 15:10 < skelterjohn> but reading here, and the mailing list 15:10 < skelterjohn> good to have one of the language devs in the room ;) 15:11 < nsf> it it possible to create const arrays in go? 15:11 < nsf> I want a table of numbers 15:12 <+iant> you can create an array and not change it.... 15:12 <+iant> but, no, there is no way to explicitly mark it as const 15:12 < nsf> iant: hm.. ok :) 15:12 < nsf> thanks 15:12 < skelterjohn> i thought the way the scheduler worked was not by inspecting active goroutines, but by injecting code into system calls and io that will cause a goroutine to yield itself... that way no extra weird code is running in parallel 15:13 <+iant> yes 15:13 <+iant> more or less 15:14 < skelterjohn> which would mean that to put a timelimit on how long a goroutine can go without yielding doesn't really fit in, since a goroutine doesn't have to execute one of these special functions if it doesn't want to 15:14 <+iant> it would require some changes to the scheduler, yes 15:17 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts 15:20 < nsf> i saw example somewhere on the net showing how one could create overflowed uint in go (e.g. uint(-1)), but totally forget where I saw that 15:21 < nsf> i need maxInt value, can anyone give a hint? 15:21 < nsf> maxUint* 15:21 <+iant> I think uint(0) - 1 would do it 15:22 < nsf> test.go:8: constant -1 overflows uint 15:22 < nsf> not really :( 15:22 < nsf> go is very careful with that kind of things :) 15:23 <+iant> x := uint(0); x-- 15:23 < skelterjohn> max uint32 = 2^32-1 15:23 < nsf> min := int(^uint(0) >> 1) // largest int 15:23 < nsf> here it is 15:23 < nsf> I've found it :D 15:23 < nsf> but that's largest int 15:24 < nsf> ^uint(0) I guess is what I'm looking for 15:25 -!- skelterjohn [~jasmuth@c-76-124-135-117.hsd1.nj.comcast.net] has quit [Quit: skelterjohn] 15:29 -!- TR2N [email@89.180.202.171] has joined #go-nuts 15:31 < vrtical> Do Go executables know the name they were invoked as? (argv[0] in C) 15:33 -!- awidegreen [~quassel@62.176.237.78] has joined #go-nuts 15:33 <+iant> os.Args[0] 15:34 < vrtical> ah, thanks, I expected it to be in flag 15:44 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts 15:46 -!- ikke [~ikkibr@unaffiliated/ikkebr] has joined #go-nuts 15:49 -!- kanru [~kanru@61-228-150-156.dynamic.hinet.net] has quit [Ping timeout: 240 seconds] 15:51 -!- path[l] [~path@59.162.86.164] has joined #go-nuts 15:51 -!- laser [~xjih78@82.137.72.32] has joined #go-nuts 15:57 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has quit [Quit: leaving] 16:02 -!- plexdev [~plexdev@arthur.espians.com] has quit [Remote host closed the connection] 16:02 -!- plexdev [~plexdev@arthur.espians.com] has joined #go-nuts 16:08 -!- segy [~segfault@pdpc/supporter/active/segy] has quit [Ping timeout: 245 seconds] 16:15 -!- segy [~segfault@pdpc/supporter/active/segy] has joined #go-nuts 16:22 -!- weatherkid [~name@unaffiliated/weatherkid] has quit [Read error: Connection reset by peer] 16:23 < surma> Is there an URL decoder somewhere in the lib already? 16:23 < Soultaker> http://golang.org/pkg/http/#URL.ParseURL 16:23 < Soultaker> (maybe that should be in http, but ok) 16:25 < surma> Does that one also do the %20 => " " replacements? 16:25 < surma> actually, that's what I'm looking for 16:25 < surma> I just realized that my question is totally wrong ^^ 16:25 < surma> but that's right there too, thanks 16:25 < Soultaker> there are also URLEscape/URLUnescape functions if you need those :) 16:26 -!- carter_ [~carter@cpe-69-201-181-224.nyc.res.rr.com] has joined #go-nuts 16:28 -!- carter_ [~carter@cpe-69-201-181-224.nyc.res.rr.com] has quit [Remote host closed the connection] 16:29 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has joined #go-nuts 16:32 -!- General13372 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined #go-nuts 16:37 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has quit [Ping timeout: 276 seconds] 16:40 -!- b00m_chef__ [~watr@216-21-143-134.ip.van.radiant.net] has joined #go-nuts 16:41 -!- carter_ [~carter@cpe-69-201-181-224.nyc.res.rr.com] has joined #go-nuts 16:42 -!- carter_ [~carter@cpe-69-201-181-224.nyc.res.rr.com] has quit [Client Quit] 16:42 -!- carter_ [~carter@cpe-69-201-181-224.nyc.res.rr.com] has joined #go-nuts 16:42 -!- carter_ [~carter@cpe-69-201-181-224.nyc.res.rr.com] has quit [Client Quit] 16:43 < mpl> question about the template language: if one of the fields of my data structure is an array, and I only want to print one of the values of the array (not repeat over all the values), how could I do? 16:44 < mpl> tried stuff like @[0] but no luck. 16:45 -!- abiosoft [~abiosoft@41.155.88.100] has joined #go-nuts 16:46 -!- KinOfCain [~KinOfCain@rrcs-64-183-61-2.west.biz.rr.com] has quit [Remote host closed the connection] 16:55 -!- pfroehlich [~chatzilla@c-98-204-215-206.hsd1.md.comcast.net] has quit [Quit: ChatZilla 0.9.86 [Firefox 3.6.3/20100401074458]] 16:56 -!- awidegreen [~quassel@62.176.237.78] has quit [Remote host closed the connection] 17:02 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has quit [Quit: keithpoole] 17:04 -!- babusri [~E50138@122.172.231.114] has joined #go-nuts 17:04 -!- awidegreen [~quassel@62.176.237.78] has joined #go-nuts 17:06 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts 17:10 -!- xenor [~xenor-fre@unaffiliated/xenor] has joined #go-nuts 17:10 -!- xenor [~xenor-fre@unaffiliated/xenor] has left #go-nuts ["Leaving."] 17:17 -!- sahid [~sahid@lev92-4-88-164-132-26.fbx.proxad.net] has quit [Quit: Ex-Chat] 17:23 -!- alehorst [~alehorst@201.22.31.2.dynamic.adsl.gvt.net.br] has quit [Ping timeout: 248 seconds] 17:25 -!- rv2733 [~rv2733@c-98-242-168-49.hsd1.fl.comcast.net] has joined #go-nuts 17:25 -!- alehorst [~alehorst@201.22.31.2.dynamic.adsl.gvt.net.br] has joined #go-nuts 17:26 -!- abiosoft [~abiosoft@41.155.88.100] has left #go-nuts [] 17:30 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has joined #go-nuts 17:32 -!- b00m_chef__ [~watr@216-21-143-134.ip.van.radiant.net] has quit [Remote host closed the connection] 17:32 -!- b00m_chef__ [~watr@216-21-143-134.ip.van.radiant.net] has joined #go-nuts 17:34 -!- rlab [~Miranda@146-43-93-178.pool.ukrtel.net] has joined #go-nuts 17:37 -!- boscop [~boscop@g229209241.adsl.alicedsl.de] has joined #go-nuts 17:54 -!- qIIp [~qIIp@134.29.57.71] has joined #go-nuts 17:54 -!- visof [~visof@unaffiliated/visof] has quit [Ping timeout: 265 seconds] 17:55 < plexdev> http://is.gd/cUrud by [Rob Pike] in go/doc/ -- Effective Go: panic and recover 17:57 -!- rv2733 [~rv2733@c-98-242-168-49.hsd1.fl.comcast.net] has quit [Quit: Leaving] 17:58 -!- DASPRiD [~dasprid@tremulous/developer/DASPRiD] has left #go-nuts ["Ex-Chat"] 18:02 -!- __20h__ [~some_one@r-36.net] has joined #go-nuts 18:10 -!- kingfishr [~kingfishr@c-24-130-147-77.hsd1.ca.comcast.net] has quit [Ping timeout: 264 seconds] 18:13 -!- gnuvince_ [~vince@72.0.215.102] has quit [Quit: What the fruit is goin' on here!?] 18:13 -!- kingfishr [~kingfishr@c-24-130-147-77.hsd1.ca.comcast.net] has joined #go-nuts 18:18 -!- path[l] [~path@59.162.86.164] has quit [Quit: path[l]] 18:22 -!- ender2070 [~ender2070@bas5-hamilton14-1279278974.dsl.bell.ca] has quit [Remote host closed the connection] 18:22 -!- ender2070 [~ender2070@bas5-hamilton14-1279278974.dsl.bell.ca] has joined #go-nuts 18:23 < scoeri> apparently go is not using all the cores of my laptop 18:24 < scoeri> could it be that I did something wrong during installation? 18:24 < napsy> I think the runtime is limited with one thread by default 18:24 < scoeri> ah 18:24 < scoeri> can I change that? 18:25 < napsy> you have to set an environmental variable 18:26 < jessta> scoeri: you can set runtime.GOMAXPROCS to the number of threads you want 18:26 -!- Ideal [~Ideal@ideal-1-pt.tunnel.tserv6.fra1.ipv6.he.net] has joined #go-nuts 18:27 < scoeri> ok, thx 18:27 -!- wayneeseguin [~wayneeseg@rrcs-72-45-208-165.nys.biz.rr.com] has quit [Read error: Connection reset by peer] 18:36 -!- Ideal [~Ideal@ideal-1-pt.tunnel.tserv6.fra1.ipv6.he.net] has quit [Quit: Ideal] 18:37 -!- qIIp [~qIIp@134.29.57.71] has quit [Quit: leaving] 18:38 -!- Xera^ [~brit@87-194-208-246.bethere.co.uk] has quit [Read error: Connection reset by peer] 18:41 -!- Xera^ [~brit@87-194-208-246.bethere.co.uk] has joined #go-nuts 18:45 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has joined #go-nuts 18:52 -!- cmarcelo [~cmarcelo@enlightenment/developer/cmarcelo] has quit [Remote host closed the connection] 18:58 -!- b00m_chef__ [~watr@216-21-143-134.ip.van.radiant.net] has quit [Ping timeout: 240 seconds] 18:59 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts 18:59 < nsf> http://github.com/nsf/gotris <- I've just started this small project :) tetris written in Go, semi-playable right now, but requires a bit more logic and GUI, as well as few cosmetic changes 19:00 < nsf> I think I'll finish it tomorrow :) 19:01 -!- cmarcelo [~cmarcelo@200.184.118.130] has joined #go-nuts 19:01 -!- cmarcelo [~cmarcelo@200.184.118.130] has quit [Changing host] 19:01 -!- cmarcelo [~cmarcelo@enlightenment/developer/cmarcelo] has joined #go-nuts 19:02 -!- mbarkhau [~koloss@dslb-084-059-163-201.pools.arcor-ip.net] has quit [Quit: Leaving.] 19:02 < nsf> this is actually my first experience writing something in Go, and I should say it's very smooth.. a good tool certainly 19:02 -!- mbarkhau [~koloss@dslb-084-059-163-201.pools.arcor-ip.net] has joined #go-nuts 19:03 < Ginto8> Go has a lot of advantages for game programming 19:03 < Ginto8> at least that's my opinion 19:03 < nsf> yep 19:03 < Ginto8> a lot of games can benefit from the concurrent/parallel programming offered by Go 19:03 < nsf> and the most important thing it's very fast and the grammar is very clean 19:04 < nsf> even though we don't have things like templates here, but it's easy to build generators and different helpers for it 19:04 < nsf> I mean fast in a sense of compilation speed 19:04 < nsf> it's _VERY_ fast, and I love that fact :D 19:07 < napsy> it would be better if the generated code would be faster 19:08 < skelterjohn> I wish the graphics interfaces were a bit more accessible 19:08 < napsy> oh crap what a statement 19:08 < nsf> well, there are few problems 19:08 < nsf> I've tested simple vector math (like adding, multiplying 3d vectors) 19:08 < nsf> and it's somewhat like unoptimized version of clang output 19:08 < nsf> :) 19:08 < skelterjohn> use gomatrix :) 19:08 < nsf> also things like slow cgo calls are bad too 19:08 < skelterjohn> of course, that probably won't be any faster 19:09 < skelterjohn> but it would make me feel better 19:09 < nsf> skelterjohn: :) 19:09 -!- alehorst [~alehorst@201.22.31.2.dynamic.adsl.gvt.net.br] has quit [Remote host closed the connection] 19:09 < skelterjohn> i don't know what clang output is 19:09 < nsf> I mean the binary generated by clang++ using simple C++ math library 19:09 < nsf> and its speed :) 19:10 < nsf> with -O0 its performance is very close to Go 19:10 < nsf> with -O3 it's somewhat 2-4 times faster 19:10 < Ginto8> well go is getting faster 19:10 < Ginto8> slowly 19:11 < Ginto8> but it is 19:11 < nsf> yep, it's very young langauge after all 19:11 < Ginto8> very young, but even at this point it's quite complete 19:11 < Ginto8> just look at the STL 19:11 < Ginto8> well 19:11 < napsy> are there any projects creating a go compiler for llvm? 19:11 < Ginto8> not stl 19:11 < skelterjohn> *cough* generics 19:11 < boscop> has anyone benchmarked Go vs D execution speed? it would be interesting since both languages are garbage-collected systems languages 19:11 < nsf> no, I don't even want generics a lot 19:11 < napsy> ls 19:12 < nsf> what I miss more is features for static data generation 19:12 < nsf> like linked structures at compile time 19:12 < nsf> C can do that :) 19:12 < skelterjohn> i want generics, so i can have float64 matrices and complex64 matrices without rewriting code 19:12 < nsf> I'm not sure why I need this though 19:12 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has joined #go-nuts 19:12 < napsy> skelterjohn: why not use interfaces ? 19:12 < nsf> skelterjohn: make a code generator :) 19:12 < Ginto8> interfaces are quite useful for that sorta situation 19:13 < skelterjohn> because then it would be slower - a matrix library needs to be fast 19:13 < Ginto8> hmm good poing 19:13 < Ginto8> point* 19:13 < skelterjohn> when people do LA, they do a lot of it 19:13 < skelterjohn> my motivation to create gomatrix was so i could do some machine learning stuff in go 19:13 < skelterjohn> and speed is an important issue 19:14 < skelterjohn> also, unboxing data is annoying code to write, anyway 19:14 < skelterjohn> and when all the information is known at compile time, it seems like wasted effort 19:14 < Soultaker> if speed is important I'm don't think Go is the right choice at the moment. 19:14 < Soultaker> -'m 19:14 < nsf> it depends.. 19:15 < skelterjohn> sure, but if you're going to use go, might as well have it as fast as it can be 19:15 < Soultaker> reports vary, but expect Go code to be around 3 times slower than comparable C code. 19:15 < nsf> if you need really maximum speed of course you should use something like C with SSE intrinsics 19:15 < skelterjohn> but Soultaker, I consider that a compiler problem rather than a language problem 19:15 -!- babusri [~E50138@122.172.231.114] has quit [Ping timeout: 265 seconds] 19:15 < skelterjohn> the generics thing is a language problem 19:15 < nsf> I think generics is an editor problem :) 19:16 < Soultaker> that's true. and I'm sure the compiler will improve (besides, it's certainly not bad at the moment) 19:16 < nsf> I mean all they do is just generate more code 19:16 < skelterjohn> i don't think that you should depend on a particular ide to write your code 19:16 < nsf> editor can do that 19:16 < skelterjohn> i think that's one of the big problems with java 19:16 < Soultaker> but if you're interested in speed *now* then Go isn't the right tool, is what I'm saying. 19:16 < nsf> of course you shouldn't 19:16 < skelterjohn> Soultaker: sure 19:16 < nsf> but I mean you can make code generator as a separate tool 19:16 < nsf> why not 19:17 < jessta> nsf: http://github.com/droundy/gotgo 19:17 -!- Ina [~ina@5ED73781.cable.ziggo.nl] has joined #go-nuts 19:17 < skelterjohn> just feels silly to publish two identical versions of gomatrix 19:17 < nsf> well, yep 19:17 < nsf> I mean something like that 19:17 < skelterjohn> with the word float64 swapped for complex64 19:17 < skelterjohn> if i, personally, had a reason to need both types of matrix, i guess i'd do it 19:18 < skelterjohn> but i don't. i only want complex for completeness 19:18 < skelterjohn> i actually don't know of any application for complex matrices, though i'm sure they exist 19:18 < nsf> jessta: very interesting link, thanks :) 19:18 < skelterjohn> airplane engineers or something 19:19 < nsf> skelterjohn: but they use fortran probably :) 19:19 < nsf> or C++ 19:19 < skelterjohn> only because go doesn't have complex matrices, i'm sure 19:20 < skelterjohn> actually that crowd uses matlab mostly 19:20 < skelterjohn> that's the engineer's tool, these days 19:20 < nsf> no, because overall Go isn't mature enough yet 19:20 < skelterjohn> nsf: i was kidding 19:20 < nsf> to make people's lives depend on it :) 19:20 < nsf> hehe 19:20 < skelterjohn> oh for actual production systems? i have no idea 19:20 < skelterjohn> well, i have some idea 19:20 < skelterjohn> a friend of mine used to write airplane software, and it was in C 19:20 < skelterjohn> he said it was a high stress job 19:21 < nsf> of course 19:21 < skelterjohn> some of his company's software was on the plane that crashed with RFK in it 19:21 < Soultaker> gotgo looks very promising. 19:21 < skelterjohn> and the FBI or someone came all over the place 19:21 < skelterjohn> uh...any misreading of that last sentence was unintentional 19:21 < nsf> it's the same thing as writing software for medical x-ray machines 19:21 < nsf> :) 19:22 < nsf> few mistakes and there are dead people 19:22 -!- alehorst [~alehorst@201.22.31.2.dynamic.adsl.gvt.net.br] has joined #go-nuts 19:22 < skelterjohn> nsf - what platform do you use for your go/graphics stuff? 19:23 < Ginto8> I use SDL/OGL via cgo 19:23 < nsf> what you mean by platform? x86, archlinux 19:23 < Ginto8> because the go bindings are shit 19:23 < skelterjohn> that is what i meant, yes 19:23 < nsf> opengl + sdl, yes 19:23 < skelterjohn> i tried do get some go-sdl/go-opengl stuff to build, but that didn't work at all, on os x 19:23 < skelterjohn> that was a while ago, though 19:23 < nsf> yep, there are problems on OS X 19:23 < nsf> apparently it's developed on linux 19:23 < Ginto8> like I said the go bindings for SDL/OGL are shit 19:23 < Ginto8> just use cgo 19:24 < nsf> Ginto8: no, they are just not yet ready for massive use 19:24 < skelterjohn> i like to avoid interfacing between languages 19:24 < skelterjohn> i prefer to let other people do that for me 19:24 < Ginto8> nsf: half of the features I expected from a half decent port/binding weren't there 19:24 < nsf> for example my tetris depends on 'master' branch of Go-SDL 19:24 < nsf> because Go-SDL 'release' branch doesn't have GL_SetAttribute 19:24 < nsf> bindings 19:25 < Ginto8> I find it simpler to just use CGO 19:25 < skelterjohn> so i hear 19:25 < nsf> well I can use cgo too of course 19:25 < nsf> but for tetris Go-SDL + Go-OpenGL works well 19:26 < nsf> also I will add some GUI tomorrow it will contain Cgo library for loading png images 19:26 < nsf> because image.Image interface sucks 19:27 < nsf> and image.png returns images in a form of that interface only :( 19:27 < nsf> image/png* 19:28 < nsf> therefore it sucks too, even though it is implemented in Go completely :) 19:28 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has quit [Quit: keithpoole] 19:29 < jessta> nsf: what are you trying to do that image.Image doesn't do? 19:29 < nsf> get a []byte with pixels in it 19:29 < mpl> nsf: will that cgo png lib be capable of resizing pngs? if yes, I'm interested :) 19:29 < nsf> nope 19:30 < nsf> it won't be a generic image loading solution 19:30 < nsf> it will just load images that I need for tetris 19:30 < mpl> oh ok. 19:30 < Ginto8> I use SDL_Image for image loading 19:31 < nsf> jessta: of course I can iterate over every pixel and build a []byte, but it's not the way it should be 19:31 < Ginto8> since I'm already using SDL, I figured I might as well load with SDL_Image, use SDL for padding/converting image, then pass it to OGL 19:32 < nsf> well yes, I probably can use SDL_Image too, but not this time for sure 19:32 < Ginto8> what are you doing that you can't use SDL_image for? 19:32 < nsf> I already have a loader and a font format and a font generator :) 19:32 < nsf> I probably can use it as I said 19:32 < nsf> but just not that time :) 19:33 -!- rlab [~Miranda@146-43-93-178.pool.ukrtel.net] has quit [Read error: No route to host] 19:34 < nsf> ok 19:34 -!- rlab [~Miranda@146-43-93-178.pool.ukrtel.net] has joined #go-nuts 19:34 < nsf> for example SDL_Image's simple function takes filename as an argument 19:34 < nsf> I need to read an image from the center of the file (custom font format) 19:34 < nsf> therefore I need to use RW_Ops 19:34 < Ginto8> oh 19:34 < Ginto8> interesting 19:34 < nsf> and I'm not sure how it will work with Go 19:35 < Ginto8> hmmm 19:35 < Ginto8> would it be possible to set it up so that it's like a text file that references an image file? 19:35 < nsf> but in my simple lib I just have a simple function: func LoadTexture_PNG_ARGB32(data []byte) *Texture 19:35 < nsf> Ginto8: It is possible of course 19:35 < Ginto8> because combining the two must make it a bitch to change the font 19:35 < nsf> nope 19:36 < nsf> the font format is from my C++ engine 19:36 < nsf> it has all the tools 19:36 < nsf> for generating fonts and compiling them, etc. 19:37 < Ginto8> hmmm ok 19:38 < nsf> I'll upload all those tools tomorrow to the gotris repo, so if you're interested you can check it out later 19:38 < Ginto8> ok I might 19:39 < Ginto8> btw are you interested in general game dev? 19:39 < skelterjohn> <- is 19:39 < nsf> sort of, but I'm not sure really :) 19:39 < Ginto8> b/c if so there's a site you might wanna check out 19:39 < nsf> I haven't done any serious game after 6-8 years of programming 19:39 < Ginto8> http://www.elysianshadows.com/ 19:39 < nsf> but I did 3 tetrises (including this one) :D 19:39 < nsf> one of them even has networking thing :) 19:39 < Ginto8> it's a site made by a group of game devs in their early 20s 19:40 < Ginto8> they're working on a cross-platform rpg 19:40 < Ginto8> and their forum is a really good programming/game dev community 19:40 < nsf> I see :) 19:40 < Ginto8> check it out =) 19:40 < nsf> I will 19:41 < Ginto8> they've also got a bunch of awesome tutorials for how to get really started in game dev if you're interested on getting back into 19:41 < Ginto8> into it* 19:41 < Ginto8> =P 19:41 < nsf> you see with gamedev there is one simple problem 19:41 < nsf> art is dominating 19:41 < nsf> and if you want to make a decent game 19:41 < nsf> you'll need an artist 19:41 < skelterjohn> yeah - it's tricky 19:42 < skelterjohn> artists are so flakey, too 19:42 < Ina> nsf, make a roguelike? 19:42 < skelterjohn> visual appeal is an important part of many games 19:42 < nsf> Ina: it is possible, but you know.. it's just one type of games :) and ugly one also 19:42 < Ginto8> nsf: placeholder art is always appreciated on that forum 19:42 < Ina> Or another text based game, like a MU*? 19:42 < skelterjohn> if you ahve a vision that you can't complete on your own, it's tough 19:42 < nsf> i've played dwarf fortress :) 19:42 < Ginto8> they appreciate the engine for its programming awesomeness usually 19:42 < nsf> no more, thanks :D 19:43 < Ina> Or Interactive Fiction? 19:43 < nsf> ok, that's the problem 19:43 < Ginto8> and there are tons of artists on there that would probly be willing to lend you a hand 19:43 < nsf> I want make a game with awesome art 19:43 < nsf> but I'm a bad artist :) 19:43 < Ginto8> have you seen moosader's art? 19:43 < nsf> that's why I write simple programs :D 19:43 < Ginto8> she makes tons of public domain art 19:43 < Ginto8> http://www.moosader.com/ 19:44 < nsf> http://code.google.com/p/bmpanel2/ 19:44 < nsf> like this one :D 19:44 < nsf> Ginto8: I'll check that out 19:44 < nsf> also there is a game called Ryzom 19:44 < nsf> they have recently published their art under CC license too 19:44 < nsf> although it's in .max format currently 19:44 < nsf> I hope they will convert it to something non-proprietary 19:45 < Ginto8> well you may be able to use a loader to convert it 19:45 < Ginto8> the loader itself may not be COMPLETELY legal 19:45 * Ina kinda got recruited into a game project that had an artist already, and just needed someone with software engineering experience. :) 19:45 < Ginto8> but it shouldn't be too much of an issue 19:46 < Ginto8> Ina, do they appreciate your input as an experienced programmer? 19:46 < cthom> nsf: coming in a bit late, but you can get a []byte from an image.Image using png.Encode 19:46 < nsf> cthom: It will be encoded in png format, why do I need that? 19:46 < nsf> :) 19:47 < Ginto8> because there are tons of game ideas out there where people are like IMMA MAKIN A WICKED MMO AND WE'VE GOT AWESOME CONCEPTS AND ALL WE NEED ARE LIKE 2 PROGRAMMERS 19:47 < cthom> o you mean just the pixel values :P 19:47 < nsf> yep 19:47 < Ginto8> artists are sometimes clueless 19:47 < nsf> I need them to be able to upload to opengl texture 19:47 < Ginto8> nsf: do you need image padding? 19:47 < Ina> Ginto8, yeah, they do. They know that making this game will be mostly on my terms. 19:47 < Ina> Nothing passes without my approval. 19:47 < nsf> I think opengl api knows about padding 19:48 < nsf> for overall good image API check out the QImage from Qt 19:48 < nsf> it has things like bits for accessing array of pixels 19:48 < nsf> and scanLine for individual lines 19:48 < nsf> very helpful 19:48 < Ginto8> Ina: that's good to hear. I've seen quite a few that don't realize that you can't get anything done that's beyond a programmer's capabilities 19:50 < skelterjohn> at the same time, it's important to keep the vision for a project with a single person 19:50 < skelterjohn> programmers have a tendency to want game mechanics to work a certain way because the code is nicer 19:50 < skelterjohn> i have been guilty of this 19:50 < skelterjohn> that doesn't mean it's more fun, though 19:50 -!- thiagon [~thiagon@150.164.2.20] has joined #go-nuts 19:50 < nsf> and everyone else want to customize everything :D 19:50 < skelterjohn> someone who isn't deep in the code is usually better for assessing that 19:51 < Ginto8> yeah 19:51 < Ina> skelterjohn, nice code is good, but fun games are better. 19:51 < nsf> I'd say nice art is good, but fun games are better 19:51 < nsf> :D 19:51 < skelterjohn> right - i'm saying what is fun for the programmer writing the code isn't necessarily for the random player 19:51 < Ginto8> so you need artists/concept people and programmers that mutually understand each other's capabilities/points of view 19:51 < Ginto8> which is why teams generally suck 19:52 < skelterjohn> eh, i think it's more important that you have a project leader who does those things, and can be the interface between them 19:52 < Ginto8> and I'm just saying that as a general case 19:52 < skelterjohn> very hard to have everyone understand everybody 19:52 < skelterjohn> n^2 vs n, etc 19:52 < nsf> teams suck because communication between people sucks 19:52 < nsf> :) 19:52 < Ginto8> nsf, exactly 19:53 < nsf> http://www.secretgeek.net/program_communicate_4reasons.asp 19:53 < nsf> nice article about that 19:53 < Ina> The artist isn't the lead designer, and the lead designer, while not a software engineer, knows that he can't rely on getting anything done that I can't make. 19:57 -!- gnuvince [~vince@70.35.165.132] has joined #go-nuts 19:59 < boscop> you can always make your game's graphics minimalistic or surreal if you are not a good artist 19:59 < nsf> yes, you see maybe a graphics isn't a problem at all and I'm just looking for a reason not making games 19:59 < nsf> I don't know.. really :) 20:00 < boscop> maybe lack of original ideas :P 20:00 < nsf> maybe 20:00 < boscop> the feeling that everything has been done already... 20:00 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has quit [Read error: Connection reset by peer] 20:01 < nsf> I just don't know :) 20:01 < skelterjohn> i had a fun graduate seminar on game design last semester 20:01 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has joined #go-nuts 20:01 < skelterjohn> for the first 5 weeks of class, we had to make a game prototype every week 20:01 < skelterjohn> and demonstrate it to everyone else 20:01 < skelterjohn> (12ish students total) 20:01 < skelterjohn> and then we formed groups to finish the best prototypes 20:01 < skelterjohn> it was a lot of fun - i think prototyping is a really important thing 20:01 < nsf> how many tower defense games were there? :) 20:02 < nsf> :) 20:02 < skelterjohn> zero 20:02 < Ginto8> what class is this for 20:02 < nsf> hehe 20:02 < Ginto8> ? 20:02 < skelterjohn> it was a graduate seminar in computer science 20:02 < skelterjohn> not sure what answer i can give other than that 20:02 < skelterjohn> 3 credits? 20:02 -!- laser [~xjih78@82.137.72.32] has quit [Ping timeout: 265 seconds] 20:02 < Ginto8> hmm nice 20:02 < skelterjohn> the prototypes all had to be original 20:02 < skelterjohn> something that had been done before was considered a failure 20:03 < skelterjohn> no polish required, just a way to communicate a game concept and to see if it could be fun 20:03 < skelterjohn> that was a very good experience 20:05 < Ina> Yeah, some indie game devs produce a lot of prototypes... most of which never got worked into full games. 20:06 -!- adu [~ajr@pool-71-191-173-125.washdc.fios.verizon.net] has joined #go-nuts 20:06 < skelterjohn> cause most of them suck. but the idea is to not spend a year working on something that turns out to suck :) 20:08 < Ina> skelterjohn, most of the cool ones sadly never get worked into full games either. 20:08 < skelterjohn> there are many obstacles to success, only one of which is a crappy concept 20:09 -!- b00m_chef__ [~watr@216-21-143-134.ip.van.radiant.net] has joined #go-nuts 20:09 -!- path[l] [UPP@120.138.102.50] has joined #go-nuts 20:15 -!- adu [~ajr@pool-71-191-173-125.washdc.fios.verizon.net] has quit [Quit: adu] 20:19 < nsf> http://codepad.org/pW7OwjB9 <- will there be an array copy when calling that function? 20:19 < nsf> with fixed-size array as an agrument 20:19 < nsf> argument* 20:20 < Ginto8> yes I believe so 20:20 < nsf> I mean it's an interface 20:20 < nsf> and an interface is a pointer value sort of 20:20 < Ginto8> yeah 20:20 < Ginto8> not really 20:20 < nsf> hm.. 20:20 < Ginto8> it can be 20:21 < Ginto8> but with a fixed-size array it'll have a copy 20:21 < Ginto8> you might want a slice or an array pointer 20:21 < skelterjohn> not if the param is ain interface{} 20:21 < skelterjohn> actually 20:21 < Ginto8> skelterjohn, are you sure? 20:21 < skelterjohn> yea i think Ginto8 is right 20:21 < skelterjohn> hum. 20:21 < Ginto8> oh ok 20:21 < nsf> well I think converting to an interface{} is a special case 20:21 < Ginto8> nope 20:21 < skelterjohn> well when you cast something to an interface{}, it lifts it to a pointer if it isn't already one, yes? 20:22 < nsf> :D 20:22 < Ginto8> interface{} is treated like any other interface 20:22 < skelterjohn> and now you have a pointer to a fixed sized array, which might not copy 20:22 < skelterjohn> since it's on the heap now, instead of the stack 20:22 < nsf> we need a specialist here! 20:22 < skelterjohn> paging iant ;) 20:22 < nsf> but one thing for sure yep 20:22 < nsf> it will cause heap alloc 20:22 < nsf> of the array 20:22 < nsf> which is bad 20:23 < nsf> and the function sucks therefore 20:23 < nsf> I'll just delete it :D 20:23 < skelterjohn> if you pass a slice of that array, it won't heap alloc 20:23 < skelterjohn> well 20:23 < skelterjohn> haha 20:23 < skelterjohn> i lie 20:23 < nsf> it will 20:23 < skelterjohn> that was a silly thing to say 20:23 < skelterjohn> ignore. 20:23 < nsf> :D 20:23 < Ginto8> it'll create a heap alloc? 20:23 < Ginto8> are you sure? 20:23 < nsf> yep 20:23 < skelterjohn> a slice ahs a pointer to the array 20:23 <+iant> if you assign a fixed size array to an interface{} it will be copied 20:23 < skelterjohn> and if something gets pointered, it goes on the heap 20:23 < nsf> because you're taking a pointer to the data on the stack 20:23 < nsf> iant: thanks 20:24 < nsf> both ways are bad 20:24 < Ginto8> you can't take a pointer to stack data? 20:24 < nsf> copy is bad and a heap alloc is bad :) 20:24 < nsf> Ginto8: you can 20:24 < skelterjohn> Ginto8: you can, but it's no longer stack data 20:24 < skelterjohn> the compiler sees you doing that 20:24 < nsf> but only inside of a scope of a single function 20:24 < skelterjohn> and puts it on the heap instead 20:24 < nsf> because when it escapes a function it has to be GC controlled 20:24 < nsf> because of safety 20:25 < Ginto8> so it goes I SEE WHAT YOU DID THAR and throws it in the heap like a bad kid's toys 20:25 < nsf> yep 20:25 < Ginto8> ok then 20:25 < nsf> I believe D language does the same 20:25 < Ginto8> hmm 20:25 < Ginto8> I didn't get any real code done in D 20:25 < Ginto8> I didn't like that structs couldn't have inheritance and properties just didn't seem to work 20:26 < nsf> :D let's not talk about D here 20:26 < Ginto8> ok 20:26 < Ginto8> =D 20:27 < nsf> what I meant by "D langauge does the same" is that it's a common trick in GC languages 20:27 < nsf> to do heap allocs for usual on-the-stack values in case if they are escaping function 20:28 -!- jer [~jtregunna@unaffiliated/jer] has joined #go-nuts 20:28 -!- Silentvoice [~silentvoi@c-76-111-56-192.hsd1.ga.comcast.net] has quit [Quit: Leaving] 20:29 < jer> if i've got a type struct which would be implemented as such in C: struct foo { int tag; void* data; }; where 'data' can be any other struct identified by 'tag' ... is there an easy way i can do this in go? 20:29 < nsf> you can use interface{} 20:29 < jer> oh, interface isn't just for functions? 20:29 < skelterjohn> an interface{} holds onto its type, too 20:29 * jer must have missed that sorry; all the examples i saw were using it for functions 20:29 < skelterjohn> so you can forget tag 20:29 < nsf> it's not for functions at all 20:29 < jer> skelterjohn, fantastic 20:30 < nsf> well it describes an interface in terms of functions 20:30 < Soultaker> in fact, you can forget about the whole struct ;) 20:30 < skelterjohn> if you have i of type interface{}, you can say i.(theTypeIWant) to type assert 20:30 < jer> this was a contrived example 20:30 < nsf> but it serves as a base pure virtual class kind of thing ) 20:30 < Soultaker> (also see the type switch examples) 20:30 < skelterjohn> and type switching, right 20:31 < nsf> http://golang.org/doc/go_spec.html#Type_assertions 20:31 < nsf> http://golang.org/doc/go_spec.html#Switch_statements 20:31 < nsf> spec is actually readable :) (in comparison with C++ :D) 20:32 < nsf> very readable :) 20:32 -!- cthom [~cthom@wsip-70-169-149-118.hr.hr.cox.net] has quit [Remote host closed the connection] 20:32 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has joined #go-nuts 20:32 < jer> but what if the thing data points to can vary wildly? as in # and types of field members? ... actually what i'd really like is just someone to smack me with a concise manual on using interfaces; the effective go is alright for a 30 minute intro, but leaves a lot to be desired 20:32 < jer> alright, then i'll use that 20:33 < skelterjohn> jer: i'm not sure how the variance in type affects type assertions and switches 20:33 < jer> usually skip over it for precisely that and other reasons: too many interdependencies -- one thing that really drives me bonkers is having to flip around to 85 different places in the document just to understand on concept 20:33 -!- jalmeida [~jalmeida@c934233f.virtua.com.br] has joined #go-nuts 20:34 < jer> skelterjohn, all the types are known at some point in the system, but there's very limited commonalities (all share a common header, but what comes after, could be nothing, or could be a lot of field members) 20:34 < skelterjohn> you can still detect which one by doing a type switch, and the acting accordingly 20:34 < skelterjohn> how they differ amongst each other doesn't matter 20:35 < jessta> jer: http://research.swtch.com/2009/12/go-data-structures-interfaces.html 20:35 -!- ikke [~ikkibr@unaffiliated/ikkebr] has quit [] 20:35 -!- surma [~surma@91-64-25-119-dynip.superkabel.de] has quit [Quit: Leaving.] 20:35 < jer> yeah but i'm not at that phase right yet, i need to figure out how to *DO* it first without causing the type system to shoot itself (and me) in the head first =] 20:35 < skelterjohn> if they all share a common header you might do some composition 20:35 < skelterjohn> ie 20:35 < skelterjohn> type Header struct {some header stuff} 20:35 < jer> jessta, yeah i've got the spec open now 20:35 < skelterjohn> type AType struct { Header \n some other stuff for this type} 20:35 < skelterjohn> then they'll all have the header info, along with any functionality of the header type 20:36 < jer> skelterjohn, this is where i'ma little messed up then; if i have a function Do() which takes any number of let's just say 3 types as an argument (one single argument); would i simply declare it without a type, and then swich on the type when i needed to deviate out of the header? 20:37 < skelterjohn> you can only have one version of Do(). however, its first parameter can be of type interface{} 20:37 < Ginto8> jer: in $GOROOT/docs there are 3 .pdf's that have a pretty extensive explanation on everything from interfaces to slices to channels 20:37 < Ginto8> check them out 20:37 < jer> i.e., if i needed to read a property of 2 of the 3 types, i could switch on the type of the parameter 'foo' and if it's type struct a or b then take appropriate action, or if it's type struct c, take a reasonable default -- for instance 20:38 < skelterjohn> yes. 20:39 < jer> alright, answers my nagging question.. i'll continue reading about it in the spec, thanks 20:39 < skelterjohn> or another possibility - make some methods that have your three types as receivers 20:39 < skelterjohn> func (t1 *Type1) result {examine t1 and return something} 20:39 < skelterjohn> func (t2 *Type2) result {return a default} 20:39 < jer> skelterjohn, not practical; the system is effectively a little toy language, i don't know what the types are going to be 20:40 < jer> that is, types created inside the system i only know they'll be of one given type in the system, beyond that, i don't know 20:40 < skelterjohn> func (t1 *Type1) GetProperty() result {...}, i meant 20:40 < skelterjohn> then you can have an interface that defines the GetProperty()result method 20:40 < skelterjohn> and the runtime will decide which one to call based on the type 20:40 < skelterjohn> i see. 20:41 < skelterjohn> i'm afraid i don't understand your example fully, but that's ok 20:41 < jer> yeah i'm not explaining it well, but that's alright. i'm not looking for all the answers, was just a little confused based on what i had been reading before. 20:41 < Ginto8> jer: did you look at type switches? 20:43 < jer> Ginto8, enough to know they're there, but not indepth yet; i'm reading now 20:43 < Ginto8> because those are damn useful when looking at something where a variable can be of types x,y and z and you have to figure out which you need to use it as 20:44 < jer> yeah seem like it 20:46 < Ginto8> for example if you were to rewrite the lua interpreter in Go, you could handle the entire dynamic typing system by passing around interface{}'s and using type switches 20:48 < jer> Ginto8, i've been reimplementing the io programming language in C until today; now i'm exploring creating a naive interpreter in go to see if it's a language i might want to add to my "get serious about" list =] 20:48 < jer> and if so, that project will just move to go 20:52 < Ginto8> sounds good 20:54 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has quit [Read error: Connection reset by peer] 20:55 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has joined #go-nuts 20:57 -!- jalmeida [~jalmeida@c934233f.virtua.com.br] has quit [Quit: Fui embora] 20:59 -!- thiagon [~thiagon@150.164.2.20] has quit [Quit: Leaving] 21:04 -!- ExtraSpice [~ExtraSpic@78-62-86-161.static.zebra.lt] has quit [Quit: Leaving] 21:05 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has quit [Quit: keithpoole] 21:10 -!- marsu [~marsu@93.11.242.97] has joined #go-nuts 21:19 -!- twolfe18 [~twolfe18@c-71-61-180-11.hsd1.pa.comcast.net] has joined #go-nuts 21:22 -!- bmizerany [~bmizerany@99.13.242.166] has joined #go-nuts 21:22 < nsf> I'm trying to do this in go: mask |= 1 << i 21:23 < nsf> where i is int 21:23 < nsf> why the compiler is complaining? :) 21:23 < nsf> gotris.go:154: invalid operation: 1 << i (shift count type int) 21:23 < nsf> should it be uint? 21:23 < nsf> oh.. yes :D 21:23 < nsf> nevermind 21:24 < nsf> (autohelp system in action, just write down a question and the answer might come to your head out of nowhere :D) 21:24 -!- rlab [~Miranda@146-43-93-178.pool.ukrtel.net] has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org] 21:25 -!- Fish [~Fish@bus77-2-82-244-150-190.fbx.proxad.net] has quit [Remote host closed the connection] 21:25 < Soultaker> useful that. 21:28 -!- twolfe18 [~twolfe18@c-71-61-180-11.hsd1.pa.comcast.net] has quit [Quit: twolfe18] 21:34 -!- carrus85 [~carrus85@64.0.193.15] has joined #go-nuts 21:37 -!- jlouis [jlouis@130.225.165.29] has quit [Quit: leaving] 21:38 -!- jlouis [jlouis@horus.0x90.dk] has joined #go-nuts 21:52 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has quit [Quit: skelterjohn] 21:52 -!- smw [~smw@pool-96-232-88-231.nycmny.fios.verizon.net] has joined #go-nuts 21:54 -!- rhelmer [~rhelmer@adsl-69-107-86-90.dsl.pltn13.pacbell.net] has quit [Quit: rhelmer] 21:57 -!- Shyde [~shyde@HSI-KBW-078-043-070-132.hsi4.kabel-badenwuerttemberg.de] has quit [Quit: Shyde] 21:58 -!- lux` [~lux@151.71.147.33] has joined #go-nuts 22:07 -!- smw [~smw@pool-96-232-88-231.nycmny.fios.verizon.net] has quit [Quit: Leaving] 22:11 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.2] 22:18 -!- stanleylieber [~stanleyli@68-179-130-17.bsr-c9-d1.evv.dhcp.sigecom.net] has left #go-nuts [] 22:22 -!- ikaros [~ikaros@g226197181.adsl.alicedsl.de] has quit [Quit: Leave the magic to Houdini] 22:23 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has quit [Quit: Verlassend] 22:26 -!- Project_2501 [~Marvin@82.84.97.61] has quit [Quit: E se abbasso questa leva che succ...] 22:31 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has joined #go-nuts 22:38 -!- cmarcelo [~cmarcelo@enlightenment/developer/cmarcelo] has quit [Remote host closed the connection] 22:38 -!- lux` [~lux@151.71.147.33] has quit [Remote host closed the connection] 22:44 -!- aho [~nya@f051235230.adsl.alicedsl.de] has joined #go-nuts 22:47 -!- wrtp [~rog@92.17.21.107] has quit [Quit: wrtp] 22:48 -!- carllerche [~carllerch@enginey-9.border1.sfo002.pnap.net] has joined #go-nuts 22:49 -!- b00m_chef__ [~watr@216-21-143-134.ip.van.radiant.net] has quit [Remote host closed the connection] 22:49 -!- b00m_chef__ [~watr@216-21-143-134.ip.van.radiant.net] has joined #go-nuts 22:52 -!- mbarkhau [~koloss@dslb-084-059-163-201.pools.arcor-ip.net] has quit [Quit: Leaving.] 22:53 -!- boscop [~boscop@g229209241.adsl.alicedsl.de] has quit [Ping timeout: 276 seconds] 22:55 -!- boscop [~boscop@g227121000.adsl.alicedsl.de] has joined #go-nuts 22:57 -!- boscop_ [~boscop@g230102099.adsl.alicedsl.de] has joined #go-nuts 22:58 -!- boogles_ [~highb@shell.onid.oregonstate.edu] has quit [Quit: leaving] 22:59 < plexdev> http://is.gd/cUIjg by [Russ Cox] in 2 subdirs of go/ -- complex divide: match C99 implementation 22:59 -!- boscop__ [~boscop@g230102099.adsl.alicedsl.de] has joined #go-nuts 22:59 -!- lure [~chatzilla@222.73.189.45] has joined #go-nuts 23:00 -!- boscop [~boscop@g227121000.adsl.alicedsl.de] has quit [Ping timeout: 240 seconds] 23:00 -!- boscop_ [~boscop@g230102099.adsl.alicedsl.de] has quit [Read error: Connection reset by peer] 23:00 -!- boscop__ [~boscop@g230102099.adsl.alicedsl.de] has left #go-nuts [] 23:01 -!- boscop [~boscop@g230102099.adsl.alicedsl.de] has joined #go-nuts 23:02 -!- tvw [~tv@e176004235.adsl.alicedsl.de] has quit [Remote host closed the connection] 23:08 -!- skelterjohn [~jasmuth@c-76-124-135-117.hsd1.nj.comcast.net] has joined #go-nuts 23:09 -!- keithpoole [~keithpool@cpc3-bagu8-0-0-cust84.bagu.cable.ntl.com] has quit [Quit: keithpoole] 23:13 -!- awidegreen [~quassel@62.176.237.78] has quit [Read error: Connection reset by peer] 23:18 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has quit [Quit: slashus2] 23:23 -!- Kashia [~Kashia@port-92-200-136-234.dynamic.qsc.de] has joined #go-nuts 23:25 -!- skelterjohn [~jasmuth@c-76-124-135-117.hsd1.nj.comcast.net] has quit [Quit: skelterjohn] 23:27 -!- carrus85 [~carrus85@64.0.193.15] has quit [Quit: carrus85] 23:28 -!- iant [~iant@nat/google/x-snlhsptipcuhzwwq] has quit [Read error: Operation timed out] 23:29 -!- SRabbelier [~SRabbelie@ip138-114-211-87.adsl2.static.versatel.nl] has quit [Read error: Connection reset by peer] 23:30 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts 23:38 -!- carllerche [~carllerch@enginey-9.border1.sfo002.pnap.net] has quit [Quit: carllerche] 23:45 -!- b00m_chef__ [~watr@216-21-143-134.ip.van.radiant.net] has quit [Ping timeout: 240 seconds] 23:48 -!- photron [~photron@port-92-201-100-15.dynamic.qsc.de] has quit [Ping timeout: 260 seconds] --- Log closed Sat Jun 19 00:00:12 2010