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

--- Log opened Tue Jun 21 00:00:53 2011
00:15 -!- robteix [~robteix@host243.200-82-125.telecom.net.ar] has joined #go-nuts
00:23 -!- message144 [~message14@cpe-75-83-155-145.socal.res.rr.com] has joined
#go-nuts
00:25 -!- Tv [~Tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
00:39 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
00:52 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has joined #go-nuts
00:54 -!- robteix [~robteix@host243.200-82-125.telecom.net.ar] has quit [Quit:
Leaving...]
00:55 -!- ijknacho [~ijknacho4@cpe-72-190-64-3.tx.res.rr.com] has joined #go-nuts
00:56 -!- tavis_rain [~tavisb@24-104-129.146.hfc.mediarain.com] has quit [Read
error: Connection reset by peer]
00:59 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has quit [Quit:
Linkinus - http://linkinus.com]
01:04 -!- kevinwatt [~kevin@59-125-147-75.HINET-IP.hinet.net] has quit [Remote
host closed the connection]
01:04 -!- m4dh4tt3r [~Adium@adsl-76-205-250-81.dsl.pltn13.sbcglobal.net] has quit
[Quit: Leaving.]
01:07 -!- Nisstyre [~nisstyre@109.74.204.224] has quit [Ping timeout: 276 seconds]
01:07 -!- franciscosouza [~francisco@187.105.24.41] has joined #go-nuts
01:08 -!- B33p [~mgray@li226-224.members.linode.com] has quit [Quit: Lost
terminal]
01:17 -!- Nisstyre [~nisstyre@109.74.204.224] has joined #go-nuts
01:18 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has joined
#go-nuts
01:19 -!- tokuhiro_ [~tokuhirom@www33009u.sakura.ne.jp] has joined #go-nuts
01:20 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has quit [Client
Quit]
01:20 -!- Nisstyre [~nisstyre@109.74.204.224] has quit [Client Quit]
01:25 -!- ijknacho [~ijknacho4@cpe-72-190-64-3.tx.res.rr.com] has quit [Ping
timeout: 240 seconds]
01:25 -!- Nisstyre [~nisstyre@109.74.204.224] has joined #go-nuts
01:28 -!- Dr_Who [~tgall_foo@206.9.88.154] has joined #go-nuts
01:28 -!- Dr_Who [~tgall_foo@206.9.88.154] has quit [Changing host]
01:28 -!- Dr_Who [~tgall_foo@linaro/tgall-foo] has joined #go-nuts
01:32 -!- franciscosouza_ [~francisco@187.105.24.41] has joined #go-nuts
01:33 -!- franciscosouza [~francisco@187.105.24.41] has quit [Read error:
Connection reset by peer]
01:37 -!- Nisstyre [~nisstyre@109.74.204.224] has quit [Ping timeout: 250 seconds]
01:38 -!- twolfe18 [~twolfe18@c-71-61-180-11.hsd1.pa.comcast.net] has quit [Quit:
twolfe18]
01:40 -!- franciscosouza [~francisco@187.105.24.41] has quit [Quit:
franciscosouza]
01:43 -!- mikespook [~mikespook@183.47.227.51] has joined #go-nuts
01:45 -!- tokuhiro_ [~tokuhirom@www33009u.sakura.ne.jp] has quit [Quit: Tiarra
0.1: SIGINT received; exit]
01:45 -!- tokuhiro_ [~tokuhirom@www33009u.sakura.ne.jp] has joined #go-nuts
01:47 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has joined
#go-nuts
01:48 -!- benjack [~benjack@bb121-6-49-120.singnet.com.sg] has joined #go-nuts
01:48 -!- vsmatck [~smack@64-142-40-6.dsl.static.sonic.net] has quit [Quit:
Leaving.]
01:55 -!- Nisstyre [~nisstyre@109.74.204.224] has joined #go-nuts
01:58 -!- scoeri_ [~jdekoste@mail.ssel.vub.ac.be] has joined #go-nuts
01:58 -!- vegai_ [v@discord.fi] has joined #go-nuts
01:58 -!- ekontsev1y [~ekontsevo@209.20.66.251] has joined #go-nuts
01:59 -!- kanru_ [~kanru@kanru-1-pt.tunnel.tserv15.lax1.ipv6.he.net] has joined
#go-nuts
02:02 -!- danilo04 [~danilo04@66.44.225.80] has joined #go-nuts
02:02 -!- Bigbear1 [~Cody@d75-158-128-4.abhsia.telus.net] has left #go-nuts []
02:03 -!- Netsplit *.net <-> *.split quits: scoeri, darkhelmetlive,
ekontsevoy, vegai, araujo, kanru, mfoemmel, creack
02:08 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has joined
#go-nuts
02:08 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has left #go-nuts
[]
02:26 -!- kevinwatt [~kevin@59-125-147-75.HINET-IP.hinet.net] has joined #go-nuts
02:34 -!- bugQ [~bug@c-71-195-206-245.hsd1.ut.comcast.net] has quit [Ping timeout:
240 seconds]
02:41 -!- ijknacho [~ijknacho4@cpe-72-190-64-3.tx.res.rr.com] has joined #go-nuts
02:42 -!- i__ [~none@unaffiliated/i--/x-3618442] has joined #go-nuts
02:58 -!- ExtraSpice [XtraSpice@78-57-204-104.static.zebra.lt] has joined #go-nuts
02:58 -!- Queue29 [~Queue29@egress-w.sfo1.yelpcorp.com] has quit [Remote host
closed the connection]
03:03 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has joined #go-nuts
03:08 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has quit [Ping timeout:
260 seconds]
03:10 -!- weazelb0y [~weazelb0y@69.60.16.202] has left #go-nuts []
03:19 -!- va3atc [~va3atc@24.246.17.37] has quit [Ping timeout: 240 seconds]
03:20 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has joined
#go-nuts
03:32 -!- go^lang [~newblue@119.121.252.242] has joined #go-nuts
03:49 -!- Queue29 [~Queue29@173-8-182-114-SFBA.hfc.comcastbusiness.net] has joined
#go-nuts
03:53 -!- danilo04 [~danilo04@66.44.225.80] has quit [Quit: Leaving]
03:54 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
04:00 -!- kfmfe04 [~kfmfe04@220-135-201-83.HINET-IP.hinet.net] has joined #go-nuts
04:08 -!- rejb [~rejb@unaffiliated/rejb] has quit [Disconnected by services]
04:08 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
04:10 -!- Dr_Who [~tgall_foo@linaro/tgall-foo] has quit [Quit: ZZZZZzzzzz]
04:15 -!- pvarga [~pvarga@pool-71-172-108-117.nwrknj.east.verizon.net] has joined
#go-nuts
04:16 -!- pvarga [~pvarga@pool-71-172-108-117.nwrknj.east.verizon.net] has quit
[Client Quit]
04:16 -!- pvarga [~pvarga@pool-71-172-108-117.nwrknj.east.verizon.net] has joined
#go-nuts
04:18 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has quit [Ping
timeout: 260 seconds]
04:18 -!- pvarga [~pvarga@pool-71-172-108-117.nwrknj.east.verizon.net] has quit
[Client Quit]
04:18 -!- Queue29 [~Queue29@173-8-182-114-SFBA.hfc.comcastbusiness.net] has quit
[Remote host closed the connection]
04:19 -!- pvarga [~pvarga@pool-71-172-108-117.nwrknj.east.verizon.net] has joined
#go-nuts
04:25 -!- pvarga [~pvarga@pool-71-172-108-117.nwrknj.east.verizon.net] has quit
[Quit: pvarga]
04:30 -!- benjack [~benjack@bb121-6-49-120.singnet.com.sg] has quit [Ping timeout:
250 seconds]
04:45 -!- B33p [~mgray@li226-224.members.linode.com] has joined #go-nuts
04:50 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has quit [Ping
timeout: 240 seconds]
04:51 -!- fabled [~fabled@83.145.235.194] has joined #go-nuts
04:53 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has joined #go-nuts
04:53 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts
04:56 -!- kfmfe04 [~kfmfe04@220-135-201-83.HINET-IP.hinet.net] has quit [Quit:
kfmfe04]
04:57 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts
05:03 -!- Queue29 [~Queue29@173-8-182-114-SFBA.hfc.comcastbusiness.net] has joined
#go-nuts
05:05 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host
closed the connection]
05:06 -!- benjack [~benjack@bb119-74-99-26.singnet.com.sg] has joined #go-nuts
05:06 -!- Adys [~Adys@unaffiliated/adys] has quit [Ping timeout: 250 seconds]
05:10 -!- Xenith [~xenith@xenith.org] has quit [Ping timeout: 260 seconds]
05:11 -!- Xenith [~xenith@xenith.org] has joined #go-nuts
05:16 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
05:21 -!- Tv [~Tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout: 250
seconds]
05:24 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: Quit]
05:25 -!- krolaw [~krolaw@203.100.208.229] has joined #go-nuts
05:29 -!- niemeyer [~niemeyer@187.53.255.234] has quit [Ping timeout: 240 seconds]
05:39 -!- cafesofie [~cafesofie@ool-18b97779.dyn.optonline.net] has quit [Remote
host closed the connection]
05:42 -!- NiteRain [~kvirc@c-98-254-236-21.hsd1.fl.comcast.net] has joined
#go-nuts
05:57 -!- zippoxer [~zippoxer@109.65.248.117] has quit [Remote host closed the
connection]
06:03 -!- niemeyer [~niemeyer@187.53.255.234] has joined #go-nuts
06:17 -!- mikespook [~mikespook@183.47.227.51] has quit [Quit: Leaving.]
06:24 -!- mikespook [~mikespook@183.47.227.51] has joined #go-nuts
06:25 -!- mikespook [~mikespook@183.47.227.51] has quit [Remote host closed the
connection]
06:28 -!- mikespook [~mikespook@116.21.153.227] has joined #go-nuts
06:28 -!- noodles775 [~michael@g229203233.adsl.alicedsl.de] has joined #go-nuts
06:28 -!- noodles775 [~michael@g229203233.adsl.alicedsl.de] has quit [Changing
host]
06:28 -!- noodles775 [~michael@canonical/launchpad/noodles775] has joined #go-nuts
06:29 < Aperculum> in Effective go, under parallelization, in all the
examples the function declarations are backwards, providing return value before
parameter definitions
06:29 < aiju> these are methods
06:30 < Aperculum> hmm
06:30 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
06:30 < aiju> func (a Type) foo(b int, c string)
06:30 < aiju> if you mean that
06:31 < Aperculum> yeah
06:31 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
06:32 < Aperculum> I should me more systematic in the way I read the
documentation
06:33 < Aperculum> is there a reason why method's declaration is backwards
to function?
06:33 -!- sebastianskejoe [~sebastian@188.114.142.217] has joined #go-nuts
06:34 < Aperculum> oh, now I get it
06:35 < Aperculum> don't mind me, I'll just ramble on about something
everyone knows
06:35 -!- ExsysHost [~ExsysTech@50-46-210-255.evrt.wa.frontiernet.net] has joined
#go-nuts
06:38 -!- ExsysTech [~ExsysTech@50-46-210-255.evrt.wa.frontiernet.net] has quit
[Ping timeout: 276 seconds]
06:39 -!- niemeyer [~niemeyer@187.53.255.234] has quit [Ping timeout: 240 seconds]
06:39 -!- ExsysHost [~ExsysTech@50-46-210-255.evrt.wa.frontiernet.net] has quit
[Ping timeout: 240 seconds]
06:39 -!- mikespook [~mikespook@116.21.153.227] has quit [Remote host closed the
connection]
06:40 -!- ExsysTech [~ExsysTech@50-46-210-255.evrt.wa.frontiernet.net] has joined
#go-nuts
06:42 -!- mikespook [~mikespook@116.21.153.227] has joined #go-nuts
06:46 -!- mikespook [~mikespook@116.21.153.227] has quit [Remote host closed the
connection]
06:47 -!- Count_Niedar [~bleh@ip68-99-166-222.hr.hr.cox.net] has quit [Read error:
Connection reset by peer]
06:48 -!- Niedar [~bleh@ip68-99-166-222.hr.hr.cox.net] has joined #go-nuts
06:48 -!- mikespook [~mikespook@116.21.153.227] has joined #go-nuts
06:49 -!- mikespook [~mikespook@116.21.153.227] has quit [Client Quit]
06:50 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
06:54 -!- htoothrot [~mux@66-169-185-121.dhcp.ftwo.tx.charter.com] has quit [Ping
timeout: 260 seconds]
06:59 -!- Project_2501 [~Marvin@82.84.81.189] has joined #go-nuts
06:59 -!- htoothrot [~mux@66-169-185-121.dhcp.ftwo.tx.charter.com] has joined
#go-nuts
07:05 -!- lugu [~ludo@122.147.15.66] has joined #go-nuts
07:08 -!- GeertJohan [~geertjoha@s51478c91.adsl.wanadoo.nl] has joined #go-nuts
07:14 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has quit [Ping timeout:
612 seconds]
07:19 -!- krolaw [~krolaw@203.100.208.229] has quit [Quit: krolaw]
07:21 -!- Queue29 [~Queue29@173-8-182-114-SFBA.hfc.comcastbusiness.net] has quit
[Remote host closed the connection]
07:28 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
07:28 -!- sebastianskejoe [~sebastian@188.114.142.217] has quit [Quit: Lost
terminal]
07:31 -!- _dfc [~dfc@eth59-167-133-99.static.internode.on.net] has joined #go-nuts
07:33 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving]
07:35 -!- dfc [~dfc@eth59-167-133-99.static.internode.on.net] has quit [Ping
timeout: 258 seconds]
07:36 -!- _dfc [~dfc@eth59-167-133-99.static.internode.on.net] has quit [Ping
timeout: 250 seconds]
07:36 -!- ccmtaylor [ctaylor@h-213.61.231.85.host.de.colt.net] has joined #go-nuts
07:37 -!- ccmtaylor_ [~ctaylor@vpn20.sjc.collab.net] has joined #go-nuts
07:38 -!- photron [~photron@port-92-201-66-238.dynamic.qsc.de] has joined #go-nuts
07:40 -!- ccmtaylor [ctaylor@h-213.61.231.85.host.de.colt.net] has quit [Ping
timeout: 250 seconds]
07:46 -!- krolaw [~krolaw@203.100.208.229] has joined #go-nuts
08:01 -!- pyrhho [~pyrhho@host-92-27-75-48.static.as13285.net] has joined #go-nuts
08:02 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 276 seconds]
08:12 < str1ngs> how can I use C.errno in cgo?
08:12 < str1ngs> proplist.go:27:90: cannot refer to errno directly; see
documentation
08:13 -!- napsy [~luka@193.2.66.6] has joined #go-nuts
08:17 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has left #go-nuts []
08:25 -!- bytbox [~s@96.26.105.154] has joined #go-nuts
08:26 < aiju> str1ngs: maybe try seeing documentation?
08:26 -!- ccmtaylor_ [~ctaylor@vpn20.sjc.collab.net] has quit [Ping timeout: 276
seconds]
08:27 < str1ngs> and that would be where?
08:27 < aiju> http://golang.org/cmd/cgo/
08:28 < str1ngs> grr thats actually elagant
08:28 < str1ngs> thanks aiju
08:31 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Connection reset by
peer]
08:34 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
08:35 -!- message144 [~message14@cpe-75-83-155-145.socal.res.rr.com] has quit
[Quit: gone]
08:50 -!- micromatikal [~quassel@96-42-218-124.dhcp.roch.mn.charter.com] has quit
[Ping timeout: 260 seconds]
08:52 -!- dfc [~dfc@124-169-4-131.dyn.iinet.net.au] has joined #go-nuts
08:56 -!- creack [~charme_g@163.5.84.203] has joined #go-nuts
08:57 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-174-126.clienti.tiscali.it] has
joined #go-nuts
08:58 -!- virtualsue [~chatzilla@host81-148-45-252.in-addr.btopenworld.com] has
joined #go-nuts
09:01 -!- Project_2501 [~Marvin@82.84.81.189] has quit [Ping timeout: 252 seconds]
09:05 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
09:06 -!- ExsysTech [~ExsysTech@50-46-210-255.evrt.wa.frontiernet.net] has quit
[Read error: Connection reset by peer]
09:07 -!- ExsysTech [~ExsysTech@50-46-210-255.evrt.wa.frontiernet.net] has joined
#go-nuts
09:22 -!- dfc [~dfc@124-169-4-131.dyn.iinet.net.au] has quit [Quit: dfc]
09:31 -!- ronnyy [~quassel@p4FF1C44A.dip0.t-ipconnect.de] has joined #go-nuts
09:43 -!- dfc [~dfc@124-169-4-131.dyn.iinet.net.au] has joined #go-nuts
09:54 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts
10:01 -!- benjack [~benjack@bb119-74-99-26.singnet.com.sg] has quit [Quit:
Leaving.]
10:04 -!- genbattle [~nick@118-93-46-51.dsl.dyn.ihug.co.nz] has joined #go-nuts
10:26 -!- va3atc [~va3atc@24-246-17-37.cable.teksavvy.com] has joined #go-nuts
10:29 -!- manveru [~manveru@b08s28ur.corenetworks.net] has quit [Quit: ZNC -
http://znc.sourceforge.net]
10:30 -!- manveru [~manveru@b08s28ur.corenetworks.net] has joined #go-nuts
10:31 -!- zippoxer [~zippoxer@109.65.248.117] has joined #go-nuts
10:32 -!- araujo [~araujo@190.73.44.29] has joined #go-nuts
10:32 -!- araujo [~araujo@190.73.44.29] has quit [Changing host]
10:32 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
10:32 -!- zippoxer [~zippoxer@109.65.248.117] has quit [Remote host closed the
connection]
10:34 -!- alehorst [~alehorst@200.146.83.98.dynamic.adsl.gvt.net.br] has joined
#go-nuts
10:35 -!- virtualsue [~chatzilla@host81-148-45-252.in-addr.btopenworld.com] has
quit [Ping timeout: 250 seconds]
10:36 -!- ijknacho [~ijknacho4@cpe-72-190-64-3.tx.res.rr.com] has quit [Ping
timeout: 264 seconds]
10:40 -!- mojbro [~philip@harris.suitopia.com] has quit [Remote host closed the
connection]
10:42 -!- virtualsue [~chatzilla@host81-148-72-131.in-addr.btopenworld.com] has
joined #go-nuts
10:43 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host
closed the connection]
10:49 -!- bytbox [~s@96.26.105.154] has quit [Remote host closed the connection]
10:56 -!- zippoxer [~zippoxer@109.65.248.117] has joined #go-nuts
11:09 -!- ExtraSpice [XtraSpice@78-57-204-104.static.zebra.lt] has quit [Quit:
Leaving]
11:10 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
11:11 -!- krolaw [~krolaw@203.100.208.229] has quit [Quit: krolaw]
11:16 -!- noodles775 [~michael@canonical/launchpad/noodles775] has quit [Ping
timeout: 252 seconds]
11:18 -!- noodles775 [~michael@e178255213.adsl.alicedsl.de] has joined #go-nuts
11:18 -!- noodles775 [~michael@e178255213.adsl.alicedsl.de] has quit [Changing
host]
11:18 -!- noodles775 [~michael@canonical/launchpad/noodles775] has joined #go-nuts
11:25 -!- virtualsue [~chatzilla@host81-148-72-131.in-addr.btopenworld.com] has
quit [Ping timeout: 250 seconds]
11:28 -!- virtualsue [~chatzilla@host81-148-52-109.in-addr.btopenworld.com] has
joined #go-nuts
11:36 -!- tncardoso [~thiago@189.59.178.169.dynamic.adsl.gvt.net.br] has joined
#go-nuts
11:38 -!- va3atc [~va3atc@24-246-17-37.cable.teksavvy.com] has quit [Ping timeout:
240 seconds]
11:42 -!- ronnyy [~quassel@p4FF1C44A.dip0.t-ipconnect.de] has quit [Remote host
closed the connection]
11:46 -!- genbattle [~nick@118-93-46-51.dsl.dyn.ihug.co.nz] has quit [Quit:
Leaving]
11:53 -!- jyxent [~jyxent@129.128.191.96] has quit [Ping timeout: 240 seconds]
11:54 -!- jyxent [~jyxent@129.128.191.96] has joined #go-nuts
11:57 -!- ronnyy [~quassel@p4FF1C44A.dip0.t-ipconnect.de] has joined #go-nuts
12:03 -!- replore_ [~replore@ntkngw256114.kngw.nt.ftth.ppp.infoweb.ne.jp] has
joined #go-nuts
12:06 -!- angasule [~angasule@190.2.33.49] has quit [Remote host closed the
connection]
12:14 -!- va3atc [~va3atc@205.211.141.207] has joined #go-nuts
12:19 -!- dfc [~dfc@124-169-4-131.dyn.iinet.net.au] has quit [Quit: dfc]
12:31 -!- vegai_ [v@discord.fi] has quit [Changing host]
12:31 -!- vegai_ [v@archlinux/developer/vegai] has joined #go-nuts
12:31 -!- ronnyy [~quassel@p4FF1C44A.dip0.t-ipconnect.de] has quit [Remote host
closed the connection]
12:33 -!- NiteRain [~kvirc@c-98-254-236-21.hsd1.fl.comcast.net] has quit [Read
error: Operation timed out]
12:46 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has joined #go-nuts
12:46 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has quit [Remote host
closed the connection]
12:47 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
12:50 -!- ExtraSpice [XtraSpice@78-57-204-104.static.zebra.lt] has joined #go-nuts
12:54 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-165-183.clienti.tiscali.it] has
joined #go-nuts
12:55 -!- virtualsue [~chatzilla@host81-148-52-109.in-addr.btopenworld.com] has
quit [Ping timeout: 250 seconds]
12:57 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-174-126.clienti.tiscali.it] has
quit [Ping timeout: 276 seconds]
12:58 -!- KBme [~KBme@2001:470:cabe:666:666:666:666:666] has quit [Ping timeout:
260 seconds]
12:59 -!- KBme [~KBme@2001:470:cabe:666:666:666:666:666] has joined #go-nuts
13:03 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-183-35.clienti.tiscali.it] has
joined #go-nuts
13:06 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-165-183.clienti.tiscali.it] has
quit [Ping timeout: 264 seconds]
13:10 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts
13:14 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has joined #go-nuts
13:25 -!- bytbox [~s@129.2.129.145] has joined #go-nuts
13:26 < zippoxer> why is time.Nanoseconds() int64 instead of uint64?
13:27 < exch> In case someone finally builds a time machine, operated by a
Go program.  With uint64, he can't travel further back than the unix epoch
13:27 < exch> int64 at least extends hs range a bit
13:27 < zippoxer> lol now seriously :P
13:28 < Nisstyre> yes
13:28 < zippoxer> just for convenience?
13:28 < Tonnerre> No
13:28 < Tonnerre> For the exact same reason exch outlined
13:28 < Tonnerre> There are reasons to refer to dates before January 1st,
1970
13:28 < zippoxer> ohh okay
13:30 < jlaffaye> I wonder how smart is the goroutine scheduler.  for
instance does it know about io wait and so on
13:30 < jlaffaye> indeed it must know about Sleep() :)
13:31 -!- robteix [~robteix@192.55.54.36] has joined #go-nuts
13:34 < exch> afaik, if it encounters a goroutine that blocks for a
substantial while, it move said goroutine 'out of the way' to make room for others
13:36 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has left #go-nuts []
13:36 < uriel> jlaffaye: it is not *too* smart, but it does know about
'blocking' operations, obviously
13:36 -!- ArgonneIntern [82ca0251@gateway/web/freenode/ip.130.202.2.81] has joined
#go-nuts
13:37 < uriel> exch: afaik any goroutine that blocks is moved out of the way
13:38 -!- kfmfe04 [~kfmfe04@host-58-114-183-56.dynamic.kbtelecom.net] has joined
#go-nuts
13:39 < jlaffaye> uriel: thanks
13:46 < ArgonneIntern> if you want to test if an array is empty can you test
it against nil?
13:47 < skelterjohn|work> ArgonneIntern: and empty slice i think is nil
13:47 < skelterjohn|work> you should double check
13:47 < skelterjohn|work> (an empty array is of type [0]Type, so no checking
is required)
13:48 < ArgonneIntern> suppose I could just use len() and see if it is 0
13:48 < skelterjohn|work> that also works
13:48 < kfmfe04> hi - I'm having problems with the standard time package -
it seems that subsequent calls to os.Setenv( "TZ", "SomeTimeZone" ) has no impact
on calls to time.LocalTime(); the very first call is ok, but in subsequent calls,
it is ignored.  I dug around the code and found
http://golang.org/src/pkg/time/zoneinfo_unix.go - the problem is Line 264:
onceSetupZone.Do(setupZone) - I think I can patch the code to have it serve my
needs, bu
13:48 < kfmfe04> there a bug/feature request database out there where I can
post this observation?
13:49 < skelterjohn|work> in the topic
13:49 < skelterjohn|work> :)
13:49 < kfmfe04> ahhh - excellent - tyvm
13:51 < skelterjohn|work> ArgonneIntern: fmt.Println(make([]int, 0)==nil)
prints false
13:51 < ArgonneIntern> hmm
13:51 < ArgonneIntern> guess len() it is then
13:51 < skelterjohn|work> yes.
13:52 < ArgonneIntern> i tried something like intArrayVariable == []int{}
13:52 < ArgonneIntern> but it doesn't like that either
13:53 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has quit [Quit:
Computer has gone to sleep.]
13:53 < skelterjohn|work> you can't do == for slice types
13:53 < skelterjohn|work> unless one half is nil
13:59 -!- chomp [~chomp@dap-209-166-184-50.pri.tnt-3.pgh.pa.stargate.net] has
joined #go-nuts
14:01 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
14:09 -!- napsy [~luka@193.2.66.6] has quit [Ping timeout: 260 seconds]
14:13 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host
closed the connection]
14:14 -!- niemeyer [~niemeyer@187.53.255.234] has joined #go-nuts
14:20 -!- mz [~maddas@74.125.57.33] has joined #go-nuts
14:21 < mz> Hi. I'm having trouble getting the protocol buffer package to
work, starting with a clean install of go, and calling "goinstall
goprotobuf.googlecode.com/hg/proto".  Any ideas what I'm doing wrong?  Here's the
error: http://pastie.org/2101598
14:22 < ArgonneIntern> can yous how those lines of code
14:22 < ArgonneIntern> show*
14:23 < mz> What lines of code?
14:23 < ArgonneIntern> hah I might know what's going on
14:23 < ArgonneIntern> you're reading themin as chars?
14:23 < ArgonneIntern> correct?
14:23 < mz> I didn't modify any of the files mentioned there.
14:23 < mz> (Are you talking to me?)
14:24 < ArgonneIntern> yes
14:24 < ArgonneIntern> the type is uintptr
14:24 < mz> I'm just trying to install and build the package.
14:24 < ArgonneIntern> oh
14:24 < ArgonneIntern> lmao
14:24 < mz> (This was broken yesterday already, and I assume other people
would notice if it's a real problem...)
14:25 < ArgonneIntern> I'm sure someone will come along with an answer
14:25 < skelterjohn|work> it goinstalls fine for me
14:25 < skelterjohn|work> try updating your go distribution
14:25 < ArgonneIntern> I did yesterday
14:25 < ArgonneIntern> changing the exec on me
14:25 < ArgonneIntern> meanies
14:26 < skelterjohn|work> that change is several weeks old :)
14:26 < skelterjohn|work> and it's a very positive change, too
14:26 < ArgonneIntern> skelterjohn|work: is right though, things change in
go very fast
14:26 < ArgonneIntern> so updating is probably a good idea
14:26 < mz> skelterjohn|work: I updated just now.
14:26 < mz> (Unless the instructions on the go website are outdated)
14:27 < ArgonneIntern> you using mercurial?
14:27 < mz> Yes.
14:27 < ArgonneIntern> hmm...  mine updated
14:27 < mz> Do I need anything other than "hg sync"?
14:27 < skelterjohn|work> mz - what os/arch?
14:27 < ArgonneIntern> the instructions are accurate
14:27 < skelterjohn|work> mz - "hg pull -u"
14:27 < ArgonneIntern> yes you do
14:27 < skelterjohn|work> i don't know what hg sync does
14:28 < skelterjohn|work> but i'm not an hg expert.  maybe it has the same
effect
14:28 < ArgonneIntern> niether do I lol
14:28 < mz> No changes found.
14:28 < ArgonneIntern> http://pastie.org/2101635
14:29 < ArgonneIntern> that is what it says on the getting started and it
worked for me
14:29 < mz> Yeah, but that doesn't install the protocol buffers package.
14:29 < mz> http://pastie.org/2101637
14:29 < ArgonneIntern> I know
14:29 < ArgonneIntern> but the package may rely on newer go src
14:29 < ArgonneIntern> which is what skelterjohn|work was suggesting
14:31 < ArgonneIntern> oh snap
14:31 < ArgonneIntern> no he is currect
14:31 < mz> I'll try building a different goprotobuf release.
14:31 < ArgonneIntern> the mercurial DB must not be up to date
14:32 < mz> Who is correct?
14:32 < ArgonneIntern> you
14:32 < ArgonneIntern> I thought mine updated correctly yesterday but in
fact ti didn't
14:32 < ArgonneIntern> I use mercurial too
14:32 -!- fabled [~fabled@83.145.235.194] has quit [Quit: Ex-Chat]
14:32 < ArgonneIntern> I just compiled an old exec function use
14:32 < ArgonneIntern> and it worked
14:32 < ArgonneIntern> so My go is not updating either
14:33 < mz> OK.
14:33 < ArgonneIntern> it means mercurial is not pulling the latest release
14:33 < ArgonneIntern> which is likely your problem and probably mine very
soon lol
14:34 < ArgonneIntern> I know the debian package is up to date, a coworker
of mine uses it
14:34 -!- robteix [~robteix@192.55.54.36] has quit [Ping timeout: 255 seconds]
14:34 -!- fabled [~fabled@83.145.235.194] has joined #go-nuts
14:34 < ArgonneIntern> brb
14:35 -!- Queue29 [~Queue29@173-8-182-114-SFBA.hfc.comcastbusiness.net] has joined
#go-nuts
14:37 -!- r_linux [~r_linux@static.200.198.180.250.datacenter1.com.br] has joined
#go-nuts
14:39 < skelterjohn|work> can anyone verify this for me?  "goinstall -clean
x" doesn't seem to be working
14:39 < skelterjohn|work> add a -v in there, and it says it cleans it, but
then it's up to date
14:40 < ArgonneIntern> ahhhh
14:40 < ArgonneIntern> mz
14:40 < ArgonneIntern> go to go/src directory
14:40 < ArgonneIntern> and type hg update weekly
14:40 < ArgonneIntern> thats hould display some updates
14:41 < ArgonneIntern> they havn't added those changes to the release yet
14:41 < zippoxer> release is not weekly?
14:41 < ArgonneIntern> not for me
14:41 < zippoxer> mm is there a goroutine pool or something?
14:41 < ArgonneIntern> hg update release showed no updates, hg update weekly
did
14:42 < ArgonneIntern> it may be true that this package he is using relys on
these new changes
14:42 < mz> Same error.  Do I need anything other than "hg update -u
weekly"?
14:42 -!- Nisstyre [~nisstyre@109.74.204.224] has quit [Remote host closed the
connection]
14:42 < skelterjohn|work> release != weekly
14:42 < mz> erm, without -u
14:43 < skelterjohn|work> zippoxer: no.  in fact, that doesn't make sense.
14:43 < skelterjohn|work> about goroutine pools
14:43 < skelterjohn|work> you launch every goroutine explicitly (with the
"go" keyword).
14:43 -!- Nisstyre [~nisstyre@109.74.204.224] has joined #go-nuts
14:43 < skelterjohn|work> there are thread pools, of course
14:43 < zippoxer> yeah?
14:44 < zippoxer> what package?
14:44 < ArgonneIntern> well mz that's as far as I can help unfortunatly
14:44 < skelterjohn|work> zippoxer: hidden in the runtime
14:44 < zippoxer> like python lol..
14:45 < skelterjohn|work> let the runtime do this sort of thing for you -
all you have to worry about is what you want to be concurrent
14:45 < ArgonneIntern> mz: did you run ./all.bash after updating
14:45 < skelterjohn|work> goroutines are lightweight enough that you don't
need to be concerned about (for instance) the cost of a context switch
14:45 < ArgonneIntern> just now
14:45 < Namegduf> Unless you're doing silly benchmarks, yeah
14:45 < Namegduf> :P
14:46 < skelterjohn|work> of course, if *all* you're doing is context
switching, you can point out things that would improve performance
14:46 < skelterjohn|work> but it's generally insignificant compared to an
actual task
14:47 < zippoxer> I just need something to execute tasks for me
concurrently, with a limited number of threads/goroutines.
14:47 < skelterjohn|work> threads != goroutines
14:47 < skelterjohn|work> but you can try the leaky bucket approach
14:48 < zippoxer> what's that?
14:48 < skelterjohn|work> launch a goroutine for every task, but have them
wait on something that allows only X of them to continue
14:48 < ArgonneIntern> skelterjohn|work: but go routines use threads
correct?
14:48 < skelterjohn|work> multiple goroutines per thread
14:48 < zippoxer> ohh got it :P thanks
14:48 < skelterjohn|work> zippoxer: you could also launch X worker threads,
and have them grab tasks off a channel
14:48 < Namegduf> zippoxer: Don't bother limiting goroutines, and let the
runtime limit the threads, by default.
14:48 < zippoxer> lol even better.
14:49 < Namegduf> If you really really can't have units of tasks big enough
for that, then that worker goroutine setup works
14:49 < zippoxer> how large is the limit?
14:49 < skelterjohn|work> hundreds of thousands
14:49 -!- m4dh4tt3r [~Adium@c-98-210-145-213.hsd1.ca.comcast.net] has joined
#go-nuts
14:49 < zippoxer> lol
14:49 < zippoxer> i love my computer..
14:49 < Namegduf> For *threads*
14:49 < Namegduf> Right now, it goes off environmental settings
14:49 < Namegduf> And defaults to 1
14:49 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has joined #go-nuts
14:49 < Namegduf> You can set it to whatever you like.
14:49 < zippoxer> ohh nice :)
14:50 < Namegduf> For goroutines, each goroutine uses about 4KB of RAM as
its major expense
14:50 < skelterjohn|work> oh - i misread his question
14:50 -!- init6 [~chad@ice.superfrink.net] has joined #go-nuts
14:50 < skelterjohn|work> i meant that a go program can have hundreds of
thousands of goroutines without it being a problem
14:50 < Namegduf> So you can easily get hundreds of thousands running on a
machine, yeah.
14:50 < skelterjohn|work> for threads, i don't know - i find i don't have to
worry about it
14:50 < skelterjohn|work> except to say GOMAXPROCS = 4 or something
14:51 < zippoxer> it really exists?
14:51 < skelterjohn|work> GOMAXPROCS?
14:51 < zippoxer> yeah
14:51 < Namegduf> zippoxer: If your pieces of work are way smaller than 4KB
memory, and your setup doesn't easily let you make them bigger, then the worker
goroutine thing works great.
14:51 < skelterjohn|work> GOMAXPROCS is an env var that the go runtime uses
to decide how many things can go on in parallel
14:52 -!- _andre [~andre@fosforo.f2.k8.com.br] has joined #go-nuts
14:52 < Namegduf> You don't need to do it unless you have major performance
reasons to, though.
14:52 -!- Nisstyre [~nisstyre@109.74.204.224] has quit [Quit: Leaving]
14:52 < Namegduf> Just spawn a goroutine per task, and leave that kinda
thing to optimising later
14:52 -!- pjacobs [~pjacobs@75-27-133-72.lightspeed.austtx.sbcglobal.net] has
joined #go-nuts
14:52 < zippoxer> I don't think I'll use more than 20 goroutines
14:52 < zippoxer> yeah the best is to worry about performance only if it
disturbs..
14:53 < skelterjohn|work> is there a way to delete something from a map and
check if it was in there in the first place, in one operation?
14:53 < mz> ArgonneIntern: That did the trick, I had just forgotten
./all.bash.  Thanks.
14:53 < ArgonneIntern> np glad I could help
14:53 -!- Queue29 [~Queue29@173-8-182-114-SFBA.hfc.comcastbusiness.net] has quit
[Remote host closed the connection]
14:54 < ArgonneIntern> if package creaters aren't going to use the latest
release files and instead use the weekly, they should say that somewhere
14:55 < skelterjohn|work> for my stuff i try to have a release tag
14:56 < skelterjohn|work> and when i say "i try", i mean i do this for
exactly one thing i publish, and that's gb
14:56 < skelterjohn|work> i don't think anyone uses any of the other stuff
anyway
14:57 < ArgonneIntern> well in any case, I'm glad we could help him.  That's
the kinda thing that you could over look for hours and hours and not figure out
lol
14:57 < ArgonneIntern> good call on the go src not being the latest update
skelterjohn|work
14:58 < mz> Yeah, I don't think I'd have noticed the problem myself (never
used Mercurial before).
14:58 < skelterjohn|work> it's a pretty common problem
14:58 < mz> Or rather, I wouldn't have found the solution.  I certainly did
notice the problem :-)
14:59 -!- rcrowley [~rcrowley@c-71-202-44-233.hsd1.ca.comcast.net] has quit [Quit:
Computer has gone to sleep.]
14:59 < init6> I've noticed the golang.org docs and my localhost doc server
have been out of sync before.
15:00 < skelterjohn|work> golang.org docs are for the release version
15:00 < init6> *nod*
15:02 < ArgonneIntern> so what does http.Client.Get() return now
15:02 -!- tncardoso [~thiago@189.59.178.169.dynamic.adsl.gvt.net.br] has quit
[Quit: bye]
15:02 < ArgonneIntern> used to return 3 values now says 2
15:02 < skelterjohn|work> check the doc?
15:02 < ArgonneIntern> is there a place for the weekly docs
15:03 < skelterjohn|work> godoc http Client
15:03 < ArgonneIntern> in the go docs it still shows 3 returned value
15:03 -!- weazelb0y [~weazelb0y@69.60.16.202] has joined #go-nuts
15:03 < skelterjohn|work> i mean run that on the command line
15:03 < skelterjohn|work> not look at golang.org
15:04 < ArgonneIntern> ohhh sweet tyvm
15:04 < skelterjohn|work> you can also do "godoc -http :6060" and run a
local copy of golang.org
15:04 < skelterjohn|work> on port 6060
15:05 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has quit [Ping timeout:
264 seconds]
15:05 < ArgonneIntern> does it work on individual function names in the
package or the type in the packlage
15:05 < skelterjohn|work> not sure
15:05 < skelterjohn|work> try and find out
15:05 < ArgonneIntern> it doesn't seem to
15:05 < ArgonneIntern> my coworker is confirming for me
15:06 < ArgonneIntern> I'll just trial by error it
15:06 < exch> $ godoc http Client | less
15:07 < ArgonneIntern> lol exch now I feel stupid
15:07 < ArgonneIntern> thanks though
15:07 < ArgonneIntern> it's in there
15:10 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has joined #go-nuts
15:11 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
15:11 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-148-118.clienti.tiscali.it]
has joined #go-nuts
15:13 -!- Nisstyre [~nisstyre@109.74.204.224] has joined #go-nuts
15:13 -!- Nisstyre [~nisstyre@109.74.204.224] has quit [Max SendQ exceeded]
15:14 -!- awidegreen [~quassel@h-170-226.A212.priv.bahnhof.se] has joined #go-nuts
15:14 -!- Nisstyre [~nisstyre@109.74.204.224] has joined #go-nuts
15:14 -!- tzok [~tzok___@c126-6.icpnet.pl] has joined #go-nuts
15:15 < tzok> Hi
15:15 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-183-35.clienti.tiscali.it] has
quit [Ping timeout: 258 seconds]
15:15 < fzzbt> hello
15:15 < skelterjohn|work> hi
15:15 < tzok> I am new to programming in go and have now stopped in a place
where I can't find solution for in the golang.org
15:16 -!- mfoemmel [~mfoemmel@chml01.drwholdings.com] has joined #go-nuts
15:17 -!- darkhelmetlive [u1769@gateway/web/irccloud.com/x-gloeotybueijutiv] has
joined #go-nuts
15:17 < tzok> I created a list (usual from container/list), added there
several integers.  When I iterate over the list and get iterator.Value then I
don't know how to make it seen as an integer again
15:17 < uriel> tzok: never ask to ask, just ask
15:17 < ArgonneIntern> what do you mean tzok
15:17 < ArgonneIntern> seen as an integer again
15:17 < tzok> I want it to index an array
15:17 < tzok> I get an error that the index must be integer
15:18 < ArgonneIntern> array[iteratorElement.Value]
15:18 < tzok> That's how I did this and this gave me an error
15:18 < tzok> error: index must be integer
15:18 < ArgonneIntern> I had this error before and I can't remember how I
solved it
15:19 < ArgonneIntern> can you paste the error here
15:19 < tzok> The error is exactly this: "error: index must be integer"
15:19 < tzok> I am using gccgo btw
15:19 < ArgonneIntern> try array[iterator.Value.(int)]
15:20 < skelterjohn|work> yes - you have to use a type assertion
15:20 < aiju> why do you even use container/list?
15:20 < ArgonneIntern> I thought so
15:20 < aiju> use a slice
15:20 -!- saschpe [~quassel@opensuse/member/saschpe] has joined #go-nuts
15:20 < skelterjohn|work> also, what aiju said
15:20 < skelterjohn|work> unless you have a specific performance reason, use
a slice
15:20 < aiju> container/list should be removed, it only confuses newbies
15:20 < ArgonneIntern> he probably has a list of items with certain
properties
15:20 < ArgonneIntern> and wants random access to them
15:21 < skelterjohn|work> slices are pretty good for that =p
15:21 < tzok> ArgonneIntern, thanks that worked!  So is this construct an
"explicit conversion" in go?
15:21 < skelterjohn|work> container/list is only if you specifically need a
linked list
15:21 < tzok> My data structure is very dynamic so I used a list
15:21 < mpl> the container/list package should have as its first line of
doc: "Y U NO USE SLICE?"
15:21 < tzok> I remove and add elements there very often
15:21 < skelterjohn|work> if you remove items from the middle often, then
using a container/list can be worthwhile, at the cost of expensive indexing
15:22 < skelterjohn|work> tzok: this isn't conversion - it's type assertion.
you're just saying that you know what is in there is an int, so give me the int
15:22 -!- Queue29 [~Queue29@egress-w.sfo1.yelpcorp.com] has joined #go-nuts
15:22 < skelterjohn|work> conversion would be changing it from an int to
something else
15:22 < skelterjohn|work> like a float, etc
15:22 < ArgonneIntern> if you want to remove and element from an array and
you know the index you can't add two slices together
15:22 < tzok> I always iterate over whole container, then remove a single
item from inside and proceed to iterate again over changed list
15:23 < ArgonneIntern> so you take the first slice before the index, and try
to combine it with after the slice
15:23 < ArgonneIntern> which is basically why I don't use them
15:23 < aiju> tzok: map[] is also a good idea
15:23 < ArgonneIntern> list.Remove is easier
15:23 < tzok> ArgonneIntern, nice, I didn't think of that
15:24 < skelterjohn|work> the typical way to represent a set of type T is
map[T]bool
15:24 < skelterjohn|work> assuming T is a valid key
15:24 < ArgonneIntern> unless someone knows of a function to join two arrays
together?
15:24 < tzok> skelterjohn|work, I tried int(iterator.Value) which gave me
error "needs explicit conversion" - that's why I asked about it
15:24 < skelterjohn|work> append(slice1, slice2...)
15:25 < ArgonneIntern> that will return a single array of the types sent
15:25 < ArgonneIntern> sorry that was a question
15:26 < skelterjohn|work> a slice, yes
15:26 < skelterjohn|work> and it will use the memory in slice1 if there is
enough
15:26 < ArgonneIntern> well then..  I'll try using slices instead of lists
next time :)
15:26 < tzok> aiju, right, map could also be used here, thanks
15:26 < skelterjohn|work> but that is a linear time operation, rather than a
constant time one like joining two LLs would be
15:27 < ArgonneIntern> yea go makes maps super easy to use lol
15:27 < tzok> great, thanks for your help and all advice guys!
15:28 -!- noodles775 [~michael@canonical/launchpad/noodles775] has quit [Quit:
leaving]
15:29 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has quit [Ping timeout:
240 seconds]
15:30 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
15:31 < zippoxer> string(100) != "100"
15:31 < zippoxer> how can I get from an int 100, a string "100"\
15:32 -!- sniper506th [~sniper506@rrcs-70-61-192-18.midsouth.biz.rr.com] has
joined #go-nuts
15:33 -!- GeertJohan [~geertjoha@s51478c91.adsl.wanadoo.nl] has quit [Quit:
Leaving.]
15:33 < tzok> strconv.Itoa() maybe?
15:33 < ArgonneIntern> cannot use i (type []string) as type string in append
15:34 < skelterjohn|work> ArgonneIntern: the "..." i put in there was not
accidental
15:34 < skelterjohn|work> append's 2nd parameter is variadic
15:34 < zippoxer> thanks
15:35 < skelterjohn|work> zippoxer: string(100) uses the character
represented by 100, whatever it is
15:35 < zippoxer> yeah like chr in many other langs
15:35 -!- Queue29 [~Queue29@egress-w.sfo1.yelpcorp.com] has quit [Remote host
closed the connection]
15:36 < aiju> many other langs = all the thousand slangs of basic
15:36 < ArgonneIntern> skelterjohn|work: i'm reading the append function and
it's a bit confusing
15:37 < skelterjohn|work> the first argument is the slice you want to append
to
15:37 < skelterjohn|work> the remaining arguments are the things you want to
append onto the slice, in order
15:37 < ArgonneIntern> the slice passed can be of an arbitrary type, yet
they are adding it's length to an array of bytes
15:37 < skelterjohn|work> but if have a slice for the 2nd argument, followed
by a ..., it unpacks it
15:37 < skelterjohn|work> what you just said makes no sense
15:38 < ArgonneIntern> here i'll put it into pastie
15:38 < ArgonneIntern> http://www.pastie.org/2101944
15:38 < ArgonneIntern> in effective go doc that's what it shows for append
15:38 < ArgonneIntern> it's using the length of a slice, and length of bytes
15:39 < skelterjohn|work> that Append() has almost nothing to do with the
built-in function "append"
15:39 < ArgonneIntern> ok
15:39 < ArgonneIntern> it's in the slices section lol
15:39 < skelterjohn|work> "almost nothing" is misleading, but the built-in
function doesn't require it to be []byte, for instance
15:40 < skelterjohn|work>
http://golang.org/doc/go_spec.html#Appending_and_copying_slices
15:41 < ArgonneIntern> ahh ty that is much more clear
15:42 -!- kfmfe04 [~kfmfe04@host-58-114-183-56.dynamic.kbtelecom.net] has quit
[Quit: kfmfe04]
15:42 < ArgonneIntern> hmm that append just removed about 20 lines of code
lol
15:43 < skelterjohn|work> it's a useful function
15:43 < skelterjohn|work> and did much to quiet the grumblings about the
lack of generics
15:44 -!- B33p [~mgray@li226-224.members.linode.com] has quit [Quit: Lost
terminal]
15:45 < ArgonneIntern> so if I want to remove a value from an array and I
have the index of that value I can append(array[:index], array[index:]...)
15:45 < ArgonneIntern> the problem there is if index is 0 the slice will be
from 0 to -1
15:45 < ArgonneIntern> the first slice
15:46 < skelterjohn|work> perhaps append(slice[:index], slice[index+1:]...)
15:46 < ArgonneIntern> well yea
15:46 < skelterjohn|work> any index works fine there
15:46 < ArgonneIntern> in the first slice it's ok
15:46 < skelterjohn|work> the first slice will be from 0 to 0 (empty)
15:47 -!- Nisstyre [~nisstyre@109.74.204.224] has quit [Remote host closed the
connection]
15:47 -!- r_linux [~r_linux@static.200.198.180.250.datacenter1.com.br] has quit
[Read error: Operation timed out]
15:47 < skelterjohn|work> the second slice will be from 1 to the end
15:47 < ArgonneIntern> cause index will end up being -1
15:47 -!- r_linux [~r_linux@189.38.220.35] has joined #go-nuts
15:47 < skelterjohn|work> how do you figure?
15:47 < ArgonneIntern> cause it subtracts one from the second argument if I
recall
15:47 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has joined
#go-nuts
15:47 < skelterjohn|work> where is index used as an argument?
15:47 < ArgonneIntern> in the slice
15:47 < skelterjohn|work> that isn't a function
15:47 < ArgonneIntern> [:index]
15:47 < skelterjohn|work> x[0:0] is an empty slice
15:47 < skelterjohn|work> no -1s
15:48 < ArgonneIntern> let me see if I can find where it said it subtracts 1
from the second argument
15:48 < skelterjohn|work> "it" doesn't subtract one from anything
15:49 < ArgonneIntern> Given an array, or another slice, a new slice is
created via a[I:J].  This creates a new slice which refers to a, starts at index
I, and ends before index J
15:49 -!- Tv [~Tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
15:49 < skelterjohn|work> no subtracting yet
15:49 < ArgonneIntern> before index J would imply -1
15:49 < skelterjohn|work> nope
15:50 < skelterjohn|work> the last element in the new slice would have index
J-1, but if there are no elements, there is no last element, is there?
15:50 -!- tncardoso [~thiagon@150.164.2.20] has joined #go-nuts
15:50 < ArgonneIntern> but if fo instance index of 1 was in there it would
return just the 0th element?
15:50 < skelterjohn|work> what?
15:50 < skelterjohn|work> oh
15:50 < ArgonneIntern> wellt hat is really cool
15:51 < skelterjohn|work> x[0:1] is a slice with one element, yes
15:51 < ArgonneIntern> this is why I didn't use slices in the first place
lol
15:51 < ArgonneIntern> i thought it always did -1
15:51 < ArgonneIntern> ><
15:51 < skelterjohn|work> that would make no sense at all
15:51 < ArgonneIntern> IKR
15:51 < ArgonneIntern> <-- C++ programmer, I take everything literally
15:51 < skelterjohn|work> so does go
15:52 < ArgonneIntern> the element just before 0 is a seg fault in C++ lmao
15:52 < aiju> "C++ programmer, I take LSD"
15:52 < skelterjohn|work> in go, as well
15:52 < ArgonneIntern> it doesn't make sense, but who am I to judge
15:52 < aiju> shouldn't it be more like this?
15:52 -!- r_linux [~r_linux@189.38.220.35] has quit [Ping timeout: 264 seconds]
15:52 -!- r_linux [~r_linux@static.200.198.180.250.datacenter1.com.br] has joined
#go-nuts
15:53 < Tonnerre> Well, not necessarily a segfault unless there's some kind
of redtape page
15:53 < Tonnerre> Typically it just would be other data which doesn't make
sense in the context
15:54 < ArgonneIntern> so if you put the numbers into that sentence, it
would say it starts at 0 and ends before 0
15:54 < skelterjohn|work> that means it ends immediately
15:54 < ArgonneIntern> gotcha
15:54 < skelterjohn|work> or it never starts
15:54 < ArgonneIntern> which is pretty awesome IMO
15:59 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
15:59 -!- StoVoKor [~va3atc@205.211.141.184] has joined #go-nuts
16:01 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
16:01 -!- LeNsTR [~lenstr@unaffiliated/lenstr] has quit [Ping timeout: 258
seconds]
16:02 -!- m4dh4tt3r [~Adium@c-98-210-145-213.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
16:02 -!- va3atc [~va3atc@205.211.141.207] has quit [Ping timeout: 240 seconds]
16:02 -!- m4dh4tt3r [~Adium@c-98-210-145-213.hsd1.ca.comcast.net] has joined
#go-nuts
16:03 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has quit [Ping
timeout: 260 seconds]
16:06 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts
16:07 < ArgonneIntern> skelterjohn|work: can I trouble you once more lol
16:08 < ArgonneIntern> http://www.pastie.org/2102093
16:08 < ArgonneIntern> append is tossing an error at me for that
16:08 < ArgonneIntern> Info in both cases being an array of infoMsg
16:09 -!- virtualsue [~chatzilla@nat/cisco/x-tychbpvvxnvemwmq] has joined #go-nuts
16:09 -!- Tv [~Tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout: 255
seconds]
16:15 < jessta> ArgonneIntern: what is the error?
16:15 -!- nesv [~nick@LONDON14-1176247333.sdsl.bell.ca] has joined #go-nuts
16:16 -!- mz [~maddas@74.125.57.33] has quit [Disconnected by services]
16:17 -!- alehorst [~alehorst@200.146.83.98.dynamic.adsl.gvt.net.br] has quit
[Ping timeout: 250 seconds]
16:17 < nesv> Is there a way to interface with RS232 devices using Go?
16:17 < jessta> type Quote struct { Description string Amount float64
Tradesman *Tradesman
16:17 < jessta> gah
16:18 -!- Project_2501 [~Marvin@82.84.96.110] has joined #go-nuts
16:20 -!- pyrhho [~pyrhho@host-92-27-75-48.static.as13285.net] has quit [Quit:
pyrhho]
16:21 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-148-118.clienti.tiscali.it]
has quit [Ping timeout: 250 seconds]
16:22 < nesv> ...meaning is there a first-party package, or third-party
library to assist with this?
16:24 -!- va3atc [~va3atc@205.211.141.207] has joined #go-nuts
16:26 -!- StoVoKor [~va3atc@205.211.141.184] has quit [Ping timeout: 264 seconds]
16:29 < ArgonneIntern> jessta: I found the problem
16:30 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
16:30 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
16:30 < ArgonneIntern> sorry it took so long to respond we are doing some
application testing atm
16:30 < jessta> ArgonneIntern: nice, lacking the error and that code missing
important things makes it difficult for people to help
16:31 -!- alehorst [~alehorst@187.58.246.111] has joined #go-nuts
16:32 -!- rcrowley [~rcrowley@24-104-73-2-ip-static.hfc.comcastbusiness.net] has
joined #go-nuts
16:34 -!- rcrowley [~rcrowley@24-104-73-2-ip-static.hfc.comcastbusiness.net] has
quit [Client Quit]
16:35 < jessta> nesv: not that I'm aware of, but you could search
github,google code etc.
16:36 < jessta> nesv: have you checked the godashboard?
16:36 < nesv> Thanks, jessta.  I've been searching for a while, though.
16:36 < nesv> jessta: Yes, I have.
16:36 < jessta> then it might be time to write your own
16:37 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
16:37 -!- allengeorge [~allengeor@c-67-188-178-118.hsd1.ca.comcast.net] has joined
#go-nuts
16:37 < jessta> or write bindings for a c lib that does it
16:38 < nesv> Fair enough.  In an effort to learn Go, I was going to write
an application for work, but it requires serial communications.
16:39 < nesv> I feel like a newb saying this, but I would have absolutely no
idea how to start this.  My fault, I suppose, for always relying on a library to
provide such things.
16:41 -!- Queue29 [~Queue29@egress-w.sfo1.yelpcorp.com] has joined #go-nuts
16:43 -!- Tv [~Tv@ip-66-33-206-8.dreamhost.com] has joined #go-nuts
16:43 -!- allengeorge [~allengeor@c-67-188-178-118.hsd1.ca.comcast.net] has quit
[Quit: allengeorge]
16:45 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has joined
#go-nuts
16:46 -!- rcrowley [~rcrowley@24-104-73-2-ip-static.hfc.comcastbusiness.net] has
joined #go-nuts
16:47 < chomp> nesv, well do you know how to do that with, say, C?
16:47 -!- va3atc [~va3atc@205.211.141.207] has quit [Ping timeout: 258 seconds]
16:48 < nesv> chomp: No, I haven't had to do any RS232 communications in C.
16:48 < chomp> what platform are you on?
16:48 < chomp> or developing for, i should say
16:49 < chomp> on linux et al you have /dev/ttyS#
16:49 < nesv> chomp: Linux.  And it is intended to run as a daemon to handle
data flow, from a modem to a data processing engine.
16:49 < chomp> and you can perform plain old file i/o on it to interface
with an rs232 controller
16:49 < nesv> *** a bidirectional data flow
16:50 < chomp> you will probably also need to adjust terminal i/o settings
on the device file, but you can just use cgo and termios.h for that
16:51 < nesv> Okay, thanks for the pointers.
16:51 < chomp> no problem.
16:51 -!- GeertJohan [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has joined
#go-nuts
16:51 < chomp> it's really pretty easy to do
16:51 < nesv> chomp: I bet it is, it's just nothing I have ever had to do
before, at that "low" of a level.
16:51 < chomp> sure
16:51 < chomp> linux makes it easy :)
16:51 < nesv> :D
16:52 < chomp> here, C code http://www.ontrak.net/linux.htm
16:52 < nesv> Oooh, thank you!
16:52 < chomp> probably will show you everything you need to know
16:53 < nesv> Sweet - thank you very much!  :D
16:54 -!- LeNsTR [~lenstr@unaffiliated/lenstr] has joined #go-nuts
16:57 -!- tavis_rain [~tavisb@24-104-129.146.hfc.mediarain.com] has joined
#go-nuts
16:57 -!- rcrowley [~rcrowley@24-104-73-2-ip-static.hfc.comcastbusiness.net] has
quit [Quit: Computer has gone to sleep.]
16:58 -!- Nisstyre [~nisstyre@109.74.204.224] has joined #go-nuts
16:59 -!- pharris [~Adium@rhgw.opentext.com] has joined #go-nuts
17:00 -!- va3atc [~va3atc@205.211.141.207] has joined #go-nuts
17:10 < skelterjohn|work> exch: new version of go broke glfw
17:10 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 246 seconds]
17:10 < skelterjohn|work> trivial fixes, but fixes nonetheless
17:10 -!- noam [~noam@87.69.42.61.cable.012.net.il] has quit [Ping timeout: 250
seconds]
17:12 < exch> another new version?  D:
17:12 < exch> going way too fast
17:12 * exch hecks it out
17:12 < exch> *checks
17:14 < exch> which one is that?  I have weekly.2011-06-16
17:14 < skelterjohn|work> i updated earlier today
17:14 < skelterjohn|work> it has to do with unsafe.Sizeof
17:14 < skelterjohn|work> i think the type that evaluates to has changed
17:14 -!- noam [~noam@87.69.42.61.cable.012.net.il] has joined #go-nuts
17:15 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has quit [Ping
timeout: 252 seconds]
17:18 < exch> mm.  0 files merged, 0 files removed,
17:18 < skelterjohn|work> i get that sometimes
17:18 < skelterjohn|work> then i try again
17:19 < skelterjohn|work> or i'll up release and then up tip
17:19 < exch> tried it 3 times now.  it seems to think its up to date
17:21 -!- Nisstyre [~nisstyre@109.74.204.224] has quit [Ping timeout: 260 seconds]
17:21 -!- allengeorge [~allengeor@c-24-7-17-50.hsd1.ca.comcast.net] has joined
#go-nuts
17:22 < exch> meh.  i'll reinstall go from scratch.  Not looking forward to
that over a crappy wifi connection
17:23 < chomp> wait you can't just sync?
17:23 < exch> apparently not
17:24 < exch> hg pull && hg update weekly usually does the trick
17:24 < chomp> ah well the changes arent in the latest weekly it seems
17:24 < chomp> they went in friday
17:24 < exch> doh
17:24 < skelterjohn|work> oh - yeah i'm on tip
17:24 < exch> lol ok then :p
17:25 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has joined #go-nuts
17:25 -!- iwinulose [~iwinulose@2620:149:4:1604:8c34:a860:f615:8e6b] has joined
#go-nuts
17:26 < iwinulose> hello, world
17:26 < skelterjohn|work> hi
17:26 < iwinulose> fun question: has anyone here tried to build Go! on osx
10.7
17:26 < skelterjohn|work> yes, works fine
17:26 -!- Dr_Who [~tgall_foo@linaro/tgall-foo] has joined #go-nuts
17:26 < iwinulose> interesting
17:27 < iwinulose> I built on 10.6 just fine last night
17:27 < skelterjohn|work> wait, do i have 10.7?  i have the most recent
publicly available one
17:27 < skelterjohn|work> not the dev beta
17:27 < iwinulose> ah
17:27 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts
17:27 -!- mode/#go-nuts [+v iant] by ChanServ
17:27 < skelterjohn|work> and i'm not on that comp right now so i can't
check
17:27 < iwinulose> 10.6 (snow leopard) is the last public one
17:27 < iwinulose> there have been developer previews of 10.7
17:27 < skelterjohn|work> then i can't answer your question
17:27 < iwinulose> OK no worries :-)
17:29 -!- alehorst [~alehorst@187.58.246.111] has quit [Ping timeout: 255 seconds]
17:29 < chomp> iwinulose, do you have a beta of it?
17:35 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has quit [Ping timeout:
240 seconds]
17:35 -!- huin [~huin@91.85.188.1] has joined #go-nuts
17:38 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has joined
#go-nuts
17:40 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has joined #go-nuts
17:43 -!- 30BAAFM8H [~quassel@96-42-218-124.dhcp.roch.mn.charter.com] has joined
#go-nuts
17:45 -!- alehorst [~alehorst@200.146.5.247.dynamic.dialup.gvt.net.br] has joined
#go-nuts
17:48 -!- GeertJohan1 [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has joined
#go-nuts
17:49 -!- virtualsue [~chatzilla@nat/cisco/x-tychbpvvxnvemwmq] has quit [Quit:
ChatZilla 0.9.87 [Firefox 4.0.1/20110413222027]]
17:50 -!- robteix [~robteix@192.55.54.36] has joined #go-nuts
17:50 -!- kevlar_work [~kevlar@unaffiliated/eko] has quit [Remote host closed the
connection]
17:50 < zippoxer> is there any func to get array's average?
17:50 < skelterjohn|work> no
17:50 < zippoxer> ok so it'll be easy to implement
17:50 < skelterjohn|work> very few languages have that kind of thing built
in
17:51 < zippoxer> I think go will have that in future
17:51 < skelterjohn|work> i do ont.
17:51 < skelterjohn|work> not.
17:51 < zippoxer> wait there's a math package no?
17:51 < skelterjohn|work> certainly not as a built-in, and probably not in a
core library
17:51 < skelterjohn|work> yes, there is
17:52 -!- va3atc [~va3atc@205.211.141.207] has quit [Ping timeout: 276 seconds]
17:52 < skelterjohn|work> does C have an array averaging function anywhere
in the stdlib?  does java?
17:52 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has joined #go-nuts
17:52 < zippoxer> anyway just for a avg function I won't import a math lib
17:52 -!- go^lang [~newblue@119.121.252.242] has quit [Remote host closed the
connection]
17:52 < zippoxer> lol ur right
17:53 < skelterjohn|work> sum(l)/len(l) is almost as few chars as average(l)
anyway
17:53 < zippoxer> there is sum?
17:53 < skelterjohn|work> no :)
17:53 < skelterjohn|work> but in python there is
17:53 < skelterjohn|work> and they still don't have average
17:53 < zippoxer> yeah that's i know
17:56 -!- nesv [~nick@LONDON14-1176247333.sdsl.bell.ca] has quit [Quit: Leaving]
17:56 -!- ExsysTech [~ExsysTech@50-46-210-255.evrt.wa.frontiernet.net] has quit
[Read error: Connection reset by peer]
17:56 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has joined
#go-nuts
17:57 -!- kevlar_work [~kevlar@nat/google/x-lfxnfjpkgjdodnmt] has joined #go-nuts
17:57 -!- kevlar_work [~kevlar@nat/google/x-lfxnfjpkgjdodnmt] has quit [Changing
host]
17:57 -!- kevlar_work [~kevlar@unaffiliated/eko] has joined #go-nuts
17:57 -!- kevlar_work [~kevlar@unaffiliated/eko] has quit [Remote host closed the
connection]
17:57 -!- kevlar__work [~kevlar@nat/google/x-zzcdqupqspwcesjp] has joined #go-nuts
17:57 -!- ExsysTech [~ExsysTech@50-46-210-255.evrt.wa.frontiernet.net] has joined
#go-nuts
17:58 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has quit
[Client Quit]
17:58 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has joined
#go-nuts
17:59 -!- kevlar_work [~kevlar@nat/google/x-zzcdqupqspwcesjp] has quit [Changing
host]
17:59 -!- kevlar_work [~kevlar@unaffiliated/eko] has joined #go-nuts
18:01 -!- alehorst [~alehorst@200.146.5.247.dynamic.dialup.gvt.net.br] has quit
[Ping timeout: 255 seconds]
18:03 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has quit [Quit:
Computer has gone to sleep.]
18:05 < tzok> I have an array of structures.  I want to sort it by one of
structure's elements.  Do I have to implement Len(), Less() and Swap() or is there
maybe an easier way?
18:05 <+iant> you do have to implement those, yes
18:06 < tzok> ok, thanks
18:06 < aiju> there are each one line
18:06 < skelterjohn|work> if you want to use the sort package, anyway
18:06 < aiju> ...
18:06 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has joined #go-nuts
18:08 -!- wallerdev [~wallerdev@72.44.102.30] has joined #go-nuts
18:08 < tzok> Hmm, I tried it like this: http://pastebin.com/h97N8uy4
18:09 < tzok> but got: "error: attempt to index object which is not array,
string, or map"
18:09 < skelterjohn|work> why is the receiver type *neighbourhood?
18:09 < skelterjohn|work> why isn't it neighbourhood?
18:09 < skelterjohn|work> a slice is a reference type already
18:09 < skelterjohn|work> but specifically, you cannot index the address of
a slice.  you need to dereference it ifrst.
18:09 < skelterjohn|work> first
18:10 < tzok> I admit I made it *neighbourhood somewhat blindly by repeating
what I saw in the tutorial...
18:11 < skelterjohn|work> that isn't uncommon.  in this case you don't need
to.
18:11 < tzok> what does it mean to dereference a slice?
18:11 < skelterjohn|work> you don't dereference a slice - you dereference a
pointer
18:12 < skelterjohn|work> if you have "var x *T", you dereference it with
"*x".  the expression "*x" has type T
18:12 < tzok> Ok, I see, thanks
18:12 < skelterjohn|work> so one fix to your code would be to say
(*n)[index]
18:12 < skelterjohn|work> but that's not the best fix
18:13 -!- Nisstyre [~nisstyre@109.74.204.224] has joined #go-nuts
18:14 < tzok> It's clear for me now, thanks for very helpful answers
18:14 < skelterjohn|work> np
18:15 -!- TheMue [~TheMue@p5DDF5CD3.dip.t-dialin.net] has joined #go-nuts
18:17 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has quit [Quit:
Computer has gone to sleep.]
18:19 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host
closed the connection]
18:21 -!- replore_ [~replore@ntkngw256114.kngw.nt.ftth.ppp.infoweb.ne.jp] has quit
[Remote host closed the connection]
18:25 -!- Lockal [~Lockal@wikipedia/Lockal] has joined #go-nuts
18:27 -!- tncardoso [~thiagon@150.164.2.20] has quit [Quit: Leaving]
18:29 -!- rutkowski [~adrian@078088207207.walbrzych.vectranet.pl] has joined
#go-nuts
18:32 -!- Fish- [~Fish@9fans.fr] has quit [Ping timeout: 258 seconds]
18:34 -!- alehorst [~alehorst@189.58.26.26.dynamic.adsl.gvt.net.br] has joined
#go-nuts
18:36 < Lockal> hi!  Is it possible to separate Go code into 2 files with
gccgo?  It seems there is no #include or any similar function...
18:36 <+iant> are the files in the same package or in different packages?
18:36 < skelterjohn|work> you just compile them at the same time
18:36 <+iant> ...if they are in the same package
18:37 < Lockal> they are in different packages, and i can not compile them
neither at the same time nor one by one
18:37 <+iant> in different packages, presumably one imports the other
18:37 < aiju> you can't have circular dependencies
18:39 < skelterjohn|work> if two packages have to know about each other to
make sense, then they also make sense as a single package
18:39 < Lockal> package main imports package sdl.  When I link 2 object
files, gccgo says "main.go:(.text+0xac5): undefined reference to
`go.sdl.SDL_Init'"
18:39 < skelterjohn|work> i don't think sdl will import main
18:39 < aiju> Lockal: is there a particular reason you use gccgo and not gc?
18:40 <+iant> Lockal: show us the gccgo commands you are using to build the
program
18:41 < Lockal> aiju, from man gc: "gc is a graph analogue to wc in that it
prints to standard output the number of nodes, edges, connected components or
clusters contained in the input files"
18:41 < aiju> Lockal: haha
18:41 < aiju> no, the official go compiler
18:41 < Lockal> aiju, do you mean 8c?
18:41 < aiju> yeah
18:42 < Lockal> can it use shared libgo.so?
18:42 <+iant> no, 8c always links statically
18:44 < aiju> i.e.  in a sane manner
18:44 < Lockal> bad optimization, only static linking, impossible to strip
the result...  I still hope there is a way to link objects with gccgo
18:45 <+iant> there is of course a way to link objects with gccgo, it works
fine
18:45 < aiju> striping binaries should be a crime
18:45 < skelterjohn|work> why
18:45 < bugQ> stripping or striping ?
18:45 < aiju> makes debugging real fun
18:45 <+iant> if you show us the gccgo commands you are using, I can
probably tell you what you need to do
18:45 < aiju> bugQ: haha
18:45 < Lockal> hello world > 1mb is a crime
18:45 < aiju> stripping ;P
18:45 < skelterjohn|work> so don't do it if you're debugging
18:46 < aiju> skelterjohn|work: because problems are always perfectly
reproducible
18:46 < aiju> and you can always get the source of what you're running!
18:46 < skelterjohn|work> good
18:46 < bugQ> now my head is hurting to think about raid 3 executables O_o
18:46 < aiju> 20:50 < Lockal> hello world > 1mb is a crime
18:46 < aiju> the benefits outweigh the disadvantage
18:47 < Lockal> gccgo produces fast and small binaries.  But my programs
look really strange in 1 huge source code file
18:47 -!- fabled [~fabled@83.145.235.194] has quit [Quit: Ex-Chat]
18:47 < str1ngs> there goroutines are not faster though :P
18:47 -!- tavis_rain [~tavisb@24-104-129.146.hfc.mediarain.com] has quit [Quit:
Leaving.]
18:48 < aiju> is gccgo still a half broken implementation?
18:48 <+iant> no
18:48 < str1ngs> no its not broken at all
18:48 < skelterjohn|work> Lockal, you haven't showed us how you're using
gccgo
18:48 < aiju> does that mean it stopped using gcc?  ;P
18:48 <+iant> it's less efficient in some areas, more efficient in others,
but it's not broken
18:48 < skelterjohn|work> you don't have to put everything in one source
file
18:48 < aiju> but good that at least the worst stuff got fixed
18:49 < str1ngs> imo gccgo is a good alternative
18:49 -!- _andre [~andre@fosforo.f2.k8.com.br] has quit [Ping timeout: 276
seconds]
18:51 -!- _andre [~andre@fosforo.f2.k8.com.br] has joined #go-nuts
18:51 < aiju> when are LLVM and Microsoft Visual Go coming up?
18:51 < skelterjohn|work> don't scare me
18:51 < aiju> or Go#
18:52 < kevlar_work> someone already tried and failed at MSVGO (they called
it what, erGo?)
18:52 < aiju> ah yeah that ergo cra^Wproject
18:52 < skelterjohn|work> if MS ever made a go compiler, it would change
teenie pieces of it, call it the same language, and wonder why people get mad that
it it's no longer cross platform
18:52 < str1ngs> is there a way to make cont char** in cgo?
18:52 < aiju> no
18:52 < str1ngs> err const
18:52 < aiju> there is no const
18:52 < skelterjohn|work> strings are already constant
18:52 < kevlar_work> skelterjohn|work, they'd add an "exported" keyword,
remove the capitalization requirement, and call it "compatible"
18:52 < aiju> #define cunt const
18:53 < aiju> i should do that in my C99 code
18:53 < skelterjohn|work> you don't have a job, do you
18:53 <+iant> we used to have an "export" keyword, actually
18:53 < str1ngs> aiju: ok I have the option to use char* would that be
better as long as I free it?
18:53 < aiju> str1ngs: what are you talking about
18:53 < aiju> const has no semantic impact
18:54 < str1ngs> it does with warnings
18:54 < aiju> no
18:54 < aiju> const doesn't change semantics at all
18:54 < aiju> it just adds warnings
18:54 < str1ngs> /usr/include/prop/prop_dictionary.h:139:7: note: expected
'const char **' but argument is of type 'char **'
18:54 < skelterjohn|work> you aren't disagreeing with him, str1ngs
18:54 <+iant> aiju: const on a definition of a global variable does change
semantics
18:54 <+iant> but I agree that in most uses it does not
18:55 < aiju> iant: does it move to stuff to .rodata now?
18:55 <+iant> yes
18:55 < aiju> (.rodata should really be just .text)
18:55 < str1ngs> iant: so use a cont* if I can to avoid the warning?
18:55 < str1ngs> char* sorry
18:56 <+iant> give it whatever type it expects, yes
18:56 <+iant> .rodata does not require execute access
18:56 <+iant> on processors which can distinguish read access and execute
access
18:57 < aiju> this reminds me of gentoo complaining about qemu
18:57 < aiju> because it executes writable sections
18:57 <+iant> there are valid reasons for some programs to avoid that
18:57 -!- tvw [~tv@212.79.9.150] has quit [Remote host closed the connection]
18:57 < aiju> just put all the data on unaligned addresses ;P
18:57 <+iant> many security holes exist due to executable writable sections
18:58 < aiju> many security holes exist due to "voltage" in the CPU
18:58 <+iant> but that one is harder to fix
18:59 -!- saschpe [~quassel@opensuse/member/saschpe] has quit [Read error:
Connection reset by peer]
18:59 < aiju> the other kind is fixed by not running BIND ;P
18:59 -!- tncardoso [~thiago@189.59.178.169.dynamic.adsl.gvt.net.br] has joined
#go-nuts
19:00 -!- weazelb0y [~weazelb0y@69.60.16.202] has quit [Quit: weazelb0y]
19:05 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
19:05 < Lockal> skelterjohn|work, http://pastie.org/2102823
19:05 -!- MX80 [~MX80@cust151.253.117.74.dsl.g3telecom.net] has quit [Ping
timeout: 244 seconds]
19:05 < skelterjohn|work> ah
19:05 < skelterjohn|work> this isn't a gccgo or compiler issue
19:06 -!- _andre [~andre@fosforo.f2.k8.com.br] has quit [Ping timeout: 244
seconds]
19:06 < skelterjohn|work> you can't reference unexported things in other
packages
19:06 < ArgonneIntern> it's syntax
19:06 < skelterjohn|work> and they're unexported if they aren't upper case
19:06 -!- MX80 [~MX80@cust151.253.117.74.dsl.g3telecom.net] has joined #go-nuts
19:06 < ArgonneIntern> import ("./sdl")
19:06 < ArgonneIntern> ?
19:06 < skelterjohn|work> that won't fix it
19:06 <+iant> You also can't compile them that way, you need to compile them
separately, since they are in different packages
19:06 < skelterjohn|work> that code just won't work, no matter how you
compile it
19:06 < skelterjohn|work> that too
19:06 <+iant> gccgo -c sdl.go
19:06 <+iant> gccgo -c main.go
19:06 <+iant> gccgo main.o sdl.o
19:07 < Lockal> ArgonneIntern, still the same message
19:07 < skelterjohn|work> you didn't read what i said :\
19:07 < ArgonneIntern> heh they said it wouldn't work lol
19:07 <+iant> anyhow the error is telling you the same thing
skelterjohn|work is telling you: 'sdl.test' is not exported
19:07 -!- rcrowley [~rcrowley@24-104-73-2-ip-static.hfc.comcastbusiness.net] has
joined #go-nuts
19:08 < Lockal> iant, gccgo -c main.go > main.go:3:18: error: invalid
reference to unexported identifier 'sdl.test'
19:08 <+iant> yes, you have to also fix the problem skelterjohn|work is
telling you about
19:08 <+iant> and that gccgo is telling you about
19:08 <+iant> 'sdl.test' is not exported
19:09 <+iant> only identifiers starting with an uppercase letter are
exported
19:09 -!- allengeorge_ [~allengeor@c-24-7-17-50.hsd1.ca.comcast.net] has joined
#go-nuts
19:10 < Lockal> skelterjohn|work, "main.go:3:18: error: reference to
undefined identifier 'sdl.Test'"
19:10 < Lockal> or did you mean TEST or Sdl?
19:11 < skelterjohn|work> I meant sdl.Test
19:11 < skelterjohn|work> but you have to fix it in both filoes
19:11 -!- fs111 [~fs111@fs111.0x20.be] has joined #go-nuts
19:11 < skelterjohn|work> files
19:11 < skelterjohn|work> and recompile them both
19:11 -!- allengeorge [~allengeor@c-24-7-17-50.hsd1.ca.comcast.net] has quit [Ping
timeout: 240 seconds]
19:12 -!- tncardoso [~thiago@189.59.178.169.dynamic.adsl.gvt.net.br] has quit
[Ping timeout: 255 seconds]
19:12 -!- _andre [~andre@fosforo.f2.k8.com.br] has joined #go-nuts
19:12 < Lockal> have recompiled them both, still the same error x_x
19:13 < fs111> hi
19:13 <+iant> that error means that main refers to sdl.Test but the sdl
package does not define anything named Test
19:13 < skelterjohn|work> in sdl.go, you need to change "func test() {}" to
"func Test() {}"
19:14 < fs111> I have a question about launching programs from go, can it
be, that os.Stdout is not a tty, if I just pass it through?
19:14 < aiju> fs111: sure
19:15 < Lockal> Ok, i removed all the .o and .gox files, and it says now
"error: import file 'sdl' not found".  main.go and sdl.go are in the same
directory
19:15 < zippoxer> does go have something like the one line condition?
(someBool ? x : y)
19:15 < aiju> Lockal: you need to build sdl first
19:15 < aiju> zippoxer: no
19:15 <+iant> Lockal: are you running the gccgo -c commands I suggested?
19:15 < aiju> zippoxer: it's called a ternary expression
19:16 < zippoxer> pretty sad because I killed 6 lines
19:16 < zippoxer> instead of one line
19:16 < aiju> just catenate them and place ; on the end of each
19:16 < aiju> ;P
19:16 < skelterjohn|work> line count is not a good metric for code quality
19:17 < Lockal> aiju, iant, skelterjohn|work Thank you, it works now!
19:17 < zippoxer> lol :P
19:17 -!- _andre [~andre@fosforo.f2.k8.com.br] has quit [Ping timeout: 240
seconds]
19:17 < skelterjohn|work> is there decent makefile support for using gccgo?
19:17 < aiju> zippoxer: you probaly split one 180 char line into six with 30
chars each ;P
19:17 < fs111> aiju: so, you say it is a tty still?  I am just trying to
figure out, why ls -l is not working, when I invoke it from go
19:17 < zippoxer> nah
19:17 < zippoxer> just a second
19:17 < aiju> fs111: it is just passed on
19:18 < zippoxer> http://www.pastie.org/2102870
19:18 < fs111> hmm, okay
19:18 < zippoxer> maybe there's a shortcut for it?
19:18 < fs111> then ls expects something I do not understand yet
19:18 < aiju> fs111: how are you calling it?
19:18 < str1ngs> skelterjohn|work: not templates.  but I have some Makefile
that use both compilers
19:19 < aiju> countRecords = resetCount
19:19 < skelterjohn|work> zippoxer: 4 lines http://www.pastie.org/2102877
19:19 < aiju> if resetCount == 0 { countRecords = len(speedRecords) }
19:19 < aiju> and your variable name insult my eyes
19:19 < skelterjohn|work> your eyes can take it
19:19 < fs111> aiju: https://gist.github.com/1038652
19:20 < zippoxer> but gofmt destroys that line :P
19:20 < fs111> something like that
19:20 -!- bakedb [~kel@cpc4-lea21-0-0-cust755.6-3.cable.virginmedia.com] has
joined #go-nuts
19:20 < aiju> zippoxer: i just didn't ment to spam
19:20 < aiju> *meant
19:20 < skelterjohn|work> zippoxer, why is it that you want things to be
condensed and compact?
19:20 < fs111> aiju: I am just playing with go and try to reimplement some
small unix utils
19:20 < aiju> fs111: what's your arguments string?
19:20 < fs111> this is going to be something like the watch command
19:20 < aiju> ehm array
19:20 < zippoxer> I just wanted to know if there's a shortcut
19:20 < zippoxer> if I'm doing it the go way...
19:20 < str1ngs> fs111: use exec package imo
19:20 < aiju> compactness is good to some extent
19:21 < aiju> fs111: you might need to pass "ls" as a first argument
19:21 < fs111> aiju: [-l] basically
19:21 < fs111> uh, right, lemme see
19:21 < aiju> StartProcess should really be called CreateProcessEx
19:22 < fs111> aiju: well, that changed it already, I get now a list, but no
details yet
19:22 < aiju> odd
19:23 < aiju> fs111: have you tried stracing it?
19:23 < Namegduf> CreateProcessX2RevengeOfFork
19:23 < tzok> does anybody know if the official go compiler is available as
arch linux package?
19:23 < fs111> no, I only play w/ go for two evenings after work
19:23 < skelterjohn|work> depending on how you launch the subprocess, you
might want args to be ["ls", "-l"] or just ["-l"]
19:23 < str1ngs> fs111: use the exec package
19:23 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has quit [Ping
timeout: 260 seconds]
19:23 < fs111> don't know yet, how to do that really :/
19:23 < skelterjohn|work> the new exec api is the latter
19:23 < skelterjohn|work> the os api is the former (i think)
19:23 < fs111> okay, going to give that a try
19:23 < zippoxer> some people here hold the whole go library in their head.
19:24 < fs111> it's constantly changing also, as it seems
19:24 < zippoxer> I wish I could too :\
19:24 < fs111> the other day it said use ForkExec which was then renamed to
StartProcess
19:24 < fs111> confusing...
19:24 < skelterjohn|work> i maintain a tool that uses the exec api
19:24 < fs111> but fun so far!
19:24 < skelterjohn|work> so i have to know how exec works
19:24 < str1ngs> fs111: ie output,err := exec.Command("ls","-l").Output()
19:25 -!- tncardoso [~thiago@187.59.186.148] has joined #go-nuts
19:25 < aiju> 21:29 < zippoxer> some people here hold the whole go
library in their head.
19:25 < aiju> i doubt that
19:25 < fs111> str1ngs: going to try that, thx
19:25 < aiju> no one can remember the entire crypto package
19:25 < skelterjohn|work> hahahahah
19:25 < zippoxer> loll
19:25 < zippoxer> I mean most..
19:25 < skelterjohn|work> it's 87 unique packages, afterall
19:25 < str1ngs> fs111: or you can use exec.Command to create a cmd struct
19:25 < aiju> zippoxer: Go stdlib is not Windows API
19:25 < aiju> your daily programming needs are fulfilled by not too many
functions
19:26 < zippoxer> yeah that's the modern way
19:26 < aiju> i want fork back
19:26 < aiju> fork or bust
19:26 <+iant> crypto is 87 packages but most of them are basically the same
19:26 < skelterjohn|work> aiju, cgo
19:26 < zippoxer> aiju: btw what's your alternative to resetCount?  ^.^
19:26 < aiju> zippoxer: nreset
19:27 < skelterjohn|work> of the crypto packages, i wonder how many have
never been invoked outside of their test suites?
19:27 < zippoxer> lol
19:27 < aiju> or nres, even
19:27 < zippoxer> okay I got it, short names
19:27 < skelterjohn|work> i would call it "x"
19:27 < aiju> consistency is more important than length
19:27 < skelterjohn|work> and the other var would be "y"
19:27 < zippoxer> than look at the code after a week
19:27 < aiju> local variables can be named i, j, k
19:27 < aiju> zippoxer: nreset is rather clear to me
19:27 < aiju> n-anything means "number of" to me
19:27 < zippoxer> i mean x, y whatever
19:28 <+iant> skelterjohn|work: believe it or not I'm pretty sure that every
one of the crypto packages has been used at least once
19:28 < skelterjohn|work> if it's something that i need to read in a week,
my vars are the pair of a letter and a number
19:28 < zippoxer> iant: by who?  :)
19:28 < aiju> zippoxer: basically, the larger the scope, the longer the name
19:28 < skelterjohn|work> the letter tells me the category of the variable,
and the number indexes into the code
19:28 -!- rutkowski [~adrian@078088207207.walbrzych.vectranet.pl] has quit [Quit:
WeeChat 0.3.3-dev]
19:29 < skelterjohn|work> doing this makes it much easier to read decompiled
code
19:29 < zippoxer> but that's readable?  :\
19:29 < aiju> zippoxer: skelterjohn|work is obviously trolling you
19:29 < aiju> we need a package for detecting sarcasm
19:29 -!- m4dh4tt3r [~Adium@c-98-210-145-213.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
19:30 -!- m4dh4tt3r [~Adium@c-98-210-145-213.hsd1.ca.comcast.net] has joined
#go-nuts
19:30 < str1ngs> if skelterjohn|work || aiju { panic("sarcasm") }
19:30 < str1ngs> there hows that?
19:31 < skelterjohn|work> doesn't compile - i'm not a valid identifier
19:31 * aiju is now known as aiju|takingadump
19:32 < zippoxer> shame for you.
19:32 < skelterjohn|work> heh - i have the name tag because i often leave my
laptop on at home, and it will have the nick "skelterjohn"
19:33 < zippoxer> don
19:33 < zippoxer> i never clicked enter.
19:34 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Read error:
Connection reset by peer]
19:34 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
19:34 -!- ShadowIce
[~pyoro@HSI-KBW-109-193-121-123.hsi7.kabel-badenwuerttemberg.de] has joined
#go-nuts
19:34 -!- ShadowIce
[~pyoro@HSI-KBW-109-193-121-123.hsi7.kabel-badenwuerttemberg.de] has quit
[Changing host]
19:34 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
19:36 -!- ijknacho [~ijknacho4@cpe-72-190-64-3.tx.res.rr.com] has joined #go-nuts
19:38 -!- jessta [~jessta@li7-205.members.linode.com] has quit [Ping timeout: 255
seconds]
19:38 < skelterjohn|work> my quad tree is leaking
19:39 < aiju> "quad tree"?
19:39 < aiju> what sort of fruit is a quad?
19:39 -!- rcrowley [~rcrowley@24-104-73-2-ip-static.hfc.comcastbusiness.net] has
quit [Quit: Computer has gone to sleep.]
19:39 < aiju> ah, a quartary tree
19:39 < skelterjohn|work> it's a fruit that partitions 2-space into four
quadrants, centered on a single point, recursively
19:39 -!- kuroneko [~chris@yayoi.xware.cx] has quit [Read error: Connection reset
by peer]
19:40 -!- rphillips [~rphillips@unaffiliated/rphillips] has quit [Ping timeout:
260 seconds]
19:40 -!- kuroneko [~chris@yayoi.xware.cx] has joined #go-nuts
19:40 -!- mjard [~k@misadventuregames.com] has quit [Remote host closed the
connection]
19:40 < zippoxer> sounds tasty.
19:40 -!- mjard [~k@misadventuregames.com] has joined #go-nuts
19:40 -!- mibocote [~matt@li161-224.members.linode.com] has quit [Ping timeout:
252 seconds]
19:40 -!- adg [~nf@atka.wh3rd.net] has quit [Ping timeout: 252 seconds]
19:40 < chomp> just place a large bucket under it
19:40 -!- jtoy_ [~jtoy@li167-197.members.linode.com] has quit [Ping timeout: 244
seconds]
19:40 < skelterjohn|work> i am, that's how i know it's leaking
19:40 < skelterjohn|work> but searching through that bucket takes linear
time
19:40 < aiju> sounds like a fancy way to replace arrays for replacing arrays
19:41 -!- ijknacho [~ijknacho4@cpe-72-190-64-3.tx.res.rr.com] has quit [Ping
timeout: 244 seconds]
19:41 < chomp> then step 2.  drink the quad juice from the bucket.
delicious quad juice.
19:41 < aiju> -for replacing arrays
19:41 < skelterjohn|work> i...guess
19:41 < skelterjohn|work> somewhat faster, when it doesn't leak
19:42 -!- adg [~nf@atka.wh3rd.net] has joined #go-nuts
19:42 -!- mode/#go-nuts [+o adg] by ChanServ
19:42 < chomp> yeah quad-trees are a bit nicer than that.
19:42 -!- bytbox [~s@129.2.129.145] has quit [Read error: Connection reset by
peer]
19:42 < fs111> aiju: str1ngs: got it working with the exec package!  thx!
19:43 -!- rphillips [~rphillips@unaffiliated/rphillips] has joined #go-nuts
19:43 -!- mibocote [~matt@li161-224.members.linode.com] has joined #go-nuts
19:43 -!- alehorst [~alehorst@189.58.26.26.dynamic.adsl.gvt.net.br] has quit [Ping
timeout: 255 seconds]
19:44 -!- rcrowley [~rcrowley@24-104-73-2-ip-static.hfc.comcastbusiness.net] has
joined #go-nuts
19:46 < tzok> I'm trying to compile the official go compiler, but it fails
with this error
19:46 < tzok> http://pastebin.com/BQMMWLKb
19:47 < str1ngs> fs111: np
19:47 -!- message144 [~message14@pool-98-112-179-26.lsanca.fios.verizon.net] has
joined #go-nuts
19:47 < aiju> yacc problem?
19:47 < str1ngs> tzok: bison 2.5?
19:47 < tzok> str1ngs, yes
19:47 -!- jtoy [~jtoy@li167-197.members.linode.com] has joined #go-nuts
19:48 -!- tvw [~tv@e176004201.adsl.alicedsl.de] has joined #go-nuts
19:48 < tzok> is it faulty in this version?
19:48 -!- jessta [~jessta@li7-205.members.linode.com] has joined #go-nuts
19:48 < str1ngs> tzok: that should be fixed.  with the latest release
19:48 < str1ngs> tzok: try with tip
19:49 < tzok> str1ngs, tip?
19:50 < tzok> Did previous versions of bison work?  Maybe byacc (Berkeley
yacc) will do?
19:51 < str1ngs> hg pull;hg upgrade tip
19:51 < str1ngs> previous version of bison worked.  but bison 2.5 exposed a
bug
19:52 < str1ngs> the bug has been fixed.  so try with latest release or tip
19:52 < skelterjohn|work> upgrade -> update?
19:52 < str1ngs> yes
19:53 -!- zippoxer [~zippoxer@109.65.248.117] has quit [Remote host closed the
connection]
19:53 < str1ngs> thanks for correcting every useless thing I say
19:53 < aiju> hg pull -u
19:55 < tzok> It went through this error, thanks!
19:55 < tzok> So hg update tip is basically like updating to head in svn or
master in git?
19:56 < aiju> tip is the latest revision
19:56 < str1ngs> tzok: yes but try to use release if you can
19:56 < aiju> i think it is HEAD in svn
19:56 * aiju has repressed most SVN knowledge
19:56 < aiju> i'm suffering from post subversion stress disorder
19:56 < str1ngs> tzok: release.r57.2 should be ok to use for this
19:57 < tzok> Yes, I tried to to use release version before.  If new release
is in repo, I'll use it and try then
19:57 -!- alehorst [~alehorst@177.16.64.197] has joined #go-nuts
19:58 -!- alehorst [~alehorst@177.16.64.197] has quit [Client Quit]
19:59 -!- va3atc [~va3atc@24-246-17-37.cable.teksavvy.com] has joined #go-nuts
19:59 -!- GeertJohan1 [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has quit [Quit:
Leaving.]
20:02 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
20:02 < visof> hello
20:02 < skelterjohn|work> hi
20:02 < visof> is Go alternative to C ?
20:03 < visof> can we replace Go with C , and C go to die ?
20:03 <+iant> Go is an alternative to C, yes, but it is not a replacement
for C
20:03 < visof> we can't write kernels in Go ?
20:05 < visof> 4?
20:05 < visof> ?
20:06 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has joined
#go-nuts
20:07 < Aperculum> visof: you can write kernel with go
20:07 < Aperculum> you can do pretty much anything with Go that you can do
with C
20:07 < ArgonneIntern> poiner arithmetic
20:07 < skelterjohn|work> not sure i agree with that
20:07 < ArgonneIntern> BAM!
20:07 < Aperculum> you just can't use C libraries directly with Go
20:08 < Aperculum> correct me if I'm wrong
20:08 < skelterjohn|work> not sure i agree with that either
20:08 < skelterjohn|work> go drags around a runtime
20:08 < skelterjohn|work> making it hard to insert it into the kernel, i'd
think
20:08 < visof> why is C alive?
20:08 < aiju> 22:13 < ArgonneIntern> poiner arithmetic
20:08 < skelterjohn|work> also, go (via cgo) can interact with C libraries
20:08 < aiju> you can do pointer arithmetic in C
20:08 < aiju> eh
20:08 < aiju> Go :D
20:08 < skelterjohn|work> visof: legacy, familiarity
20:08 < aiju> visof: why is COBOL alive?
20:09 < aiju> but that counter-question makes C sound bad
20:09 * aiju is twotiming Go with C
20:09 < visof> someone told me the Go code can be faster than C code
20:09 < aiju> visof: probably not
20:09 < aiju> i'd expect Go to be a wee bit slower
20:09 < skelterjohn|work> depends what it's doing
20:09 < visof> Go can do all what C do and as fast as C or faster , why C is
alive ?
20:10 -!- visof [~visof@unaffiliated/visof] has quit [Quit: Reconnecting]
20:10 < skelterjohn|work> well, i guess if you use the c compiler included
with go, you can do some extra stuff
20:10 -!- visof [~visof@41.238.233.106] has joined #go-nuts
20:10 <+iant> why do we have more than one programming language?
20:10 -!- visof [~visof@41.238.233.106] has quit [Changing host]
20:10 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
20:10 < skelterjohn|work> can you launch goroutines from C code compiled
with 6c/8c?
20:10 < visof> Go can do all what C do and as fast as C or faster , why C is
alive ?
20:10 < aiju> visof: C doesn't change every month
20:10 < aiju> skelterjohn|work: yes
20:11 < aiju> skelterjohn|work: but i expect it to be a frightening
procedure
20:11 < visof> aiju: what do you mean ?
20:11 < skelterjohn|work> go changes every month.  C does not.
20:11 < aiju> visof: one current problem with Go is that it changes often
20:11 < aiju> and hence go code breaks often
20:11 < aiju> gofix alleviates this to some extent
20:11 < visof> go still experimental ?
20:11 < skelterjohn|work> yes
20:12 < aiju> Go doesn't allow my favourite tricks with switch()
20:12 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 240 seconds]
20:12 < aiju> switch(x) { case 1: x = 1; if(y > 3) { case 2: z++; } }
20:12 < aiju> yes, that's valid C:)
20:12 < visof> i still can't understand why C is alive and there is Go ?
20:12 < skelterjohn|work> then you haven't been reading what has been said
20:12 < aiju> visof: programming languages don't die ...
20:13 < aiju> visof: people still program Fortran 77
20:13 < fs111> visof: there is still Cobol code written every day
20:13 < aiju> existing codebases, existing programmers ;P
20:13 -!- kfmfe04 [~kfmfe04@host-58-114-183-56.dynamic.kbtelecom.net] has joined
#go-nuts
20:13 < aiju> fs111: sssh cobol has genuine advantages
20:13 <+iant> visof: why is there more than one programming language?
20:14 < aiju> fs111: its lack of hype features such as functions,
procedures, user-defined types etc.  makes the code very clearly
20:14 < aiju> and very maintanable
20:14 < fs111> aiju: i dont believe in these modern things anyway *g*
20:14 < aiju> although COBOL has procedures, you just can't pass arguments
20:14 < aiju> or write recursive code
20:15 < skelterjohn|work> sort of like expressive goto statements
20:15 < aiju> all control flow in COBOL is basically glorified GOTO
statements
20:15 < aiju> you can even tell it to exist all the code between two labels!
20:15 < aiju> s/exist/execute
20:15 < aiju> sort of like a procedure call
20:15 -!- rcrowley [~rcrowley@24-104-73-2-ip-static.hfc.comcastbusiness.net] has
quit [Quit: Computer has gone to sleep.]
20:15 < skelterjohn|work> does it then jump back?
20:16 < aiju> exactly
20:16 < exch> 10 PUT "YAY"; 20 GOTO 10
20:16 < skelterjohn|work> does it keep a stack to tell it where to jump back
to?
20:16 < aiju> PERFORM INPUTDATA THRU OUTPUTDATA
20:16 < aiju> not a stack
20:16 < aiju> it's not recursive
20:16 < huin> okay, something of a daft question...  how do i work out if
the result of os.Open is ENOENT?
20:16 < skelterjohn|work> so you can't do this while you're doing it, and
jump back twice to the right spot?
20:16 < huin> i'm finding this quite complex to find out :/
20:16 < aiju> skelterjohn|work: it will just break
20:16 < aiju> in a totally random manner
20:16 < skelterjohn|work> good
20:16 -!- visof [~visof@unaffiliated/visof] has quit [Ping timeout: 240 seconds]
20:17 < aiju> COBOL even has pointers
20:17 < aiju> people write linked lists in COBOL
20:17 < skelterjohn|work> they can use them to implement recursive
algorithms
20:17 < aiju> every single feature of C can be emulated in COBOL
20:17 -!- visof [~visof@41.238.233.106] has joined #go-nuts
20:17 < skelterjohn|work> fin
20:17 -!- visof [~visof@41.238.233.106] has quit [Changing host]
20:17 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
20:17 < aiju> it's just a HUGE clusterfuck
20:18 < visof> i still can't understand why C is alive and there is Go ?
20:18 < skelterjohn|work> i guess it's one of the world's many unfathomable
mysteries
20:18 < visof> what is Go best for ?
20:18 <+iant> visof: you aren't actually reading anything we say, are you?
20:18 -!- tavis_rain [~tavisb@24-104-129.146.hfc.mediarain.com] has joined
#go-nuts
20:18 < visof> iant: i got a DC
20:19 < visof> i have a badinternet connect
20:19 < Aperculum> visof: C is alive because languages won't just die after
another one is invented and Go was created to make a low level language with many
advantages of modern higher level languages
20:19 < aiju> visof: is the gov't still fucking with it?
20:19 < exch> Goos not intended as a replacement for C, or anything really.
Even if it was, C will probably always be around.  It's closer to the metal and
thus useful for tasks that Go does not seek to address
20:19 < exch> *Go is
20:19 <+iant> visof: why would you expect any language to replace any other
language?
20:19 <+iant> visof: why does C still exist now that we have C++?
20:19 < aiju> HAHA
20:20 < exch> C++ exists because an obvious practical joke was
misinterpreted as being serious
20:20 < skelterjohn|work> lol
20:20 < Aperculum> why do we speak english here even though esperanto was
invented?
20:20 < visof> the smart guys should write unified language
20:20 < visof> that can replace all of them
20:20 < skelterjohn|work> they did - it's called java
20:20 < Aperculum> you cannot do that
20:20 < exch> why?  :P
20:20 < visof> you can
20:21 < visof> exch: you can save a lot of time of learning
20:21 < aiju> Aperculum: I'm sorry Dave, I can't let you do that
20:21 < visof> you can focus with one langage
20:21 < Aperculum> indeed
20:21 < aiju> visof: it is called C
20:21 < skelterjohn|work> no one needs to know anything other than java,
because that's what they teach at most american universities for intro courses
20:21 < exch> languages that seek to fit in everywhere usually end up
fitting in nowhere at all
20:21 < visof> well, so why there is Go , C++, java, python, ...  ?
20:21 < skelterjohn|work> anyway, i'm going to stop feeding/trolling the
troll
20:22 < visof> skelterjohn|work: i'm not troll
20:22 < skelterjohn|work> if no difference is observable, then no difference
exists
20:23 -!- visof [~visof@unaffiliated/visof] has quit [Quit: Reconnecting]
20:23 < huin> anyway..  :)
20:23 -!- visof [~visof@41.238.233.106] has joined #go-nuts
20:23 < huin> okay, something of a daft question...  how do i work out if
the result of os.Open is ENOENT?
20:23 < aiju> huin: Error stuff ;P
20:23 < visof> skelterjohn|work: i'm not troll
20:23 < skelterjohn|work> huin: did you try looking through the source?
20:23 < skelterjohn|work> if no difference is observable, then no difference
exists
20:24 < aiju> huin: i think it's in syscall
20:24 < huin> skelterjohn|work: yeah...  i'm having a hard time going
through the multitude of files in os and syscall
20:24 < huin> figured there should be a quick easy way that i'm just not
seeing
20:24 < aiju> huin: ah, just compare to ENOENT
20:24 < aiju> or Enonexist, for the awesome Plan 9 flair
20:24 < huin> i tried err == os.ENOENT
20:24 -!- wallerdev [~wallerdev@72.44.102.30] has quit [Quit: wallerdev]
20:25 < skelterjohn|work> how'd that work out
20:25 < huin> not as well as i'd like :) - i.e false, it would seem
20:25 < skelterjohn|work> if you are actually getting the error, use
fmt.Printf("%T", theErr) to see what its grounded type is
20:25 < huin> os.Errno
20:25 < huin> well, no, in fact
20:25 < skelterjohn|work> theErr.(os.Errno) == os.ENOENT
20:26 < huin> it would be os.PathError, with Err = os.Errno
20:26 < skelterjohn|work> err.(*os.PathError).Err == os.ENOENT
20:26 < skelterjohn|work> or something like that
20:28 < skelterjohn|work> os.PathError has an Error field (of type os.Error)
20:28 < skelterjohn|work> so that won't work probably
20:28 < huin> hm.  well it compiled :/
20:28 < skelterjohn|work> what
20:28 < skelterjohn|work> did you do .Error instead of .Err?
20:29 < huin> yeah
20:29 < huin> if e, ok := err.(*os.PathError); ok && e.Error == os.ENOENT
20:29 < skelterjohn|work> if that doesn't work, check out e.Error's type
20:30 -!- bugQ [~bug@c-71-195-206-249.hsd1.ut.comcast.net] has quit [Ping timeout:
244 seconds]
20:30 < huin> os.Errno with a value of 2, apparently
20:31 < aiju> don't rely on that value
20:31 < huin> aye, os.ENOENT
20:31 < huin> if that's what you mean
20:31 < skelterjohn|work> syscall.ENOENT is 2
20:32 -!- bakedb [~kel@cpc4-lea21-0-0-cust755.6-3.cable.virginmedia.com] has quit
[Ping timeout: 255 seconds]
20:32 < aiju> skelterjohn|work: on your system
20:33 < skelterjohn|work> what i meant was, that "2" should be written
"syscall.ENOENT" when comparing
20:33 < huin> i'd never use 2 literally, the constant is there for a reason
20:33 < huin> but yeah, it makes it likely that my debug output indicates
ENOENT
20:34 < huin> hm.  this is a sadly complicated way to check that error :(
20:34 -!- robteix [~robteix@192.55.54.36] has quit [Ping timeout: 255 seconds]
20:35 < skelterjohn|work> compare err.String() to something
20:35 < skelterjohn|work> :)
20:35 < huin> bleh.  :)
20:35 < huin> if err != nil { if e, ok := err.(*os.PathError); ok { if
errno, ok := e.Error.(os.Errno); ok && errno == os.ENOENT { ...
20:35 < huin> am i missing something?  it feels...  overcomplex :)
20:36 < skelterjohn|work> i agree
20:37 * huin writes utility function.
20:45 -!- Lockal [~Lockal@wikipedia/Lockal] has quit [Quit: Ухожу я от вас (xchat
2.4.5 или старше)]
20:46 -!- virtualsue [~chatzilla@nat/cisco/x-eeforqamvmsijnki] has joined #go-nuts
20:48 -!- eimantas [~eimantas@ip-212-52-52-163.kava.lt] has joined #go-nuts
20:56 -!- TheMue [~TheMue@p5DDF5CD3.dip.t-dialin.net] has quit [Quit: TheMue]
20:56 -!- allengeorge_ [~allengeor@c-24-7-17-50.hsd1.ca.comcast.net] has joined
#go-nuts
20:58 -!- bobbysworld [~bobbyswor@99-20-88-178.lightspeed.austtx.sbcglobal.net]
has joined #go-nuts
20:59 -!- visof [~visof@41.238.233.106] has quit [Ping timeout: 246 seconds]
20:59 -!- allengeorge [~allengeor@c-24-7-17-50.hsd1.ca.comcast.net] has quit [Ping
timeout: 252 seconds]
21:00 -!- visof [~visof@41.238.233.106] has joined #go-nuts
21:02 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Remote host closed
the connection]
21:04 -!- kfmfe04 [~kfmfe04@host-58-114-183-56.dynamic.kbtelecom.net] has quit
[Quit: kfmfe04]
21:04 -!- kfmfe04 [~kfmfe04@host-58-114-183-56.dynamic.kbtelecom.net] has joined
#go-nuts
21:05 -!- eimantas [~eimantas@ip-212-52-52-163.kava.lt] has quit [Quit: eimantas]
21:08 -!- visof [~visof@41.238.233.106] has quit [Ping timeout: 246 seconds]
21:09 -!- visof [~visof@41.238.233.106] has joined #go-nuts
21:13 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has quit [Ping
timeout: 244 seconds]
21:14 -!- huin [~huin@91.85.188.1] has quit [Quit: bedtime]
21:19 -!- visof [~visof@41.238.233.106] has quit [Quit: leaving]
21:21 -!- zippoxer [~zippoxer@109.65.248.117] has joined #go-nuts
21:21 -!- zippoxer [~zippoxer@109.65.248.117] has left #go-nuts []
21:21 -!- zippoxer [~zippoxer@109.65.248.117] has joined #go-nuts
21:25 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has quit [Remote
host closed the connection]
21:28 -!- r_linux [~r_linux@static.200.198.180.250.datacenter1.com.br] has quit
[Ping timeout: 246 seconds]
21:31 -!- dfc [~dfc@124-169-4-131.dyn.iinet.net.au] has joined #go-nuts
21:33 < kfmfe04> hi, I'm having trouble getting the proper syntax to
initialize a constant array of strings: const weekdays string[] = string[]{"SUN",
"MON", "TUE", "WED", "THU", "FRI", "SAT"} - how do I correct this?
21:34 -!- ronnyy [~quassel@p4FF1C44A.dip0.t-ipconnect.de] has joined #go-nuts
21:34 -!- ijknacho [~ijknacho4@cpe-72-190-64-3.tx.res.rr.com] has joined #go-nuts
21:35 < aiju> const weekdays = [...]string{"SUN", "MON", etc, "SAT"}
21:35 < crunge> []string
21:35 < kevlar_work> aiju, :P.  Don't encourage him to use an array.
21:35 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
21:35 < aiju> arrays aren't evil
21:35 -!- zaero [~eclark@servo.m.signedint.com] has quit [Ping timeout: 264
seconds]
21:36 -!- ArgonneIntern [82ca0251@gateway/web/freenode/ip.130.202.2.81] has quit
[Quit: Page closed]
21:36 < kevlar_work> aiju, there's no reason for him to use them.
21:37 < kfmfe04> what's the alternative?
21:37 < kevlar_work> and in any case, until he understands the difference,
it's best for him to use []string because he can pass it to a function that takes
a []string without needing the [:]
21:37 < kevlar_work> kfmfe04, use a slice
21:37 -!- dfc [~dfc@124-169-4-131.dyn.iinet.net.au] has quit [Quit: Silly man, I
am a Baron!]
21:37 < kfmfe04> so for my specific example, how would I do this?
21:38 -!- zaero [~eclark@servo.m.signedint.com] has joined #go-nuts
21:38 < kevlar_work> var ( weekdays = []string{"SUN", "MON", ...  , "SAT"} )
21:39 < kfmfe04> for my specific purpose, I just need to index into the
array/slice by time.Weekday (an int) to get the equivalent string - what would be
the difference between using a slice or an array?
21:39 < kevlar_work> it doesn't matter much for what you're doing, which is
probably just for _, dow := range weekdays {...}
21:40 < kevlar_work> kfmfe04, you can use either.  A slice, however, is what
you will use whenever you're actually interacting with the data, so you might as
well use them until you get more comfortable with when you can use one and when to
use the other.
21:40 < kevlar_work> in my not so humble opinion, which you are free to
disregard.
21:41 < kfmfe04> is there a good tutorial/url on using slices vs arrays?
21:41 < kevlar_work> kfmfe04, use slices.
21:41 < kevlar_work> !golang slice type
21:41 < GoBIR> kevlar_work: Spec Section Slice types -
http://golang.org/doc/go_spec.html#Slice_types
21:43 < kevlar_work> (aiju, also, neither slices nor arrays can be const)
21:43 -!- Project_2501 [~Marvin@82.84.96.110] has quit [Quit: E se abbasso questa
leva che succ...]
21:43 < kevlar_work> kfmfe04, have you read Effective Go?
21:43 < kevlar_work> there is a section in there on arrays, and probably one
on slices too
21:44 < kevlar_work> !goego arrays
21:44 < GoBIR> kevlar_work: Effective Go arrays -
http://golang.org/doc/effective_go.html#arrays
21:44 < kfmfe04> rereading effective go now - so the distinction is arrays
are value-types while slices are reference-types?
21:45 < kevlar_work> uh, if you want to distinguish value and reference
types, then sure.
21:46 < chomp> the distinction is more importantly that slices are views of
arrays
21:46 < kevlar_work> but that Go can (and does) easily manage the underlying
array for you.
21:46 -!- awidegreen [~quassel@h-170-226.A212.priv.bahnhof.se] has quit [Ping
timeout: 260 seconds]
21:46 < kevlar_work> x = append(x, y) to add to the end, x = x[1:] to remove
from the beginning, etc.
21:48 < kfmfe04> I would prolly understand the distinction better in C/C++
terms - a slice is like an array of pointers whereas an array is like a contiguous
array of structs?
21:48 -!- gnuvince [~vince@ip-96-43-233-174.dsl.netrevolution.com] has joined
#go-nuts
21:49 < aiju> kfmfe04: no
21:49 < aiju> a slice is a fancy pointer
21:49 < aiju> (with a length)
21:50 < kfmfe04> so sizeof( slice ) is not dependent on length
21:50 < kfmfe04> cheap to send as an argument to a function?
21:50 < aiju> slices are 12 bytes wide on x86
21:50 < aiju> so yeah
21:51 -!- virtualsue [~chatzilla@nat/cisco/x-eeforqamvmsijnki] has quit [Ping
timeout: 264 seconds]
21:52 < kevlar_work> kfmfe04, a slice can be thought of as a struct { void
*start; int len; int capacity; }
21:52 < gnuvince> Does Go ship with tools for lexing/parsing?
21:52 -!- Dr_Who [~tgall_foo@linaro/tgall-foo] has quit [Quit: ZZZZZzzzzz]
21:52 < kevlar_work> gnuvince, only for Go
21:53 < kevlar_work> unless ebnf has grown a parser, which I don't think it
has.
21:53 -!- init6 [~chad@ice.superfrink.net] has quit [Remote host closed the
connection]
21:53 -!- kuroneko_ [~chris@yayoi.xware.cx] has joined #go-nuts
21:53 < gnuvince> kevlar_work: thanks
21:53 -!- kuroneko [~chris@yayoi.xware.cx] has quit [Ping timeout: 260 seconds]
21:54 < kfmfe04> ic - thx for the clarification, aiju, kevlar_work - I guess
in my particular case, for weekday (a constant array), either should work
21:54 -!- zanget [~zanget@hurf.durf.me] has quit [Ping timeout: 252 seconds]
21:54 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping
timeout: 255 seconds]
21:54 < kevlar_work> kfmfe04, note that you have to use a var; arrays cannot
be const.
21:54 -!- mjard [~k@misadventuregames.com] has quit [Ping timeout: 260 seconds]
21:54 -!- xb95 [~xb95@dreamwidth/staff/mark] has quit [Ping timeout: 252 seconds]
21:54 < kevlar_work> (neither can slices or maps)
21:54 < kfmfe04> ya - I just noticed that
21:55 -!- iant [~iant@216.239.45.130] has joined #go-nuts
21:55 -!- mode/#go-nuts [+v iant] by ChanServ
21:55 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts
21:55 < kfmfe04> there must've been a reason why const arrays are not
allowed...
21:55 < kfmfe04> or are arrays implied to be const anyways?
21:56 -!- zanget [~zanget@hurf.durf.me] has joined #go-nuts
21:56 -!- xb95 [~xb95@qq.is] has joined #go-nuts
21:56 -!- mjard [~k@misadventuregames.com] has joined #go-nuts
21:56 -!- xb95 [~xb95@qq.is] has quit [Changing host]
21:56 -!- xb95 [~xb95@dreamwidth/staff/mark] has joined #go-nuts
21:56 < tzok> does go allow to do operations on bool variables?
21:57 < kevlar_work> tzok, what kind of operations?
21:57 < tzok> I get compilation error that neither & nor * are defined for
bool...  and I wanted a logical AND of two boolean expressions
21:57 < kevlar_work> try || and &&
21:58 < tzok> I know, but I have a long list of conditions which all must be
met
21:58 < tzok> So I always did with & operator in C/Python/whatever
21:58 < Namegduf> So combine them.
21:58 < Namegduf> One more character each won't hurt you.
21:58 < Namegduf> a && b && c
22:00 < tzok> I know that one character won't hurt.  It;'s just that
expressions are quite long and I used to put each one of them on a separate line
this way :)
22:00 < kevlar_work> tzok, I've seen that end in disaster in C, because a
boolean is often implemented with a full word value, so people try to do (a == b)
& (b == c) which can have very unintended results
22:01 -!- tncardoso [~thiago@187.59.186.148] has quit [Quit: bye]
22:01 < kevlar_work> but in any case, && is explicitly for a boolean value
and your variables/expressions should be long enough that the added character
doesn't noticably affect anything.
22:01 -!- tncardoso [~thiago@187.59.186.148] has joined #go-nuts
22:01 -!- tncardoso [~thiago@187.59.186.148] has quit [Read error: Connection
reset by peer]
22:02 < tzok> Ok, thanks
22:03 < kfmfe04> I think I'm beginning to understand slices - they're more
like an iterator or a range construct used to point to a range in a struct?
slices seem to be a replacement for pointer arithmetic
22:03 < Namegduf> There's no reason you'd need another line with && and not
with &
22:03 < kfmfe04> sry - I meant point to a range of an array in that last
comment
22:03 -!- sniper506th [~sniper506@rrcs-70-61-192-18.midsouth.biz.rr.com] has quit
[Quit: Leaving...]
22:04 < Namegduf> They're not a replacement for anything that C had.
22:05 < tzok> Namegduf, here take a look at this: http://pastie.org/2103545
22:05 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has joined #go-nuts
22:05 < kfmfe04> slices not like a replacement for STL iterators?  they seem
to have similar functionality (although slices seem more straightforward)
22:06 < tzok> Namegduf, that's how I used it for readability purpose only
22:06 < Namegduf> tzok: Lack of &&= might be legitimate, I guess, but doing
it manually as
22:06 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
22:06 < Namegduf> v = v && another_very_long_expression
22:06 < Namegduf> Isn't too bad either
22:07 < tzok> Mhm, right.  It's not a blocker or something.  Just that I
wasn't sure about bool type in go
22:13 -!- noam [~noam@87.69.42.61.cable.012.net.il] has quit [Ping timeout: 260
seconds]
22:13 -!- CodeWar [~sfsdf@c-98-210-15-142.hsd1.ca.comcast.net] has joined #go-nuts
22:13 -!- ronnyy [~quassel@p4FF1C44A.dip0.t-ipconnect.de] has quit [Remote host
closed the connection]
22:16 < CodeWar> wrt GO memory model:
http://golang.org/doc/go_mem.html#tmp_112 I noticed print(a) here a is being used
without any lock or synchronization.  Two questions:
22:16 < CodeWar> <a> is it going to throw if print(a) is invoked
before the initialization or is it going to sleep or just print the wrong value
22:16 < CodeWar> <b> how do you implement this on ARM where we have
weak consistency....  the reads of a will require a read barrier ....
22:17 < kevlar_work> I have no idea where you're looking
22:17 < kevlar_work> what section and what code block?
22:18 < CodeWar> kevlar_work, look for the section that explains "once"
22:20 < CodeWar> if I m understanding this feature right ..  then whoever
added it ...  GREAT JOB!!  wish Java had it too :-)
22:20 < kevlar_work> CodeWar, a doesn't need synchronization because there
are no goroutines
22:21 < kevlar_work> oh, sorry, again looking at wrong place
22:21 < CodeWar> it does have two goroutines right?
22:21 < kevlar_work> yes
22:21 < kevlar_work> however, in both cases, by the time it gets to
print(a), the variable a is guaranteed to not be changing
22:22 < CodeWar> its a smart way of doing publication safety or lazy
immutables ..  nice work ..  but I m curious how the reader side is implemented or
are you assuming x86 causual consistency
22:22 < CodeWar> kevlar_work, :-) if you dont follow what weak consistency
is or what role a read barrier plays then our conversation ends right here...
22:23 < kevlar_work> CodeWar, while I do understand those things, they are
irrelevant to this conversation
22:23 < CodeWar> kevlar_work, not really lets try an example...  lets say
the first go routine executed on core 1 and it did the initialization and called
setup which initializes "a"
22:24 < CodeWar> now the second go routine runs on core 8 skips
initialization because it must use atomics underneath but does a read of "a"
kapouch!!!!
22:24 < CodeWar> for it to see the right value of "A" you are either
assuming causal consistency or need explicit read barrier
22:24 < pharris> CodeWar: Then the 2nd goroutine would block until the
function called by the 1st one returns.
22:24 < CodeWar> pharris, I see so that explains <a>
22:25 < kevlar_work> CodeWar, that particular example is intended to
demonstrate sync.Once; there is a whole list of things that is wrong with the code
itself (not the least of which is the use of print and global variables)
22:26 < CodeWar> kevlar_work, understoood...  do you atleast understand the
problem I m pointing at ? viz., reads happening without an explicit lock variable
and the problem it causes with memory consistency?
22:26 < pharris> There is a lock.  It's buried inside Once.
22:27 < CodeWar> pharris, are you saying readeres must always use once() or
only initializers should use it
22:27 < CodeWar> if the former then how is it different than synchronized
with a bool that checks for initialized inside the lock
22:27 < kevlar_work> CodeWar, you need to reread the "happens before"
section
22:27 -!- noam [~noam@87.69.42.61.cable.012.net.il] has joined #go-nuts
22:27 < kevlar_work> the whole point of the memory model is to say that if a
= "blah" is guaranteed to happen before print(a), then a must be "blah"
22:27 < CodeWar> kevlar_work, I ve implemented happens before semantics in
compilers and processors below ..  so calm down ..
22:27 < kevlar_work> and any implementation that violates that is not a
proper Go implementation or is buggy.
22:28 < CodeWar> there is a good documentation that explains this problem ..
it was discussed in 1999 for JMM let me pull out that thread
22:28 -!- GeertJohan [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has quit [Quit:
Leaving.]
22:28 -!- chomp [~chomp@dap-209-166-184-50.pri.tnt-3.pgh.pa.stargate.net] has quit
[Quit: Leaving]
22:29 < pharris> CodeWar: Yes, in that example any read of 'a' without
calling Once(setup) would be undefined.
22:29 < kevlar_work> CodeWar, and if anyone anywhere ever changed "a" after
once() it would also be undefined.
22:30 < CodeWar> I must be really dumb since after 10 mins I ve still not
been able to communicate the problem ..  my bad
22:30 < CodeWar> the issue is any core that does a read of a variable
without an acquire (something a lock provides) can see stale data...
22:30 < CodeWar> which is the basis of the DCL problem in Java...  what you
have here is very promising but I m wondering how its implemented
22:31 < CodeWar> this wont cause problems on x86_64 because they guarantee
casual consistency and total lock order but anywhere else its busted ...  most
importantly ARM
22:31 < pharris> CodeWar: And we're trying to tell you that Once does all
that for you.
22:31 < kevlar_work> CodeWar, how does a lock (stored at a different memory
location) cause your data to become fresh?
22:31 < pharris> It might be an Aquire.  It might be a Mutex.  It might be
little green aliens.  You don't care.  It's a high level construct.
22:31 < CodeWar> pharris, understood and I m curious how its doing that
because the reader either places the code inside once or it doesnt ...  if it
doesnt then ?
22:32 -!- ExtraSpice [XtraSpice@78-57-204-104.static.zebra.lt] has quit [Remote
host closed the connection]
22:32 < CodeWar> kevlar_work, please read up on meomry consistency
22:32 < CodeWar> *memory
22:32 < kevlar_work> CodeWar, you make me less interested in trying to get
the root of your question every time you imply that I don't know what I'm talking
about.
22:33 < CodeWar> kevlar_work, unfortunately it is true..  I m not interested
in hearing from you because you are not familiar with consistency to begin with ..
22:33 < CodeWar> I m here to chat with the compiler guy or the memory model
guy that made this decision for Go...
22:33 < kevlar_work> In any case, I think you won't be satisfied with my
answer no matter what it is, so I'll point you to iant and rsc, both of whom
should be able to answer how/whether it's done in gc and gccgo.
22:33 < CodeWar> sorry if this sounds bad ..  I mean no disrespect
22:34 < CodeWar> to a language guy "how does one implement publication
safety" is a sufficient question ...  anybody else is simply the wrong guy to talk
to ...
22:34 < kevlar_work> CodeWar, I told you who to talk to.  While I can answer
your question for gc, I won't, because you don't think I'm a compiler guy.
22:34 -!- pharris [~Adium@rhgw.opentext.com] has quit [Quit: Leaving.]
22:34 < CodeWar> thanks kevlar_work ..  while I sounded like a jerk I
apologize
22:34 < kevlar_work> note also that neither of them come on IRC often, so
you'll have to post on the mailing list.
22:35 < uriel> adg: can't you guys get the dumbass that published this
garbage that is comming up as FUD on every mention of Go to publish a retraction
or something:
http://www.reddit.com/r/programming/comments/i5jbg/experience_porting_4k_lines_of_c_code_to_go/c213ia1
22:35 -!- jbooth1 [~jay@209.249.216.2] has left #go-nuts []
22:35 < Namegduf> CodeWar: On x86, it makes use of a full fence instruction
22:35 < Namegduf> On ARM, I am unsure
22:35 < CodeWar> Namegduf, on the writer side right?
22:35 < Namegduf> In sync.Once
22:35 < uriel> adg: or probably better, just publish a paper (along the
lines of the paper for example that ken published for his C compilers in the early
90's), doing a minimally sane comarison
22:36 < Namegduf> sync.Once uses a mutex, and always locks it.
22:36 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 276 seconds]
22:36 < Namegduf> (Then unlocks it after potentially calling f)
22:36 < CodeWar> makes sense thats exactly what Java does at the end of
constructor ....  a #StoreStore barrier
22:36 < Namegduf> The mutex lock causes a full fence.
22:36 < CodeWar> on the reader side there is no fence ...  am I correct?
22:36 < CodeWar> its just a plain load instruction
22:36 < Namegduf> There's no writer or reader side.
22:36 < Namegduf> Both call sync.Once, both have full fence instructions
executed when sync.Once locks and unlocks a mutex.
22:37 < CodeWar> ouchh!!
22:37 < CodeWar> then its not a cool feature ...  my bad :-(((
22:37 < CodeWar> so its a synchronized iwth a counter to check if it was
initialized ....
22:37 < Namegduf> It's a mutex and a bool.
22:37 < CodeWar> fences on ARM are terrible
22:38 < CodeWar> on x86 ...  you actually dont need a fence for the reader
but since we dont make the distinction we dont gain anything . its how Java does
final references
22:38 < Namegduf> On x86 all that matters, technically speaking
22:38 < Namegduf> Is that some processor core executed a full fence
instruction somewhere
22:38 < CodeWar> correct
22:39 < CodeWar> because there is cache coherence and no load reordering
22:40 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts
22:40 < CodeWar> the argument against the current implementation being for a
onetime setup and 1 million time read ..  hyou ll play the full fence cost a
million times
22:42 < kevlar_work> I still find this entire conversation irrelevant.  It
is an implementation detail.  What is used right now is the proverbial sledge
hammer, just like a whole lot of things in Go (see GOMAXPROCS).  Expect them to
get smarter in the future.
22:43 <+iant> CodeWar: sync.Once does require a memory fence, yes
22:43 < kevlar_work> I suspect fewer ffi and memory barriers when the
runtime actually starts knowing about locality and tries to schedule goroutines
based on it.
22:44 <+iant> Go is not a language which requires reasoning about memory
barriers, because that is really hard
22:44 < kevlar_work> (and by that I mean that I expect the implementations
to do somewhat more intelligent things about them, not that it will magically get
better)
22:44 < CodeWar> iant, since theres a mutex ..  its a fence + CAS ..  while
CAS has been getting cheaper on x86 nehalem + its still not there yet ..
22:44 < CodeWar> iant, I completely understand not exposing it to the
programmer but I m curious on any work at the compiler level to speed things up
22:45 < CodeWar> on the Cortex Axx chips these atomics + fences are really
slow or its just me
22:45 <+iant> there are no current plans for that, no
22:45 <+iant> maybe someday
22:46 < kevlar_work> CodeWar, I suspect that the current bottlenecks in
using GOMAXPROCS>1 vastly outweigh the fence penalty.
22:47 -!- piranha [~piranha@adsl-ull-233-41.41-151.net24.it] has quit [Quit:
Computer has gone to sleep.]
22:47 < CodeWar> kevlar_work, as you can tell by now I m a complete Go
novice with dumb questions ...  so I totally dont know what Go does and hwat its
problems are ..
22:47 < CodeWar> BUT
22:47 < CodeWar> the sync.Once caught my atttention ...  because that is a
problem I ve been forever trying to solve :-) unsuccessfully that is ....  the
fenceless read part
22:48 <+iant> Go has pretty good runtime performance, but beating the
runtime performance of C++0x atomics is not really a goal at present
22:48 <+iant> our goal is more like getting within 10%
22:49 < CodeWar> iant, you want to take the atomics out ..  Java style so
biased locks / thin locks lock elision but I m not sure if GO is jitted..  is it?
22:49 <+iant> Go is not jitted, it is compiled to machine code
22:49 < CodeWar> ahh ...  well you can still do biased lock without Jittin
...  happy to discuss if you re interested
22:50 < CodeWar> idea being uncontested locks that dont migrate much should
be atomic free and fence free
22:50 <+iant> sure, but at this point in the development of Go that is an
implementation detail
22:51 < CodeWar> as I read through the docs . I ll admit I m being more and
more attracted .....  :-)
22:56 -!- antihero [~james@0xf.nl] has joined #go-nuts
22:56 < CodeWar> ahh the concurrency thing ..  and it seems somebody asked
this question in the audience too
22:56 < CodeWar> the problem I ve faced with similar designs is when you
message pass references ..  it is HARD to guarantee single ownership
22:56 < antihero> What resources would one recommend (free, preferably) for
getting started with Go?
22:56 < CodeWar> because that reference will have a hierarchical structure
..  which could contain other references....
23:00 -!- tzok [~tzok___@c126-6.icpnet.pl] has left #go-nuts ["Wychodzi"]
23:02 -!- CodeWar [~sfsdf@c-98-210-15-142.hsd1.ca.comcast.net] has quit [Quit:
Leaving]
23:06 -!- angasule [~angasule@190.2.33.49] has quit [Read error: Connection reset
by peer]
23:06 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts
23:07 -!- angasule [~angasule@190.2.33.49] has quit [Remote host closed the
connection]
23:08 < kfmfe04> would be nice if there were a webpage with a listing of all
standard library interfaces (for browsing) so we could adhere more closely to
accepted conventions...
23:09 < kevlar_work> huh?
23:09 < kevlar_work> oh, I see what you mean.
23:10 < kfmfe04> sometimes I find myself defining an interface that's
slightly different from a standard one - no reason why I shouldn't adapt mine to
fit in that case
23:14 -!- Bigbear1 [~Cody@d75-158-128-4.abhsia.telus.net] has joined #go-nuts
23:16 -!- photron [~photron@port-92-201-66-238.dynamic.qsc.de] has quit [Ping
timeout: 258 seconds]
23:17 < kfmfe04> suppose I have a var x *MyObject that already points to
something - how would I copy-construct a var y MyObject off of x?
23:17 -!- replore [~replore@ntkngw256114.kngw.nt.ftth.ppp.infoweb.ne.jp] has
joined #go-nuts
23:19 < kevlar_work> y := *x?
23:19 < kfmfe04> nm - didn't realize there was a dereference operator - thx
23:19 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host
closed the connection]
23:20 < kfmfe04> got thrown off by the fact that . acts as . and -> in Go
23:21 < kevlar_work> lol
23:21 < kevlar_work> it's tricky.
23:21 < kfmfe04> :) sometimes, the baggage from other languages help,
sometimes not
23:31 -!- tavis_rain [~tavisb@24-104-129.146.hfc.mediarain.com] has quit [Read
error: Connection reset by peer]
23:40 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has joined
#go-nuts
23:46 < str1ngs> junk in the trunk?  :P
23:46 -!- dreadlorde [~dreadlord@c-68-42-82-10.hsd1.mi.comcast.net] has quit [Ping
timeout: 258 seconds]
23:52 -!- dfc [~dfc@eth59-167-133-99.static.internode.on.net] has joined #go-nuts
23:54 -!- TheSeeker2 [riiight@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has
joined #go-nuts
23:55 -!- keithcascio [~keithcasc@nat/google/x-byviopauslxpawik] has joined
#go-nuts
23:55 -!- replore [~replore@ntkngw256114.kngw.nt.ftth.ppp.infoweb.ne.jp] has quit
[Remote host closed the connection]
23:56 -!- TheSeeker [riiight@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has
quit [Ping timeout: 260 seconds]
23:58 -!- taruti [taruti@ultra.violetti.org] has quit [Ping timeout: 258 seconds]
23:58 -!- Aperculum [lauri@kapsi.fi] has quit [Ping timeout: 250 seconds]
23:59 < kfmfe04> what is the proper way to implement a set<string> in
Go? map[string] bool ?
23:59 < kevlar_work> that seems to be the common idiom
--- Log closed Wed Jun 22 00:00:14 2011