Go Language Resources Go, golang, go... NOTE: This page ceased updating in October, 2012

--- Log opened Mon Apr 25 00:00:50 2011
01:12 -!- crazy2be [~crazy2be@S01060012171a573b.cg.shawcable.net] has joined
#go-nuts
01:12 < crazy2be> is there some way to have a hybrid blocking/non-blocking
pipe read?
01:13 < crazy2be> that is, if there is nothing to read, i want it to block
until there is something to read
01:13 < crazy2be> however, as soon as there is anything to read, it should
return
01:13 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
01:13 < crazy2be> e.g.  not try and fill the []byte buffer
01:14 < crazy2be> i've emulated it with something like
http://pastie.org/1829922
01:14 < crazy2be> but that has memory leackage issues since the stack
becomes huge quickly
01:15 < crazy2be> to work around that, i added a time.Sleep() call in there
somewhere
01:15 < crazy2be> but that is a hack
01:15 < crazy2be> makes it less responsive
01:15 < crazy2be> and only works to slow the leak, it does not stop it
01:17 < crazy2be> hmm maybe using one, small GOTO will fix it
01:19 < uriel> crazy2be: if you don'tw ant to fill the buffer, give it a
smaller buffer
01:19 < edsrzf> crazy2be: Your pastie can be tweaked pretty easily to not
recurse
01:19 < edsrzf> Change the if to a for and change the p.Read to another
pipe.Read
01:20 < uriel> didn't look at you code, but if you want to return as soon as
there is any data, then you should give it a buffer of 1
01:20 < crazy2be> uriel: I could do that
01:20 < crazy2be> but i'm not allocating the buffer, so i would have to
allocate another one
01:21 < crazy2be> edsrzf: Yeah, that works, and keeps the dengos off :P
01:21 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has joined #go-nuts
01:23 -!- ajstarks [~ajstarks@pool-98-109-198-180.nwrknj.fios.verizon.net] has
joined #go-nuts
01:24 < crazy2be> there, new version :P http://pastie.org/1829922
01:25 < crazy2be> although that doesn't actually work
01:25 < crazy2be> but close
01:25 < edsrzf> I'm kind of curious about why you want something like this
01:26 < crazy2be> well
01:26 < crazy2be> i'm trying to do IPC between a useland control process and
a system deamon
01:27 < crazy2be> e.g.  foo stop blar
01:27 < crazy2be> so i made two pipe files, in order to allow for
multidirectional transport
01:27 < crazy2be> and the deamon listens on one and writes to the other
01:28 < crazy2be> and it uses the RPC package to exchange commands and
responses
01:28 < crazy2be> JSONRPC to be specific, the gob encoding wasn't working
properly
01:28 < Namegduf> I'm pretty sure what you're talking about is already how
Read() behaves.
01:28 < crazy2be> no
01:28 < Namegduf> When reading on a TCP connection it certainly isn't
waiting until its buffer is filled for me.
01:29 < Namegduf> Maybe the pipe Read() is different in a weird way
01:29 < crazy2be> if you open a file blocking (normal mode) it seems to try
to fill the buffer
01:29 < crazy2be> if you open it non-blocking, it returns an error if no
data is available
01:29 < Namegduf> Are you using bufio?
01:29 < crazy2be> which causes tons of bogus error messages
01:29 < crazy2be> can you use bufio for this?
01:30 < Namegduf> No, I was just thinking that bufio might cause this.
01:30 < crazy2be> i think that it just just treating a pipe as a normal file
01:31 < crazy2be> since this would be the desired behaviour with a normal
file
01:32 < crazy2be> anyway i'll be back later
01:32 < crazy2be> thanks for the help!
01:32 -!- gregschlom [~quassel@118.68.165.201] has joined #go-nuts
01:39 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
02:07 -!- angasule [~angasule@190.2.33.49] has quit [Remote host closed the
connection]
02:18 -!- ccallahan [~name@ip68-102-215-66.ks.ok.cox.net] has quit [Quit: get
satisfied!  • :: core-networks.de ««« (Gamers.IRC) »»» gamersirc.net ::]
02:48 -!- nsfx [~nsfx@pool-96-225-70-167.nwrknj.fios.verizon.net] has joined
#go-nuts
02:50 < nsfx> I have an interface and several struct types implementing it,
and I'm having trouble declaring a pointer to these structs as its interface type.
Example here: http://pastebin.com/tsFRFGcY Any tips?
02:53 -!- damikin11 [~damikin11@cpe-24-30-179-173.socal.res.rr.com] has quit
[Remote host closed the connection]
02:54 -!- ajstarks [~ajstarks@pool-98-109-198-180.nwrknj.fios.verizon.net] has
left #go-nuts []
02:58 < edsrzf> nsfx: Don't use pointers to interface types
02:58 < edsrzf> If you change "var instance *Interface" to "var instance
Interface" it should compile
03:00 < nsfx> edsrzf: Thanks.  I need to read more about that as I don't
quite understand it
03:02 < crazy2be> nsfx: there was a block post about it a while back
03:02 < edsrzf> nsfx: Without going into too much detail, just know that
it's almost always mistake to use a pointer to an interface.
03:02 < crazy2be> are you the same as nsf?
03:06 -!- crodjer [~rohanjain@203.110.240.205] has joined #go-nuts
03:07 < skelterjohn> i dpn
03:07 < skelterjohn> i don't think he is
03:07 < skelterjohn> nsf doesn't write go code :)
03:09 < crazy2be> nsfx:
http://research.swtch.com/2009/12/go-data-structures-interfaces.html
03:24 -!- mikespook [~mikespook@183.47.226.203] has joined #go-nuts
03:37 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has joined #go-nuts
03:40 < crazy2be> wow the deamon is much more responsive now, thanks @edsrzf
03:41 < crazy2be> although i still have to time.Sleep, it is for a much
smaller amount of time
03:41 < crazy2be> since the stack isn't exploding in my face :)
03:47 -!- gregschlom [~quassel@118.68.165.201] has quit [Read error: Connection
reset by peer]
03:48 -!- gregschlom [~quassel@118.68.165.201] has joined #go-nuts
03:49 -!- vsayer [~vivek@c-67-170-236-166.hsd1.ca.comcast.net] has quit [Read
error: No route to host]
03:51 < crazy2be> anyway night
03:52 -!- crazy2be [~crazy2be@S01060012171a573b.cg.shawcable.net] has quit [Remote
host closed the connection]
03:54 < nsfx> crazy2be: thanks
04:13 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts
04:13 -!- vsayer [~vivek@67.170.236.166] has joined #go-nuts
04:18 -!- rejb [~rejb@unaffiliated/rejb] has quit [Disconnected by services]
04:18 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
04:29 -!- gregschlom [~quassel@118.68.165.201] has quit [Ping timeout: 240
seconds]
04:37 -!- dj2 [~dj2@CPE001f5b35feb4-CM0014048e0344.cpe.net.cable.rogers.com] has
quit [Remote host closed the connection]
04:40 -!- aho [~nya@fuld-590c6c9a.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
04:42 -!- Tv [~Tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout: 260
seconds]
04:48 -!- bakkal [~hawk@41.141.53.201] has joined #go-nuts
04:55 -!- gregschlom [~quassel@118.68.165.201] has joined #go-nuts
04:56 -!- coud [~coud@81.25.16.87] has joined #go-nuts
04:56 -!- a2800276_ [~a2800276@xdsl-87-78-136-232.netcologne.de] has joined
#go-nuts
04:58 -!- a2800276 [~a2800276@xdsl-87-79-211-136.netcologne.de] has quit [Ping
timeout: 240 seconds]
04:58 -!- ezys [~ezys@c-67-161-85-212.hsd1.wa.comcast.net] has quit [Quit: WeeChat
0.3.3]
04:58 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Ping timeout: 240
seconds]
05:01 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts
05:04 -!- gregschlom [~quassel@118.68.165.201] has quit [Ping timeout: 260
seconds]
05:05 -!- pjm0616 [~user@110.9.28.45] has quit [Ping timeout: 248 seconds]
05:06 -!- soveran [~soveran@186.19.214.247] has joined #go-nuts
05:17 -!- soveran [~soveran@186.19.214.247] has quit [Remote host closed the
connection]
05:35 -!- JusticeFries [~JusticeFr@c-24-9-171-36.hsd1.co.comcast.net] has quit
[Quit: JusticeFries]
05:36 -!- JusticeFries [~JusticeFr@c-24-9-171-36.hsd1.co.comcast.net] has joined
#go-nuts
05:56 -!- coud [~coud@81.25.16.87] has quit [Read error: Connection reset by peer]
06:00 -!- photron_ [~photron@port-92-201-42-236.dynamic.qsc.de] has joined
#go-nuts
06:16 -!- gregschlom [~quassel@118.68.165.201] has joined #go-nuts
06:18 -!- JusticeFries [~JusticeFr@c-24-9-171-36.hsd1.co.comcast.net] has quit
[Quit: JusticeFries]
06:21 -!- viirya [~viirya@cml506-25.csie.ntu.edu.tw] has quit [Quit: leaving]
06:24 -!- viirya [~viirya@cml506-25.csie.ntu.edu.tw] has joined #go-nuts
06:27 -!- gregschlom [~quassel@118.68.165.201] has quit [Read error: Connection
reset by peer]
06:28 -!- gregschlom [~quassel@118.68.165.201] has joined #go-nuts
06:34 -!- boomtopper
[~boomtoppe@cpc12-nrte22-2-0-cust249.8-4.cable.virginmedia.com] has joined
#go-nuts
06:39 -!- gregschlom [~quassel@118.68.165.201] has quit [Read error: No route to
host]
06:40 -!- gregschlom [~quassel@118.68.165.201] has joined #go-nuts
06:45 -!- damikin11 [~damikin11@cpe-24-30-179-173.socal.res.rr.com] has joined
#go-nuts
06:48 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Ping timeout: 250
seconds]
07:06 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
07:06 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has joined
#go-nuts
07:07 -!- zozoR [~Morten@90.185.81.29] has joined #go-nuts
07:13 -!- gedevan [~gedevan@wn1nat26.beelinegprs.ru] has joined #go-nuts
07:18 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
07:24 -!- gregschlom [~quassel@118.68.165.201] has quit [Ping timeout: 240
seconds]
07:25 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Remote
host closed the connection]
07:29 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
07:41 -!- SecretAgent [sa@28.158.143.98.nitemare.name] has quit [Ping timeout: 246
seconds]
07:42 -!- SecretAgent [sa@28.158.143.98.nitemare.name] has joined #go-nuts
07:42 -!- ShadowIce` [~pyoro@109.193.120.162] has joined #go-nuts
07:42 -!- ShadowIce` [~pyoro@109.193.120.162] has quit [Changing host]
07:42 -!- ShadowIce` [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
07:42 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Read error:
Connection reset by peer]
07:43 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has quit [Quit:
Leaving]
07:56 -!- DerHorst [~Horst@e176110136.adsl.alicedsl.de] has joined #go-nuts
07:57 -!- crodjer [~rohanjain@203.110.240.205] has quit [Quit: Leaving]
08:03 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has joined #go-nuts
08:10 -!- arun_ [~arun@unaffiliated/sindian] has joined #go-nuts
08:21 -!- gregschlom [~quassel@118.68.165.201] has joined #go-nuts
08:25 -!- crodjer [~rohanjain@203.110.240.205] has joined #go-nuts
08:28 -!- foocraft [~dsc@86.36.49.200] has joined #go-nuts
08:29 -!- rutkowski [~adrian@078088213084.walbrzych.vectranet.pl] has joined
#go-nuts
08:30 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
joined #go-nuts
08:40 -!- wrtp [~rog@92.17.70.99] has joined #go-nuts
08:42 -!- edsrzf [~edsrzf@122-61-221-144.jetstream.xtra.co.nz] has quit [Read
error: Connection reset by peer]
08:44 -!- a2800276 [~a2800276@xdsl-87-78-136-232.netcologne.de] has quit [Quit:
a2800276]
08:46 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
quit [Quit: ChatZilla 0.9.86.1 [Firefox 4.0/20110318052756]]
08:48 -!- Scorchin [~Scorchin@host109-156-222-109.range109-156.btcentralplus.com]
has joined #go-nuts
08:54 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
08:57 -!- TheMue [~TheMue@p5DDF6D1D.dip.t-dialin.net] has joined #go-nuts
09:23 < taruti> Is there a good way to debug why a go app eats too much
memory?  (or is the gc broken on Plan 9?)
09:25 -!- foocraft [~dsc@86.36.49.200] has quit [Read error: Operation timed out]
09:25 < Namegduf> taruti: Keep cycling and see if the memory usage
stablises.
09:25 < Namegduf> It can rise *really* high before stablising.
09:26 < taruti> Namegduf: it is rising so high that the kernel is killing
the application
09:26 -!- gedevan [~gedevan@wn1nat26.beelinegprs.ru] has left #go-nuts ["Linkinus
- http://linkinus.com"]
09:26 < Namegduf> How much RAM, how heavy is normal usage expected to be?
09:26 < Namegduf> I would expect to see it maybe peak at three times its
actual requirements
09:27 < taruti> well I think it used to work, and now it is not :(
09:27 < Namegduf> Hmm, could be a problem.
09:30 < gregschlom> Hi guys, anyone there running mgo?  (mongo db package
for go).  I'm having trouble with the install
09:30 < gregschlom> I'm getting the error: server.go:55: not enough
arguments in call to net.ResolveTCPAddr
09:31 < gregschlom> I've updated my go source and ran ./all.bash to build
all
09:31 -!- mikespook [~mikespook@183.47.226.203] has quit [Read error: Connection
reset by peer]
09:32 < fhs> gregschlom: try running gofix on that file
09:38 < gregschlom> fhs: thanks for the tip.  I ran gofix server.go, it
produced no output, and rnning gomake leads to the same error
09:38 < gregschlom> but it's a good tip nevertheless, for similar situations
:)
09:40 < gregschlom> oh, it looks like an easy fix.  It's missing the
os.Error stuff (sorry, I'm new to go, I don't know the righ terms yet)
09:40 < gregschlom> But I'll probably be able to fix it myself
09:43 -!- crodjer [~rohanjain@203.110.240.205] has left #go-nuts ["Leaving"]
09:47 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
joined #go-nuts
09:54 -!- boscop_ [~boscop@f055222001.adsl.alicedsl.de] has joined #go-nuts
09:55 -!- boscop [~boscop@g229214061.adsl.alicedsl.de] has quit [Ping timeout: 250
seconds]
10:02 -!- shvntr [~shvntr@113.84.144.70] has joined #go-nuts
10:08 -!- foocraft [~dsc@86.36.49.200] has joined #go-nuts
10:10 -!- pjm0616 [~user@110.8.235.86] has joined #go-nuts
10:10 -!- tvw [~tv@e176005120.adsl.alicedsl.de] has joined #go-nuts
10:11 -!- sebastianskejoe [~sebastian@188.114.142.217] has joined #go-nuts
10:19 -!- firwen [~firwen@lns-bzn-27-82-248-17-134.adsl.proxad.net] has joined
#go-nuts
10:19 -!- conra [conra@213.195.238.238] has joined #go-nuts
10:29 -!- crodjer [~rohanjain@203.110.240.205] has joined #go-nuts
10:39 -!- vsayer [~vivek@67.170.236.166] has quit [Read error: Connection reset by
peer]
10:46 -!- genbattle [~nick@122-61-58-156.jetstream.xtra.co.nz] has joined #go-nuts
10:49 -!- vsayer [~vivek@c-67-170-236-166.hsd1.ca.comcast.net] has joined #go-nuts
10:52 -!- a2800276 [~a2800276@xdsl-87-78-136-232.netcologne.de] has joined
#go-nuts
10:52 < genbattle> does anyone know what might be causing this output, i'm
trying to build an interface between openCL and go: http://pastebin.com/M6QbUHtE
10:52 < genbattle> cgo seems to be throwing a fit on a function call which
seems perfectly valid
10:54 -!- firwen [~firwen@lns-bzn-27-82-248-17-134.adsl.proxad.net] has quit [Ping
timeout: 250 seconds]
10:54 < genbattle> at the moment i'm thinking it could be a linking problem,
but i'm not the expert on C/C++ interoperability
10:54 < genbattle> or even C programming, for that matter
10:58 -!- hopso [3e4ed8ee@gateway/web/freenode/ip.62.78.216.238] has joined
#go-nuts
11:03 -!- gregschlom_ [~quassel@118.68.165.201] has joined #go-nuts
11:06 -!- gregschlom [~quassel@118.68.165.201] has quit [Ping timeout: 260
seconds]
11:06 -!- genbattle [~nick@122-61-58-156.jetstream.xtra.co.nz] has quit [Quit:
Leaving]
11:07 -!- gregschlom_ [~quassel@118.68.165.201] has quit [Ping timeout: 260
seconds]
11:09 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
11:13 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-160-212.clienti.tiscali.it] has
joined #go-nuts
11:19 -!- sebastianskejoe [~sebastian@188.114.142.217] has quit [Quit: leaving]
11:31 -!- hopso [3e4ed8ee@gateway/web/freenode/ip.62.78.216.238] has quit [Ping
timeout: 252 seconds]
11:41 -!- Adys [~Adys@unaffiliated/adys] has quit [Ping timeout: 250 seconds]
11:44 -!- artefon [~thiago@dhcp42.usuarios.dcc.ufmg.br] has joined #go-nuts
11:46 -!- crodjer [~rohanjain@203.110.240.205] has left #go-nuts ["Leaving"]
11:49 -!- ajstarks [~ajstarks@pool-98-109-198-180.nwrknj.fios.verizon.net] has
joined #go-nuts
11:57 -!- Adys_ [~Adys@unaffiliated/adys] has joined #go-nuts
12:07 -!- zozoR [~Morten@90.185.81.29] has quit [Ping timeout: 250 seconds]
12:07 -!- ajstarks [~ajstarks@pool-98-109-198-180.nwrknj.fios.verizon.net] has
left #go-nuts []
12:17 -!- pancake [~lia@95.61.49.229] has joined #go-nuts
12:17 < pancake> gcc-go cannot find the 'main' symbol, because it's named
<packagename>.main
12:17 < pancake> how can I fix this?
12:18 -!- dario [~dario@domina.zerties.org] has quit [Ping timeout: 240 seconds]
12:19 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts
12:20 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
12:28 -!- JusticeFries [~JusticeFr@c-24-9-171-36.hsd1.co.comcast.net] has joined
#go-nuts
12:32 -!- a2800276 [~a2800276@xdsl-87-78-136-232.netcologne.de] has quit [Quit:
a2800276]
12:33 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
12:34 -!- a2800276 [~a2800276@xdsl-87-78-136-232.netcologne.de] has joined
#go-nuts
12:38 < rm445> put main in package main
12:44 -!- JusticeFries [~JusticeFr@c-24-9-171-36.hsd1.co.comcast.net] has quit
[Quit: JusticeFries]
12:49 -!- phoeton [~phoeton@p579BDBEB.dip.t-dialin.net] has joined #go-nuts
12:52 -!- a2800276 [~a2800276@xdsl-87-78-136-232.netcologne.de] has quit [Quit:
a2800276]
12:52 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined
#go-nuts
12:59 -!- pharris [~Adium@rhgw.opentext.com] has joined #go-nuts
12:59 < phoeton> Hi guys.
13:04 -!- DerHorst [~Horst@e176110136.adsl.alicedsl.de] has quit [Remote host
closed the connection]
13:07 -!- niemeyer [~niemeyer@189-10-219-9.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
13:13 -!- JusticeFries [~JusticeFr@173.sub-75-244-219.myvzw.com] has joined
#go-nuts
13:14 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
quit [Ping timeout: 250 seconds]
13:17 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts
13:21 -!- virtualsue [~chatzilla@nat/cisco/x-notgtbtkzwmodvur] has joined #go-nuts
13:29 -!- r_linux [~r_linux@189.38.220.35] has joined #go-nuts
13:35 -!- apaneske [~kristofer@c83-250-48-151.bredband.comhem.se] has joined
#go-nuts
13:38 -!- JusticeFries [~JusticeFr@173.sub-75-244-219.myvzw.com] has quit [Quit:
JusticeFries]
13:39 -!- soveran [~soveran@186.19.214.247] has joined #go-nuts
13:40 < phoeton> Are you all just lurking or is anyone in here looking for
some light conversation ;) ?
13:40 < aiju> haha
13:41 < phoeton> So, just lurking it is, then.
13:42 -!- creack [~charme_g@163.5.84.203] has quit [Read error: Operation timed
out]
13:42 < phoeton> I actually have a question concerning the time package in
the Go standard library:
13:42 < phoeton> Would the package "time" be the thing to use if all I want
to do is have a goroutine wait for x microseconds inside a loop?
13:43 < TheMue> time.Sleep()
13:44 < phoeton> So that's the way to do it, then?  Okay.
13:44 < phoeton> Thanks.
13:44 -!- rutkowski [~adrian@078088213084.walbrzych.vectranet.pl] has quit [Quit:
WeeChat 0.3.3-dev]
13:46 -!- creack [~charme_g@163.5.84.203] has joined #go-nuts
13:47 -!- shvntr [~shvntr@113.84.144.70] has quit [Quit: leaving]
13:50 -!- soveran [~soveran@186.19.214.247] has left #go-nuts []
13:51 -!- dj2 [~dj2@216.16.242.254] has joined #go-nuts
13:52 -!- alexandere [~alexander@eijg.xs4all.nl] has joined #go-nuts
14:05 < jeremy_c> I am using the all.bash pattern for compliation but when
developing if I have 1 unused variable it aborts the compliation.  How can I allow
unused variables during development?
14:06 < scyth> comment them out :)
14:07 < jeremy_c> scyth: it's part of a return value for a function I am
working on.
14:07 < scyth> lots of us would like to see "--nostrict" compile time option
14:07 < jeremy_c> scyth: I use the other return value right now.
14:07 < jeremy_c> scyth: oh, so in other words, there is no way is what you
are saying?  I thought you were being silly.
14:08 < scyth> nah
14:08 < scyth> many discussions on that one...  but still, no such feature
14:09 < scyth> at least not to my awareness
14:09 < jeremy_c> It's a good feature to have (failing on a warning) but I
also think a --nostrict should exist :-) I'm with you on that one.
14:11 < scyth> especially since GC by nature does exactly that - pick up
unused variables in runtime
14:12 < scyth> not sure I understand why they chose to avoid "-nostrict"
behavior
14:13 < scyth> though I'm not an expert in compilers :)
14:18 < rm445> jeremy_c: I think people mainly use _ a lot.  ( _ =
unused_variable or the like)
14:19 < rm445> I think the Go team philosophically don't distinguish between
warnings and errors, and bombing out on an unused variable is just the most
visible consequence of the idea.
14:21 < scyth> rm445, the thing is, while we're developing, often we produce
two scenarios
14:21 < scyth> and we don't wanna remove the one to see if other one works..
in the process
14:22 < scyth> and also changing local vars to _ to avoid compile time
failures is essentially the same as commenting the line out
14:22 < scyth> if we don't temporarily need it
14:24 < rm445> Sure.  I don't have a horse in this race, but presumably the
counter-argument is that we benefit from having code that either compiles or
doesn't.  We've all seen C and C++ codebases that compile with a million warnings
and you know no-one is ever going to sort them all out.
14:24 -!- dj2 [~dj2@216.16.242.254] has quit [Ping timeout: 260 seconds]
14:24 < scyth> yeah
14:33 < telexicon> maybe
14:34 < telexicon> if you want something unsafe, write it in C and use the C
code from your main go program?  that way, anyone looking will know theres unsafe
code because its C
14:34 < scyth> thing is, we don't want unsafe code.  It just removes some
overhead while developing, but the end product must not be compiled with
"nostrict"
14:35 < scyth> problem is, once you allow such feature, there's no way to
stop people from distributing unsafe code
14:35 < scyth> :)
14:36 < plexdev> http://is.gd/5kbmeY by [Adam Langley] in
go/src/pkg/crypto/tls/ -- crypto/tls: use time(), not Time().
14:36 < telexicon> hm, what about an IDE with an incremental compiler,
warning/error highlighting and code completion?
14:36 < scyth> maybe a huge disclaimer after compile finishes "THIS IS ALPHA
QUALITY CODE.  BE AWARE!" :)
14:36 < jeremy_c> seems that an unused variable really isn't unsafe, just
poor style/code.  And you can never stop people from using poor style/code.
14:36 -!- dj2 [~dj2@216.16.242.254] has joined #go-nuts
14:36 < aiju> warnings are usually code which could be an error
14:36 < jeremy_c> s/using/creating
14:36 < telexicon> is that what you mean by reducing development overhead,
so you can quickly compile even with extra variables you may use later
14:36 < aiju> like a mispelled variable names or something
14:37 < aiju> telexicon: IDE features are languages flaws
14:37 < aiju> -s
14:37 -!- virtualsue [~chatzilla@nat/cisco/x-notgtbtkzwmodvur] has quit [Ping
timeout: 264 seconds]
14:37 < jeremy_c> telexicon: that is what started this initial conversation
14:37 < scyth> telexicon, yes
14:38 < telexicon> aiju, i dont think tools like error highlighting and code
completion means there are language flaws
14:38 < vegai> you can stop people from using *some* poor style
14:38 < aiju> unused variables can be signs of a genuine error
14:38 < telexicon> code snippet generators on the other hand, and huge
refactoring tools, and pattern workarounds
14:39 < aiju> telexicon: i don't have any need for either
14:40 < telexicon> aiju, well, not everyone has your memorization skills
14:40 < aiju> os.Open is very hard to remember
14:41 < telexicon> thats really not what im talking about
14:41 -!- napsy [~luka@88.200.96.18] has quit [Quit: Lost terminal]
14:41 < aiju> but?
14:42 < aiju> Go is not Win32 API
14:42 < telexicon> its handy when you're working with a library you use less
often, its basically integrated inline context-sensitive reference documentation,
so you dont break your focus
14:42 < telexicon> i dont see whats so bad about that
14:43 < aiju> it's highly specific code
14:43 < aiju> i like reducing that sort of code
14:43 < jeremy_c> I don't think snippet generators are for simple keyword
expansion but larger block expansion, such as a function definition, a switch
statement, etc...
14:44 < aiju> jeremy_c: it won't kill you to type two braces
14:44 < telexicon> wait
14:44 < telexicon> i wasnt still talking about snippet generators
14:47 < telexicon> i could've been more clear, aiju you said you didnt need
either, i thought you were referring to error highlighting and code completion
14:47 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
14:47 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 252 seconds]
14:50 < aiju> telexicon: yes i were
14:51 < telexicon> well im glad we has settled that
14:54 < jeremy_c> in most cases my snippets are more than two braces,
however, you are right it will not kill me but it certainly doesn't hurt me.  I'll
take all the development speedups I can get.  ifeTAB...  complete if/else
structure while others are still typing, I'm beyond that boiler plate code.
14:54 -!- joelkronander
[~joelkrona@c-bf2fe253.617-1-64736c22.cust.bredbandsbolaget.se] has joined
#go-nuts
14:55 < skelterjohn> one of the things i like best about go is that, unlike
java or C++, I never feel the need for a code generator
14:55 < telexicon> for me, typing isnt where i spend most of my time coding
14:56 < jnwhiteh> I needed them for one thing
14:57 < jnwhiteh>
https://github.com/jnwhiteh/autohttperf/blob/master/client/parse.go
14:57 < jnwhiteh> but I could have easily done that without codegen =)
14:59 -!- joelkronander
[~joelkrona@c-bf2fe253.617-1-64736c22.cust.bredbandsbolaget.se] has quit [Quit:
joelkronander]
15:09 < jeremy_c> oh, another one (for --nostrict) is during development I
have "fmt" imported some times...  remove printf code and my program fails to
compile.  Comment out import "fmt", compile, great, code some more add a printf,
gotta uncomment.
15:09 < skelterjohn> jnwhiteh: you could have done that with much more
compact code!
15:10 < jeremy_c> I guess I should be using tdd more to remove this problem
but I'm brand new to go, printf is great.
15:10 < jnwhiteh> skelterjohn: yes =)
15:10 < skelterjohn> heh ok
15:10 < jnwhiteh> I just needed to get it done =)
15:10 -!- zapvandijk [~zapvandij@GS6172.SP.CS.CMU.EDU] has quit [Quit: Leaving]
15:17 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:49fb:3683:9ed0:b21d] has joined
#go-nuts
15:17 < apaneske> Hello, I'm looking for suggestions on speeding up a markov
chain implementation
15:17 < apaneske> This is my current implementation,
http://pastie.org/1831668
15:17 < skelterjohn> ohhh markov chains
15:17 < skelterjohn> if only i wasn't leaving in a few minutes
15:18 < apaneske> But the creation of the state map is somewhat slow
15:18 < apaneske> Rats, I should've posted it earlier then :)
15:22 < skelterjohn> what's the format of your file?
15:23 < apaneske> Just a regular text file
15:23 < skelterjohn> you must have the data stored in some format
15:23 < apaneske> I downloaded some book from project gutenberg
15:23 < skelterjohn> i don't mean encoding
15:23 < skelterjohn> is it just a list of words?
15:23 < apaneske> Yes
15:24 < apaneske> The slow part seem to be when creating the mapping in
allwords; statetab[p] = append(statetab[p], w)
15:25 < apaneske> But I'm not sure if there is a better approach to the
problem in Go
15:28 < skelterjohn> you could initialize that slice to the size you know
you'll need
15:28 < skelterjohn> err, it's amap
15:29 < skelterjohn> i don't understand what your statemap is doing
15:29 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping
timeout: 240 seconds]
15:29 < skelterjohn> will p ever be repeated?
15:29 < apaneske> Yes
15:29 < apaneske> P is a word combination
15:29 < skelterjohn> so words in your dictionary repeat?
15:29 -!- iant [~iant@216.239.45.130] has joined #go-nuts
15:30 -!- mode/#go-nuts [+v iant] by ChanServ
15:30 < apaneske> Since I'm using a regular text words will be repeated
15:30 < skelterjohn> oh it's not a dictionary - it's just a corpus
15:30 < skelterjohn> i get it
15:30 < apaneske> Correct
15:30 < skelterjohn> you're building up trigram frequencies
15:30 < skelterjohn> not sure if that's the right word
15:31 < apaneske> Word pair indexing and an array of words that appear after
that word pair
15:31 < skelterjohn> you could do a test and see the expected length of
those tables
15:31 < skelterjohn> and initialize them to that
15:32 < phoeton> Is there a special reason you are using Go for this?  I
mean it's great and all, but other languages might offer you a library
specifically equipped with optimized algorithms for exactly that purpose.
15:33 < apaneske> Just wanted to test it in Go as a learning exercise
15:33 < phoeton> Oh alright.
15:33 < phoeton> Cool.
15:34 < ww> go's probably a pretty good language for compute intensive
things like markhov processes...
15:34 < ww> i've used the HMM in python's nltk for example and it's slooow
(could maybe be sped up with some cython work)
15:34 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit
[Ping timeout: 260 seconds]
15:35 < ww> though I also found HMM brittle in the face of unknown words
(which are encountered a lot when you try to glue an NLP bot to an IRC channel)
15:35 -!- alexandere [~alexander@eijg.xs4all.nl] has quit [Quit: alexandere]
15:35 < phoeton> In that case, just as a suggestion, maybe get rid of
building from scratch (from your corpus or text file in this case) by storing the
data structure in binary format when you first build an then loading that later.
15:36 < phoeton> I've experienced Psyco doing quite a remarkable job on
nltk, btw.
15:36 < ww> phoeton: if you use gob's hooks for doing that it could be done
very neatly too
15:36 < phoeton> In terms of speed increase
15:36 < apaneske> Yes, that should probably speed it up a bit since it seem
to spend most of it's time atm
15:36 < apaneske> *it's time there
15:37 < phoeton> Still doesn't replace speeding up the compilation of the
structure itself if you need original data in most of your runs.
15:38 < ww> phoeton: i'll mention psyco to ewan klein (nltk book) he's just
down the hall from me :)
15:38 < phoeton> Also, just as an aside, it might be nice to load the file
into memory completely (if not too large) first, then have different goroutines
operate on it concurrently.  Might speed up any algorithm on multicore machines.
15:38 < skelterjohn> you could use bytes.Fields instead of strings.Fields
15:39 < skelterjohn> and not convert the whole file to a string
15:39 < ww> actually, maybe even use gommap to mmap the file and give you a
big []byte, let the os worry about what to actually keep in memory
15:39 < apaneske> Ah, had only seen the strings one :)
15:39 < phoeton> ww: Oh, if you do that, please also mention that psyco is
known to vary greatly in performance increase (2x to 100x speed) for slightly
different programs, so he might not be able to replicate my results.
15:40 -!- exch [~exch@31-151-123-254.dynamic.upc.nl] has quit [Ping timeout: 240
seconds]
15:40 < phoeton> I got under 1min.  on a piece of NLP homework code with
psyco that took nearly half an hour to compute without it.
15:40 -!- exch [~exch@31-151-123-254.dynamic.upc.nl] has joined #go-nuts
15:40 < phoeton> Quite remarkable
15:41 < ww> so ymmv, but cool!
15:41 < phoeton> more like ymwv ;)
15:42 < phoeton> Basically, if you write code that is as easy to read as
possible (but inefficient), like i did for homework purposes, psyco can optimize
quite a bit.
15:42 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
15:42 < phoeton> If you code for speed in the first place, you will
typically "only" get 2x-5x speed.
15:42 < phoeton> Average is roughly 4x, according to a bunch of benchmarks.
15:42 < skelterjohn> what does psyco do, exactly?
15:43 < phoeton> I think you can find most of those on the psyco hp
15:43 < phoeton> Psyco is a Python extension module which can greatly speed
up the execution of any Python code.
15:43 < phoeton> (taken from psyco.sf.net)
15:43 < skelterjohn> ah, not an HMM thing, then
15:43 < phoeton> so it's not a compiler
15:43 < apaneske> Thanks for the suggestions, now I have at least 3 more
things to test
15:43 < phoeton> still interprets the code.
15:44 < phoeton> apaneske: sorry for not looking at your code right now, but
I'm still trying to improve upon "exp/draw/x11"
15:44 < ww> i guess for more optimised code cython would beat it because
you're basically writing C in python syntax
15:45 < phoeton> and looking into writing something like "exp/draw/mac"
15:45 < phoeton> ww: probably, but at the same time you lose the very
qualities you are using an interpreted language for in the first place.
15:46 < skelterjohn> i would love it if exp/draw/mac started to exist
15:46 < phoeton> It's not that hard to do on the level in which draw/x11
currently works.
15:47 < phoeton> But I think I want something a little more comprehensive.
15:47 < skelterjohn> the ability to resize windows, for instance
15:47 < phoeton> Working out how exactly to do that while still keeping the
simplicity of draw's API turns out to be anything but trivial.
15:48 < phoeton> Yes, that is a good example of something I just added to
draw/x11
15:48 < phoeton> But also stuff like buffered drawing.
15:48 < phoeton> Stuff like an abstraction over os-native features.
15:49 < phoeton> Originally I also wanted to implement an os-independant
scene-graph.
15:49 < phoeton> Think I am going to go a little simpler than that in the
beginning ;)
15:50 < phoeton> In the end I want to end up with something more akin to a
native Go/Tk
15:51 < phoeton> Instead of having to use wrappers like Go-Gtk.
15:51 < phoeton> Which is nice, but if you wrap another language you
invariably end up not being very idiomatic in your api.
15:51 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has joined #go-nuts
15:52 < phoeton> What do you guys think – is this worth doing?  Would you
use it over an established, foreign-language toolkit?
15:53 < phoeton> Also, I never figured out why go-opengl isn't called GoOGL
;) It's just too good an opportunity.
15:53 < phoeton> Might have to rewrite the thing just to change the name ;)
15:56 < phoeton> hmm… Sorry for spamming the place.
15:58 < ww> a go compiler for opencl might be interesting...  i wonder if
somehow channels could be efficiently made to work on the gpu
15:59 < pancake> rm445: already done (it's the basic hello world example
(package main;import fmt;func main() ..) but gccgo says there's no main symbol..
because in the .o it's named main.main
15:59 < pancake> can I override the main symbol name in gcc?
16:00 < jeremy_c> I have a string containing Unicode characters.  I know
that a persons name starts at index position 10 and is 8 Unicode characters long.
content[10:18] does not seem to read 8 Unicode characters starting at index
position 10.  How can I accomplish this?
16:00 <+iant> when using gccgo the main symbol is in libgobegin
16:00 < pancake> oh!  i see.  gcc foo.go -lgobegin -lgo
16:00 < pancake> thanks iant :)
16:02 -!- pancake [~lia@95.61.49.229] has quit [Quit: Lost terminal]
16:02 < jeremy_c> fmt.Printf(content) shows the full content including the
persons name w/Unicode characters.  fmt.Printf(content[10:18]) shows "John ??"
16:02 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts
16:03 < phoeton> jeremy_c: could you uplode your code or a minimal example?
16:03 < phoeton> please :D
16:04 < jeremy_c> phoeton: I'll try and reduce it to a minimal example.
16:04 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Client
Quit]
16:05 < phoeton> jeremy_c: I think what content[10:18] does is give you
_bytes_ 9 to 17 from your data structure.
16:05 < phoeton> As UTF-8 does contain 2-byte-long signs, that might not be
what you want.
16:05 < phoeton> You could make it UTF-16, then you'd have uniform symbol
length.
16:06 < taruti> utf-16 is variable length
16:06 < phoeton> Oh I see I just noticed.
16:06 < phoeton> How silly of me.
16:06 < taruti> using runes is the solution
16:08 < jeremy_c> phoeton: http://pastie.org/1831863
16:08 < phoeton> Right.  Going for four bytes on every sign would just be
too uneconomical.
16:09 < plexdev> http://is.gd/qchFRY by [Robert Hencke] in 2 subdirs of go/
-- gc: allow complex types to be receiver types
16:09 < jeremy_c> Yes, I understand the problem but not sure how to get X
characters (unicode or ascii) from my string.
16:09 < plexdev> http://is.gd/n3oz3P by [Russ Cox] in 6 subdirs of go/ --
gc: fix import width bug
16:09 -!- exch [~exch@31-151-123-254.dynamic.upc.nl] has quit [Read error:
Connection reset by peer]
16:09 < taruti> jeremy_c: string([]int(mystring)[index1:index2])
16:11 < taruti> or utf8.NewString(mystring).Slice(index1, index2)
16:11 < phoeton> The second method is much better.
16:12 < jeremy_c> taruti: phoeton: thanks.  the first worked and I do like
the second better.  I'll convert right after reading from a file.
16:12 < phoeton> What this will do in your pasted example is basically the
same as name[10:24]
16:13 -!- exch [~exch@31-151-123-254.dynamic.upc.nl] has joined #go-nuts
16:15 < phoeton> http://pastie.org/1831883
16:16 -!- gmilleramilar [~gmiller@pool-74-101-133-165.nycmny.fios.verizon.net] has
quit [Ping timeout: 250 seconds]
16:21 -!- aimxhaisse [~mxs@94.23.241.199] has quit [Ping timeout: 260 seconds]
16:25 -!- rlab_ [~Miranda@91.200.158.34] has joined #go-nuts
16:26 < plexdev> http://is.gd/HgzNAy by [Russ Cox] in go/lib/codereview/ --
codereview: various fixes
16:26 < plexdev> http://is.gd/ipKkaK by [Russ Cox] in 3 subdirs of
go/src/pkg/runtime/ -- runtime: correct out of memory error
16:26 < plexdev> http://is.gd/Ps73Iy by [Fazlul Shahriar] in 2 subdirs of
go/src/cmd/ -- 8g,8l: fix "set but not used" gcc error
16:27 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 248 seconds]
16:29 < jeremy_c> phoeton: thanks!
16:30 < phoeton> jeremy_c: I just gave you some bad advice on how utf16 is
totally fixed-width ;), thank taruti!
16:33 < telexicon> utf-16 is sometimes variable length, for rare characters
it needs more bytes, it has all the disadvantages of fixed-length and
variable-length encodings
16:33 < aiju> utf-16 sucks
16:33 < aiju> phoeton: many NT programmers thought so
16:33 < taruti> and even that it does badly.
16:34 < phoeton> Yeah I'm sorry for saying that earlier; I meant 32 of
course.
16:34 < phoeton> Didn't pay attention to what I was typing again, watching
my girlfriend play Oblivion.
16:34 < phoeton> She just became the Gray Fox (YAY!) :D
16:42 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-160-129.clienti.tiscali.it] has
joined #go-nuts
16:45 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-160-212.clienti.tiscali.it] has
quit [Ping timeout: 240 seconds]
16:50 -!- aimxhaisse [~mxs@94.23.241.199] has joined #go-nuts
16:58 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Read error: Operation
timed out]
17:01 < phoeton> I want a t-shirt that says
17:01 < phoeton> defer Design()
17:01 < phoeton> go Code()
17:01 < aiju> hahahahahhaa
17:01 < aiju> Go away, I'm ARMed ;)
17:01 -!- joelkronander
[~joelkrona@c-bf2fe253.617-1-64736c22.cust.bredbandsbolaget.se] has joined
#go-nuts
17:01 < phoeton> hehe :D
17:04 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
17:05 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
17:13 -!- artefon [~thiago@dhcp42.usuarios.dcc.ufmg.br] has quit [Quit: bye]
17:13 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts
17:14 < vegai> phoeton: brilliant!
17:14 < phoeton> vegai:What is?
17:15 < vegai> the t-shirt
17:15 -!- gedevan [~gedevan@83.167.106.253] has joined #go-nuts
17:15 < phoeton> Oh yeah thanks.  Think it's better merchandize than the
t-shirt they currently have ;)
17:16 < phoeton> the "go t.shirt()" one.
17:18 < photron_> phoeton: that one is actually subtle, because depending on
the scheduler decision, Design() could be executed before Code() :)
17:19 < phoeton> Oh it works on even more layers :D
17:19 < phoeton> Thought about that for quite a while.
17:19 < phoeton> It also means you can design while you code,
17:19 < photron_> :D
17:19 < exch> sup dawg..
17:20 < phoeton> you don't have to think about the design because it's going
to come eventually anyway.
17:20 < aiju> programming motherfuckers, do you speak it?
17:20 -!- dj2 [~dj2@216.16.242.254] has quit [Remote host closed the connection]
17:21 < uriel> utf-16 worse than sucks
17:21 < phoeton> Sup dawg we head you liek procrastination, so we put a
defer statement in your programming language
17:21 < phoeton> uriel: yes it does.
17:22 < aiju> uriel: UTF-9 is the one true encoding
17:22 < phoeton> April 1st is long gone ;9
17:22 < pTonnerre> Nah, UTF-18 is even better
17:24 < phoeton> fixed-length ftw ;)
17:24 < aiju> no, ascii compatibility
17:27 -!- jbooth1 [~jay@209.249.216.2] has joined #go-nuts
17:27 < phoeton> I would love to see a 32-bit encoding that is
int-compatible from 0 to 9 and where every non-digit-glyph address is the pixel
representation of the character in a 4x8 pixel grid ;)
17:28 -!- damikin11 [~damikin11@cpe-24-30-179-173.socal.res.rr.com] has quit [Ping
timeout: 240 seconds]
17:28 < ampleyfly> why not?
17:29 < ampleyfly> granted, most of the characters would be junk
17:31 -!- dj2 [~dj2@216.16.242.254] has joined #go-nuts
17:34 < phoeton> They probably would.
17:35 < dahankzter> mgo vs gomongo, there was something on the mailing list
about these...  Are they merged?  Which one to use for a real project?
17:38 < phoeton> dahankzter: mgo looks very good, but seems to still be
going through a lot of changes.
17:40 < phoeton> Also, mgo seems to make very good use of everything that
makes Go special.
17:41 < phoeton> Hence, as the quality of Go-compilers increases, so will
the speed of programs using mgo.
17:41 < dahankzter> Ill give mgo a stab.  Thx!
17:41 < phoeton> Also:
17:41 -!- artefon [~thiago@189.59.176.154.dynamic.adsl.gvt.net.br] has joined
#go-nuts
17:41 < phoeton> Go-Mongo seems to be much smaller.
17:42 < phoeton> So if you need an easy-as-possible mongo-driver, go-mongo
might be your best bet.
17:43 < dahankzter> i see that mgo has GridFS which i will need so its
settled then i guess
17:43 < plexdev> http://is.gd/7HXzQY by [Russ Cox] in 2 subdirs of
go/src/cmd/gofix/ -- gofix: add support for reflect rename
17:43 < plexdev> http://is.gd/wLDcc5 by [Russ Cox] in go/src/pkg/reflect/ --
reflect: rename Typeof, NewValue -> TypeOf, ValueOf
17:43 < plexdev> http://is.gd/w2m8zp by [Russ Cox] in 25 subdirs of go/ --
fix tree for reflect rename
17:44 -!- apaneske [~kristofer@c83-250-48-151.bredband.comhem.se] has quit [Quit:
apaneske]
17:44 < phoeton> Yeah that seems to settle it.
17:45 -!- hopso [~hopso@a91-154-5-21.elisa-laajakaista.fi] has joined #go-nuts
17:45 < phoeton> go-mongo on the other hand looks so easy that you could
actually add features like that yourself.
17:45 < phoeton> The source for mgo looks a little more intricate.
17:45 -!- dj2_ [~dj2@216.16.242.254] has joined #go-nuts
17:48 -!- dj2 [~dj2@216.16.242.254] has quit [Ping timeout: 260 seconds]
17:50 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
joined #go-nuts
17:52 -!- Tv [~Tv@ip-66-33-206-8.dreamhost.com] has joined #go-nuts
17:53 -!- res99 [~anonymous@201.237.130.70] has joined #go-nuts
18:00 < plexdev> http://is.gd/Xlf5eK by [Russ Cox] in go/src/cmd/ld/ -- ld:
fix 6l -d on Mac, diagnose invalid use of -d
18:01 < jeremy_c> How do I clear a map?  i.e.  make it contain now
keys/values after it has been used for a bit?
18:01 < aiju> jeremy_c: make a new one
18:01 < aiju> the GC will clean it up
18:02 < jeremy_c> aiju: ok.  didn't know if that was the best way or if it
was just wasting time/resources
18:02 -!- JLarky [~jlarky@217.197.6.21] has joined #go-nuts
18:04 < JLarky> Hi. Can someone explain to me how I can Read from socket if
packet is greater that buffer?
18:04 < JLarky> read_buf := make([]byte, 128)
18:04 < JLarky> n, error := con.Read(read_buf)
18:04 < JLarky> this code reads last 128 bytes from socket, not first :(
18:06 < JLarky> hm...  it's even worst.  It reads by 128 bytes, but this
function returns last chank, so if I send 150 bytes it will return 22 bytes
18:06 < JLarky> *worse
18:10 -!- JLarky [~jlarky@217.197.6.21] has quit [Quit: Leaving.]
18:13 < skelterjohn> well you need a bit more patience
18:13 < skelterjohn> if you want to get an answer
18:14 -!- m4dh4tt3r [~Adium@c-69-181-217-82.hsd1.ca.comcast.net] has joined
#go-nuts
18:21 < dahankzter> The restrictions onmt init function makes it safe to use
state setup in it for concurrent access right?
18:21 < dahankzter> s/onmt/on/
18:21 -!- dforsyth [~dforsyth@ec2-50-18-22-230.us-west-1.compute.amazonaws.com]
has joined #go-nuts
18:22 < dahankzter> I need some effectively immutable data for reads later
18:22 -!- thiago__ [~thiago@189.59.176.154.dynamic.adsl.gvt.net.br] has joined
#go-nuts
18:22 -!- artefon [~thiago@189.59.176.154.dynamic.adsl.gvt.net.br] has quit [Read
error: Connection reset by peer]
18:22 < Tv> dahankzter: yeah as long as you don't use it from other init()s
you're safe
18:23 < Tv> dahankzter: now whether that's good practise or not, that's a
different matter ;)
18:23 -!- dj2 [~dj2@216.16.242.254] has joined #go-nuts
18:24 < dahankzter> But if the data is truly immutable it should be safe and
fast right?
18:24 -!- dj2_ [~dj2@216.16.242.254] has quit [Read error: Connection reset by
peer]
18:25 < Tv> dahankzter: yeah
18:25 < Tv> dahankzter: it's more if it'd be state, it'd be global state,
and that's often evil
18:25 < phoeton> dahankzter: I think if you were a bit more specific on what
you wish to achieve, there might even be a more idiomatic way of doing it :D
18:25 < aiju> the world is global state
18:26 < dahankzter> I want to precompile mustache templates and store them
in a map (yes i am making the assumption the templates are safe) :)
18:27 < aiju> are you programming a razor or something?
18:28 < skelterjohn> init functions are run without concurrency
18:28 < skelterjohn> so there are no thread-safety issues in that stuff
18:28 < dahankzter> no thats my view, the map access later should be safe
18:29 < dahankzter> razor?
18:30 < phoeton> Well, if you do have a fixed set of templates that are not
going to change and will be needed globally throughout the entire runtime of the
program, init would be the place to put that :D .
18:30 < phoeton> If any of these conditions do not apply, somewhere else
might be better.
18:31 < phoeton> Concurrency will not be an issue, as everything gets called
from main() and everything in init() which is not a goroutine call _will_ be done
before main even starts.
18:32 < dahankzter> i doubt it will be so big a project to motivate having
templates controlled from several places
18:32 -!- boomtopper
[~boomtoppe@cpc12-nrte22-2-0-cust249.8-4.cable.virginmedia.com] has quit [Ping
timeout: 276 seconds]
18:33 < dahankzter> but what would the alternative be apart from compiling
locally on demand?  Sending templates over channels?
18:33 < phoeton> I'd say if you want to stay modular, invent a
concurrency-safe type templateStore and use that.  Yes, channels might be used to
communicate individual mustache-templates.
18:34 -!- boomtopper
[~boomtoppe@cpc12-nrte22-2-0-cust249.8-4.cable.virginmedia.com] has joined
#go-nuts
18:34 < phoeton> What I would do is just keep templates in a TemplateStore,
and have it perform an Apply(map) function that applies the template and gives
back the result.
18:34 < dahankzter> Ok maybe a good idea to not refer to that poor map
everywhere any way
18:35 < phoeton> That way you don't need to worry about concurrency that
much.
18:35 < dahankzter> Ok, thx!  Ill see where it leads :)
18:35 < phoeton> or you send the value map through a channel and receive the
result on another channel, if computing it might take too much time, but I think
that might be unnecessary bloat.
18:41 -!- kr [~kr@c-24-5-193-165.hsd1.ca.comcast.net] has joined #go-nuts
18:48 -!- tdc [~santegoed@host217-44-215-18.range217-44.btcentralplus.com] has
joined #go-nuts
18:52 -!- kr [~kr@c-24-5-193-165.hsd1.ca.comcast.net] has quit [Remote host closed
the connection]
18:53 < skelterjohn> if you're just reading from the map, it is threadsafe
18:54 < aiju> maps aren't thread safe
18:54 < skelterjohn> there are no locking mechanisms within, so it won't
even be slower
18:54 < aiju> well, if you're reading *ONLY*
18:54 < skelterjohn> that's why i said "just reading"
18:54 < aiju> just to clarify …
18:55 < dahankzter> Yes i am well aware of the concurrency issues with maps,
my initial concern was about the init function
18:56 < skelterjohn> there is no problem
18:56 < dahankzter> Still i think i will abstract some sort of template
store struct, much nicer code.  Thx phoeton
18:56 < dahankzter> cool
18:57 < dahankzter> learning go when you are an old java mistreat is so
refreshing
18:57 < dahankzter> still threading issues are wverywhere i guess
18:58 < telexicon> go has threading issues?
18:58 < phoeton> dahankzter: If you only need the precompiled ones and
nothing more you can store template names as consts and have your TemplateStore
apply the template to your data with store.Apply(data map, template int)
18:58 < aiju> telexicon: yes
18:58 < skelterjohn> telexicon: go doesn't remove the problem - go just
makes the problem easier to address
18:58 < telexicon> well thats complete fail
18:59 < skelterjohn> go is not fairy dust
18:59 < aiju> that's quite an idiotic statement
18:59 < skelterjohn> it's a programming language
18:59 < telexicon> no it isnt
18:59 < aiju> Go is a concurrent language
18:59 < dahankzter> @phoeton how would i do that?  They need to be read
which is at least a little code
18:59 < telexicon> you should be able to contain access
18:59 < aiju> not one for parallellism
18:59 < skelterjohn> you can - that doesn't mean it's impossible to make
mistakes when writing concurrent code
18:59 < aiju> telexicon: you only have threading issues when you share data
and you're not supposed to do that
19:00 < telexicon> aiju, why is it possible?
19:00 < skelterjohn> one way to make a mistake is to write to a map from two
different goroutines
19:00 < phoeton> dahankzter: let me explain in private chat, so as not to
clutter this room :D
19:00 < telexicon> from what i understood, a big deal was made over memory
safety
19:00 < dahankzter> sure
19:00 < skelterjohn> yes, go is memory safe
19:00 < telexicon> why not the same for thread safety through language
design
19:00 < skelterjohn> because no one knows how to do that in a nice way
19:00 < aiju> telexicon: making all operations thread safe involves a lot
ofwork
19:00 < aiju> and clutters up many things
19:00 < exch> not to mention a lot of performance overhead
19:00 < aiju> and you're not supposed to share data
19:00 < skelterjohn> also it makes your code very slow when you don't need
thread safety
19:00 < aiju> period
19:01 < exch> Go allows you to shoot yourself in the foot if you are
inclined to do so.  It's a choice you can make.  If you don't want to, then simply
don't do it
19:06 -!- nictuku [~yvesj@unaffiliated/nictuku] has joined #go-nuts
19:11 -!- rlab_ [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
19:14 < jeremy_c> How do I break from the containing for loop while in a
switch?  i.e.  for { switch { case abc: break } }
19:14 < aiju> goto or labelled break
19:14 < aiju> label: for { switch { case abc: break label } }
19:14 * jeremy_c searches for labelled break
19:14 < aiju> for { switch { case abc: goto label } } label:
19:14 < jeremy_c> aiju: thanks.
19:14 < aiju> any of the two
19:14 < aiju> depending on taste ;)
19:14 < jeremy_c> nice to see goto is in go.
19:15 < TheMue> or, if for is the only thing and cleanup is needed, use
defer and just a return
19:16 < jeremy_c> TheMue: ah, I forgot about defer.  New to go, but did see
it in the docs I read.
19:20 < phoeton> Or, if cleanup is needed and for is not the only thing, use
a func() closure around the for and a defer right in the beginning of that :D
19:27 < jeremy_c> seems there are a few options here :-)
19:30 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has joined #go-nuts
19:31 -!- gedevan [~gedevan@83.167.106.253] has quit [Quit: Leaving...]
19:34 -!- damikin11 [~damikin11@cpe-24-30-179-173.socal.res.rr.com] has joined
#go-nuts
19:41 -!- keithcascio [~keithcasc@nat/google/x-vqacckyliltkiipx] has joined
#go-nuts
19:47 < nictuku> so, I have a utf-16 string.  Let's say it's one char long,
say 0x0007 (letter 'n' I think).  I have to write that into the network, keeping
the 16bit-wide bytes intact.
19:48 < nictuku> since the Writer() interface is []uint6 and not []uint16,
I'm kind of lost.
19:48 < pharris> nictuku: encoding/binary
19:48 < plexdev> http://is.gd/9bE4q0 by [Ian Lance Taylor] in
go/src/pkg/time/ -- time: Support Irix 6 location for zoneinfo files.
19:48 < nictuku> pharris, right..  the one go-nuts@ say is very slow ;-(
19:48 < nictuku> pharris, but I'll try, at least it's something
19:48 < pharris> You have to know if the other end of the network wants big
endian or little endian.
19:49 < nictuku> that I know, it's big endian.
19:49 < pharris> Well, reflection might be slow, but they're working on
that.  On the other hand, you can loop around BigEndian.PutUint16() by hand if you
need "fast".
19:51 < nictuku> very cool, thanks for the pointer
19:54 -!- telexicon [~telexicon@unaffiliated/chowmeined] has quit [Ping timeout:
252 seconds]
19:56 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Read error:
Connection reset by peer]
19:59 -!- boomtopper
[~boomtoppe@cpc12-nrte22-2-0-cust249.8-4.cable.virginmedia.com] has quit [Ping
timeout: 252 seconds]
20:01 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
20:01 -!- boomtopper
[~boomtoppe@cpc12-nrte22-2-0-cust249.8-4.cable.virginmedia.com] has joined
#go-nuts
20:07 -!- tdc [~santegoed@host217-44-215-18.range217-44.btcentralplus.com] has
quit [Quit: tdc]
20:10 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts
20:12 -!- pothos [~pothos@111-240-164-129.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:14 -!- pothos [~pothos@111-240-171-181.dynamic.hinet.net] has joined #go-nuts
20:16 -!- pothos [~pothos@111-240-171-181.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:17 -!- pothos [~pothos@111-240-171-181.dynamic.hinet.net] has joined #go-nuts
20:30 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Quit:
Leaving.]
20:31 -!- phoeton [~phoeton@p579BDBEB.dip.t-dialin.net] has left #go-nuts []
20:36 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Quit: Lost terminal]
20:36 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
20:38 -!- photron_ [~photron@port-92-201-42-236.dynamic.qsc.de] has quit [Read
error: Operation timed out]
20:40 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
quit [Ping timeout: 250 seconds]
20:55 -!- boomtopper
[~boomtoppe@cpc12-nrte22-2-0-cust249.8-4.cable.virginmedia.com] has quit [Quit:
Lost terminal]
20:57 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
joined #go-nuts
20:57 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Remote host closed
the connection]
20:58 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has joined #go-nuts
20:58 -!- MX80 [~MX80@cust151.253.117.74.dsl.g3telecom.net] has quit [Ping
timeout: 240 seconds]
21:06 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-160-129.clienti.tiscali.it] has
quit [Quit: E se abbasso questa leva che succ...]
21:06 -!- MX80 [~MX80@cust151.253.117.74.dsl.g3telecom.net] has joined #go-nuts
21:06 < plexdev> http://is.gd/BdmncL by [Russ Cox] in 13 subdirs of
go/src/pkg/ -- runtime: turn "too many EPIPE" into real SIGPIPE
21:07 -!- dj2 [~dj2@216.16.242.254] has quit [Remote host closed the connection]
21:12 -!- angasule [~angasule@190.2.33.49] has quit [Read error: Connection reset
by peer]
21:13 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts
21:15 -!- TheMue [~TheMue@p5DDF6D1D.dip.t-dialin.net] has quit [Quit: TheMue]
21:17 -!- jrabbit [~babyseal@unaffiliated/jrabbit] has joined #go-nuts
21:17 < jrabbit> what would be the advisable route to trying to build go on
a new platform?
21:18 < KirkMcDonald> A magnetic needle and a steady hand.
21:18 < jrabbit> right now I'm just getting a "wrong" $GOOS
21:18 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:49fb:3683:9ed0:b21d] has quit
[Quit: Leaving.]
21:18 < jrabbit> I mean I just want to see if it'll run out of the box which
has the least hacks?
21:18 < aiju> jrabbit: what is the platform?
21:18 < jrabbit> it ought to compile, (on Haiku a fairly posix system)
21:18 < jrabbit> haiku
21:18 < aiju> heh
21:18 < jrabbit> linux or fbsd?  :P
21:19 < aiju> Go makes use of pretty platform specific stuff
21:19 < jrabbit> Gah :\
21:19 < aiju> you should get the compiler, linker etc working
21:19 < jrabbit> well i guess the project I wanted to use dosen't have to
use go
21:20 < aiju> the runtime, os and syscall packages need to be adjusted
21:20 < aiju> not trivial, but doable
21:20 < jrabbit> Hm. I think I'll let someone who knows go try that :P
21:20 < aiju> haha
21:21 -!- ezys [~ezys@c-67-161-85-212.hsd1.wa.comcast.net] has joined #go-nuts
21:23 < plexdev> http://is.gd/l6hiDy by [Russ Cox] in 2 subdirs of go/ --
gc: explain why invalid receiver types are invalid
21:23 -!- ezys [~ezys@c-67-161-85-212.hsd1.wa.comcast.net] has quit [Client Quit]
21:24 -!- Adys_ [~Adys@unaffiliated/adys] has joined #go-nuts
21:24 -!- Adys [~Adys@unaffiliated/adys] has quit [Ping timeout: 250 seconds]
21:24 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
21:26 -!- Adys [~Adys@unaffiliated/adys] has quit [Read error: Operation timed
out]
21:29 < delinka> []whatever cannot be interchanged with *whatever (like C),
correct?
21:29 -!- r_linux [~r_linux@189.38.220.35] has quit [Quit: Lost terminal]
21:30 < aiju> yeah
21:30 < aiju> they are two very different things
21:31 < homa_rano> they can be interchanged only in one direction anyway
21:32 < homa_rano> as you can take the address of elements of slices
21:32 < delinka> "just say no" is my current stance :P
21:32 < homa_rano> although I think I've only seen people do that when
intentionally trying to avoid the allocator and the gc
21:33 -!- ezys [~ezys@c-67-161-85-212.hsd1.wa.comcast.net] has joined #go-nuts
21:35 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
21:36 -!- creack [~charme_g@163.5.84.203] has quit [Read error: Operation timed
out]
21:40 -!- creack [~charme_g@163.5.84.203] has joined #go-nuts
21:41 -!- ezys [~ezys@c-67-161-85-212.hsd1.wa.comcast.net] has quit [Quit: ezys]
21:42 -!- nutate [~rseymour@cacsag4.usc.edu] has joined #go-nuts
21:42 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Quit: leaving]
21:42 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
21:43 -!- creack [~charme_g@163.5.84.203] has quit [Read error: Operation timed
out]
21:47 -!- alexandere [~alexander@eijg.xs4all.nl] has joined #go-nuts
21:50 -!- pharris [~Adium@rhgw.opentext.com] has quit [Quit: Leaving.]
21:54 -!- kr [~Keith@204.14.152.118] has joined #go-nuts
21:54 -!- foocraft [~dsc@86.36.49.200] has quit [Ping timeout: 240 seconds]
21:56 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
quit [Ping timeout: 250 seconds]
21:57 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
22:00 -!- creack [~charme_g@163.5.84.203] has joined #go-nuts
22:01 -!- zanget [~zanget@hurf.durf.me] has quit [Ping timeout: 240 seconds]
22:05 < kamaji> Is it possible to initialise a slice with all the same
values?
22:05 < kamaji> if the value is a struct, that is
22:05 < kamaji> or do I have to loop
22:06 < aiju> you have to loop
22:06 < kamaji> okey dokes
22:06 < kamaji> thanks
22:07 -!- bakkal [~hawk@41.141.53.201] has quit [Ping timeout: 276 seconds]
22:07 -!- foocraft [~dsc@dyn-86-36-41-74.wv.qatar.cmu.edu] has joined #go-nuts
22:11 -!- JusticeFries_
[~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net] has joined #go-nuts
22:14 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Ping timeout: 250 seconds]
22:16 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
joined #go-nuts
22:18 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Quit: JusticeFries]
22:20 -!- fmoo [~Adium@66.220.144.74] has joined #go-nuts
22:20 -!- bakkal [~hawk@41.141.225.221] has joined #go-nuts
22:21 < wrtp> kamaji: unless the value is zero :-)
22:22 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
quit [Ping timeout: 250 seconds]
22:22 < nutate> are there any good articles on transitioning from MPI (or
pthreads) to Go?
22:23 < aiju> forget everything you know about threading
22:23 < aiju> learn Go
22:23 -!- waqas [~waqas@jaim.at] has joined #go-nuts
22:23 -!- wrtp [~rog@92.17.70.99] has quit [Quit: wrtp]
22:23 < nutate> fair enough
22:23 < nutate> but it would seem that some directed forgetting would be
helpful
22:25 < pTonnerre> Heh
22:27 -!- ville-_ [ville@xollo.net] has quit [Ping timeout: 260 seconds]
22:28 < jeremy_c> the name of the language doesn't make googling very easy.
22:28 < KirkMcDonald> I like how D solved that problem.
22:29 < jeremy_c> KirkMcDonald: how was that?
22:29 -!- virtualsue [~chatzilla@nat/cisco/x-dnfopvqfnliolipu] has joined #go-nuts
22:29 < KirkMcDonald> Walter asked everyone to use the phrase "D programming
language" when they talked about D.
22:29 < KirkMcDonald> And for the most part they have.
22:30 < waqas> Can someone see any obvious issues with this json
unmarshalling code: https://gist.github.com/941386 ?
22:31 -!- Stiletto [7f000001@69.195.144.4] has quit [Ping timeout: 276 seconds]
22:31 < nutate> doing something 'real' in go is a distant idea, but
something i'd still like to do
22:35 -!- Stiletto [stiletto@69.195.144.4] has joined #go-nuts
22:35 -!- virtualsue [~chatzilla@nat/cisco/x-dnfopvqfnliolipu] has quit [Quit:
ChatZilla 0.9.86.1 [Firefox 4.0/20110318052756]]
22:39 < jeremy_c> Anyone have a pointer to a good example of using Go's XML
parser?
22:39 < kamaji> jeremy_c: 0x8014A98D
22:40 < damikin11> kamaji: clever
22:40 < kamaji> i'll show myself out :P
22:40 < pTonnerre> Eww, 32-bit pointers
22:40 < jeremy_c> :-/
22:40 < kamaji> too much C64x assembly :D
22:41 < plexdev> http://is.gd/VpkQDy by [Dave Cheney] in
go/src/pkg/runtime/linux/arm/ -- runtime: fix arm build
22:41 < aiju> yeah, 16-bit is the way to go
22:41 < damikin11> C64x?  i haven't heard that term.
22:41 < kamaji> it's a TI dsp
22:42 < damikin11> ahhh
22:42 < kamaji> I don't understand their naming schemes
22:43 < damikin11> C64x searched on google also came up with "A commodore 64
with Blu-ray..."
22:43 < aiju> haha
22:43 < kamaji> yeah I saw that, I was like.......  :|
22:43 < kamaji> how does that even work :D
22:44 < damikin11> They are making a "modern" Commodore 64, with all the
modern bells and whistles
22:45 < kamaji> should've called it the Commodore 64K
22:47 -!- zanget [~zanget@205.185.124.164] has joined #go-nuts
22:49 -!- jbooth1 [~jay@209.249.216.2] has quit [Quit: Leaving.]
22:50 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
22:52 -!- Saskwach [~nathan@dhcp-0-25-9c-d3-a7-c7.cpe.townisp.com] has joined
#go-nuts
22:53 -!- Stiletto [stiletto@69.195.144.4] has quit [Ping timeout: 276 seconds]
22:54 -!- Scorchin [~Scorchin@host109-156-222-109.range109-156.btcentralplus.com]
has quit [Quit: Scorchin]
22:58 -!- damikin11 [~damikin11@cpe-24-30-179-173.socal.res.rr.com] has quit
[Quit: damikin11]
23:00 < kamaji> hm, I have a slice of a type implementing an interface, but
I can't pass it to a function taking a slice of that interface
23:02 < jeremy_c> I'm using a switch tok ...  to determine the result of
tok, parseErr := xmlParser.Token() ....  When I have a xml.StartElement, how do I
gain access to it's Name, Attr properties?  tok.Name = compile error.
23:02 -!- Stiletto [7f000001@69.195.144.4] has joined #go-nuts
23:04 < waqas> jeremy_c: t.Name.Local, t.Name.Space?
23:04 -!- damikin11 [~damikin11@cpe-24-30-179-173.socal.res.rr.com] has joined
#go-nuts
23:04 < jeremy_c> waqas: nope, adix.go:45: tok.Name undefined (type
xml.Token has no field or method Name) ...  tok.Name.Local
23:05 < waqas> Are you switching?  switch t := token.(type) { case
xml.StartElement:
23:06 < jeremy_c> waqas, hm.  no.  I have: tok := xmlParser.Token(); switch
tok.(type) { case ....  }
23:07 < waqas> xml.Token doesn't have a Name, xml.StartElement does.  That
switch gives t type xml.StartElement in that case (not token, which is type
xml.Token).
23:07 -!- Stiletto [7f000001@69.195.144.4] has quit [Ping timeout: 240 seconds]
23:08 < jeremy_c> I didn't realize switch did that.  I changed my code and
now it does work as expected.  Thanks waqas
23:09 < waqas> I quite like the way it works
23:09 < jeremy_c> I guess I don't follow why yet.
23:09 -!- tvw [~tv@e176005120.adsl.alicedsl.de] has quit [Read error: Connection
reset by peer]
23:10 < skelterjohn> having "switch x := y.(type) { ...  }" has x be of
whatever type you specify in your case statement
23:10 < KirkMcDonald> Type switches are fun.
23:11 < skelterjohn> http://pastebin.com/BrDWahYx
23:11 < skelterjohn> jeremy_c: that pastie might make it clear
23:12 < skelterjohn> oh except put that "else if" on the same line as the
closing curly brace
23:12 < jeremy_c> skelterjohn: what does y.(A) return/do?
23:13 -!- hopso [~hopso@a91-154-5-21.elisa-laajakaista.fi] has quit [Quit: hopso]
23:13 < skelterjohn> y.(A) is an attempt to turn y, which must be an
interface, into an A
23:13 < skelterjohn> it only works if the underlying type is A
23:13 < skelterjohn> otherwise it panics or puts "false" into ok, depending
on context
23:13 < skelterjohn> a type switch does the same thing
23:14 < skelterjohn> "switch x.(type)" only makes sense if x is an interface
23:14 < KirkMcDonald> A can be another interface type, can't it?
23:14 < skelterjohn> yes probably
23:14 < waqas> Sigh, I can't figure out why my json unmarshalling is
failing..  /me thinks of falling back to the interface{} approach
23:15 < jeremy_c> skelterjohn: I think I get it, I'm going to play with it a
bit to see if I actually do.
23:16 < skelterjohn> cool
23:17 -!- napsy [~luka@88.200.96.18] has quit [Quit: Lost terminal]
23:26 -!- niemeyer [~niemeyer@189-10-219-9.pltce701.dsl.brasiltelecom.net.br] has
quit [Ping timeout: 240 seconds]
23:32 -!- thiago__ [~thiago@189.59.176.154.dynamic.adsl.gvt.net.br] has quit [Ping
timeout: 250 seconds]
23:36 -!- dj2 [~dj2@CPE001f5b35feb4-CM0014048e0344.cpe.net.cable.rogers.com] has
joined #go-nuts
23:44 -!- thiago__ [~thiago@189.115.131.67] has joined #go-nuts
23:51 -!- nutate [~rseymour@cacsag4.usc.edu] has quit [Quit: I'm outta heee-eere]
--- Log closed Tue Apr 26 00:00:01 2011