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

--- Log opened Thu Feb 24 00:00:29 2011
00:17 -!- grumpytoad [~niel@t1004.greatnet.de] has joined #go-nuts
00:20 -!- gid [~gid@220-253-146-76.VIC.netspace.net.au] has joined #go-nuts
00:20 -!- gid [~gid@220-253-146-76.VIC.netspace.net.au] has quit [Client Quit]
00:22 -!- tarrant [~tarrant@216.83.139.130] has quit [Quit: Leaving...]
00:25 -!- gstrock [~gstrockbi@64-60-93-202.static-ip.telepacific.net] has quit
[Quit: Ex-Chat]
00:32 -!- Natch| [~natch@c-6dcde155.25-4-64736c10.cust.bredbandsbolaget.se] has
quit [Ping timeout: 272 seconds]
00:33 -!- Natch| [~natch@c-6dcde155.25-4-64736c10.cust.bredbandsbolaget.se] has
joined #go-nuts
00:40 -!- Scorchin [~Scorchin@host109-157-106-108.range109-157.btcentralplus.com]
has quit [Quit: Scorchin]
00:42 -!- stalled [~stalled@unaffiliated/stalled] has joined #go-nuts
00:46 < rl> Go is dangerous...  Now whenever I write C++ or Java at work I
keep forgetting semicolons.
00:51 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
00:51 < Xenith> The obvious solution to that is to never write in C++ or
Java again.
00:52 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has joined #go-nuts
00:53 -!- nettok [~quassel@200.119.176.110] has joined #go-nuts
00:54 < rl> If only I was fanatical enough that the programming language I
worked in was a higher priority than what I actually got to work on ;)
00:55 -!- deltaphc [delta@cpe-76-173-127-142.socal.res.rr.com] has joined #go-nuts
00:56 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
00:57 -!- kingfishr_ [~kingfishr@c-98-207-87-183.hsd1.ca.comcast.net] has quit
[Ping timeout: 240 seconds]
00:57 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has joined #go-nuts
01:07 -!- tav [~tav@92.7.72.160] has quit [Read error: Connection reset by peer]
01:07 -!- tarrant [~tarrant@69.169.141.202.provo.static.broadweavenetworks.net]
has joined #go-nuts
01:11 -!- tav [~tav@92.7.72.160] has joined #go-nuts
01:13 -!- saturnfive [~saturnfiv@210.74.155.131] has joined #go-nuts
01:18 -!- aconran_ [~aconran-o@38.104.129.126] has quit [Remote host closed the
connection]
01:26 -!- coldturnip [~COLDTURNI@118-166-68-6.dynamic.hinet.net] has quit [Read
error: Connection reset by peer]
01:27 -!- coldturnip [~COLDTURNI@118-166-68-6.dynamic.hinet.net] has joined
#go-nuts
01:29 -!- digi9 [~digi9@unaffiliated/digi9] has joined #go-nuts
01:30 < digi9> I'd like to build an arm binary, but I'm not sure what the
proper way to build the arm compilers on amd64 would be.  I see mention of
make-arm.sh but that seems to be no more
01:31 -!- aho [~nya@fuld-590c7bfa.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
01:43 -!- 14WAAPRS3 [Wiz@h29.117.232.68.ip.windstream.net] has quit [Ping timeout:
260 seconds]
01:44 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has quit
[Ping timeout: 260 seconds]
01:44 -!- Piggie [~Piggie@76.91.53.83] has quit []
01:44 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has joined
#go-nuts
01:45 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has quit [Ping timeout: 264
seconds]
01:45 -!- binarypie [~binarypie@adsl-99-37-227-229.dsl.pltn13.sbcglobal.net] has
quit [Ping timeout: 276 seconds]
01:50 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has joined #go-nuts
01:51 -!- `Wiz126 [~Wiz@h29.117.232.68.ip.windstream.net] has joined #go-nuts
01:51 -!- Wiz126 [Wiz@h29.117.232.68.ip.windstream.net] has quit [Disconnected by
services]
01:51 -!- `Wiz126 [~Wiz@h29.117.232.68.ip.windstream.net] has quit [Client Quit]
01:51 -!- Wiz126 [Wiz@h29.117.232.68.ip.windstream.net] has joined #go-nuts
02:04 -!- Glasswalker
[~Glasswalk@CPE002369b3cd1a-CM00222d53f155.cpe.net.cable.rogers.com] has joined
#go-nuts
02:05 -!- bobc [~bobc@cpe-98-155-23-151.san.res.rr.com] has joined #go-nuts
02:08 < Glasswalker> Hey, completely new to go, trying some basic
concurrency.  I have this simple program (trying to spawn 10 concurrent counter
threads to count in parallel) it works as expected, but throws an error at the end
because all goroutines are sleeping.
02:08 < Glasswalker> http://pastie.org/1600557
02:08 < Glasswalker> So how do I detect when the goroutines are cleanly
exited.  (I kind of assumed, falsely, that the for would detect when the channel
was finished)
02:08 < Glasswalker> but I guess it makes sense that it doesn't it's just a
stream basicallyl.
02:09 < Glasswalker> Anyway, what am I missing?  (it should be noted this is
literally my first go program lol)
02:10 < rl> How would it know that a channel has "finished" if you don't
tell it?
02:10 -!- amacleod [~amacleod@pool-96-252-93-11.bstnma.fios.verizon.net] has
joined #go-nuts
02:10 < Namegduf> Glasswalker: You have them send a message back.
02:11 < Glasswalker> so I would need the routine to send two things back,
and then track how many of the threads have completed?
02:11 < rl> right
02:11 < Glasswalker> (one would be the channel for counting, the other just
a random boolean flag for finished)
02:11 < Namegduf> Or take the thing sent back as meaning it's complete.
02:12 < Namegduf> You could close() the channel.
02:12 < rl> There's only one channel...
02:12 < rl> If you had 10 different channels though you could close them
02:12 < Glasswalker> hmm
02:12 < Namegduf> In that case, yes.  You need some way for the program to
know you aren't sending any more.
02:12 < rl> But that doesn't sound like a great idea
02:12 < Glasswalker> ok so I realize my example is simple, but what if the
main routine didn't know how many threads were counting
02:13 < rl> Someone has to start the threads; someone should know
02:13 < Glasswalker> fair enough
02:13 < Glasswalker> hmm
02:13 < Namegduf> Then you need to implement some way to tell it to return.
02:13 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has joined
#go-nuts
02:13 < Glasswalker> can I aggregate the channels somehow?
02:13 < Namegduf> That kinda design issue is your job.  :P
02:13 < Glasswalker> so I could have individual channels for each thread
02:14 < Glasswalker> and have them aggregate into one, which the output
routine uses?
02:14 < rl> You could write a goroutine which iterated over each channel,
read it, and wrote the output to a single channel
02:14 < skelterjohn> you'd want to use select, rather than iterating
02:14 < skelterjohn> so that you don't get blocked by one channel
02:14 < skelterjohn> oh but
02:14 < rl> Hm how would you use select?
02:14 < Glasswalker> ok, I'll look up select in the docs.
02:14 < skelterjohn> can't select on an arbitrary set of chans
02:14 < Glasswalker> oh
02:14 < Glasswalker> ok lol
02:14 < skelterjohn> think think
02:15 < rl> I'm wondering if you could hack it
02:15 < skelterjohn> oh no
02:15 < Glasswalker> yeah your right, wouldn't want to block on one channel
or the other
02:15 < skelterjohn> you have a goroutine for each in-channel
02:15 < skelterjohn> that reads a value and writes to the single out channel
02:15 < skelterjohn> nothing hacky needed
02:15 < rl> Well then you're back at the case he has now lol
02:15 < rl> His original threads might as well just write to the same
channel
02:15 < skelterjohn> oh
02:15 < skelterjohn> i missed everything before "can I aggregate the
channels somehow?"
02:16 < skelterjohn> but...
02:16 < Glasswalker> see I would want the aggregator to somehow know once
all the individual channels are closed
02:16 < rl> Yea I think he wanted to split them up so they could be
individually closed when they were done
02:16 < skelterjohn> what i said will work, who cares how it's implemented?
02:16 < Glasswalker> then I could have those goroutines close the channel
when done
02:16 < skelterjohn> rl - still possible
02:16 < skelterjohn> oh i see, Glasswalker
02:16 < Glasswalker> then the aggregator would detect once the final one is
closed and close the aggregated channel
02:16 < Glasswalker> so the main routine listening to the aggregated channel
would know to stop listening
02:17 < skelterjohn> your function that adds to the aggregation also counts
how many are added
02:17 < rl> can you use select on a slice?
02:17 < skelterjohn> then the goroutines that forward messages, when they
finish a chan they send something over a special channel
02:17 < rl> like on ch[i]
02:17 < Glasswalker> (I might be going about this all wrong, just trying to
get my head around Go's concurrency model, and some go programming concepts) lol
02:17 < skelterjohn> and when enough things come on that special channel,
close the out-chan
02:17 < rl> Then you could just have a loop which tries to select on a
channel, with the default option being to continue the for loop
02:17 < rl> Non-blocking reads
02:18 < Glasswalker> slice being something like a linked list right?
02:18 < Glasswalker> (or in .net speak, a collection)
02:18 < rl> no, like an array
02:18 < skelterjohn> rl - then you'd be busy-waiting if there was nothing
incombing
02:18 < rl> skelterjohn: good point
02:18 < skelterjohn> incoming
02:19 < skelterjohn> i think i have a good solution - gimme a minute to put
it togethr
02:19 < Glasswalker> thanks for your help guys
02:19 < Glasswalker> I realize this is mostly just a thought experiment
02:19 < rl> Glasswalker: a slice is a view of an array, actually
02:19 < Glasswalker> but this kind of thing helps me get my head around a
new language, just dive in and try some arbitrary problems
02:20 < Glasswalker> Hmm...  perhaps I should check the docs on slices
02:20 < Glasswalker> lol
02:20 < rl> read the language spec
02:20 < rl> it's not bad, as far as language specs go
02:20 < rl> (you don't have to read it all now, but it's a good reference)
02:22 < Glasswalker> ok, I think I understand slices to a point
02:23 < skelterjohn> here's one thing - how do you know if the aggregated
channel is done?  do you give it all the input channels before anything begins?
02:23 < skelterjohn> or can new ones be added at any time?
02:24 < |Craig|> give it a chan chan when you make it, so you can send chans
to it
02:25 < skelterjohn> yes, i intend to :) but the issue is
02:25 < skelterjohn> if it has two channels, and they both finish, and then
a third one is added
02:25 < Glasswalker> oh I see your point
02:25 < |Craig|> don't close unless chan chan is closed
02:25 < skelterjohn> if the aggregator took the first two finishing to mean
everything was over, then it's too late for the third
02:25 < Glasswalker> I was thinking they could be arbitrarily added
02:25 < skelterjohn> ah, good idea
02:25 < Glasswalker> oh
02:25 < skelterjohn> |Craig|'s got it
02:25 < Glasswalker> yeah that works
02:26 * Glasswalker is still processing to get my head around the concept
02:26 < Glasswalker> ok so a chan chan, would be a channel, of type channel.
(send channels into the channel)
02:26 < skelterjohn> chan chan int
02:26 < Glasswalker> so would the agregator have an array of channels which
it fetches the incoming channels from
02:27 < skelterjohn> it's a channel that sends chan int
02:27 < skelterjohn> yes
02:27 < Glasswalker> and then it iterates over the array internally
02:27 < Glasswalker> but...  what would keep it from blocking
02:27 < Glasswalker> say one of the "feeder" channels blocks on something
02:27 < Glasswalker> would it block when the iteration hits that particular
feeder?
02:27 < skelterjohn> almost done
02:28 < skelterjohn> when i have code to point at it will be easier to talk
about
02:28 < Glasswalker> ok cool
02:28 < |Craig|> skelterjohn: you spawing a go routine for each input
channel?
02:28 < skelterjohn> yes
02:29 < |Craig|> I was tying to think of a solution to avoid that, but
didn't see one
02:29 < Namegduf> There is another option.
02:29 < Namegduf> Run the thing responding to the counter events outside of
main.
02:30 < Namegduf> Have main listen on a second channel for quit messages up
to the limit of spawned goroutines; you can keep a counter.
02:30 < Namegduf> Not counting that thing handling the counter events.
02:30 < Namegduf> Have each source send one message to quit when they quit.
02:30 < Namegduf> main returns when all sources return.
02:30 < Glasswalker> Does Go support dynamic arrays?
02:31 < Namegduf> Use slices.
02:31 < |Craig|> the issue is you have lots of inputs.  If you block, then
you need a routine for each.  If they don't block, you busy loop checking them.
02:31 < Glasswalker> as in can I have a list of elements, which I can add
and remove elements to arbitrarily?
02:31 < Glasswalker> (similar in functionality to .net Collections)
02:31 < Namegduf> Use a slice.
02:31 < |Craig|> Glasswalker: slices have append which will do whats
expected of dynamic array type things
02:31 < skelterjohn> Glasswalker: I recommend looking at the tutorials :)
02:31 < Glasswalker> but don't slices use an underlying array for storage
02:31 < Glasswalker> which has to have a static size definition?
02:31 < Glasswalker> or did I misunderstand that in the spec?
02:31 < |Craig|> Glasswalker: yes
02:32 < Namegduf> No.
02:32 < Namegduf> Use make()
02:32 < |Craig|> slices allocate a new array when the underlying array gets
full
02:32 < Namegduf> Which can allocate arrays of size determined at runtime.
02:32 < Namegduf> You can also use append(), which behaves as the above.
02:32 < Glasswalker> oh
02:32 < Glasswalker> interesting
02:32 < Glasswalker> :)
02:32 < Namegduf> ("slices" are data, they don't do anything, and you don't
essentially have to use append())
02:32 < Glasswalker> what about removal?
02:32 < Namegduf> (They have a static size if you don't.)
02:33 < |Craig|> append is kinda strange though.  It returns a new slice
which may or may not be of the origional array
02:33 < Namegduf> You can set the slice to itself minus the last element.
02:33 < Glasswalker> what if I want to remove an element in the middle
02:33 < Namegduf> Then you are using the wrong data structure.
02:33 < Glasswalker> lol
02:33 < |Craig|> swap the last one on top of it, then remove the end
02:33 < Namegduf> Oh, that often works.
02:34 < Namegduf> If order isn't relevant that works.
02:34 < |Craig|> as long as order does not mater
02:34 < Glasswalker> right
02:34 < Glasswalker> so I'm thinking...  in the agregator
02:34 < Namegduf> There is no way to implement it caring about order
efficiently with anything that behaves like an array.
02:34 < Glasswalker> have a slice filled with the various counter channels
02:34 < Glasswalker> iterate through them
02:34 < Glasswalker> if one closes
02:34 < Glasswalker> then remove it from the slice
02:34 < Glasswalker> and continue
02:34 < Glasswalker> if the length of the slice falls to 0
02:35 < Glasswalker> then close the aggregated channel
02:35 < Glasswalker> that would assume of course that it starts with at
least one counter
02:35 < |Craig|> Glasswalker: you get a busy wait when nothing is comming in
that way
02:35 < Namegduf> You can't listen on all counters in a slice without a busy
loop
02:35 < Glasswalker> and that you never intend to add more after your last
one is done
02:35 < Namegduf> Which is Bad]
02:35 < Namegduf> *Bad
02:35 < skelterjohn> http://pastebin.com/2wJjmqsn
02:36 < Namegduf> The way my program does it is to have an arbitrary number
of separate service goroutines
02:36 < Namegduf> Which can send quit messages when they themselves are
ready to quit
02:36 < Namegduf> And main returns when they've all said they're good to
quit.
02:36 < Namegduf> But none ever terminate on their own, they keep listening
to any incoming requests from others.
02:37 < Namegduf> You CAN use a counter in main for that.
02:37 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has joined #go-nuts
02:41 < skelterjohn> no high fives?  :\
02:41 < Glasswalker> lol still reading code lol
02:44 < Glasswalker> That actually looks like it will do the trick.  A bit
more complicated than I had hoped, but I think I can get my head around it ;)
02:44 < Glasswalker> I'm very used to using collections in .net, so that's
going to take some getting used to
02:45 < skelterjohn> it's mostly complicated by the fact that you want the
aggregated channel to close when the incoming channels are all done
02:46 < skelterjohn> and the fact that this isn't a super well-defined
criterion
03:19 -!- yiyus [1242712427@je.je.je] has quit [Remote host closed the connection]
03:27 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping
timeout: 240 seconds]
03:31 -!- digi9 [~digi9@unaffiliated/digi9] has left #go-nuts []
03:35 -!- marekweb [~marek@bas1-montreal48-1176173369.dsl.bell.ca] has quit [Ping
timeout: 272 seconds]
03:45 -!- keithcascio_ [~keithcasc@nat/google/x-jazdvhhcjnyqelal] has quit [Quit:
Leaving]
03:50 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #go-nuts
03:53 -!- bobc [~bobc@cpe-98-155-23-151.san.res.rr.com] has quit [Quit: Leaving]
04:05 -!- coldturnip1 [~COLDTURNI@118-166-68-6.dynamic.hinet.net] has joined
#go-nuts
04:07 -!- coldturnip [~COLDTURNI@118-166-68-6.dynamic.hinet.net] has quit [Ping
timeout: 264 seconds]
04:13 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has joined
#go-nuts
04:14 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 250
seconds]
04:14 -!- tensai_cirno [~cirno@77.232.15.216] has quit [Ping timeout: 260 seconds]
04:19 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
04:28 -!- nettok [~quassel@200.119.176.110] has quit [Ping timeout: 264 seconds]
04:42 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has quit [Quit:
Leaving]
05:01 < plexdev> http://is.gd/YRkaLs by [Dave Cheney] in go/src/ -- build:
remove unused nacl conditional from make.bash
05:18 -!- amacleod [~amacleod@pool-96-252-93-11.bstnma.fios.verizon.net] has quit
[Quit: Bye Bye]
05:18 -!- [muttox] [~dheppell@93.135.70.115.static.exetel.com.au] has joined
#go-nuts
05:18 < plexdev> http://is.gd/w5A3VJ by [Alex Brainman] in 4 subdirs of
go/src/ -- 8l/6l: new -Hwindowsgui flag allows to build windows gui pe
05:19 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has joined #go-nuts
05:19 -!- tensai_cirno [~cirno@194.186.220.179] has joined #go-nuts
05:26 -!- niemeyer [~niemeyer@189-10-154-99.pltce701.dsl.brasiltelecom.net.br] has
quit [Ping timeout: 272 seconds]
05:42 -!- fabled [~fabled@mail.fi.jw.org] has joined #go-nuts
05:58 -!- tensai_cirno [~cirno@194.186.220.179] has quit [Quit: Leaving]
06:08 -!- deltaphc [delta@cpe-76-173-127-142.socal.res.rr.com] has quit [Ping
timeout: 240 seconds]
06:09 -!- ExtraSpice [XtraSpice@78-62-101-194.static.zebra.lt] has joined #go-nuts
06:09 -!- [muttox] [~dheppell@93.135.70.115.static.exetel.com.au] has quit [Quit:
leaving]
06:10 -!- deltaphc [delta@cpe-76-173-127-142.socal.res.rr.com] has joined #go-nuts
06:12 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
06:16 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has quit [Remote host closed
the connection]
06:16 -!- kanru` [~kanru@kanru-1-pt.tunnel.tserv15.lax1.ipv6.he.net] has joined
#go-nuts
06:21 -!- tarrant [~tarrant@69.169.141.202.provo.static.broadweavenetworks.net]
has quit [Quit: Leaving...]
06:22 -!- kanru` [~kanru@kanru-1-pt.tunnel.tserv15.lax1.ipv6.he.net] has quit
[Quit: rcirc on GNU Emacs 23.2.1]
07:05 -!- JusticeFries_
[~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net] has joined #go-nuts
07:08 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Ping timeout: 276 seconds]
07:09 -!- JusticeFries_
[~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net] has quit [Ping
timeout: 240 seconds]
07:13 -!- kanru [~kanru@kanru-1-pt.tunnel.tserv15.lax1.ipv6.he.net] has quit
[Quit: WeeChat 0.3.2]
07:17 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has joined
#go-nuts
07:18 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has quit
[Client Quit]
07:19 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has quit [Quit:
itrekkie]
07:19 -!- adu [~ajr@softbank220043138128.bbtec.net] has joined #go-nuts
07:27 -!- maattd [~maattd@esc31-1-78-245-92-71.fbx.proxad.net] has joined #go-nuts
07:33 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
07:48 -!- ios_ [~ios@180.191.92.205] has joined #go-nuts
07:52 -!- maattd [~maattd@esc31-1-78-245-92-71.fbx.proxad.net] has quit [Remote
host closed the connection]
08:02 -!- Guest90899 [~Fish@exo3753.pck.nerim.net] has quit [Quit: So Long, and
Thanks for All the Fish]
08:02 -!- Fish [~Fish@exo3753.pck.nerim.net] has joined #go-nuts
08:10 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
08:12 -!- mbernstein [~michael@cpe-70-113-7-72.austin.res.rr.com] has quit [Ping
timeout: 260 seconds]
08:14 -!- Glasswalker
[~Glasswalk@CPE002369b3cd1a-CM00222d53f155.cpe.net.cable.rogers.com] has quit []
08:21 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
08:42 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
08:43 < wrtp> nice slip from rob on golang-dev: "I'd rather shelve this
discussion at least until the App Engine stuff is out."
08:43 < wrtp> app engine support for go would be great!
08:44 < str1ngs> o'rly
08:44 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
08:45 < wrtp> well, maybe.  that's all the info i've seen...
08:45 < str1ngs> seems logical imo
08:48 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
09:05 -!- yiyus [1242712427@server1.bouncer4you.de] has joined #go-nuts
09:11 -!- Innominate [~sirrobin@cpe-076-182-074-143.nc.res.rr.com] has quit [Ping
timeout: 272 seconds]
09:12 -!- Innominate [~sirrobin@cpe-076-182-074-143.nc.res.rr.com] has joined
#go-nuts
09:13 -!- andreas_ [~andreas@mivacukor.lha.sgsnet.se] has joined #go-nuts
09:13 -!- andreas_ [~andreas@mivacukor.lha.sgsnet.se] has quit [Client Quit]
09:14 -!- visof [~visof@41.233.120.85] has joined #go-nuts
09:14 -!- visof [~visof@41.233.120.85] has quit [Changing host]
09:14 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
09:17 -!- Bagarn [~andreas@mivacukor.lha.sgsnet.se] has joined #go-nuts
09:17 -!- tensorpudding [~user@99.23.127.179] has quit [Read error: Connection
reset by peer]
09:18 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
09:29 < fzzbt> how do you convert interface{} to []byte?
09:29 < Namegduf> You can't "convert" an interface value to anything.
09:30 < fzzbt> ehm
09:30 < Namegduf> It's an arbitrary type's value plus a pointer to an
itable.
09:30 < Namegduf> It's not equivalent to anything.
09:30 < Namegduf> At least not consistently so.
09:30 < Namegduf> Do you mean "If I have an interface{} which contains a
[]byte, how do I get the []byte out?"
09:31 < fzzbt> yes
09:31 < Namegduf> Okay.  Bearing in mind that the compiler cannot check this
for you, so it's up to you to design it such that you know the arbitrary type
inside is what you expect it to be:
09:31 < fzzbt> i have "data ...interface{}" and i want to get data[0]
09:31 < fzzbt> which should be []byte
09:31 < Namegduf> var v []byte := int.([]byte)
09:32 < Namegduf> Will set v to that value, and will panic if it isn't a
[]byte.
09:32 < Namegduf> Er, =, not :=
09:32 < Namegduf> v, ok := int.([]byte) is the same but sets ok to false and
v to the zero value (nil, for a slice) if it is not a []byte, instead of panicing.
09:33 < Namegduf> This is profoundly unhelpful if you don't intend to
actually do error checks on ok.
09:33 < fzzbt> what exactly does int.([]byte) mean?  int has a field
([]byte) ???
09:33 < Namegduf> No.
09:33 < Namegduf> It's a type assertion.
09:33 < Namegduf> It is its own thing, not a part of any other syntax.
09:33 < fzzbt> oh ok
09:34 < Namegduf> It asserts that int contains a []byte and gets it for you.
09:34 < Namegduf> In this case, though, you are aware that you can have
...[]byte, right?
09:34 < Namegduf> Just in case that would work better.
09:34 < fzzbt> im pretty sure it'll be []byte
09:36 < Namegduf> I guess my point is that if you're ever relying on an
interface{} to be a specific type, you're working without the type system's safety
so it's your job to get it right, not that you can't get it right.
09:36 < fzzbt> im relying for the user to know what he is doing
09:37 < Namegduf> Are you sure you can't use a ...[]byte?
09:38 < Namegduf> Exposing type unsafe stuff to another package sounds like
a bad thing in a design...
09:39 < fzzbt> im writing template formatters and the template doc says they
must have signature "func(wr io.Writer, formatter string, data ...interface{})"
09:39 < fzzbt> ...[]byte does not seem to be okay
09:39 < Namegduf> That's true, and one reason you might need to, but you
should probably handle things other than []byte.
09:40 < fzzbt> hmm, but now that i looked through the other example
formatters, i can see that they actually do some type checking so maybe i should
too
09:41 -!- cenuij [~cenuij@78.112.41.178] has joined #go-nuts
09:41 -!- cenuij [~cenuij@78.112.41.178] has quit [Changing host]
09:41 -!- cenuij [~cenuij@base/student/cenuij] has joined #go-nuts
10:03 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
10:10 -!- kanru [~kanru@kanru-1-pt.tunnel.tserv15.lax1.ipv6.he.net] has joined
#go-nuts
10:12 -!- unofficialmvp1 [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
10:13 -!- unofficialmvp1 [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
10:13 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-179-102.clienti.tiscali.it] has
joined #go-nuts
10:14 < wrtp> fzzbt: you need to do the type checking
10:15 < wrtp> otherwise you can make the program crash by spelling a field
name wrong in a template
10:16 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has joined #go-nuts
10:20 -!- saturnfive [~saturnfiv@210.74.155.131] has quit [Read error: Connection
reset by peer]
10:21 -!- shvntr [~shvntr@119.121.24.219] has joined #go-nuts
10:32 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
10:32 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
10:41 -!- coldturnip [~COLDTURNI@118-166-68-6.dynamic.hinet.net] has joined
#go-nuts
10:42 -!- coldturnip1 [~COLDTURNI@118-166-68-6.dynamic.hinet.net] has quit [Ping
timeout: 276 seconds]
10:44 -!- sauerbraten [~sauerbrat@80.140.160.147] has joined #go-nuts
10:52 -!- unofficialmvp1 [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
10:52 -!- unofficialmvp1 [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
11:05 -!- coldturnip1 [~COLDTURNI@118-166-68-6.dynamic.hinet.net] has joined
#go-nuts
11:05 -!- coldturnip [~COLDTURNI@118-166-68-6.dynamic.hinet.net] has quit [Ping
timeout: 240 seconds]
11:14 -!- kanru [~kanru@kanru-1-pt.tunnel.tserv15.lax1.ipv6.he.net] has quit [Read
error: Operation timed out]
11:15 -!- kanru [~kanru@kanru-1-pt.tunnel.tserv15.lax1.ipv6.he.net] has joined
#go-nuts
11:23 -!- neshaug [~oyvind@213.239.108.5] has quit [Ping timeout: 272 seconds]
11:46 -!- cenuij [~cenuij@base/student/cenuij] has quit [Remote host closed the
connection]
11:47 -!- adu [~ajr@softbank220043138128.bbtec.net] has quit [Quit: adu]
11:48 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has quit [Remote host
closed the connection]
11:49 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has joined #go-nuts
11:51 -!- artefon [~thiagon@150.164.2.20] has joined #go-nuts
11:52 -!- rlab_ [~Miranda@91.200.158.34] has joined #go-nuts
11:54 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 260 seconds]
11:56 -!- saturnfive [~saturnfiv@219.144.238.222] has joined #go-nuts
11:56 -!- saturnfive [~saturnfiv@219.144.238.222] has left #go-nuts []
12:05 -!- ios_ [~ios@180.191.92.205] has quit [Quit: Leaving]
12:25 -!- niemeyer [~niemeyer@189-10-154-99.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
12:39 -!- anticw [~anticw@c-67-169-68-180.hsd1.ca.comcast.net] has quit [Ping
timeout: 240 seconds]
12:41 -!- anticw [~anticw@c-67-169-68-180.hsd1.ca.comcast.net] has joined #go-nuts
12:48 * wrtp hates it when you write a lovely bit of code, then think about it and
realise that the whole thing was built on an invalid assumption so it's all
worthless.
12:51 < Namegduf> Me too.
12:52 < Namegduf> I wrote one compare-and-swap "lockfree" writes into my
data structure, then realised that in order to correctly invoke hooks on changes
in the right order, mutexing its usage was still needed and it was a waste of
time.
12:53 < wrtp> in this case, i've been layering timeouts onto an
io.ReadWriter.  only to realise that it's not possible, in general.
12:54 < Namegduf> Ah.
12:54 < wrtp> but i think i can salvage something, actually...
12:54 < Namegduf> I have a very weird Writer implementation which is
guaranteed to never block for more than a very short amount of time used to
deliver messages between untrusted connections.
12:55 < Namegduf> If it can't write fast enough it shoves it into a buffer
and returns.
12:55 < Namegduf> (Spawning another goroutine if it doesn't already exist to
deal with said buffer)
12:56 < wrtp> yeah, that's one way of doing it, but it's not good in general
(if a write times out, you don't expect it to actually complete some seconds after
it "timed out"...)
12:57 < Namegduf> It also always returns success.  :P
12:57 < Namegduf> (Well, unless the underlying thing being written to is
dead from another error)
12:58 < wrtp> it's always the edge cases that get ya
12:59 < Namegduf> The real issue is that you can't do that with anything but
a net.Conn varient.
12:59 < Namegduf> Maybe you could define a ReadTimeout interface?
12:59 < niemeyer> Hey there
13:00 < niemeyer> Namegduf: I also thought about a similar data structure
some time ago, but ended up avoiding it.  The issue is that there's an underlying
assumption that the reader can keep up with the writer
13:00 < niemeyer> Namegduf: If that assumption fails, it's a designed leak
;)
13:00 < niemeyer> Namegduf: If the assumption succeeds, OTOH, you just need
plain buffering
13:01 < Namegduf> niemeyer: The primary issue is that copying to thousands
of instances of buffers is actually quite expensive
13:02 < Namegduf> So when clients are not lagging it wishes to avoid them.
13:02 < wrtp> Namegduf: i'm implementing net.Conn
13:02 < wrtp> NewConn(rw io.ReadWriter, local, remote net.Addr) net.Conn {
13:03 < wrtp> similar to what net.Pipe does, but with working timeouts
13:03 < Namegduf> niemeyer: I solve that assumption by dropping connections
whose buffers overflow.
13:03 < Namegduf> Nasty?  Yes.  Avoidable?  Not really.
13:03 < Namegduf> There's an alternative available for actually doing
blocking I/O in a fancy way
13:03 < niemeyer> Namegduf: Ah, well, if you have a concept of buffer
overflow then you're using a fixed buffer already, ok
13:03 < Namegduf> Yeah.
13:04 < Namegduf> Well, I might dynamically grow/shrink it at some point
13:04 < Namegduf> But quite probably not, the blocking I/O's usage lets it
be avoided.
13:07 < Namegduf> But it will have an upper limit to deal with that issue.
13:08 < wrtp> ok, i've got a question for you
13:09 < Namegduf> The central issue is that one connection needs to send
stuff to a large number of other connections without letting Bad People block
other people.
13:09 < wrtp> which do you think is the most acceptable behaviour for a
timing out reader:
13:09 < wrtp> discard the data if the read times out?
13:09 < wrtp> or return the old data on the next read?
13:11 < wrtp> the problem with the second approach is that a) it breaks the
one-read -> one-read-result association and b) you have to copy all the data
13:11 < wrtp> i think the first approach will break more things though
13:13 < Electro^> I need some help understanding a API, and specifically
interfaces
13:13 < Electro^> given this function:
13:13 < Electro^>
http://garyburd.github.com/go-mongo/pkg/mongo.html#RunCommand
13:13 < Electro^> how would i use that to send a command to the database?
we've tried for a while but cannot get it to work
13:14 < wrtp> it's badly documented
13:14 < Electro^> returnVal, err := mongo.RunCommand(conn, dBCollection,
map[string]interface{}{"dropDatabase" : cmd})
13:14 < Electro^> is what we have now, but it wont work
13:15 < wrtp> they should use a named interface type, not interface{}
13:15 < wrtp> or else document specifically what types are acceptable
13:16 < Electro^> given shell access to the DB i'll type db.dropDatabase()
for the desired effect
13:16 < Electro^> but you dont have an answer for this?  guess i
13:16 < Electro^> but you dont have an answer for this?  guess i'll mail the
developer then
13:16 < wrtp> read the source code
13:17 < Electro^> i'm a go newb, but ill try
13:17 < Electro^> thanks
13:17 < fzzbt> Electro^: you could maybe try another more popular go mongo
implementation eg.  https://github.com/mikejs/gomongo ?
13:18 < Electro^> we tried that first but found very little documentation at
all
13:19 < Electro^> but our chief technical manager here suggested we move
back to that so perhaps we should
13:25 < niemeyer> Electro^: Hi :-)
13:26 < wrtp> Electro^: why don't you try wrapping a logger around the
connection with NewLoggerConn and see what gets logged?
13:26 < niemeyer> Electro^: Proposal is still up
13:27 < Electro^> wrtp: that i have no idea how to do, but at this time it
seems easier to change to Mikejs.  More people seem to know that
13:28 < Electro^> niemeyer: hey there!
13:29 < Electro^> niemeyer: i talked to our superiors, and from what i
gather its incombability with licenses thats the problem
13:29 < niemeyer> Electro^: What's the problem with simplified BSD?
13:29 < Electro^> at this moment its an open project, but in a few weeks it
will turn into a commersial product and the lincesing stuff havent been decided
13:29 < Namegduf> Your superiors do not understand software licencing.  :P
13:30 < Namegduf> BSD is compatible with commercial usage
13:30 < Electro^> niemeyer: I dont know really, but when i said BSD they
said it might work but was probably more work than it was work
13:30 < Namegduf> Well, closed-source usage.
13:30 -!- foocraft [~dsc@dyn-86-36-42-96.wv.qatar.cmu.edu] has quit [Ping timeout:
240 seconds]
13:30 < Namegduf> There's not much/any significant work involved with BSD.
13:30 < Electro^> As i understand it we use GPL and mixing them isnt a good
idea
13:30 < niemeyer> Electro^: You're currently using an apache licensed
software..  simplified BSD is more liberal than that
13:30 < Electro^> I, personally, have no idea
13:30 < Namegduf> Mixing them is perfectly fine
13:31 < Namegduf> BSD + GPL -> GPL
13:31 < niemeyer> Electro^: It can tell..  but whoever is making decisions
there should stop and sort this out
13:31 < Namegduf> The GPL meets all the terms of the BSD as well as imposing
its own much stricter ones, so they just merge.
13:31 < Namegduf> Well, it just takes the GPL.
13:32 < Namegduf> The exception is the old four clause BSD, which is
relatively rare now, I think.
13:32 < Electro^> well you obviously know more about this than i do
13:32 < niemeyer> Namegduf: Strictly speaking, it doesn't *take* it..  it
just doesn't conflict with it
13:33 < Namegduf> niemeyer: I meant the resulting project takes on the GPL
licence
13:33 < niemeyer> Namegduf: Like most licenses, the BSD license text is
supposed to stay around
13:34 < niemeyer> Namegduf: Otherwise it's public domain
13:34 * exch really doesnt like all this lawyery nonsense
13:34 < niemeyer> Namegduf: But people are free to license their attached
work in any way they please
13:34 < niemeyer> and source code doesn't have to be available
13:34 < exch> Unfortunately just saying "this is public domain" doesnt
really go in many countries
13:35 < niemeyer> exch: I wish it was simpler, but I understand the need for
it
13:36 < Namegduf> CC-Zero is how I'd declare it.
13:36 < Namegduf> "Public Domain or equivalent licence if Public Domain is
not legal wherever you are"
13:37 < exch> I release most of my stuff under a 1-clause BSD license
nowadays.  I haven't really found anything more liberal than that unfortunately
13:37 < niemeyer> exch: "You are free to use it.  Enjoy." ? :-)
13:38 < exch> somethig along thpose lines, yea :) But with a disclaimer for
potential damages included.  You never know :p
13:38 < exch> basically 'it's free, but use with caution - enjoy!'
13:40 < exch> actually, I might just get rid of that 1 clause as well
13:40 < exch> 'Redistributions of source code must retain the above
copyright notice, this list of conditions and the following disclaimer.
13:40 < Namegduf> http://creativecommons.org/publicdomain/zero/1.0/
13:40 < exch> that really serves no purpose, other than to stroke my ego
13:40 < Namegduf> ^ The most liberal licence.
13:40 < Namegduf> Public Domain but they take care of the legal issues
involved in it not existing everywhere, basically.
13:41 < exch> interesting
13:41 < exch> is that guaranteed to hold up everywhere?
13:41 < Namegduf> I don't know about guaranteed, but Creative Commons is
fairly major.
13:42 < Namegduf> The legal text is linked to at the bottom.
13:42 < niemeyer> Namegduf: Nice
13:43 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has joined #go-nuts
13:43 < Namegduf> I favour GPL myself, mostly, but if I wanted to not use
copyleft I use that.
13:43 < Namegduf> That said I'm thinking programms, not libraries.
13:43 < Namegduf> GPL libraries are kinda irritating
13:43 -!- shvntr [~shvntr@119.121.24.219] has quit [Ping timeout: 264 seconds]
13:45 < wrtp> i've put out most stuff as GPL - if anyone wants a more
liberal license, i'll do it for a pint...
13:45 < Namegduf> Mostly because I tend to think "Use my code, but give back
in kind" to be a reasonable "offer".  I'm not one who thinks it is ethically "the
way things should be", at all, I just think it's the offer I want to make with my
stuff.
13:47 < exch> For me it's mostly about disclaiming any and all
responsibility to my work.  I do it for myself, as a hobby.  I don't want to be
responsible for maintaining it, or get caught in any other obligations relating to
it, unless it absolutely serves my own needs
13:47 < Namegduf> That makes sense.
13:48 < exch> I put it online so I have easy access to it.  If it happens to
help anyone else, thats only a bonus
13:50 < Namegduf> Yeah.
13:50 < niemeyer> wrtp: I used to do that as well, but started to regret
after some time
13:51 < niemeyer> With open source, one always has to remember that the
license is usually imposed *back* as well, due to contributions
13:51 < wrtp> niemeyer: regret what?  that you'd been too liberal or too
restrictive?
13:51 < niemeyer> wrtp: Using GPL widely
13:51 < wrtp> ah, i see
13:52 < niemeyer> Suddenly I couldn't use my own work for certain things
without stripping out a ton of mixed wok
13:52 < niemeyer> work
13:52 < wrtp> if someone contributes, then i couldn't change the license
back because i wouldn't hold the copyright
13:52 < Namegduf> niemeyer: If you don't want that, you can do something
similar to what the Linux kernel does, or request contributions be under a licence
other than the thing's own licence.
13:52 < Namegduf> BUT you can't do that retroactively.
13:52 < niemeyer> wrtp: Exactly
13:52 < Namegduf> You have to do it before you accept contributions.
13:52 < niemeyer> Namegduf: Using Simplified BSD is much simpler :-)
13:53 < wrtp> i haven't had that problem yet :-)
13:53 < Namegduf> It is, but only if you're comfortable with someone taking
your work and making thousands out of it as closed source.
13:53 < niemeyer> Truth is that I don't really mind if people close and get
money out of my work..  in fact, I hope they do.
13:53 < Namegduf> I'm only comfortable with them doing that if they can
figure out a way to make those thousands that gives whatever they did back to me.
:P
13:53 < niemeyer> Namegduf: Yeah, I'm totally fine with that..
13:53 < wrtp> Namegduf: but would they have used it if it wasn't a liberal
license...?
13:54 < Namegduf> wrtp: Probably not, why?
13:54 < wrtp> Namegduf: 'cos then they'd have to pay you and get lawyers
involved and agreements and...  probably easier just to write it themselves.
13:55 < niemeyer> Namegduf: All of the money I make is based upon work of
other people..
13:55 < Namegduf> wrtp: Depends on the scale of the thing.
13:55 < Namegduf> wrtp: For small libraries, I agree.
13:55 < wrtp> Namegduf: sure.  but for anything that i've created myself,
the scale is gonna be quite small
13:55 < Namegduf> As I said, I was thinking of programs, not packages.
13:56 < Namegduf> niemeyer: I'm not saying either side is right or wrong.
I'm saying that depending on I "feel happy with" would determine what I picked.
13:57 < niemeyer> Namegduf: I'm not saying that either..  was just stating
my position
13:58 < Namegduf> Fair enough.
13:58 < Namegduf> The only thing I really dislike is people complaining that
either stuff they released themselves under a permissive licence was "abused" or
stuff released by someone else under a restrictive licence "can't be used".  In
either case..  the dev made a decision, it's on their head, and it's their stuff
to do so with.
13:59 < niemeyer> Yeah, don't even start
14:00 < niemeyer> Some people think there's an invisible clause in the
license like " * Don't make too much money with this" :-)
14:00 < Namegduf> Haha.
14:00 < Namegduf> Yeah.
14:03 -!- deltaphc [delta@cpe-76-173-127-142.socal.res.rr.com] has quit []
14:03 -!- mbernstein [~michael@cpe-70-113-7-72.austin.res.rr.com] has joined
#go-nuts
14:11 -!- freetz [~freetz@secure-atrc-dip23.nat.okstate.edu] has joined #go-nuts
14:24 -!- mbone [~mbone2@216-80-120-74.mart-bsr1.chi-mart.il.static.cable.rcn.com]
has joined #go-nuts
14:29 -!- decaf [~mehmet@85.106.193.214] has joined #go-nuts
14:31 -!- emjayess [~emjayess@pix1.i29.net] has joined #go-nuts
14:33 -!- jeng [~jeng@74.194.1.28] has joined #go-nuts
14:37 -!- tvw [~tv@e176006100.adsl.alicedsl.de] has joined #go-nuts
14:38 -!- decaf [~mehmet@85.106.193.214] has left #go-nuts ["Leaving"]
14:47 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has joined #go-nuts
14:54 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
14:55 < skelterjohn> morning
14:56 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 264 seconds]
15:00 -!- visof [~visof@unaffiliated/visof] has quit [Remote host closed the
connection]
15:03 -!- artefon [~thiagon@150.164.2.20] has quit [Quit: Leaving]
15:04 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-178-79.clienti.tiscali.it]
has joined #go-nuts
15:06 -!- rlab_ [~Miranda@91.200.158.34] has quit [Ping timeout: 240 seconds]
15:07 -!- freetz [~freetz@secure-atrc-dip23.nat.okstate.edu] has quit [Remote host
closed the connection]
15:07 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-179-102.clienti.tiscali.it] has
quit [Ping timeout: 264 seconds]
15:08 -!- freetz [~fritz@secure-atrc-dip23.nat.okstate.edu] has joined #go-nuts
15:09 < wrtp> mornin
15:18 -!- fabled [~fabled@mail.fi.jw.org] has quit [Quit: Ex-Chat]
15:30 -!- scoeri [~jdekoste@ecoop98.vub.ac.be] has joined #go-nuts
15:32 < scoeri> quick question, is there a way to make the garbage collector
print something whenever it is triggered?
15:33 < skelterjohn> I don't imagine so...
15:33 < nsf> you can always hack the GC source code
15:33 < skelterjohn> it's triggered with almost every system call or
allocation, though it doesn't always do a full collection
15:33 < skelterjohn> true, it is open source, after all
15:34 < aiju> and unlike GNU code is actually readable ;P
15:34 -!- fabled [~fabled@83.145.235.194] has joined #go-nuts
15:34 < scoeri> ok, thanks
15:34 < skelterjohn> runtime/mgc0.c
15:35 -!- mattn_jp [~mattn@112-68-85-213f1.hyg1.eonet.ne.jp] has joined #go-nuts
15:36 < scoeri> and is there a separate memory space for each process?
15:36 < aiju> no
15:36 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
15:38 < scoeri> so there is only one allocator for all processes
15:39 -!- femtoo [~femto@95-89-196-109-dynip.superkabel.de] has joined #go-nuts
15:40 < scoeri> because if you do a lot of allocation from within those
processes you get a lot of contention
15:40 < scoeri> and I seem to have that problem in my application
15:41 < wrtp> scoeri: what value have you got for MAXGOPROCS?
15:42 < scoeri> 4
15:42 < scoeri> im running my benchmarks on a intel core i7
15:43 < scoeri> thats 2 cores and 2 hyperthreads
15:43 < aiju> you only have two real cores …
15:43 < scoeri> yes
15:44 < aiju> i suppose using GOMAXPROCS = 2
15:44 < scoeri> 2 cores and 2 hyperthreads/core
15:44 < aiju> i'd even try GOMAXPROCS = 1
15:44 -!- boscop [~boscop@g227153244.adsl.alicedsl.de] has joined #go-nuts
15:46 < scoeri> yeah, but that is not really the problem, the problem is
that if I allocate a lot that my cores dont run on full speed
15:47 < scoeri> wait, let me see if I can get an example
15:51 < scoeri> http://pastie.org/1602576
15:52 < scoeri> if I run this with GOMAXPROCS = 1 I use one core 100%
15:53 < scoeri> if I run this with GOMAXPROCS = 4 I use one 30% of each core
15:53 < aiju> scoeri: much I/O?
15:53 < aiju> you don't need semicolons with go
15:53 -!- DerHorst [~Horst@e176097176.adsl.alicedsl.de] has joined #go-nuts
15:54 < scoeri> I know
15:54 < aiju> and goroutines are for concurrent programming, not prallelism
15:54 < scoeri> force of habit
15:54 < jumzi> remove that force of habit tbh :P
15:54 < aiju> 1,$s/;$//
15:54 < jumzi> It gives nothing but clutter
15:54 < aiju> just use ed
15:57 < scoeri> btw, go used to require semicolons
15:57 < scoeri> and I wrote the bulk of my code in those days
15:59 < jumzi> Sure, luckily this is better days ;)
16:01 -!- sauerbraten [~sauerbrat@80.140.160.147] has quit [Quit: Leaving]
16:02 -!- artefon [~thiago@189.59.165.132] has joined #go-nuts
16:04 -!- boscop [~boscop@g227153244.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
16:05 -!- DerHorst [~Horst@e176097176.adsl.alicedsl.de] has quit [Ping timeout:
240 seconds]
16:05 -!- boscop [~boscop@g227153244.adsl.alicedsl.de] has joined #go-nuts
16:05 -!- tvw [~tv@e176006100.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
16:05 < kimelto> Maybe we will have go in Android quicker than planned
thanks to Oracle ;p
16:07 -!- DerHorst [~Horst@e176097176.adsl.alicedsl.de] has joined #go-nuts
16:11 -!- Venom_X [~pjacobs@66.54.185.133] has joined #go-nuts
16:14 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
16:20 -!- jbooth1 [~jay@209.249.216.2] has joined #go-nuts
16:23 -!- snearch [~snearch@f053004251.adsl.alicedsl.de] has joined #go-nuts
16:31 -!- tarrant [~tarrant@216.83.139.130] has joined #go-nuts
16:32 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.]
16:35 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
16:36 -!- schmrkc [~marcus@sxemacs/devel/schme] has joined #go-nuts
16:37 < wrtp> scoeri: you won't get much parellelisation from a
communication-heavy program
16:37 < wrtp> oh yeah, that's not very comms heavy
16:38 -!- ronnyy [~quassel@p4FF1C522.dip0.t-ipconnect.de] has joined #go-nuts
16:43 -!- femtoo [~femto@95-89-196-109-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
16:50 < mpl> kimelto: link plz?
16:57 < kimelto> mpl: Just trolling about the Oracle lawsuit
16:57 -!- artefon [~thiago@189.59.165.132] has quit [Ping timeout: 240 seconds]
16:58 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
17:07 -!- aho [~nya@fuld-590c70e2.pool.mediaWays.net] has joined #go-nuts
17:09 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
17:10 -!- artefon [~thiago@189.59.205.114] has joined #go-nuts
17:10 < mpl> kimelto: ok.  I haven't followed the news, and I'm too lazy too
google for it.  ;)
17:13 < zozoR> "aiju> and goroutines are for concurrent programming, not
prallelism"
17:13 < zozoR> whats the difference?
17:14 < tarrant> zozoR:
http://blogs.sun.com/yuanlin/entry/concurrency_vs_parallelism_concurrent_programming
17:15 -!- belkiss [~kvirc@drn13-1-78-235-168-105.fbx.proxad.net] has joined
#go-nuts
17:15 -!- belkiss [~kvirc@drn13-1-78-235-168-105.fbx.proxad.net] has left #go-nuts
[]
17:18 < zozoR> thanks
17:18 < zozoR> :D
17:18 -!- skejoe [~skejoe@188.114.142.162] has quit [Quit: Lost terminal]
17:25 -!- artefon [~thiago@189.59.205.114] has quit [Ping timeout: 240 seconds]
17:26 -!- JusticeFries_
[~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net] has joined #go-nuts
17:29 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Ping timeout: 260 seconds]
17:31 -!- mattn_jp [~mattn@112-68-85-213f1.hyg1.eonet.ne.jp] has quit [Quit:
Ex-Chat]
17:31 -!- elimisteve [~elimistev@pool-71-102-138-52.snloca.dsl-w.verizon.net] has
quit [Ping timeout: 272 seconds]
17:35 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 272 seconds]
17:36 < fzzbt> why go's strings are indexed by bytes, not by characters
(unicode "runes")?  many languages have it the other way.  i often feel awkward
when handling non-ascii strings.
17:36 -!- keithgcascio [~keithcasc@nat/google/x-xmcvndvpivlqjhod] has joined
#go-nuts
17:39 < fzzbt> i know there's utf8.String, but still..
17:41 < Namegduf> fzzbt: Because Go is supposed to have non-shit
performance, and those languages are not.
17:41 -!- sauerbraten [~sauerbrat@p508CA093.dip.t-dialin.net] has joined #go-nuts
17:41 < Namegduf> fzzbt: You have two options plus a third hack option for
indexing:
17:41 < Namegduf> 1) Store the array as UTF-8.  Indexing is O(n).  Generally
most efficient memory.
17:42 < Namegduf> 2) Store the string as UTF-32.  Indexing is O(1).
Horrifically inefficient.
17:42 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
#go-nuts
17:43 < Namegduf> 3) Store the string as UTF-16.  Indexing is O(1)...  right
up until your string contains a double-size character.  Then indexing by character
breaks.  ALSO very inefficient, just less so.
17:43 < Namegduf> 2 and 3 also break for multiple-rune characters, caused by
combining marks.
17:44 -!- artefon [~thiago@189.59.196.59] has joined #go-nuts
17:44 < Namegduf> Go uses 1.  It's efficient and fast for everything BUT
indexing by character.
17:44 < Namegduf> 2 and 3 permit fast indexing by character, but in 3's case
it's a hack and their fast indexing will never work with multiple-rune characters.
17:44 < Namegduf> 3 will work *most* of the time because double-width
characters are really rare.
17:46 < Namegduf> The result of the above is that Go doesn't do it because
it's very slow the way Go stores strings, and the fast ways require being way more
memory heavy just for that one thing, AND don't work reliably anyway (but will
trick people into writing bad code thinking it does).
17:46 < Namegduf> Unicode is not very nice for indexing by character.  :P
17:46 < fzzbt> :)
17:47 < Namegduf> I hope that's not so unclear you can't understand it.
17:47 < Namegduf> These other languages tend to use 3.
17:48 < Namegduf> It kind of works when you look at it but if you really
care about indexing by an exact character count it isn't reliable.
17:48 -!- Glasswalker [~Glasswalk@72.1.221.250] has joined #go-nuts
17:48 < Namegduf> Most people don't..  but for them doing it by byte is
usually sufficient anyway.
17:49 < Glasswalker> Hey, so trying to set GOMAXPROCS on my code, based on
the faq entry.  Calling GOMAXPROCS(4) from func main(), and have import "runtime"
after my package statement.  But I'm getting an error that runtime is imported but
unused, and GOMAXPROCS is undefined.
17:49 < Glasswalker> what am I missing?  :)
17:50 < fzzbt> Glasswalker: did you write it as runtime.GOMAXPROCS(4) ?
17:50 < Glasswalker> nope
17:50 < Glasswalker> lol
17:50 < Glasswalker> that's totally what I was missing
17:50 < Glasswalker> thanks!
17:50 < fzzbt> :)
17:50 < Glasswalker> :)
17:52 -!- ako [~nya@fuld-590c79f3.pool.mediaWays.net] has joined #go-nuts
17:53 -!- aho [~nya@fuld-590c70e2.pool.mediaWays.net] has quit [Disconnected by
services]
17:55 -!- cfedde [~cfedde@c-67-165-220-38.hsd1.co.comcast.net] has joined #go-nuts
17:56 * ww just basically reimplemneted python's shelve for go without
particularly intending to...  hashing + gob + sqlite :P
17:56 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has joined #go-nuts
17:57 -!- gmilleramilar [~gmiller@38.104.67.234] has quit [Remote host closed the
connection]
17:58 -!- jyoshm_ [~jmissao@C1202.karlshof.wh.tu-darmstadt.de] has quit [Ping
timeout: 250 seconds]
18:01 < aiju> zozoR: concurrent programming is a way to structure your
programs in a simple and nice way, parallelism is about HURR DURR MY PROGRAM IS
FASTER THAN YOURS
18:01 -!- MaybeSo [~jimr@lions.Stanford.EDU] has left #go-nuts []
18:04 < cfedde> idealy, when working in a high level language, we won't have
to concern ourselves with optimization for a given hardware model.
18:05 < fzzbt> i doubt concurrency can ever be "simple and nice"
18:06 -!- decaf [556ee0e9@gateway/web/freenode/ip.85.110.224.233] has joined
#go-nuts
18:07 < cfedde> it appears that go takes us a long way in that direction.
18:11 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Remote host closed the connection]
18:11 -!- ShadowIce
[~pyoro@HSI-KBW-109-193-120-162.hsi7.kabel-badenwuerttemberg.de] has joined
#go-nuts
18:11 -!- ShadowIce
[~pyoro@HSI-KBW-109-193-120-162.hsi7.kabel-badenwuerttemberg.de] has quit
[Changing host]
18:11 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
18:12 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
18:16 < aiju> fzzbt: it looks like you never wrote a good concurrent program
18:16 < aiju> cfedde: ideally, everyone would be happy and wealthy
18:16 < aiju> just like yours, not going to happen
18:20 -!- tensorpudding [~user@99.23.127.179] has joined #go-nuts
18:22 < wrtp> concurrent programs can be simpler than the equivalent
sequential programs
18:22 < wrtp> channels make that a not-uncommon occurrence in Go
18:23 < aiju> unlike parallelism, the only *point* of concurrency is making
the program simpler
18:27 < plexdev> http://is.gd/1i7Ayv by [Rob Pike] in go/src/pkg/fmt/ --
fmt: stop giving characters to the Scan method of Scanner
18:27 < plexdev> http://is.gd/EaHFkd by [Robert Griesemer] in
go/src/cmd/godoc/ -- godoc: log errors when reading filter files
18:27 < cfedde> aiju: ideally, everyone would be happy and wealthy _and_
wise.  :-)
18:33 -!- ronnyy [~quassel@p4FF1C522.dip0.t-ipconnect.de] has quit [Remote host
closed the connection]
18:36 -!- itrekkie_ [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has joined #go-nuts
18:36 -!- itrekkie_ [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has quit [Client
Quit]
18:39 -!- Scorchin [~Scorchin@host86-145-9-54.range86-145.btcentralplus.com] has
joined #go-nuts
18:39 < fzzbt> aiju: your right
18:39 < fzzbt> 're
18:40 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has quit [Ping
timeout: 276 seconds]
18:45 -!- tvw [~tv@e176006100.adsl.alicedsl.de] has joined #go-nuts
18:45 -!- jyoshm [~jmissao@C1202.karlshof.wh.tu-darmstadt.de] has joined #go-nuts
18:45 -!- jyoshm [~jmissao@C1202.karlshof.wh.tu-darmstadt.de] has quit [Changing
host]
18:45 -!- jyoshm [~jmissao@unaffiliated/sundial] has joined #go-nuts
18:50 < ww> not sure i agree with that blog post.  the reasoning is pretty
strange.
18:50 < ww> parallelism implies concurrency, but not the reverse
18:51 < ww> i have trouble thinking of some parallel programming or
execution scenario that is not concurrent
18:51 -!- aconran [~aconran-o@38.104.129.126] has joined #go-nuts
18:54 -!- binarypie [~binarypie@adsl-99-37-227-229.dsl.pltn13.sbcglobal.net] has
joined #go-nuts
18:54 -!- eriko [~eriko@mail.familyolson.org] has joined #go-nuts
18:57 < wrtp> ww: i'm not sure he's saying there is
18:58 < wrtp> he says concurrency is more general than parallelism - which
it is, because you can have a concurrent program that's not parallel but not vice
versa
18:59 < ww> wrtp: that's what's funny, he says "They are overlapped, but
neither is the superset of the other"
19:00 < ww> unless he's just talking about the words that people studing
particular topics in the literature tend to like to use in which case *shrug*
19:01 < skelterjohn> what blog post is being discussed?
19:01 < wrtp>
http://blogs.sun.com/yuanlin/entry/concurrency_vs_parallelism_concurrent_programming
19:01 < skelterjohn> thanks
19:02 < wrtp> ww: he's making the distinction between concurrency and
concurrent programming
19:03 < wrtp> and between parallelism and parallel programming
19:03 < wrtp> and saying that concurrent programming isn't a strict superset
of parallel programming
19:03 -!- freetz [~fritz@secure-atrc-dip23.nat.okstate.edu] has quit [Ping
timeout: 264 seconds]
19:03 < wrtp> because you don't have to deal with parallel issues e.g.
memory consistency
19:04 < wrtp> which seems reasonable to me
19:06 < ww> in that case go edges into parallel territory directly, cf.
maps from different goroutines
19:07 < aiju> concurrency and parallelism aren't really related
19:07 < aiju> or rather "they just happen to be related"
19:08 < aiju> the blog post isn't really getting it
19:12 -!- decaf [556ee0e9@gateway/web/freenode/ip.85.110.224.233] has quit [Quit:
Page closed]
19:12 -!- decaf [556ee0e9@gateway/web/freenode/ip.85.110.224.233] has joined
#go-nuts
19:14 < plexdev> http://is.gd/W8Ar9u by [Robert Griesemer] in
go/src/cmd/godoc/ -- godoc: fix writeFileAtomically utility function
19:15 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
19:20 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
19:23 -!- aconran [~aconran-o@38.104.129.126] has quit [Remote host closed the
connection]
19:23 -!- aconran [~aconran-o@38.104.129.126] has joined #go-nuts
19:25 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has quit [Read error:
Connection reset by peer]
19:27 -!- Guest27203 [556ee0e9@gateway/web/freenode/ip.85.110.224.233] has quit
[Ping timeout: 272 seconds]
19:30 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
19:30 -!- irc [~irc@209.17.191.58] has joined #go-nuts
19:36 -!- uriel [~uriel@li43-28.members.linode.com] has joined #go-nuts
19:36 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-178-79.clienti.tiscali.it]
has quit [Ping timeout: 240 seconds]
19:37 -!- irc_ [~irc@209.17.191.58] has joined #go-nuts
19:37 -!- Guest46486 [~irc@209.17.191.58] has quit [Ping timeout: 246 seconds]
19:37 -!- fabled [~fabled@83.145.235.194] has quit [Ping timeout: 240 seconds]
19:39 -!- aconran [~aconran-o@38.104.129.126] has quit [Ping timeout: 240 seconds]
19:39 -!- prip [~foo@host129-120-dynamic.53-79-r.retail.telecomitalia.it] has quit
[Ping timeout: 276 seconds]
19:46 < plexdev> http://is.gd/7QANkp by [Russ Cox] in go/src/pkg/http/ --
http: remove debugging log statement
19:47 -!- prip [~foo@host129-120-dynamic.53-79-r.retail.telecomitalia.it] has
joined #go-nuts
19:47 -!- fabled [~fabled@83.145.235.194] has joined #go-nuts
19:47 -!- aconran [~aconran-o@38.104.129.126] has joined #go-nuts
19:48 -!- ShadowIce`
[~pyoro@HSI-KBW-109-193-120-162.hsi7.kabel-badenwuerttemberg.de] has joined
#go-nuts
19:48 -!- ShadowIce`
[~pyoro@HSI-KBW-109-193-120-162.hsi7.kabel-badenwuerttemberg.de] has quit
[Changing host]
19:48 -!- ShadowIce` [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
19:49 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Read error:
Connection reset by peer]
19:54 -!- boscop [~boscop@g227153244.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
19:58 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
20:00 < aiju> http://aiju.phicode.de/misc/concurrency i tried to sum it up
20:01 < jumzi> aiju colored?
20:01 < aiju> no
20:01 -!- sauerbraten [~sauerbrat@p508CA093.dip.t-dialin.net] has quit [Read
error: Operation timed out]
20:06 < nickbp> typo: "There are programs which are,"
20:06 < nickbp> (+"one")
20:07 < aiju> nickbp: ah, thanks
20:07 -!- TheMue [~TheMue@p5DDF79C0.dip.t-dialin.net] has joined #go-nuts
20:08 -!- Tonnerre [tonnerre@ds1789693.dedicated.solnet.ch] has quit [Ping
timeout: 272 seconds]
20:08 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has joined #go-nuts
20:08 -!- Tonnerre [tonnerre@netbsd/developer/tonnerre] has joined #go-nuts
20:09 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
20:10 -!- boscop [~boscop@g227153244.adsl.alicedsl.de] has joined #go-nuts
20:16 < nickbp> might be easier to just say "one, the other, both, or
neither"
20:16 < nickbp> also "ressource"
20:16 < nickbp> (v useful post just being nitpicky here)
20:17 < aiju> nickbp: i'm glad for that kind of suggestion
20:17 < aiju> oh it's spelled resource in english
20:18 < hypertux> aiju: sync.WaitGroup is the WaitForCompletion() you claim
doesn't exist
20:18 < aiju> you wouldn't use it in this example
20:18 < aiju> rather use a done channel
20:19 < hypertux> I was just saying that it does exist, you can use it as a
pseudo-join for the goroutines
20:20 -!- boscop [~boscop@g227153244.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
20:21 < hypertux> aiju: sorry, I misread that.  I thought you were saying
you couldn't wait.  You were just saying you weren't bothering writing the code
:-P
20:22 < aiju> it's just pseudocode
20:22 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has joined
#go-nuts
20:24 -!- snearch [~snearch@f053004251.adsl.alicedsl.de] has quit [Quit:
Verlassend]
20:31 -!- cw [~anticw@parsec.stupidest.org] has quit [Ping timeout: 272 seconds]
20:31 -!- fabled [~fabled@83.145.235.194] has quit [Quit: Ex-Chat]
20:31 -!- cw [~anticw@parsec.stupidest.org] has joined #go-nuts
20:49 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
20:52 -!- foocraft [~dsc@78.101.82.81] has joined #go-nuts
20:58 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Connection reset by
peer]
21:02 -!- toyoshim_ [~toyoshim@y253149.dynamic.ppp.asahi-net.or.jp] has quit [Ping
timeout: 240 seconds]
21:05 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
21:07 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping
timeout: 240 seconds]
21:11 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Quit: No Ping reply in 180 seconds.]
21:11 -!- awidegreen_ [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has joined #go-nuts
21:11 -!- chimes [~chimes@24.104.130.118] has joined #go-nuts
21:14 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #go-nuts
21:14 -!- toyoshim_ [~toyoshim@y253149.dynamic.ppp.asahi-net.or.jp] has joined
#go-nuts
21:15 < jnwhiteh> +1 for uniqueness type annotations in Go =)
21:21 -!- pothos [~pothos@111-240-165-208.dynamic.hinet.net] has joined #go-nuts
21:23 -!- pothos_ [~pothos@111-240-171-188.dynamic.hinet.net] has quit [Ping
timeout: 240 seconds]
21:24 -!- Scorchin [~Scorchin@host86-145-9-54.range86-145.btcentralplus.com] has
quit [Read error: Connection reset by peer]
21:24 -!- Scorchin [~Scorchin@host86-145-9-54.range86-145.btcentralplus.com] has
joined #go-nuts
21:24 -!- Scorchin [~Scorchin@host86-145-9-54.range86-145.btcentralplus.com] has
quit [Client Quit]
21:24 -!- Fish- [~Fish@9fans.fr] has quit [Ping timeout: 240 seconds]
21:25 -!- foocraft [~dsc@78.101.82.81] has quit [Ping timeout: 240 seconds]
21:25 -!- niemeyer [~niemeyer@189-10-154-99.pltce701.dsl.brasiltelecom.net.br] has
quit [Ping timeout: 240 seconds]
21:26 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
21:27 -!- foocraft [~dsc@78.101.82.81] has joined #go-nuts
21:36 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has quit [Remote host closed
the connection]
21:38 -!- niemeyer [~niemeyer@189-10-154-99.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
21:40 -!- |houkiom| [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has joined
#go-nuts
21:42 -!- |houkiom| [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has quit
[Client Quit]
21:48 < plexdev> http://is.gd/PclhMX by [Russ Cox] in 4 subdirs of
go/src/cmd/ -- ld: weak symbols
21:48 < plexdev> http://is.gd/pDiD4d by [Russ Cox] in 5 subdirs of go/src/
-- runtime: fix signal stack bug
21:51 -!- tvw [~tv@e176006100.adsl.alicedsl.de] has quit [Remote host closed the
connection]
21:55 -!- versificator [~nobody@h-68-166-192-11.nycmny83.static.covad.net] has
joined #go-nuts
21:55 -!- artefon [~thiago@189.59.196.59] has quit [Quit: bye]
21:55 < versificator> are there any classes in Go?
21:56 < aiju> no
21:56 < aiju> it's a feature™
21:56 < aiju> actually structs might be what you're looking for
21:57 < versificator> trying to test the gbg collection; by making O(100k)
objects then deleting them, maybe there is a better way?
21:57 < Namegduf> Make things other than objects?
21:57 < skelterjohn> make some new(int)s
21:57 < Namegduf> (Go has nothing it calls objects, for the record)
21:58 < skelterjohn> just do for i:=0;i<1e5;i++ { new(int) }
21:58 < skelterjohn> that will create and forget about 100k ints
21:58 -!- tarrant [~tarrant@216.83.139.130] has quit [Read error: Connection reset
by peer]
21:58 < kimelto> I'm not ashamed to call structures objects ;)
21:58 < Namegduf> You should be.
21:58 < Namegduf> A structure is not an instance of a structure.  :P
21:59 < skelterjohn> what do you call an instantiation of a struct, Namegduf
21:59 < Xenith> I wouldn't want to call an instance of a structure a
Namegduf.
21:59 < Namegduf> skelterjohn: "instance of a struct", generally
21:59 < Xenith> That's a mouthful.
21:59 < Namegduf> I don't have to say it regularly.
21:59 < skelterjohn> well, some people like to use one word instead of three
22:00 < skelterjohn> i propose: "thingermabobs"
22:00 < kimelto> and we don't have methods but functions binded to a type ;p
22:00 < Namegduf> We do have methods.
22:00 < Namegduf> They aren't on classes.
22:01 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
22:01 < skelterjohn> and our objects aren't instantiations of classes
22:01 < Namegduf> I'm not saying people shouldn't casually call stuff stuff
for convenience
22:01 < kimelto> agreed
22:01 -!- skejoe [~skejoe@188.114.142.162] has quit [Ping timeout: 272 seconds]
22:01 < Namegduf> I guess what I'm saying is that you need to be very aware
that's what you're doing and what you're calling objects in Go cannot be designed
with like objects in OOland
22:02 * aiju sometimes calls things in C objects
22:02 < Namegduf> I really would generally use "things" to refer to
arbitrary instances of something
22:02 < aiju> object meaning "thing" as in an int, a float, a char* or
whatever
22:02 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has quit [Remote host
closed the connection]
22:02 < Namegduf> Yeah.
22:03 < skelterjohn> i think i use the word "instance" usually
22:03 < Namegduf> That works too.
22:03 < aiju> i don't ever use instance
22:03 < skelterjohn> now that i think aboutit
22:03 -!- jeng [~jeng@74.194.1.28] has quit [Quit: ChatZilla 0.9.86 [Firefox
3.6.8/20100722155716]]
22:03 < kimelto> what's important is that the object^Wstuff^Wthing is fun to
work with!
22:04 < skelterjohn> objecstufthing?  :)
22:04 < aiju> ^W, not ^H
22:04 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has joined #go-nuts
22:05 < skelterjohn> i guess i got out-nerded on that one
22:05 < Namegduf> I've made that mistake before.
22:05 < aiju> i make the mistake of expecting all programs to follow that
convention
22:06 < aiju> some idiot^Wprogrammer thought it was cool if ^W closed the
current tab
22:07 < Namegduf> Huh.
22:07 < rl> It is pretty cool, though
22:07 < aiju> yeah, "let me just delete the last wo- FUCK"
22:08 < rl> try ctrl+backspace :p
22:08 < aiju> rl: that one doesn't work with some other apps
22:10 < rl> But it doesn't accidentally close the apps where it doesn't work
22:11 < aiju> http://doc.cat-v.org/bell_labs/utah2000/
22:11 < aiju> oops, wrong tab
22:11 < rl> (Yes, a consistent text editing interface *is* too much to ask
for)
22:11 < aiju> i wouldn't be amazed if it was GTK who broke the tradition
22:12 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
22:14 -!- wrtp [~rog@92.17.33.100] has quit [Quit: wrtp]
22:14 < rl> I wonder why the argument to time.sleep is nanoseconds; is this
some kind of convention?
22:14 < aiju> rl: nanosleep on Linux
22:14 < Namegduf> Basically, yes.
22:14 < Namegduf> It's the most precise unit of time Go supports.
22:14 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
22:14 < aiju> nanoseconds are the most precise unit you can ask for without
getting laughed at
22:15 < aiju> (although it's probably not even accurate to the microsecond
in reality)
22:15 < rl> but won't the margin of error be too big if you're using
nanoseconds?
22:15 < Namegduf> It's better than having a slow version and then having an
extra more precise version.
22:15 < rl> yea, that's what I thought
22:15 -!- awidegreen_ [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Read error: Operation timed out]
22:15 < Namegduf> If you're actually doing individual nanoseconds, yes.
22:15 < aiju> rl: UNIX had second sleep()
22:15 < aiju> then they added usleep()
22:15 < aiju> and then came nanosleep() in Linux
22:15 < rl> so why was nanosleep necessary?  just to return control?
22:16 < rl> or does it actually make sense to sleep for 10-100 nanoseconds?
22:16 < Namegduf> Because there's precision levels betwen nanoseconds and
microseconds.
22:16 < Namegduf> Maybe 500?
22:16 < aiju> i'd suggest real time applications
22:16 -!- __gilles [~gilles@poolp.org] has joined #go-nuts
22:17 < rl> Why would you be unhappy with 1 microsecond but not with 500
nanoseconds?
22:17 < rl> yea maybe on other architectures
22:17 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has joined #go-nuts
22:17 < Namegduf> Er, because 500ns is half 1ms
22:17 < aiju> rl: better a too precise than a too vague unit
22:17 < aiju> Namegduf: us, not ms
22:17 < Namegduf> Er, yeah
22:17 < Namegduf> Half 1us
22:17 < rl> Namegduf: I think you'd find that if you ask for 500ns of sleep
you're just as likely to get 1us, but I could be wrong
22:17 < Namegduf> Depends on architecture.
22:17 < Namegduf> And system status.
22:18 < rl> Let's say 99% of architectures?  :p
22:18 < aiju> rl: i don't quite get your point, actually
22:18 < Namegduf> I think Linux has ways of doing short things decently
22:18 < aiju> 23:19 < aiju> rl: better a too precise than a too vague
unit
22:18 < rl> aiju: why have the default sleep require that amount of
precision?
22:18 < aiju> why not?
22:18 < Namegduf> It doesn't require it, it permits it.
22:19 < Namegduf> And because then you don't have to add any other form of
sleep.
22:19 < rl> because you have to enter 9 zeros for a 1 second sleep
22:19 < aiju> rl: 1e9
22:19 < Namegduf> No, you have to write...  yeah.
22:19 < Namegduf> ALSO because Go returns measurements in ns elsewhere
22:19 < rl> ok, fair enough
22:19 < Namegduf> Because again, it's the more precise sensible unit
22:19 < rl> Namegduf: that's what I was asking about earlier when i asked if
it was convention
22:19 < rl> I'm happy to accept that as an answer
22:19 < rl> but
22:19 < aiju> you're too lazy to write 1e9
22:20 < Namegduf> I think it's convention of sorts.  Not 100% because I've
not done mmuch.
22:20 < rl> not "because it makes sense" :p because it's just silly
22:20 < Namegduf> With it, I mean.
22:20 < plexdev> http://is.gd/tRsY2g by [Russ Cox] in 4 subdirs of go/src/
-- reflect: add pointer word to CommonType
22:20 < plexdev> http://is.gd/RnL04D by [Nigel Tao] in
go/src/pkg/compress/lzw/ -- compress/lzw: implement an encoder.
22:20 < rl> I might just be too used to time being measured in us normally
22:21 -!- boscop [~boscop@g227153244.adsl.alicedsl.de] has joined #go-nuts
22:21 < aiju> "normally"?
22:21 < rl> Yes
22:21 < rl> As in in my day-to-day life
22:21 < Namegduf> Ah.
22:21 < aiju> i don't use us in my day-to-day life
22:21 < rl> We probably don't program with the same libraries
22:22 < rl> that's a good idea though, should get a us clock
22:22 -!- ShadowIce` [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
22:22 < aiju> i don't program any libraries but the standard library at all
most of the time
22:23 -!- TheMue [~TheMue@p5DDF79C0.dip.t-dialin.net] has quit [Quit: TheMue]
22:24 < rl> in some languages the standard library isn't always sufficient
22:24 < aiju> yeah, assembly
22:24 < rl> unless you really enjoy reinventing the wheel.  which I guess
isn't wrong in and of itself
22:24 < aiju> hahaha
22:24 < aiju> i get really tired of people telling me "not to reinvent the
wheel"
22:25 < aiju> i'm not going to use a library for something i code in 10
lines of code
22:25 < rl> well, it makes engineering sense not to if you have a well
tested library (possibly actively maintained)
22:25 < aiju> alternative: i write working code
22:26 < rl> i wish i was as confident about never having bugs in my own code
:)
22:26 < rl> sadly experience has proven me wrong time and time again
22:26 < aiju> my bugs always end up somewhere else
22:27 < aiju> most things people use libraries for are really ..  simple
22:29 < aiju> one great thing about compiled language is that there is no
penalty for using simple operations
22:29 -!- Glasswalker [~Glasswalk@72.1.221.250] has quit [Ping timeout: 240
seconds]
22:30 < rl> so what kind of things do you find people use libraries for
which you wouldn't?
22:30 < aiju> i for one am much more comfortable with a tiny set of
orthogonal operations instead of a huge bag of somewhat appropriate library
functions
22:30 < aiju> things like string manipulation
22:31 -!- tav [~tav@92.7.72.160] has quit [Ping timeout: 240 seconds]
22:31 < Namegduf> If it's <10 lines for an efficient implementation, it
is simple, and it is not easy to get wrong
22:31 < rl> well string manipulation can be very simple or very complex :)
i'm sure you don't think that all string manipulation should be hand coded
22:31 < Namegduf> Then I think you have an example where you're right.
22:31 < aiju> it's just experience from my programs
22:32 < aiju> i mainly use libraries for (1) graphics and (2) sophisticated
math
22:32 < aiju> (arbitrary precision arithmetic, more complex linear algebra
operations etc)
22:33 < Namegduf> I like a good stdlib
22:33 < Namegduf> It makes small programs much faster to write.
22:33 < Namegduf> By good I mean "fairly broad and covering most functions
that average programs are likely to use".
22:34 < Namegduf> What I really dislike is shitty stdlib functions which
require an external replacement for real word
22:34 < Namegduf> *work
22:34 < aiju> *cough* pascal *cough*
22:34 < Namegduf> I was thinking C
22:34 < aiju> i'm fine with the C stdlib
22:35 < Namegduf> Mostly because I had to rewrite a float-to-string
conversion myself to get half proper precision handling.
22:35 < aiju> it has its warts (huge ones), but i can work with it
22:35 < Namegduf> I want a maximum, but not printing of trailing zeroes.
22:35 < aiju> uh huh
22:35 < Namegduf> Nor padding.
22:35 < Namegduf> Otherwise you get stupid, stupid behaviour around 0
22:36 < Namegduf> As well as in other cases occasionally
22:36 < aiju> http://pastebin.com/K2F94TMk
22:36 < aiju> one of the more annoying things
22:37 -!- tav [~tav@92.7.95.171] has joined #go-nuts
22:38 < rl> only 15 includes?  psht
22:38 < aiju> yeah, just a tiny program
22:39 < aiju> Plan 9 is much nicer to this regard
22:39 < aiju> #include <u.h>
22:39 < aiju> #include <libc.h>
22:40 < aiju> hahahahah
22:40 < aiju> looking thru some old code
22:40 < aiju> if(((int)ptr) & 0x80000000) free(ptr);
22:41 < aiju> looks like i used this to prevent constant strings from being
freed
22:42 -!- ExtraSpice [XtraSpice@78-62-101-194.static.zebra.lt] has quit [Read
error: Connection reset by peer]
22:42 < skelterjohn> wow
22:42 < aiju> don't try this at home, kids
22:43 < rl> how does it prevent constant strings from being freed?
22:43 < aiju> rl: they seem to have that bit not set
22:44 < rl> seem to?
22:44 < aiju> well, it seems to have worked
22:44 < rl> i have to admit i know little about what the pointer values mean
but i always thought it was just memory offsets
22:44 < aiju> rl: constants are in a different region than heap stuff
22:44 < rl> so it's just checking that memory offsets below a certain value
don't get freed up
22:45 < aiju> this was one of my first C programs
22:45 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has joined #go-nuts
22:45 < rl> but yea it could very well be that all heap pointer references
are > 0x80000000
22:46 < rl> (seems like it would rule out half of the address space though,
but maybe that's needed for other things)
22:46 < aiju> hahaha one function is _428_ lines
22:47 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Remote host closed the connection]
22:47 < __gilles> hi
22:48 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
22:52 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn]
23:06 -!- GilJ [~GilJ@zeus.ugent.be] has quit [Quit: leaving]
23:07 -!- Davidian1024 [~Davidian1@cpe-173-88-186-130.neo.res.rr.com] has quit
[Quit: leaving]
23:11 -!- Project-2501 [~Marvin@82.84.77.186] has quit [Quit: E se abbasso questa
leva che succ...]
23:11 -!- jbooth1 [~jay@209.249.216.2] has quit [Quit: Leaving.]
23:14 -!- Davidian1024 [~Davidian1@cpe-173-88-186-130.neo.res.rr.com] has joined
#go-nuts
23:20 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts
23:23 -!- emjayess [~emjayess@pix1.i29.net] has quit [Quit: Leaving]
23:25 -!- shvntr [~shvntr@123.89.100.228] has joined #go-nuts
23:29 -!- GilJ [~GilJ@zeus.ugent.be] has joined #go-nuts
23:38 -!- boscop [~boscop@g227153244.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
23:40 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
23:48 -!- DerHorst [~Horst@e176097176.adsl.alicedsl.de] has quit [Remote host
closed the connection]
23:49 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Remote
host closed the connection]
23:59 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.4]
--- Log closed Fri Feb 25 00:00:29 2011