--- Log opened Wed May 12 00:00:03 2010
--- Day changed Wed May 12 2010
00:00 <+iant> a type assertion is not addressable
00:00 < Soultaker> fair enough.
00:01 < Ginto8> what you could do however is this:
00:01 < Ginto8> c := b.(MyType)
00:01 < Ginto8> c.x = 123
00:01 < Ginto8> b = c
00:01 < Ginto8> though it is more verbose
00:03 < sladegen> that's quite an understatement.
00:04 -!- aho [~nya@f051089083.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
00:04 -!- ________ [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has quit
[Quit: Leaving]
00:04 -!- Discoloda [~vincent@adsl-75-37-71-165.dsl.frs2ca.sbcglobal.net] has quit
[Remote host closed the connection]
00:04 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has joined
#go-nuts
00:10 < Soultaker> also that does not change the value stored for b
00:11 < kmeyer> so make your own clone of Vector
00:11 < kmeyer> that's allowed
00:11 < Soultaker> or wait, maybe it does
00:11 < Soultaker> no, I don't want any of that.  I'm just trying things out
to get a better understanding of how these concepts work in Go
00:12 < Soultaker> Vector is fine the way it is as far as I'm concerned =)
00:12 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
00:12 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
00:12 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has left
#go-nuts ["Leaving"]
00:18 < kmeyer> Soultaker: gofmt -r "interface{} -> YourType"
00:18 < kmeyer> wouldn't require all the typecasting, etc :P
00:22 -!- Venom_X [~pjacobs@71.20.102.220] has joined #go-nuts
00:23 -!- itrekkie [~itrekkie@ip68-228-245-244.ph.ph.cox.net] has joined #go-nuts
00:23 < Soultaker> yes, of course.  ;)
00:30 -!- braddunbar [~brad@rrcs-24-172-225-206.midsouth.biz.rr.com] has joined
#go-nuts
00:37 < allengeorge> So...if I'm reading stack traces and something crashes
in a method, the first value is the reciever's addr, right?
00:39 < allengeorge> Also, is there a way to inspect the value of a variable
(no debugger AFAIK, right?)
00:42 -!- Venom_X [~pjacobs@71.20.102.220] has quit [Quit: Venom_X]
00:51 -!- iant [~iant@67.218.103.81] has quit [Ping timeout: 252 seconds]
00:51 -!- jdp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has quit []
00:52 -!- kota1111 [~kota1111@gw2.kbmj.jp] has joined #go-nuts
01:00 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has quit [Quit:
slashus2]
01:04 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
01:14 -!- rv2733 [~rv2733@c-98-242-168-49.hsd1.fl.comcast.net] has quit [Quit:
Leaving]
01:16 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has joined #go-nuts
01:20 -!- zyichi [~zyichi@124.205.180.154] has joined #go-nuts
01:20 -!- Chinainvent [~yunkai@121.0.29.199] has joined #go-nuts
01:36 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has quit [Quit:
slashus2]
01:39 -!- crakrjak [~merc@rrcs-70-62-156-154.central.biz.rr.com] has quit [Ping
timeout: 240 seconds]
02:00 -!- slashus2 [~slashus2@74-141-108-109.dhcp.insightbb.com] has joined
#go-nuts
02:01 -!- b00m_chef [~watr@d64-180-45-230.bchsia.telus.net] has joined #go-nuts
02:05 -!- b00m_chef [~watr@d64-180-45-230.bchsia.telus.net] has quit [Ping
timeout: 240 seconds]
02:19 -!- bmizerany [~bmizerany@dsl081-064-072.sfo1.dsl.speakeasy.net] has quit
[Remote host closed the connection]
02:27 -!- tibshoot [~tibshoot@191.176.103-84.rev.gaoland.net] has quit [Ping
timeout: 245 seconds]
02:34 -!- kingfishr [~kingfishr@c-98-201-60-173.hsd1.tx.comcast.net] has joined
#go-nuts
02:35 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts
02:35 -!- mode/#go-nuts [+v iant] by ChanServ
02:35 -!- kingfishr [~kingfishr@c-98-201-60-173.hsd1.tx.comcast.net] has quit
[Remote host closed the connection]
02:36 -!- kingfishr [~kingfishr@c-98-201-60-173.hsd1.tx.comcast.net] has joined
#go-nuts
02:42 -!- gospch_ [~gospch@unaffiliated/gospch] has joined #go-nuts
02:46 -!- gospch [~gospch@unaffiliated/gospch] has quit [Ping timeout: 245
seconds]
02:49 -!- Nexoro [~nexo@c-71-192-75-183.hsd1.ma.comcast.net] has left #go-nuts []
02:53 -!- ikkebr [~ikke@unaffiliated/ikkebr] has quit [Ping timeout: 260 seconds]
02:57 -!- bmizerany [~bmizerany@c-24-6-37-113.hsd1.ca.comcast.net] has joined
#go-nuts
02:59 < exch> allengeorge: bit late, but you can print variable values with
fmt.Printf("%v\n", myvar)
02:59 < exch> use %+v or %#v for more output
02:59 < exch> %T prints the variable's type
03:00 -!- divoxx [~divoxx@189.63.157.83] has quit [Quit: divoxx]
03:20 -!- slashus2 [~slashus2@74-141-108-109.dhcp.insightbb.com] has quit [Ping
timeout: 245 seconds]
03:20 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 260
seconds]
03:41 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has joined #go-nuts
03:47 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
Leaving]
03:56 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
03:58 -!- Inominate [~sirrobin@cpe-076-182-074-143.nc.res.rr.com] has left
#go-nuts []
03:59 -!- tazjin [~tazjin@p5DC82572.dip.t-dialin.net] has joined #go-nuts
04:02 -!- gospch [~gospch@unaffiliated/gospch] has quit [Remote host closed the
connection]
04:03 -!- Innominate [~sirrobin@cpe-076-182-074-143.nc.res.rr.com] has joined
#go-nuts
04:05 -!- gospch [~gospch@unaffiliated/gospch] has joined #go-nuts
04:07 -!- gospch [~gospch@unaffiliated/gospch] has quit [Read error: Connection
reset by peer]
04:07 -!- itrekkie [~itrekkie@ip68-228-245-244.ph.ph.cox.net] has quit [Quit:
itrekkie]
04:07 -!- gospch [~gospch@unaffiliated/gospch] has joined #go-nuts
04:16 -!- gisikw [~gisikw@137.28.246.34] has joined #go-nuts
04:17 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
04:19 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Read error:
Connection reset by peer]
04:21 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
04:21 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Read error:
Connection reset by peer]
04:21 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
04:25 -!- apphacker [~apphacker@c-24-5-192-234.hsd1.ca.comcast.net] has joined
#go-nuts
04:30 -!- braddunbar [~brad@rrcs-24-172-225-206.midsouth.biz.rr.com] has quit
[Quit: leaving]
04:35 -!- jA_cOp [~yakobu@unaffiliated/ja-cop/x-9478493] has quit [Quit: Leaving]
04:39 -!- crakrjak [~merc@rrcs-70-62-156-154.central.biz.rr.com] has joined
#go-nuts
04:46 -!- [vertex] [~Alexandre@201.79.227.138] has quit [Ping timeout: 258
seconds]
04:59 -!- jingzuo [~brandon@h159.123.255.206.cable.thlq.cablelynx.com] has joined
#go-nuts
05:02 -!- scm [justme@d136048.adsl.hansenet.de] has quit [Ping timeout: 258
seconds]
05:06 -!- tazjin [~tazjin@p5DC82572.dip.t-dialin.net] has quit [Ping timeout: 246
seconds]
05:06 -!- jeek [~jeek@pedobear.jeek.net] has quit [Read error: Operation timed
out]
05:06 -!- samitheberber [~saada@melkinpaasi.cs.helsinki.fi] has quit [Ping
timeout: 240 seconds]
05:06 -!- scm [justme@d134010.adsl.hansenet.de] has joined #go-nuts
05:06 -!- mortens [moocow@gateway/shell/xzibition.com/x-eekvepptksiwydfb] has quit
[Ping timeout: 276 seconds]
05:06 -!- mortens [moocow@gateway/shell/xzibition.com/x-vdmfajumprropuaw] has
joined #go-nuts
05:06 -!- samitheberber [~saada@melkinpaasi.cs.helsinki.fi] has joined #go-nuts
05:06 -!- uriel [~uriel@li43-28.members.linode.com] has quit [Ping timeout: 258
seconds]
05:06 -!- uriel [~uriel@li43-28.members.linode.com] has joined #go-nuts
05:06 -!- jeek [~jeek@pedobear.jeek.net] has joined #go-nuts
05:15 -!- slashus2 [~slashus2@74-141-108-109.dhcp.insightbb.com] has joined
#go-nuts
05:19 -!- eikenberry [~jae@mail.zhar.net] has quit [Ping timeout: 276 seconds]
05:21 -!- samferry [~sam@atheme/member/samferry] has quit [Write error: Broken
pipe]
05:21 -!- segy [~segfault@pdpc/supporter/active/segy] has quit [Read error:
Operation timed out]
05:21 -!- segy [~segfault@pdpc/supporter/active/segy] has joined #go-nuts
05:22 -!- tsykoduk [~tsykoduk@2001:470:1f04:671:20d:93ff:fe77:1dc4] has quit [Read
error: Operation timed out]
05:23 -!- tsykoduk [~tsykoduk@2001:470:1f04:671:20d:93ff:fe77:1dc4] has joined
#go-nuts
05:29 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Quit: WeeChat
0.3.2]
05:29 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
05:33 -!- Archwyrm [~archwyrm@66.249.8.146] has quit [Remote host closed the
connection]
05:36 -!- wrtp [~rog@78.144.165.123] has quit [Ping timeout: 245 seconds]
05:38 -!- Kashia [~Kashia@port-92-200-245-118.dynamic.qsc.de] has joined #go-nuts
05:42 -!- wrtp [~rog@89.242.170.31] has joined #go-nuts
05:42 -!- apphacker [~apphacker@c-24-5-192-234.hsd1.ca.comcast.net] has quit [Ping
timeout: 240 seconds]
05:46 -!- samferry [sam@atheme/member/samferry] has joined #go-nuts
05:50 -!- samferry [sam@atheme/member/samferry] has quit [Read error: Operation
timed out]
05:52 -!- samferry [~sam@atheme/member/samferry] has joined #go-nuts
06:01 < MacCoaster> http://pastebin.com/z2UjEFvM am i doing it wrong?  for
line 5 it complains nested func not allowed :\
06:02 -!- path[l] [UPP@120.138.102.34] has joined #go-nuts
06:08 < dave_r5> is there any magic I can do to make cgo accept something
like this: C.fflush(C.NULL)
06:15 < jesusaurus> drevell: maybe you need to cast C.NULL to an unsafe
pointer
06:17 -!- slashus2 [~slashus2@74-141-108-109.dhcp.insightbb.com] has quit [Ping
timeout: 268 seconds]
06:17 -!- ChangeOfHeart [~trent@60-240-56-87.tpgi.com.au] has joined #go-nuts
06:22 < jessta> MacCoaster: I don't think you can do that in const
06:23 < jessta> MacCoaster: you can't use complex data structures in const
06:28 < drevell> jesusaurus: tried your suggestion, "cannot use
unsafe.Pointer(*_C_NULL) (type unsafe.Pointer) as type *_C_FILE in function
argument"
06:28 < drevell> i'm not sad about it, and it's not blocking me, i'm just
hoping to learn something.  so no biggie if it's impossible
06:29 < drevell> thanks for the suggestion
06:33 -!- Kashia [~Kashia@port-92-200-245-118.dynamic.qsc.de] has quit [Ping
timeout: 240 seconds]
06:36 -!- Kashia [~Kashia@port-92-200-245-118.dynamic.qsc.de] has joined #go-nuts
06:37 -!- Archwyrm [~archwyrm@66.249.8.146] has joined #go-nuts
06:37 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
06:44 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
06:44 -!- jingzuo [~brandon@h159.123.255.206.cable.thlq.cablelynx.com] has left
#go-nuts []
06:48 < jessta> drevell: what is the problem with C.fflush(C.NULL)?
06:49 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
06:50 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
06:50 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has joined #go-nuts
06:52 < drevell> jessta: it gives "cannot use *_C_NULL (type unsafe.Pointer)
as type *_C_FILE in function argument"
06:53 < drevell> though a good workaround seems to be "var nullPtr *C.FILE;
C.fflush(nullPtr)"
06:53 < drevell> it compiles, at least
06:54 -!- cch [~cch@2001:da8:8001:240:222:68ff:fe14:6de] has joined #go-nuts
06:56 -!- cch [~cch@2001:da8:8001:240:222:68ff:fe14:6de] has quit [Client Quit]
06:56 < wrtp> devell: have you tried C.fflush(nil) ?
06:59 -!- jacob_ [~jacob@d171-159-tercero-infillb.ucdavis.edu] has joined #go-nuts
07:00 -!- cch [~cch@2001:da8:8001:240:222:68ff:fe14:6de] has joined #go-nuts
07:02 < drevell> wrtp: you win!
07:05 < wrtp> cool.  i like winning :-)
07:05 -!- tvw [~tv@e176003032.adsl.alicedsl.de] has joined #go-nuts
07:06 < nsf> has anyone tried to write a linear algebra library (with
vectors, matrices and stuff) to do 3d in Go for example?  I'm a bit confused how
should I do this..  cause it requires a lot of prototyping and i can't imagine a
good syntax for that
07:08 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
07:10 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined
#go-nuts
07:13 -!- General13372 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has quit
[Ping timeout: 268 seconds]
07:14 -!- zozoR [~zozoR@0x5da69cf2.cpe.ge-0-1-0-1105.hsnqu1.customer.tele.dk] has
joined #go-nuts
07:14 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
07:25 < nsf> or maybe it's a mistake to try to do that?
07:26 -!- Fish-Work [~Fish@86.65.182.207] has joined #go-nuts
07:27 < jessta> nsf: prototyping?
07:28 < nsf> I mean a lot of fast typing of things and try outs (requires
nice syntax)
07:29 < jessta> Go has nice syntax
07:29 < nsf> not for a math library as far as i understand
07:30 < nsf> by math library i mean matrices, vectors, quaternions and other
much higher concepts than "number"
07:30 < wrtp> jessta: i just read this amusing (and ill informed) rant which
begs to disagree...  http://monoc.mo.funpic.de/go-rant/
07:31 < nsf> wrtp: oh..  critics are interesting always, thanks for a link
:)
07:32 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
07:32 < wrtp> he's not a very good critic - half of his accusations are
unfounded and most of the rest are irrelevant.
07:33 < wrtp> he's obviously not actually used the language much
07:33 < nsf> Go's syntax is nice (especially from the point of a compiler
writer, I tried to write a C declarations parser, I know what it's like)
07:33 < taruti> meh
07:33 < taruti> there are good criticisms for Go
07:33 < wrtp> nsf: i agree.  i think go's syntax is really nice
07:33 < taruti> but that is not one of them
07:33 -!- bmizerany [~bmizerany@c-24-6-37-113.hsd1.ca.comcast.net] has quit [Quit:
Leaving...]
07:33 < wrtp> taruti: what's your best criticism?
07:34 < nsf> taruti: every criticism is good, even the most clueless and
stupid one
07:34 < taruti> wrtp: the type system seems quite ad hoc and oversimplified
07:34 -!- nocturnal [~nocturnal@83.209.24.174] has joined #go-nuts
07:35 < taruti> wrtp: coming from an FP background many combinators are not
possible to express
07:35 < wrtp> taruti: those two things are usually opposites...
07:35 < wrtp> taruti: well, no generics
07:35 < nocturnal> i can't figure out how to quote regexp patterns in golang
code.  whatever i've tried has yielded errors regarding the escape characters i
use \s for example and \!
07:35 < taruti> for the syntax ones I think that irregular type parameter
syntax is not nice
07:35 < wrtp> nocturnal: use backquotes
07:35 < nocturnal> `?
07:35 < taruti> nocturnal: they are strings so "\\s"
07:36 < nocturnal> yeah but i don't want to double escape in regexp
07:36 < taruti> or with backquotes
07:36 < nocturnal> makes it cluttered
07:36 < nocturnal> are ` backquotes?
07:36 < wrtp> nocturnal: `\s'
07:36 < wrtp> oops
07:36 < nocturnal> thank you wrtp
07:36 < wrtp> `\s`
07:36 < nocturnal> =)
07:36 < nocturnal> ``
07:37 < wrtp> taruti: the ...  syntax?
07:37 < nsf> hehe, my main problem with Go has a spirit of that kind: "GC
solves all resource managing problems", I think Go's "defer" keyword does more
work than the GC itself in that area )
07:37 < taruti> []foo, map[foo]bar, chan foo, all different
07:38 < jessta> nsf: that rant is is out of date
07:38 < wrtp> taruti: not really - they all start with a type specifier ([],
map, chan) followed by the type parameters.
07:39 < wrtp> it's true, this isn't haskell, but that's maybe not a bad
thing.
07:39 < wrtp> the syntax follows the usage.
07:41 < wrtp> personally, i miss first class tuples the most.  followed by
lists.
07:41 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has quit [Ping timeout:
246 seconds]
07:41 < taruti> wrtp: just having "type p1 ...  pN" would be better without
the map wart
07:41 < nsf> jessta: why is that?  i think it's a very actual problem
07:41 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
07:41 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
07:42 < wrtp> nsf: how would you manage resources, by preference?
07:42 < nsf> but how GC helps me with that?  I have textures, shaders, gpu
buffers, file handles, network sockets, etc.
07:43 < nsf> it helps managing memory and that's all, but it is 20% of the
resources I need to manage
07:43 < wrtp> well, you can use finalisers
07:43 < wrtp> and defer
07:44 < jessta> nsf: Go has exception-like features and generics are a hard
problem soon to be fixed
07:44 < jessta> coming from a C background Go's syntax is obvious and nice
07:44 -!- ChangeOfHeart [~trent@60-240-56-87.tpgi.com.au] has quit [Remote host
closed the connection]
07:44 < nsf> exceptions aren't helping much either
07:45 < nsf> defer is good, and I'm actually wondering why C++ hasn't one
07:45 < jessta> this person ranting seems to be coming from functional
programming lanuages and hasn't spent enough time with Go to get a good idea of
the syntax
07:45 < taruti> defer is <3
07:46 < jessta> nsf: C++ has destructors
07:46 < nsf> destructors are worse
07:46 < wrtp> jessta: yes.  in fact when i first encountered go, i found the
syntax a little difficult to read.  now i find it very natural
07:46 < taruti> the only nasty thing is that it has some quirks that should
be faqs
07:46 < jessta> nsf: c++ is worse
07:46 < jessta> so it makes sense
07:47 < wrtp> taruti: what quirks?
07:47 < taruti> func foo(...) { ...  ; for { open(); defer close(); ...  }
...  } is idiomatic but wrong
07:47 < nsf> C++ as a whole language isn't that good, but it has a lot of
good and bad features, and the lanaguage itself is a good example of features
composition (bad example obviously, but we need to have one in computing history)
07:47 < wrtp> true
07:48 < taruti> that has bitten me several times and is a faq in my head
07:48 < nsf> but regarding to destructors, I think the whole object thing is
wrong in C++ :)
07:48 < jessta> taruti: what's the problem with that?
07:49 < nsf> but even 'defer' has problems
07:49 < taruti> jessta: that closes when the *function* exits, not when the
*block* exits.
07:49 < wrtp> jessta: the defer only executes when the function exits
07:49 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
07:49 < taruti> which is very counterintuitive
07:49 < wrtp> but it's good too, because you can do: if foo != nil {defer
close(foo)}
07:50 < nsf> for example in the simple initialization scenario: init 1, 2,
3, 4 and return them if success, otherwise cleanup already initialized things
07:50 < taruti> "now I inline this function into loop body, why does it stop
working"
07:50 < nsf> you can't cancel defer statement :(
07:50 < wrtp> any other solution would lead to more nesting
07:51 < wrtp> nsf: you can - just use a variable.
07:51 < nsf> well the solution to that problem doesn't require a variable,
just proper description and code generation
07:52 < wrtp> nsf: e.g.  func foo() {cancelled := false; defer func(){if
!cancelled {do_something()}}}
07:52 < wrtp> nsf: how would you cancel a defer?
07:52 < wrtp> nsf: i mean, how would you want to?
07:52 < bortzmeyer> wrtp: panic/recover would avoid you to have the
cancelled variable, no?  And would solve the "defer cancellation problem"
07:53 < nsf> well you can tag defer statement and then add another statement
let's say: cancel_defer "1", "2", "3"
07:53 < nsf> which says
07:53 < nsf> do not add previously deferred statements after that statement
07:53 < nsf> :)
07:53 < wrtp> i don't really see the pointy
07:53 < wrtp> s/y//
07:54 < wrtp> i've never wanted to cancel a defer...
07:54 < nsf> um..  let me show you, one sec..
07:55 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Ping
timeout: 276 seconds]
07:55 -!- ikaros [~ikaros@f051128085.adsl.alicedsl.de] has joined #go-nuts
07:58 < nsf> wrtp: http://www.everfall.com/paste/id.php?pxn9ywlcy0ix
07:58 < nsf> it's pseudo code
07:58 < nsf> simple complex object initialization scenario :)
07:58 < wrtp> "resolving host"...
07:58 < nsf> when you want to cleanup on failure and return everything on
success
07:58 < nsf> :(
07:59 < nsf> http://pastebin.com/RwCcWZbP
07:59 < wrtp> got it
08:01 < nsf> well, D has something like that ("scope" operator), but their
system tied to exceptions mechanism
08:01 < wrtp> nsf: i'm not sure that's a good argument for defer cancelling
08:02 < nsf> I think it is..  there are different reasons of quitting
functions: failure, success
08:02 < wrtp> nsf: you could make o's finalize method call its components'
finalize methods
08:02 < nsf> and sometimes it requires different code
08:02 -!- samferry [~sam@atheme/member/samferry] has quit [Read error: Operation
timed out]
08:02 < wrtp> then all you'd need would be a single call to o's finalize
08:02 < nsf> wrtp: well, it is doing that, but on the initialization stage
not everything is initialized
08:03 < nsf> you can't finalize uninitialized component
08:03 < nsf> it would require adding "if"s
08:03 < wrtp> not necessarily
08:03 < wrtp> a method call on a nil object is not necessarily a problem
08:03 < wrtp> unless it's an interface
08:04 < nsf> the point is, that kind of system allows you to eliminate
unnecessary calls and checks and keep code maintainability (unlike C's gotos)
08:05 < nsf> there are of course dozen of different things how can you solve
that problem
08:05 < nsf> ways*
08:05 < wrtp> nsf: i think cancel_defer brings on more problems than it
solves.
08:05 < nsf> but i personally thing that one is the most beautiful :)
08:05 < nsf> wrtp: nope
08:06 < wrtp> for instance, there's a 1-many relationship between labels and
defers
08:07 < nsf> what you mean by that?
08:07 < wrtp> and it's not easy to see how it could be made efficient (are
the labels constant)?
08:07 < nsf> do*
08:07 < nsf> the labels are just a syntax element
08:07 -!- tibshoot [~tibshoot@gw-puteaux.linagora.com] has joined #go-nuts
08:07 < wrtp> this for instance: for _, e := range somearray { defer
e.Close() }
08:08 < wrtp> oops
08:08 < wrtp> for _, e := range somearray { defer "1" e.Close() }
08:08 < wrtp> cancel_defer "1"
08:08 < wrtp> does that cancel all the defers with that label?
08:08 < nsf> that means that you group defers under the same label
08:08 < nsf> yep
08:09 < wrtp> so there's a hash table kind of thing going on?
08:09 < nsf> but I don't think that using defers in loops is a good idea
anyway
08:09 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 260
seconds]
08:09 < wrtp> can i do: x := "1"; cancel_defer x ?
08:09 < jlouis> defer is just a language encoded unwind-protect
08:09 < wrtp> jlouis: it's a little different from that
08:10 < wrtp> jlouis: because it's only at function scope
08:10 < jlouis> wrtp: in that case it is subtle
08:10 < nsf> well, yep you are pointing at runtime issues with defer
08:10 < nsf> I didn't dig into details of that
08:10 < wrtp> nsf: it's important that it be able to be implemented
efficiently
08:11 < nsf> yes
08:11 < nsf> for example in my example defer can be (theoretically) resolved
statically and turned into a goto-based code
08:11 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
08:12 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
08:12 < nsf> but I'm not really sure about complex examples
08:12 < nsf> defer should simplify things, not otherwise :)
08:13 < chaos95> so defer evaluates the arguments but not the function call?
08:13 < wrtp> chaos95: yup
08:13 < chaos95> that's pretty nifty
08:14 < wrtp> nsf: i'm trying to think of a nice way to phrase your example
:-)
08:15 < nsf> sequential initialization/cleanup?  :))
08:16 < nsf> well, there is difference in what I'm thinking about and what
go has
08:16 < nsf> my defer is like D's scope
08:16 < wrtp> i don't know D at all
08:17 < nsf> I have no intensions to make it work on a function basis, but
on a scope basis
08:17 < wrtp> got a link for D's scope?
08:17 < nsf> sec..
08:17 < nsf>
http://www.digitalmars.com/d/2.0/statement.html#ScopeGuardStatement
08:18 < nsf> http://www.digitalmars.com/d/2.0/exception-safe.html
08:18 -!- tvw [~tv@e176003032.adsl.alicedsl.de] has quit [Remote host closed the
connection]
08:18 < nsf> on the second page there are few examples too
08:18 < nsf> but as I said it's exceptions-based
08:19 < uriel> exceptions are an idea as wonderful as COMEFROM
08:19 < nsf> scope basis is important because it allows you to predict a
total number of defer statements in the code
08:19 < nsf> which is good I guess
08:20 < wrtp> i don't know if that's important
08:20 < uriel> exceptions are an idea as wonderful as COMEFROM
08:20 < wrtp> it is nice being able to do something like: if p.trace {
08:20 < wrtp> defer un(trace(p, "ExpressionList"))
08:20 < wrtp> }
08:20 < wrtp> uriel: we're not talking about exceptions
08:20 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
08:20 < nsf> wrtp: maybe
08:21 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
08:21 < nsf> but regarding cancelling, with that kind of defer that Go has,
it's easy to do loops..  because you can only add things to the defer statements
list
08:21 -!- Kashia [~Kashia@port-92-200-245-118.dynamic.qsc.de] has quit [Quit: This
computer has gone to sleep]
08:21 < nsf> with cancelling thing it will become kind of hard
08:22 < nsf> anyway, just an idea..  I have no language to implement it, so
probably it's not worth it to think about implementation details :)
08:23 < jlouis> uriel: hahaha
08:24 < wrtp> it is true that there are very few places that use defer not
at the top level of a function
08:24 < nsf> wrtp: I guess with D's scope at each return or scope exit you
can tell exactly what you need to execute and that's why it easy to implement
08:24 < nsf> it doens't require any kind of dynamic book keeping
08:25 < nsf> but as you said (trace example), sometimes it can be neat to
have Go's defer
08:25 < wrtp> nsf: in go the compiler can statically tell whether dynamic
book keeping is necessary
08:25 < jlouis> I like that the go inventors did not simply shovel a drivel
of features in the language from the beginning
08:25 -!- path[l] [UPP@120.138.102.34] has quit [Quit: path[l]]
08:26 < jlouis> adding a new feature is so easy
08:26 -!- tvw [~tv@e176003032.adsl.alicedsl.de] has joined #go-nuts
08:26 < nsf> jlouis: I think they understand that feature composition is
important as a language property
08:26 < jlouis> nsf: indeed!
08:26 < nsf> but it doesn't mean that Go has no wrong features :)
08:27 < nsf> on the other hand C++ and D are totally screwed with feature
loads
08:27 < nsf> and it's sad
08:28 < wrtp> i think it's a pity that defer incurs an allocation
08:28 < wrtp> i 'm not sure that's inevitable though
08:28 < nsf> wrtp: scope-based defer doesn't require any kind of dynamic
stuff, it serves as a code generation hint
08:29 < nsf> but function-based does
08:29 < wrtp> nsf: something's got to catch the exception
08:30 < nsf> we're not talking about exceptions here
08:30 < wrtp> in this case, defer has to be called if something panics
08:30 < wrtp> that's what i meant
08:31 < nsf> hm..
08:32 < nsf> ok, I'm not very familiar with Go, I talk more about an
abstract langauge with that feature :)
08:32 < jlouis> My first Go hack for real was an ident (RFC1413) client
http://github.com/jlouis/go-ident patches are welcome
08:32 < jlouis> comments likewise
08:35 < nsf> hehe, line 77, why not just: for i := int(len(p)); i > 0;
i-- {?
08:35 < wrtp> jlouis: one little point: string(113) gives the unicode code
point at 113, not the decimal representation "113"
08:35 < nsf> http://github.com/jlouis/go-ident/blob/master/ident.go#L77
08:36 < jlouis> wrtp: ahyes
08:36 < jlouis> wrtp: the correct conversion would be?
08:36 < wrtp> use strconv.Itoa
08:37 < jlouis> that makes sense
08:37 < jlouis> nsf: yup
08:39 -!- samferry [~sam@atheme/member/samferry] has joined #go-nuts
08:39 < wrtp> i don't think readLineBytes can work at all actually
08:40 < wrtp> line 72: the line must end with \n, not \r
08:40 < wrtp> and given that, the loop at line 77 is unnecessary
08:40 < wrtp> you just need:
08:41 < wrtp> (from line 75)
08:41 < wrtp> p = p[0 : len(p) - 1]
08:41 < wrtp> if len(p) > 0 && p[len(p) - 1] == '\r' {p = p[0 : len(p) -
1]}
08:41 < wrtp> return p
08:42 < wrtp> or something like that
08:42 -!- vaxholm [~vaxholm@cocoplum.spotify.net] has joined #go-nuts
08:43 < jlouis> wrtp: perhaps I should just check that the next to last is a
\r and then slice it down to just before.  That would actually be most correct
according to the RFC
08:43 < vaxholm> Hi! I'm just curious here...  What was the intended usage
for the ASN.1 parser in Go?
08:43 < wrtp> yup, that's what my code did
08:43 < jlouis> vaxholm: it screams SNMP
08:43 < wrtp> vaxholm: tls
08:44 < vaxholm> tls seems more reasonable than snmp.  now i found the x509
package too.  thanks.
08:44 < jlouis> wrtp, nsf: thanks!
08:45 < nsf> :D
08:47 < wrtp> if c <
08:47 < wrtp> 0
08:47 < wrtp> oops
08:47 < wrtp> if c < '
08:47 < wrtp> bad day
08:47 -!- Macpunk [~macpunk@cpe-72-177-26-221.austin.res.rr.com] has joined
#go-nuts
08:49 < wrtp> jlouis: line 106: instead of the "continue", i'd just reverse
the condition and just do: if if c != ' ' && c != '\t' && (c < '0' || c >
'9') { return ...  }
08:50 < jlouis> wrtp: mm
08:50 < jlouis> Heh, I like that royger/wgo use my process model
08:51 < jlouis> a bittorrent client in go is an excellent tester for the
concurrency
08:52 < wrtp> jlouis: line 150 - probably better to do switch s :=
strings.TrimSpace(string(ai)); s {case "INVALID_PORT", "NO_USER", ...: return s;
default: if s[0] == 'X' {...}else{return error}}
08:52 < jlouis> wrtp: not valid according to spec.
08:52 < wrtp> also the return at the end could just return the error, then
you would save a return
08:53 < jlouis> X must be the first thing.  It can't be a white space
08:53 < wrtp> oops no, scratch the last
08:53 < wrtp> oh, well, s/s\[0]/ai[0]/ then
08:53 < wrtp> same code structure
08:53 < jlouis> yes, and move that condition to the default
08:53 < jlouis> good idea
08:54 < jlouis> likewise with the condition inversion above
08:55 -!- Surma [~bzfsurma@gooseberry.zib.de] has joined #go-nuts
08:56 < wrtp> line 202: switch should just be: if cs != "US-ASCII" {return
...}
08:57 < wrtp> unless you're gonna add more charsets, i guess
08:57 < jlouis> wrtp: ah, historic.  I originally envisioned to have
multiple charsets, but then..
08:57 -!- tcoppi
[~nuclear@57c3ed63-1294-45bd-a8e8-cdcc07cfa16f.static.grokthis.net] has quit [Read
error: Operation timed out]
08:58 < jlouis> I decided against it for the time being
08:58 < wrtp> you could at least support utf8 :-0
08:58 -!- tcoppi
[~nuclear@57c3ed63-1294-45bd-a8e8-cdcc07cfa16f.static.grokthis.net] has joined
#go-nuts
08:59 < mpl> what I did when I coded my .torrent parser is if there's an
utf8 version for one of the field I write it over the non utf-8 one.
08:59 -!- gisikw [~gisikw@137.28.246.34] has quit [Read error: Operation timed
out]
08:59 -!- anticw [~anticw@cwedgwood.broker.freenet6.net] has quit [Ping timeout:
240 seconds]
09:01 < wrtp> jlouis: line 317, i'd tend to think that (30 * 1e9) would be
more readable, given that we're talking nanoseconds
09:01 -!- path[l] [~path@59.162.86.164] has joined #go-nuts
09:02 -!- cch [~cch@2001:da8:8001:240:222:68ff:fe14:6de] has quit [Remote host
closed the connection]
09:03 < jlouis> wrtp: those are all good suggestions
09:03 -!- Macpunk [~macpunk@cpe-72-177-26-221.austin.res.rr.com] has quit [Quit:
Leaving]
09:03 < wrtp> line 344: i'd say that the Query function is unnecessary.  if
the user wants asynchronicity, they can do the goroutine themselves
09:04 < wrtp> (which also gives them the freedom to do something different
with the error message)
09:04 < jlouis> mmm
09:04 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
09:04 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
09:05 < jlouis> I definitely see the point.  Perhaps libraries should not
have channels in their APIs
09:05 < jlouis> or at least try to cut them down
09:05 < wrtp> sometimes, a channel is useful, because it's part of how the
code works.  in this case, though, it's just a trivial wrapper.
09:07 -!- path[l] [~path@59.162.86.164] has quit [Ping timeout: 240 seconds]
09:21 < wrtp> jlouis: thinking about it, i think maybe you should just call
the Identify function "Query".  then a call looks like ident.Query() which looks
nice.
09:22 < wrtp> also, i think you could simplify the IdentResponse struct
quite a bit.  really, i think you only need UserID and OperatingSystem in it
09:22 -!- vaxholm [~vaxholm@cocoplum.spotify.net] has left #go-nuts ["Lämnar"]
09:23 < wrtp> (both of which should be strings)
09:23 < wrtp> everything else is either known to the called (ClientPort and
ServerPort), redundant (ResponseTy, Error, Valid) or unnecessary (Charset)
09:32 -!- anticw [~anticw@cwedgwood.broker.freenet6.net] has joined #go-nuts
09:33 -!- t5vaha01 [t5vaha01@rhea.oamk.fi] has quit [Quit: leaving]
09:35 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Ping
timeout: 246 seconds]
09:44 -!- rv2733 [~rv2733@c-98-242-168-49.hsd1.fl.comcast.net] has joined #go-nuts
09:47 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
09:55 -!- path[l] [~path@59.162.86.164] has joined #go-nuts
09:57 -!- Xera^ [~brit@87-194-208-246.bethere.co.uk] has joined #go-nuts
10:11 -!- mertimor [~mertimor@p4FE7584A.dip.t-dialin.net] has joined #go-nuts
10:12 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.2]
10:42 -!- Xera^ [~brit@87-194-208-246.bethere.co.uk] has quit [Read error:
Connection reset by peer]
10:45 -!- SRabbelier [~SRabbelie@ip138-114-211-87.adsl2.static.versatel.nl] has
quit [Read error: Connection reset by peer]
10:51 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
10:51 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
10:58 -!- Ideal [~Ideal@ideal-1-pt.tunnel.tserv6.fra1.ipv6.he.net] has joined
#go-nuts
11:04 -!- ikke [~ikkibr@189.58.220.202.dynamic.adsl.gvt.net.br] has joined
#go-nuts
11:04 -!- ikke [~ikkibr@189.58.220.202.dynamic.adsl.gvt.net.br] has quit [Changing
host]
11:04 -!- ikke [~ikkibr@unaffiliated/ikkebr] has joined #go-nuts
11:05 -!- SRabbelier [~SRabbelie@ip138-114-211-87.adsl2.static.versatel.nl] has
joined #go-nuts
11:06 -!- gisikw [~gisikw@137.28.246.34] has joined #go-nuts
11:10 -!- sladegen [~nemo@unaffiliated/sladegen] has quit [Read error: Operation
timed out]
11:17 < wrtp> anyone know how force all garbage to be collected and
finalizers run (just for an experiment, not for a real program) ?
11:17 < wrtp> s/how/how to/
11:34 -!- eikenberry [~jae@mail.zhar.net] has joined #go-nuts
11:41 -!- g0bl1n [~anonymous@a213-22-210-28.cpe.netcabo.pt] has joined #go-nuts
11:45 -!- megaboz [~none@unaffiliated/megaboz] has joined #go-nuts
11:50 -!- SugarBear [~stephen.s@91.86.9.223] has joined #go-nuts
11:51 -!- pda- [pda@antifail.com] has left #go-nuts []
11:52 -!- Netsplit *.net <-> *.split quits: jlouis, zerd
11:54 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
11:55 -!- path[l] [~path@59.162.86.164] has quit [Quit: path[l]]
11:55 -!- Netsplit over, joins: jlouis
11:56 -!- lmoura_ [~lmoura@187.78.190.54] has joined #go-nuts
11:56 -!- Svarthandske [~nn@dsl-tkubrasgw1-fe3cdc00-28.dhcp.inet.fi] has joined
#go-nuts
11:57 -!- divoxx [~divoxx@189.63.157.83] has joined #go-nuts
11:59 -!- zerd [~quassel@2a01:608:ccc:1000:2e0:4dff:fe83:76ed] has joined #go-nuts
12:01 -!- path[l] [~path@59.162.86.164] has joined #go-nuts
12:06 < jessta> wrtp: runtime.GC()
12:07 < jessta> wrtp: but it doesn't release memory back to the OS
12:07 < wrtp> jessta: yeah, but it wasn't running the finalizers.
12:07 < wrtp> jessta: eventually, i worked out that GC(); Gosched(); GC()
works
12:08 < wrtp> i was just trying to work out, empirically, how conservative
the GC is
12:13 -!- SugarBear [~stephen.s@91.86.9.223] has quit []
12:16 < wrtp> there's definitely some odd behaviour going on
12:18 -!- kel_ [~kel@cpc2-leat2-0-0-cust98.hers.cable.ntl.com] has joined #go-nuts
12:19 < jessta> wrtp: ood?
12:19 < jessta> odd?
12:20 < wrtp> odd
12:20 < wrtp> unusual
12:20 < wrtp> not easily explainable
12:21 < wrtp> just moving a declaration can affect whether something gets
finalized or not
12:23 < wrtp> for instance, this: http://pastebin.org/225197
12:23 < wrtp> moving line 30 to just before line 29 causes the code not to
run the finalizer
12:23 < wrtp> at least, on my platform
12:24 < wrtp> (ignore the redundant code)
12:25 < taruti> finalizers are iirc not guaranteeded to run
12:25 < taruti> they may run
12:25 < taruti> or they may not run
12:25 < wrtp> i realise that
12:25 < wrtp> but why does the placement of some irrelevant code make a
difference here?
12:26 < jessta> scheduling?
12:27 < jessta> main may finish before the finalizer gets to run
12:28 < wrtp> but i'm doing a Gosched() before exiting
12:28 < jessta> Goshed() isn't required to switch goroutines
12:28 < wrtp> and why should the scheduling behave differently depending on
where a declaration is?
12:29 < jessta> it shouldn't
12:29 < taruti> scheduling is not deterministic
12:29 < wrtp> jessta: it is required if you're about to exit main
12:29 < wrtp> jessta: alternatively you could sleep for a bit
12:29 < jessta> wrtp: you could block on a channel
12:30 < wrtp> jessta: that too.  but i want my program to exit.  so i'd have
to create another goroutine to send on the channel.
12:30 < jessta> wrtp: I mean, calling GoShed() doesn't gurantee that the
thread will switch goroutines
12:31 < wrtp> jessta: i think it does if there's another runnable goroutine
12:31 < wrtp> jessta: the implementation just puts the current goroutine at
the tail of the run queue
12:32 < jessta> relying on it is a bad idea
12:32 < wrtp> i'm not relying on it - i just want to explore the properties
of the garbage collector
12:33 < wrtp> in particular, i'm wondering if i have a large buffer full of
random data, some of which happens to look like a pointer, whether that pointer
will be GC'd or not
12:33 -!- tokuhirom [~tokuhirom@s230.GtokyoFL21.vectant.ne.jp] has quit [Ping
timeout: 240 seconds]
12:34 < wrtp> there's a possibility for a DoS attack there
12:34 < wrtp> well, maybe
12:35 < taruti> wrtp: not really
12:36 < wrtp> if you know some data is going to be read into a buffer in the
program, then you have the potential to cause a memory leak
12:37 < taruti> wrtp: that allows at maximum O(buffers_size) to be retained
as long as the buffer is retained.
12:37 < wrtp> not if you have a pointer to the head of a list
12:37 < wrtp> it's possible that the code carries on allocating at the end
of the list, relying on the GC to pick up the head
12:38 < wrtp> but if your buffer points to the head, then none of the list
will ever be deallocated
12:38 < taruti> mmh
12:38 < taruti> point
12:38 < wrtp> ok, it's a bit far fetched, but possible
12:38 < taruti> btw the garbage collector will be rewritten shortly
12:38 < wrtp> sure
12:39 < wrtp> if it's conservative now, i wonder if it's possible to rewrite
it to be non-conservative and still keep some of the nice properties of the go
runtime
12:41 < wrtp> for instance, the fact that you can point into the middle of
an array and the GC knows it needs to walk the whole array (and can find its
header just from the original pointer value)
12:41 -!- divoxx [~divoxx@189.63.157.83] has quit [Quit: divoxx]
12:41 < wrtp> that's fairly fundamental to go.
12:42 < wrtp> if it's non-conservative, then it has to maintain pointer maps
all over the place, which i don't think it does currently.  so performance might
go down...
12:45 < taruti> wrtp: just making the non-pointer containing things
allocated from a separate heap will be mostly enough
12:46 < wrtp> taruti: but what about mixed mode objects e.g.  struct {p
*int, i int}
12:46 < taruti> e.g.  []byte, string etc
12:46 -!- kota1111 [~kota1111@gw2.kbmj.jp] has quit [Quit: Leaving...]
12:46 < taruti> wrtp: those can be handled on a per-type pointer-map but for
those being conservative is not a large issue
12:46 < wrtp> struct {data [1024] byte, p *int}
12:47 -!- tokuhirom [~tokuhirom@s230.GtokyoFL21.vectant.ne.jp] has joined #go-nuts
12:47 < taruti> that one is stupid from a cache pov
12:47 < wrtp> oh?
12:48 < taruti> probably want to have the byte array separate from the
word-sized things
12:48 < wrtp> the byte array is word aligned
12:48 < taruti> anyways pointer-maps are quite standard in most languages
12:49 < wrtp> perhaps.  but it does have a runtime impact
12:50 < taruti> yes, maybe even good GC performance will be a result
12:50 < taruti> as compared to the current slow one
12:50 < wrtp> it's what happens when you're not in the GC that i'm concerned
about
12:51 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
12:51 < wrtp> for instance, allocating stack frames
12:51 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
12:51 < wrtp> it's probably not too much of a problem.
12:52 < wrtp> BTW, i've determined that currently the GC is definitely
conservative
12:53 < taruti> the implementation is very simple
12:53 < taruti> getting e.g.  a concurrent one would be a very nice
improvement
13:03 -!- alehorst [~alehorst@187.59.36.250] has joined #go-nuts
13:06 -!- tazjin [~tazjin@p5DC82572.dip.t-dialin.net] has joined #go-nuts
13:06 -!- zyichi [~zyichi@124.205.180.154] has left #go-nuts []
13:09 -!- tokuhirom [~tokuhirom@s230.GtokyoFL21.vectant.ne.jp] has quit [Ping
timeout: 248 seconds]
13:13 -!- Ideal [~Ideal@ideal-1-pt.tunnel.tserv6.fra1.ipv6.he.net] has quit
[Remote host closed the connection]
13:18 -!- tokuhirom [~tokuhirom@s230.GtokyoFL21.vectant.ne.jp] has joined #go-nuts
13:21 -!- Gracenotes [~person@wikipedia/Gracenotes] has quit [Ping timeout: 258
seconds]
13:24 -!- [vertex] [~Alexandre@201.78.254.253] has joined #go-nuts
13:25 -!- mertimor [~mertimor@p4FE7584A.dip.t-dialin.net] has quit [Quit:
mertimor]
13:29 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
13:32 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping
timeout: 245 seconds]
13:33 < wrtp> taruti: do you mean parallel?  (as in executing on several
processors at once) or concurrent?  (running concurrently with the code, rather
than stopping all goroutines to GC)
13:33 < taruti> concurrent
13:33 < taruti> avoiding "stop everything while we GC" would be nice
13:33 -!- tokuhirom [~tokuhirom@s230.GtokyoFL21.vectant.ne.jp] has quit [Ping
timeout: 276 seconds]
13:35 -!- sladegen [~nemo@unaffiliated/sladegen] has joined #go-nuts
13:36 < taruti> and yes I know that it is tricky to get right and fast.
13:36 < wrtp> yeah
13:37 -!- Gracenotes [~person@wikipedia/Gracenotes] has joined #go-nuts
13:37 < wrtp> have you encountered problems with the current GC performance?
13:37 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
13:37 -!- lux` [lux`@151.95.180.63] has joined #go-nuts
13:38 < taruti> wrtp: yes.
13:38 -!- tokuhirom [~tokuhirom@s230.GtokyoFL21.vectant.ne.jp] has joined #go-nuts
13:38 < Surma> hey guys, is there an elegant way to convert a []uint32 to
[]uint8 (making 4 uint8 outta each uint32)?
13:38 < taruti> wrtp: try measuring response times for a fuse filesystem
written in Go and having 2gb of cached data in RAM :)
13:39 < taruti> Surma: unsafe.*
13:39 < Surma> hm..  not really elegant, but it works, thanks ;)
13:40 < taruti> I should probably push out the fuse code some day.  But
getting comments on Go code seems hard.
13:41 < wrtp> Surma: why do you want to do that?  in general, it's
unportable
13:42 < wrtp> taruti: i think i big improvement would come from having the
GC type-aware - at the moment it will be scanning every byte of those buffers
(which presumably aren't full of pointers?)
13:42 < taruti> yes
13:43 < Surma> wrtp: I'm just doing a quick hack, no need for portability or
anything ;)
13:43 < taruti> http://codereview.appspot.com/1157044/show <- was this
submitted somehow in the wrong way?
13:44 < wrtp> Surma: if it's just a quick hack, use encoding/binary
13:45 < wrtp> taruti: did you do hg mail?
13:45 < taruti> wrtp: yes
13:46 < taruti> I can retry it from an another machine.
13:46 -!- tokuhirom [~tokuhirom@s230.GtokyoFL21.vectant.ne.jp] has quit [Ping
timeout: 248 seconds]
13:46 -!- cmarcelo [~cmarcelo@enlightenment/developer/cmarcelo] has joined
#go-nuts
13:46 < wrtp> taruti: 'cos i don't see that issue in golang-dev
13:47 -!- tokuhirom [~tokuhirom@s230.GtokyoFL21.vectant.ne.jp] has joined #go-nuts
13:48 < taruti> wrtp: retried it.
13:51 < richardr> After compiling a little Go library wrapper I found on
github, and trying to run it I get a lot of amd64, exports, exec.go, package..
"command not found".  My environment variables are set and everything :/
13:51 < richardr> Any ideas?
13:51 < wrtp> richardr: have you got a transcript of what you're doing and
the resulting errors?
13:52 < richardr> wrtp: I'll write one up now
13:54 < wrtp> taruti: i'm wondering if some posts are being dropped, because
golang and golang-dev have been extremely quiet the last few days
13:54 < taruti> not sure
13:55 * taruti thinks of waiting a few hours to see whether something goes through
13:55 < wrtp> try mailing golang-dev direct with a test, perhaps?
13:55 < richardr> wrtp: http://dpaste.com/193696/ along those lines
13:56 < wrtp> richardr: you're trying to execute the intermediate object
file
13:57 < richardr> wrtP: ah i see
13:57 < richardr> wrtp: what should I be executing?  fcgi.go?
13:57 < taruti> .6 = "gcc .o on amd64"
13:58 < wrtp> i'd help more, but my git clone fails
13:58 < richardr> wrtp: http://github.com/jldailey/fcgigo.git sorry
13:58 < jessta> richardr: it's a library, yeah?
13:58 -!- tibshoot [~tibshoot@gw-puteaux.linagora.com] has quit [Ping timeout: 246
seconds]
13:58 -!- nocturnal [~nocturnal@83.209.24.174] has left #go-nuts []
13:59 < jessta> so it doesn't have a main()?
13:59 < richardr> jessta: yeah, fast-cgi for Go - ya in fcgi.go
13:59 < taruti> richardr: just "make install" and use that in your own
programs.
13:59 < taruti> richardr: that is a library not an program
14:00 < wrtp> better, do goinstall github.com/jldailey/fcgigo
14:00 < wrtp> then you can do import "github.com/jldailey/fcgigo" in your go
programs
14:00 < jessta> richardr: that main() is commented out
14:00 < jessta> richardr: it's an example of how to use the library
14:01 < richardr> wrtp: oh cheers...  i get no $GOROOT, but if i "echo
$GOROOT" on the command line it gives me the go root.
14:01 < wrtp> and use fgci as the package identifier
14:01 < wrtp> richardr: is it exported (what does sh -c 'echo $GOROOT'
print?)
14:02 < wrtp> oops no, that's not necessarily a good indicator!
14:02 < wrtp> try "export GOROOT" and try again
14:02 < richardr> wrtp: /usr/lib/go , i sourced the .bashrc file where i
defined it
14:02 < richardr> wrtp: same thing
14:03 < wrtp> that's weird
14:04 < richardr> wrtp: ya :/ but I understand the whole package thing now
so cheers
14:06 < wrtp> richardr: what does python -c 'import os; print
os.environ.get("GOROOT")' print?
14:06 < ShadowIce> richardr: if you are using sudo, use "sudo -E"
14:06 < richardr> wrtp: /usr/lib/go
14:07 < richardr> ShadowIce: nope, just my regular user
14:07 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-159-141.clienti.tiscali.it] has
joined #go-nuts
14:07 < wrtp> richardr: could you post a transcript of you trying it,
please?
14:07 -!- iant [~iant@67.218.104.83] has joined #go-nuts
14:08 -!- mode/#go-nuts [+v iant] by ChanServ
14:08 < richardr> wrtp: http://dpaste.com/193699/
14:08 < wrtp> no, sorry, i meant the goinstall
14:10 < richardr> wrtp: got it to work, if i sudo -i
14:11 < richardr> wrtp: oh sudo -E works too.  i didnt know about that
14:11 < richardr> wrtp: thanks for your time
14:12 < wrtp> i thought you weren't using sudo
14:13 < richardr> wrtp: err, no idea how i missed that, my mistake...
14:16 < wrtp> sudo doesn't have a -E option on this machine
14:16 < wrtp> i'm a bit surprised it's not the default
14:16 < richardr> wrtp: i didnt test it with -E , just sudo'd i presumed
14:17 < richardr> sudo'd -i sorry
14:17 < richardr> wrtp: default definately doesnt work - i get that error
14:17 < wrtp> yup, it wouldn't here either - but i don't run any go stuff as
any other user
14:19 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-159-141.clienti.tiscali.it] has
quit [Quit: E se abbasso questa leva che succ...]
14:23 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-159-141.clienti.tiscali.it] has
joined #go-nuts
14:24 -!- nighty^ [~nighty@x122091.ppp.asahi-net.or.jp] has joined #go-nuts
14:25 -!- megaboz [~none@unaffiliated/megaboz] has quit [Quit: Lost terminal]
14:28 < richardr> ShadowIce: what does the -E argument do?  Because your
right, just tried a sudo make install only worked with -E
14:29 < richardr> ShadowIce: it's not even in my sudo man pages
14:29 -!- barismetin [~barismeti@kde/developer/baris] has joined #go-nuts
14:31 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has joined #go-nuts
14:35 -!- tumdum [~tumdum@unaffiliated/tumdum] has joined #go-nuts
14:37 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Ping
timeout: 248 seconds]
14:38 < kimelto> morning!
14:39 -!- thiago__ [~thiago@189.107.231.160] has joined #go-nuts
14:41 < ShadowIce> richardr: "The -E (preserve environment) option will
override the env_reset option in sudoers(5)).  It is only available when either
the matching command has the SETENV tag or the setenv option is set in
sudoers(5)."
14:45 -!- lmoura_ [~lmoura@187.78.190.54] has quit [Ping timeout: 265 seconds]
14:46 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
14:46 -!- tazjin [~tazjin@p5DC82572.dip.t-dialin.net] has quit [Ping timeout: 260
seconds]
14:49 -!- apphacker [~apphacker@c-24-5-192-234.hsd1.ca.comcast.net] has joined
#go-nuts
14:49 -!- b00m_chef [~watr@d64-180-45-230.bchsia.telus.net] has joined #go-nuts
14:50 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Ping
timeout: 252 seconds]
14:50 -!- ikke [~ikkibr@unaffiliated/ikkebr] has quit []
14:55 -!- b00m_chef [~watr@d64-180-45-230.bchsia.telus.net] has quit [Ping
timeout: 246 seconds]
14:57 -!- kel_ [~kel@cpc2-leat2-0-0-cust98.hers.cable.ntl.com] has quit [Ping
timeout: 240 seconds]
14:57 < wrtp> under mac os, there's no -E option
15:00 -!- alehorst [~alehorst@187.59.36.250] has quit [Remote host closed the
connection]
15:01 < ni|> :)
15:02 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
15:04 -!- iant [~iant@67.218.104.83] has quit [Ping timeout: 252 seconds]
15:06 -!- g0bl1n [~anonymous@a213-22-210-28.cpe.netcabo.pt] has quit [Quit:
g0bl1n]
15:09 -!- alehorst [~alehorst@187.59.36.250] has joined #go-nuts
15:10 -!- g0bl1n [~anonymous@a213-22-210-28.cpe.netcabo.pt] has joined #go-nuts
15:20 -!- anticw [~anticw@cwedgwood.broker.freenet6.net] has quit [Ping timeout:
248 seconds]
15:20 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.]
15:21 -!- Venom_X [~pjacobs@71.20.102.220] has joined #go-nuts
15:29 -!- richardr [~richard@124-148-225-92.dyn.iinet.net.au] has left #go-nuts []
15:30 -!- apphacker [~apphacker@c-24-5-192-234.hsd1.ca.comcast.net] has quit [Ping
timeout: 268 seconds]
15:31 -!- b00m_chef [~watr@128.189.93.50] has joined #go-nuts
15:33 -!- zozoR [~zozoR@0x5da69cf2.cpe.ge-0-1-0-1105.hsnqu1.customer.tele.dk] has
quit [Ping timeout: 276 seconds]
15:33 -!- Surma [~bzfsurma@gooseberry.zib.de] has quit [Quit: Leaving.]
15:34 -!- iant [~iant@nat/google/x-anjsqhdmtffvjhxp] has joined #go-nuts
15:34 -!- mode/#go-nuts [+v iant] by ChanServ
15:36 -!- b00m_chef [~watr@128.189.93.50] has quit [Ping timeout: 240 seconds]
15:44 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-159-141.clienti.tiscali.it] has
quit [Ping timeout: 240 seconds]
15:46 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-159-141.clienti.tiscali.it] has
joined #go-nuts
15:46 -!- thiago__ [~thiago@189.107.231.160] has quit [Remote host closed the
connection]
15:52 -!- anticw [~anticw@cwedgwood.broker.freenet6.net] has joined #go-nuts
15:58 -!- terrex [~terrex@183.38.222.87.dynamic.jazztel.es] has joined #go-nuts
16:00 -!- divoxx [~divoxx@189.63.157.83] has joined #go-nuts
16:03 -!- tibshoot [~tibshoot@gw-puteaux.linagora.com] has joined #go-nuts
16:04 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 246
seconds]
16:16 -!- tvw [~tv@e176003032.adsl.alicedsl.de] has quit [Read error: Operation
timed out]
16:18 -!- tvw [~tv@e176003032.adsl.alicedsl.de] has joined #go-nuts
16:18 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has joined #go-nuts
16:20 -!- path[l] [~path@59.162.86.164] has quit [Quit: path[l]]
16:20 -!- Chinainvent [~yunkai@121.0.29.199] has quit [Ping timeout: 240 seconds]
16:20 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
16:20 -!- path[l] [~path@59.162.86.164] has joined #go-nuts
16:21 -!- tvw [~tv@e176003032.adsl.alicedsl.de] has quit [Read error: Operation
timed out]
16:22 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Max SendQ exceeded]
16:22 -!- jhawk28 [~jhawk28@72.40.31.201] has joined #go-nuts
16:23 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
16:23 -!- tvw [~tv@e176003032.adsl.alicedsl.de] has joined #go-nuts
16:24 < taruti> meh
16:24 < taruti> mail not visible on golang-dev
16:25 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Max SendQ exceeded]
16:26 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
16:28 < wrtp> taruti: did you try mailing direct?
16:28 -!- Venom_X [~pjacobs@71.20.102.220] has quit [Quit: Venom_X]
16:29 < taruti> wrtp: I can try sending a message manually from my mail
client.
16:29 * taruti fears that she is doing something wrong
16:32 < wrtp> it should have come.  BTW, it's usually good to name an actual
reviewer rather than just golang-dev - find someone from the go team who's worked
on the same package, or just choose russ cox - he'll forward it if necessary
16:33 < wrtp> but try mailing golang-dev direct too - mention that hg mail
isn't getting through
16:33 -!- mertimor [~mertimor@p4FE7584A.dip.t-dialin.net] has joined #go-nuts
16:34 < taruti> ok
16:38 -!- megaboz [~none@unaffiliated/megaboz] has joined #go-nuts
16:39 < wrtp> taruti: BTW, i'd like to see your fuse filesystem - why don't
you put it on github or code.google.com or something?
16:39 < wrtp> what does it do?
16:40 < taruti> wrtp: distribution+encryption, will publish it when it is
more ready but the fuse library is much more ready to publish
16:41 < wrtp> that's be cool too
16:41 < wrtp> s/'s/'d
16:42 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
16:42 < taruti> wrtp: you can see some of the crypto code on
bitbucket/taruti
16:43 < taruti> but I am unsure what is the current best practise of
generating API-docs for Go code
16:43 < wrtp> follow the godoc style
16:43 < wrtp> it's not well documented, but trial and error and looking at
the pkg documentation should show you the way
16:45 < wrtp> i just goinstalled your pbkdf2 package
16:46 -!- jhawk28 [~jhawk28@72.40.31.201] has quit [Remote host closed the
connection]
16:47 < wrtp> about documentation: it's worth following the existing go
style of documentation - make the comments before the functions full sentences.
e.g.  HashPassword returns the Pbjdf2 hash of password, using reasonable defaults
(9999 iterations + SHA1 + 64 bytes output).
16:48 < taruti> noted.
16:50 < taruti> sent a manual mail to golang-dev.
16:51 < wrtp> i'll keep a look out for it
16:51 -!- path[l] [~path@59.162.86.164] has quit [Quit: path[l]]
16:52 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
16:53 -!- ikke [~ikkibr@189.58.220.202.dynamic.adsl.gvt.net.br] has joined
#go-nuts
16:53 -!- ikke [~ikkibr@189.58.220.202.dynamic.adsl.gvt.net.br] has quit [Changing
host]
16:53 -!- ikke [~ikkibr@unaffiliated/ikkebr] has joined #go-nuts
16:55 -!- Xera^ [~brit@87-194-208-246.bethere.co.uk] has joined #go-nuts
16:57 < wrtp> taruti: another thing: if you want your stuff to work with
goinstall, it's worth changing the import paths to use
"bitbucket.org/taruti/pbkdf2" rather than "crypto/pbkdf2"
16:58 < taruti> wrtp: but that won't work for people not using goinstall?
16:58 < taruti> (I'm not using it actively at the moment since some of my
machines are not on the net)
16:58 -!- g0bl1n [~anonymous@a213-22-210-28.cpe.netcabo.pt] has quit [Quit:
g0bl1n]
16:58 < wrtp> true.  but goinstall should be the standard way of installing
go packages now.  and they can always change the paths the other way if they want
16:59 -!- alehorst [~alehorst@187.59.36.250] has quit [Quit: Leaving.]
16:59 -!- terrex [~terrex@183.38.222.87.dynamic.jazztel.es] has quit [Ping
timeout: 260 seconds]
16:59 < wrtp> you could always have the makefile install into that path
anyway
17:00 -!- alehorst [~alehorst@187.59.36.250] has joined #go-nuts
17:00 < taruti> mmh
17:02 < wrtp> if you do things that way, then goinstalling any package that
uses yours will automatically pull yours and compile it
17:04 < wrtp> also, if you do that, then your package gets listed in the
stats, so people will know about it
17:04 < taruti> any example of how to make the Makefile install into a path
that makes goinstall imports work?  just TARG=bitbucket.org/foo/bar ?
17:04 < wrtp> something like that
17:04 < wrtp> try it...
17:05 * taruti tries it
17:06 < wrtp> if you do things this way, you can have shorter names for your
packages too - e.g.  bitbucket.org/taruti/pbkdf2
17:07 -!- path[l] [~path@59.162.86.164] has joined #go-nuts
17:07 < wrtp> it's nice when the last component of the path is also the
package identifier
17:07 -!- smw [~stephen@pool-96-232-88-231.nycmny.fios.verizon.net] has quit
[Quit: Konversation terminated!]
17:07 -!- smw [~stephen@pool-96-232-88-231.nycmny.fios.verizon.net] has joined
#go-nuts
17:09 < taruti> hmm.  that is going to be confusing
17:10 < taruti> if I have e.g.  SRP code in both Go and Haskell and call the
go one simply "srp" that will confuse things.
17:10 < taruti> but I can see it being convenient from a goinstall
standpoint
17:11 -!- path[l] [~path@59.162.86.164] has quit [Client Quit]
17:12 < wrtp> well, then maybe have a separate go subdirectory, e.g.
bitbucket.org/taruti/go/pbkdf2
17:13 -!- jA_cOp [~yakobu@unaffiliated/ja-cop/x-9478493] has joined #go-nuts
17:13 -!- Gracenotes [~person@wikipedia/Gracenotes] has quit [Ping timeout: 260
seconds]
17:14 < taruti> wrtp: looking at dashboard most packages seem to be
go-something
17:14 -!- terrex [~terrex@69.38.222.87.dynamic.jazztel.es] has joined #go-nuts
17:15 -!- kjk [~Adium@67.215.69.69] has joined #go-nuts
17:17 < wrtp> taruti: some are, some aren't.  i guess it's just personal
preference, but i think it works well in a go subdirectory.
17:17 < wrtp> BTW, i just sent a mail to golang-dev, and it seems to have
come through
17:18 < wrtp> at least, i can see it here:
http://groups.google.com/group/golang-dev
17:18 < taruti> hmm.  I can mail go-nuts fine (did yesterday)
17:18 < wrtp> iant: do you know if there are any current issues with the
mailing lists?
17:19 <+iant> wrtp: not that I know of
17:20 <+iant> actually there are a couple of messages in the spam queue,
I'll push them through
17:20 < wrtp> iant: just seems very quiet.  and taruti's issue
(http://codereview.appspot.com/1157044/show) doesn't seem to be appearing
17:20 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has quit [Quit:
slashus2]
17:21 <+iant> should appear soon
17:21 < wrtp> got 'em
17:21 < taruti> thanks
17:21 < wrtp> i wonder why they triggered the spam filter
17:22 <+iant> groups spam filtering is pretty good these days but sometimes
it gets a bit aggressive
17:22 <+iant> I have no idea what the algorithms are
17:22 <+iant> I think they get input from gmail or something
17:23 < wrtp> that's when it gets dangerous...  my gmail spam inbox has 485
messages, and i never scan them all properly.  i wonder how many real messages
have got lost.
17:23 < wrtp> mind you i'm not complaining!
17:27 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #go-nuts
17:28 -!- Venom_X [~pjacobs@71.20.102.220] has joined #go-nuts
17:31 < wrtp> taruti: looks like TARG=bitbucket.org/taruti/go/xxx should
work fine.  see http://code.google.com/p/goprotobuf/source/browse/proto/Makefile
for an example
17:35 < taruti> ok :)
17:41 -!- divoxx [~divoxx@189.63.157.83] has quit [Ping timeout: 240 seconds]
17:45 -!- path[l] [UPP@120.138.102.34] has joined #go-nuts
17:50 -!- Venom_X [~pjacobs@71.20.102.220] has quit [Ping timeout: 260 seconds]
17:52 -!- deso [~deso@x0561a.wh30.tu-dresden.de] has joined #go-nuts
17:59 -!- mertimor [~mertimor@p4FE7584A.dip.t-dialin.net] has quit [Quit:
mertimor]
18:16 -!- Venom_X [~pjacobs@71.20.102.220] has joined #go-nuts
18:20 -!- cmarcelo [~cmarcelo@enlightenment/developer/cmarcelo] has quit [Ping
timeout: 276 seconds]
18:30 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has joined
#go-nuts
18:34 < uriel> iant: why don't you enable moderation for new posters?  I use
it in a few groups and it works quite well
18:34 <+iant> uriel: we had it enabled for a while, and then we decided to
just trust the spam filter
18:36 < uriel> iant: in my experience the filter doesn't work very well :(
(and quite a few bits of spam have got into golang-nuts, not much, but not good
for such a huge list)
18:36 <+iant> the filter has gotten much better in the last couple of months
18:36 <+iant> it's true that some spam has slipped through, and we should
reconsider if that doesn't improve
18:37 < uriel> ok, maybe you are right =)
18:37 <+iant> a lot of spam is getting blocked
18:37 < uriel> oh, I certainly believe that :)
18:42 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Ping
timeout: 260 seconds]
18:44 -!- Venom_X [~pjacobs@71.20.102.220] has quit [Ping timeout: 276 seconds]
18:46 -!- gisikw_ [~gisikw@137.28.186.120] has joined #go-nuts
18:47 -!- gisikw [~gisikw@137.28.246.34] has left #go-nuts []
18:51 -!- warthurton [~warthurto@pdpc/supporter/active/warthurton] has quit [Quit:
ZNC - http://znc.sourceforge.net]
18:53 -!- gisikw_ [~gisikw@137.28.186.120] has left #go-nuts []
18:53 -!- kel [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has joined #go-nuts
18:54 -!- kel [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has quit [Read error:
Connection reset by peer]
18:56 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
18:57 -!- idea_squirrel [~ct2rips@77-21-16-192-dynip.superkabel.de] has joined
#go-nuts
18:58 -!- warthurton [~warthurto@pdpc/supporter/active/warthurton] has joined
#go-nuts
18:59 -!- cmarcelo [~cmarcelo@enlightenment/developer/cmarcelo] has joined
#go-nuts
19:00 -!- [vertex] [~Alexandre@201.78.254.253] has quit [Ping timeout: 240
seconds]
19:01 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
19:02 -!- kabie [kabie@114.92.155.193] has joined #go-nuts
19:03 -!- alehorst [~alehorst@187.59.36.250] has quit [Quit: Leaving.]
19:09 -!- General13372 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined
#go-nuts
19:10 -!- kel_ [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has joined #go-nuts
19:12 -!- [vertex] [~Alexandre@201.78.254.253] has joined #go-nuts
19:12 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has quit
[Ping timeout: 260 seconds]
19:15 -!- b00m_chef [~watr@128.189.93.50] has joined #go-nuts
19:18 -!- thiago__ [~thiago@189.107.177.158] has joined #go-nuts
19:22 -!- Svarthandske [~nn@dsl-tkubrasgw1-fe3cdc00-28.dhcp.inet.fi] has quit
[Quit: Svarthandske]
19:24 -!- zuser1 [~nonet@c-76-126-152-253.hsd1.ca.comcast.net] has joined #go-nuts
19:24 -!- zuser1 [~nonet@c-76-126-152-253.hsd1.ca.comcast.net] has left #go-nuts
[]
19:33 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has quit
[Read error: Connection reset by peer]
19:33 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has joined
#go-nuts
19:37 -!- g0bl1n [~anonymous@a213-22-210-28.cpe.netcabo.pt] has joined #go-nuts
19:41 -!- Venom_X [~pjacobs@71.20.102.220] has joined #go-nuts
19:47 -!- fenicks [~christian@log77-4-82-246-228-78.fbx.proxad.net] has joined
#go-nuts
19:47 < fenicks> hello
19:48 < Ginto8> hi
19:50 -!- cmarcelo [~cmarcelo@enlightenment/developer/cmarcelo] has quit [Ping
timeout: 258 seconds]
19:59 -!- megaboz [~none@unaffiliated/megaboz] has quit [Quit: Lost terminal]
20:00 -!- samferry [~sam@atheme/member/samferry] has quit [Read error: Operation
timed out]
20:00 -!- samferry [sam@atheme/member/samferry] has joined #go-nuts
20:03 -!- Nexoro [~nexo@c-71-192-75-183.hsd1.ma.comcast.net] has joined #go-nuts
20:03 -!- ampleyfly [~ampleyfly@h-148-139.A163.priv.bahnhof.se] has joined
#go-nuts
20:03 -!- lilpenguina [~penguina@75.97.68.130.res-cmts.senj.ptd.net] has joined
#go-nuts
20:04 -!- mertimor [~mertimor@p4FE7584A.dip.t-dialin.net] has joined #go-nuts
20:07 -!- kabie [kabie@114.92.155.193] has quit [Quit: Leaving]
20:08 -!- marsu [~marsu@ANancy-154-1-37-119.w83-196.abo.wanadoo.fr] has joined
#go-nuts
20:11 -!- b00m_chef [~watr@128.189.93.50] has quit [Ping timeout: 276 seconds]
20:17 -!- ampleyfly [~ampleyfly@h-148-139.A163.priv.bahnhof.se] has quit [Ping
timeout: 248 seconds]
20:28 -!- ampleyfly [~ampleyfly@h-148-139.A163.priv.bahnhof.se] has joined
#go-nuts
20:31 -!- Kashia [~Kashia@port-92-200-40-80.dynamic.qsc.de] has joined #go-nuts
20:32 -!- tumdum [~tumdum@unaffiliated/tumdum] has quit [Quit: tumdum]
20:37 -!- g0bl1n [~anonymous@a213-22-210-28.cpe.netcabo.pt] has quit [Quit:
g0bl1n]
20:40 -!- kashia_ [~Kashia@port-92-200-53-157.dynamic.qsc.de] has joined #go-nuts
20:41 -!- fenicks [~christian@log77-4-82-246-228-78.fbx.proxad.net] has quit
[Quit: Leaving.]
20:41 -!- Kashia [~Kashia@port-92-200-40-80.dynamic.qsc.de] has quit [Ping
timeout: 240 seconds]
20:42 -!- tumdum [~tumdum@unaffiliated/tumdum] has joined #go-nuts
20:48 -!- Amaranth [~travis@ubuntu/member/Amaranth] has quit [Ping timeout: 245
seconds]
21:02 -!- Amaranth [~travis@ubuntu/member/Amaranth] has joined #go-nuts
21:03 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
21:03 -!- Venom_X [~pjacobs@71.20.102.220] has quit [Ping timeout: 265 seconds]
21:04 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
21:05 -!- tumdum [~tumdum@unaffiliated/tumdum] has quit [Quit: tumdum]
21:11 -!- braddunbar [~dunbarb2@rrcs-96-10-96-162.se.biz.rr.com] has joined
#go-nuts
21:16 -!- Venom_X [~pjacobs@71.20.102.220] has joined #go-nuts
21:19 -!- deso [~deso@x0561a.wh30.tu-dresden.de] has quit [Ping timeout: 240
seconds]
21:20 -!- deso [~deso@x0561a.wh30.tu-dresden.de] has joined #go-nuts
21:21 -!- Svarthandske [~nn@dsl-tkubrasgw1-fe3cdc00-28.dhcp.inet.fi] has joined
#go-nuts
21:27 -!- wrtp [~rog@89.242.170.31] has quit [Quit: wrtp]
21:27 -!- ikke [~ikkibr@unaffiliated/ikkebr] has quit []
21:29 -!- Altercation [~Altercati@pdpc/supporter/active/altercation] has quit
[Excess Flood]
21:29 -!- Altercation [~Altercati@pdpc/supporter/active/altercation] has joined
#go-nuts
21:32 < braddunbar> hi all!  is there a standard idiomatic way to do general
set manimpulations in go?  (sum, product, min, max, etc)
21:43 < MizardX> You could use a map[T]bool or map[*T]bool for storage.
Otherwise there is no built-in support for sets.
21:47 < MizardX>
http://google.com/codesearch?hl=en&lr=&q=lang:go+^package.*set&sbtn=Search
21:50 < braddunbar> ah, I should've said sequence manipulations - like
summing a channel of some numeric type
21:50 < braddunbar> sorry
21:50 < Ginto8> for i,x := range v {} is what I'd think
21:50 < Ginto8> you can do it with a channel
21:50 < braddunbar> i find that I need a different function for each type,
like func Max(ch chan uint64) { } and func Max(ch chan uint32){} etc...
21:51 < Ginto8> uhm just use an interface
21:51 < Ginto8> oh with channels...
21:51 < Ginto8> channels complicate things
21:51 < braddunbar> Ginto8: How would I go about using an interface?
21:51 < braddunbar> Ginto8: it doesn't have to be channels necessarily
21:52 < braddunbar> Ginto8: I'm a total newb, so I haven't a clue which way
would be best
21:52 < Ginto8> uhm I believe there's a tutorial on the website
21:52 < Ginto8> either in tutorials or effective go
21:52 < Ginto8> if not you could look at the language spec
21:53 < Ginto8> If you still can't figure it out, then I'll help =P
21:54 < braddunbar> Ginto8: thanks =)
21:55 < Ginto8> np =D
21:55 -!- Chryson [~Chryson@pool-71-162-35-104.altnpa.east.verizon.net] has joined
#go-nuts
21:56 -!- barismetin [~barismeti@kde/developer/baris] has quit [Remote host closed
the connection]
21:57 -!- MizardX [~MizardX@unaffiliated/mizardx] has quit [Ping timeout: 276
seconds]
21:58 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Connection reset by
peer]
21:59 -!- b00m_chef [~watr@209-52-232-163.vlan452.dsl.ucc-net.ca] has joined
#go-nuts
22:00 -!- terrex [~terrex@69.38.222.87.dynamic.jazztel.es] has quit [Quit:
Leaving.]
22:04 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-159-141.clienti.tiscali.it] has
quit [Quit: E se abbasso questa leva che succ...]
22:05 -!- Adys [~Adys@unaffiliated/adys] has quit [Ping timeout: 260 seconds]
22:08 -!- b00m_chef [~watr@209-52-232-163.vlan452.dsl.ucc-net.ca] has quit [Remote
host closed the connection]
22:09 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
22:12 -!- deso [~deso@x0561a.wh30.tu-dresden.de] has quit [Remote host closed the
connection]
22:12 -!- braddunbar [~dunbarb2@rrcs-96-10-96-162.se.biz.rr.com] has left #go-nuts
[]
22:13 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Quit:
hcatlin]
22:17 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
22:19 -!- lilpenguina [~penguina@75.97.68.130.res-cmts.senj.ptd.net] has quit
[Quit: Leaving.]
22:20 -!- meatmanek_ [~meatmanek@c-76-21-205-249.hsd1.va.comcast.net] has quit
[Quit: Leaving]
22:24 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined
#go-nuts
22:30 -!- Kirill [~user@CPEf81edff80afa-CM0016924f5bee.cpe.net.cable.rogers.com]
has joined #go-nuts
22:30 -!- kel_ [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has quit [Remote host
closed the connection]
22:31 < Kirill> hi!  when I compile several .go files, it looks like I have
to list them by order of dependency.  is there a tool that takes care of this?
22:31 -!- kel [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has joined #go-nuts
22:32 -!- kel [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has quit [Client Quit]
22:33 -!- kel [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has joined #go-nuts
22:34 < Ginto8> Kirill, are they for the same package, or not?
22:34 -!- marsu [~marsu@ANancy-154-1-37-119.w83-196.abo.wanadoo.fr] has quit
[Quit: Leaving]
22:34 < Ginto8> because if they are for the same package you don't need to
22:34 < Kirill> Ginto8: I see.  Thanks =)
22:34 < Ginto8> all files in the same package are compiled at once
22:35 < Kirill> Ginto8: well, if my program is split into multiple files, I
don't have to make each file be a different package, right?  they would all be
members of the "my-program" package.  correct?
22:35 < Ginto8> you have to go by package order of dependency, not file
order
22:35 -!- kel [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has quit [Client Quit]
22:35 < Ginto8> yes, but then you have to have a package main with a
function main.main() I believe
22:35 -!- kel [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has joined #go-nuts
22:35 < Ginto8> or can you have main() in any package?
22:36 < Kirill> Ginto8: I don't know.
22:36 < Ginto8> you might want to check the language spec
22:36 < Ginto8> I've gotta go, hope find the issue =)
22:36 <+iant> you can have main() in any package, but the program always
starts at main() in the package main
22:36 < Kirill> iant: so if there's no main() inside package main, that's an
error?
22:37 <+iant> yes
22:37 < Kirill> So I _must_ have a package called "main" somewhere in my
program
22:37 <+iant> yes
22:37 <+iant> it can be quite small, of course
22:37 < Kirill> I guess my main file would be part of package "main", and
everything else part of "my-program" or whatever.
22:37 < Ginto8> yes
22:37 < Ginto8> but you'd have to import "my-program" to access stuff from
that package
22:37 < Ginto8> anyway bye
22:39 -!- Chryson [~Chryson@pool-71-162-35-104.altnpa.east.verizon.net] has quit
[Quit: Leaving]
22:39 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has joined #go-nuts
22:40 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Quit:
hcatlin]
22:42 -!- Ginto8 [~Ginto8@pool-72-82-235-34.cmdnnj.fios.verizon.net] has quit
[Ping timeout: 265 seconds]
22:44 -!- rv2733 [~rv2733@c-98-242-168-49.hsd1.fl.comcast.net] has quit [Quit:
Leaving]
22:47 < Kirill> how do I copy a map?
22:49 -!- kel [~kel@82-68-84-3.dsl.in-addr.zen.co.uk] has quit [Ping timeout: 246
seconds]
22:50 < Kirill> ...?
22:50 <+iant> make a new map and use range over the old map
22:50 < Kirill> iant: you mean, copy it manually using a loop?  =)
22:50 <+iant> you can do a generic version using the reflect package but it
won't be any faster
22:50 <+iant> yes
22:51 <+iant> there is no other way at present
22:51 < Kirill> that's balls.
22:51 < Kirill> serious balls.
22:51 < Kirill> iant: why do maps have reference semantics?
22:52 <+iant> because otherwise they would be copied when passed to a
function, and that is rarely what you want
22:52 < Kirill> what about arrays?
22:52 <+iant> think of the map type as a pointer
22:52 < Kirill> I know what a reference type is.
22:52 < Kirill> I'm saying...  copying an array as an argument to a function
is also seldom what I want
22:52 < Kirill> yet arrays are value types
22:52 < Kirill> why?
22:52 <+iant> the language gives both options for arrays, via arrays and
slices
22:52 < Kirill> ...  then why doesn't it give the option for maps?
22:53 < Kirill> certainly slices can be generalized to maps?
22:53 <+iant> the other reason that arrays are values is that that gives you
a clear understanding of the storage requirements of arrays
22:53 <+iant> there is no reason for maps, which always use an internal data
structure
22:54 < Kirill> but I'd like to be able to copy it in a generic way, just
like I copy anything else
22:54 < Kirill> I mean, it's nice that the implementation of maps is what it
is, but you'll agree it's sheer idiocy to write the same loop every time I want to
copy a map.
22:54 < Kirill> perhaps a language-provided "copy" is in order.
22:54 <+iant> yes, it's a place where the language suffers from the lack of
generic support
22:54 <+iant> we've avoided adding such copy functions until we know what
the answer is going to be for generics
22:55 < Kirill> you guys are hoping the answer isn't what C++'s answer is,
eh =)
22:55 <+iant> C++'s answer isn't bad, but it hurts compilation time, which
would hurt one of the goals of Go
22:56 <+iant> well, the C++ syntax gets pretty awful
22:56 < Kirill> so you expect to find a solution to compile-time generics
without impacting compile times..?
22:56 -!- ikaros [~ikaros@f051128085.adsl.alicedsl.de] has quit [Quit: Leave the
magic to Houdini]
22:56 <+iant> well, you added "compile-time" in front of "generics"
22:56 <+iant> that could be the answer
22:56 <+iant> but there are, as always, various tradeoffs
22:57 <+iant> the question is what the best tradeoff is for generics in Go
22:57 <+iant> it's possible that the language will never have generics
22:57 <+iant> that gives you one negative tradeoff, which is that you can't
write a map copy function (except via the reflect package)
22:57 <+iant> I don't know what the answer will be
22:58 < Kirill> no generics at all?  that won't be very good =)
22:58 <+iant> I agree
22:58 < Kirill> that is to say, the language won't be very good
22:58 <+iant> everything is on the table, though
22:58 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
22:59 < Kirill> We went all the way from 1968, now we're trying to create
"the next C" (sort of), and it still doesn't have generics...  *facepalm
22:59 -!- vsayer [~vivek@c-76-103-244-154.hsd1.ca.comcast.net] has joined #go-nuts
22:59 < Kirill> iant: are you on the "standards committe" (or equivalent)?
22:59 <+iant> it is a lack, and yet clearly people are able to do useful
work anyhow
22:59 <+iant> I wouldn't call it a standards committee, or any sort of
committee, but I'm in the discussions, yes
23:00 < Kirill> iant: so the fear with introducing generics is that they
will hurt compile time, but will be too slow at runtime?
23:00 < Kirill> I mean, you must have had _some_ discussions about it
23:00 <+iant> that is one of the tradeoffs, yes
23:00 < Kirill> also, is the code in the standard library "final"?  that is
to say, some of the built in packages are somewhat sketchy, both code quality
wise, and otherwise
23:01 <+iant> no, nothing is final
23:01 <+iant> everything is in the process of being changed and improved
23:01 <+iant> we very much welcome patches, and we've gotten great
contributions to the library
23:01 -!- rhelmer [~rhelmer@adsl-69-107-94-119.dsl.pltn13.pacbell.net] has joined
#go-nuts
23:02 < Kirill> I wrote a straightforward audio streamer in Go (to learn the
language).  it's gone pretty smoothly, but there are a few hiccups that I find
quite annoying
23:03 < Kirill> for instance, the inability to add methods to external types
is annoying.  at the moment, say, "string" doesn't have an "isEmpty" method.  I
could write len(s) != 0, but that's not direct.  I can't add an "IsEmpty" method
to string because of the above, but doing something like "type Mystring string" is
even more annoying.
23:04 <+iant> adding methods to external types makes dynamic satisfaction of
interfaces very complex
23:04 <+iant> not to mention potentially highly confusing
23:04 < Kirill> and writing "type MyString string" and using that instead is
less confusing?  =)
23:05 <+iant> yes, because then everything about the type is in a single
package
23:05 < KirkMcDonald> To put it another way: What is this, Ruby?
23:05 < Kirill> what is the restriction on key types for maps?
23:05 < KirkMcDonald> Or just say: func IsEmpty(s string) bool
23:05 < Kirill> KirkMcDonald: already did.  Annoying because IsEmpty doesn't
communicate the fact that it's a string.  if I want to write another IsEmpty for
(say) an array, I can't.
23:06 <+iant> the key types on maps are those types that can be compared for
equality
23:06 < KirkMcDonald> Kirill: IsStringEmpty, IsArrayEmpty, etc...
23:06 < Kirill> KirkMcDonald: even more annoying.
23:06 < KirkMcDonald> Kirill: Stupid solution: IsEmpty(x interface{}), use
reflection.  :-)
23:06 <+iant> we could define equality on struct types but it hasn't really
gotten to the top of the list
23:07 < Kirill> iant: it's not defined currently?  it isn't possible to have
struct types as keys for maps/
23:07 < Kirill> ?
23:07 <+iant> right
23:07 < Kirill> maybe I'm not being clear enough.  the idea is -- yes, I can
figure out a way around Go's problems.  but that's not good enough, because
instead I can just use C, where the majority of time is spent "working around"
things that C doesn't have.
23:08 < Kirill> I'm not trying to troll or anything.  I'm geniuinely trying
to understand the point of writing a new language that (among other things) has
fast compile times at the expense of not having fairly common features...  like
copying objects.
23:10 < KirkMcDonald> "Copy" is such a vague word.  :-)
23:11 < Kirill> KirkMcDonald: not in C++, for example =)
23:11 < KirkMcDonald> Well, in C++ you've got both copy assignment and copy
construction.
23:12 -!- idea_squirrel [~ct2rips@77-21-16-192-dynip.superkabel.de] has quit
[Quit: Verlassend]
23:13 < Kirill> iant: also, what about making external type method
"extensions" visible only in the package where they are defined?
23:13 < Kirill> iant: that is, my "IsEmpty" for string would only be visible
in the package where I wrote it
23:14 < Kirill> iant: also, are the "committe" discussions publicly
accessible somewhere?
23:15 < Kirill> iant: still there?
23:18 <+iant> Making the extensions only visible in the package doesn't work
if they get assigned to an empty interface value and then passed to a different
package which uses a type assertion to convert to another interface value
23:19 <+iant> at that point you have to know which methods the type has
23:19 <+iant> discussions are not publically available and are generally not
written down in any case
23:19 <+iant> we will eventually come up with a generics proposal
23:19 <+iant> thought right now everybody is trying to get through Google
I/O next week
23:19 <+iant> the proposal will be sent out for comments
23:20 < KirkMcDonald> Just generics?  Or full-bore template metaprogramming?
23:20 <+iant> that is another one of the tradeoffs
23:20 <+iant> By the way, the valid types for a map key are listed in the
spec
23:20 < Kirill> another way would be to introduce hygienic macros into the
language...
23:21 < Kirill> this way I could implement my "IsEmpty" as a macro and be
done with it.
23:22 < Kirill> but in this context I guess they would be equivalent to
turing-complete "generics", so you're still stuck with either doing it (slowly,
potentially) at compile time, or even slower at runtime
23:22 <+iant> yeah, you get into area like LISP macros
23:29 -!- iant [~iant@nat/google/x-anjsqhdmtffvjhxp] has quit [Ping timeout: 260
seconds]
23:29 -!- wuehlmaus [~wuehlmaus@p4FCC79E1.dip.t-dialin.net] has quit [Ping
timeout: 252 seconds]
23:30 -!- wuehlmaus [~wuehlmaus@p4FCC78D1.dip.t-dialin.net] has joined #go-nuts
23:34 -!- thiago__ [~thiago@189.107.177.158] has quit [Quit: bye]
23:35 < jlouis> Heh, so the commit slowdown is due to Google I/O ?
23:36 -!- carllerche [~carllerch@99.13.242.166] has joined #go-nuts
23:38 -!- Kirill [~user@CPEf81edff80afa-CM0016924f5bee.cpe.net.cable.rogers.com]
has left #go-nuts ["ERC Version 5.3 (IRC client for Emacs)"]
23:43 -!- lux` [lux`@151.95.180.63] has quit [Remote host closed the connection]
23:57 -!- path[l] [UPP@120.138.102.34] has quit [Ping timeout: 258 seconds]
--- Log closed Thu May 13 00:00:30 2010