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

--- Log opened Tue Apr 26 00:00:01 2011
--- Day changed Tue Apr 26 2011
00:00 -!- thiago__ [~thiago@189.115.131.67] has quit [Quit: bye]
00:11 -!- kr1 [~kr@204.14.152.118] has joined #go-nuts
00:13 < jeremy_c> Is there a way to make the executables smaller?  I have a
simple util that uses os, fmt, io, xml and it's 1.9mb.  480 LOC
00:14 < pTonnerre> That's a pretty acceptable size IMO ;)
00:14 -!- m4dh4tt3r [~Adium@c-69-181-217-82.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
00:15 * jeremy_c guesses he's use to 100k or so w/Euphoria.
00:18 < jeremy_c> It does upx to 538k, that's a bit better.
00:19 < waqas> jeremy_c: Also, -s to the linker reduces size a little
00:21 -!- nkdnstbr [~nick@cpe-173-172-231-83.rgv.res.rr.com] has joined #go-nuts
00:21 < jeremy_c> waqas: 1.1mb, that shaved 800k off the binary.
00:22 -!- kr1 [~kr@204.14.152.118] has quit [Remote host closed the connection]
00:22 < jeremy_c> I didn't notice (still don't) -s in the docs :-)
00:23 < waqas> jeremy_c: There's a link at the top of the linker docs
00:23 < jeremy_c> ah!  there is -s, that's helpful.  thanks
00:24 -!- Tv [~Tv@ip-66-33-206-8.dreamhost.com] has quit [Ping timeout: 276
seconds]
00:26 -!- alexandere [~alexander@eijg.xs4all.nl] has quit [Quit: alexandere]
00:29 < nkdnstbr> Is there anyone in here that is a little familiar with
XGB/XCB and the go bindings or perhaps may have some input on how things are done
with atoms and changing properties?  I'm trying to turn the example into a dock
window.  I've tried numerous things but my latest failed attempt is here:
http://pastebin.com/fL1q3zT1
00:29 < nkdnstbr> Would appreciate any hints and tips, I'll be idling in
here for a bit.
00:41 -!- htoothrot [~mux@66-169-185-121.dhcp.ftwo.tx.charter.com] has quit [Read
error: Connection reset by peer]
00:43 -!- htoothrot [~mux@66-169-185-121.dhcp.ftwo.tx.charter.com] has joined
#go-nuts
00:46 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X]
00:50 -!- mikespook [~mikespook@183.47.226.203] has joined #go-nuts
00:57 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has joined #go-nuts
01:00 < plexdev> http://is.gd/p88qWg by [Andrew Gerrand] in
go/src/pkg/websocket/ -- websocket: include *http.Request in websocket.Conn
01:00 -!- aho [~nya@fuld-590c73fb.pool.mediaWays.net] has joined #go-nuts
01:11 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has joined
#go-nuts
01:16 -!- l00t [~i-i3id3r_@20150129006.user.veloxzone.com.br] has joined #go-nuts
01:16 -!- randfur [~androirc@58.145.148.69] has joined #go-nuts
01:25 -!- niemeyer [~niemeyer@189.27.152.119.dynamic.adsl.gvt.net.br] has joined
#go-nuts
01:28 -!- damikin11 [~damikin11@cpe-24-30-179-173.socal.res.rr.com] has left
#go-nuts []
01:29 -!- krutcha1 [~krutcha@S010600045a27676a.vs.shawcable.net] has joined
#go-nuts
01:36 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has quit [Quit:
Leaving...]
01:38 -!- damikin11 [~damikin11@cpe-24-30-179-173.socal.res.rr.com] has joined
#go-nuts
01:39 -!- gaxxx [~woo@219.143.166.16] has joined #go-nuts
01:46 -!- waqas [~waqas@jaim.at] has left #go-nuts []
01:46 -!- randfur [~androirc@58.145.148.69] has quit [Quit: AndroIRC]
01:48 -!- nkdnstbr [~nick@cpe-173-172-231-83.rgv.res.rr.com] has quit [Quit: Lost
terminal]
01:53 -!- niemeyer [~niemeyer@189.27.152.119.dynamic.adsl.gvt.net.br] has quit
[Ping timeout: 240 seconds]
01:55 -!- damikin11 [~damikin11@cpe-24-30-179-173.socal.res.rr.com] has left
#go-nuts []
02:09 -!- angasule [~angasule@190.2.33.49] has quit [Remote host closed the
connection]
02:12 -!- waqas [~waqas@jaim.at] has joined #go-nuts
02:15 < russell_h> if I make an empty for loop, will it burn CPU or just run
until the process dies?
02:15 < russell_h> er, rather will it burn CPU, or sleep until the process
dies
02:17 < waqas> It would burn CPU I guess
02:18 < russell_h> is there a conventional way to just sleep the main
goroutine until the process is killed?
02:19 < cbeck> select {}
02:19 -!- niemeyer [~niemeyer@189-10-219-9.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
02:20 < russell_h> cbeck: ah, looks good - thanks
02:29 -!- kr [~Keith@204.14.152.118] has quit [Ping timeout: 250 seconds]
02:29 -!- crazy2be [~crazy2be@d209-89-248-73.abhsia.telus.net] has joined #go-nuts
02:30 < crazy2be> are maps gaurenteed to be safely accessed across threads
*if* they are not modified?
02:31 < Namegduf> I believe not.
02:32 < cbeck> If they're only being read?  I'm pretty sure they are
02:32 < Namegduf> I don't think anyone's ever confirmed it as safe, but it
could happen to be.
02:33 -!- mikespook1 [~mikespook@183.47.230.163] has joined #go-nuts
02:33 -!- mikespook [~mikespook@183.47.226.203] has quit [Ping timeout: 246
seconds]
02:35 < skelterjohn> nothing about reading modifies a map
02:35 < skelterjohn> but i could imagine that there exists an implementation
that watches for key frequency
02:35 < skelterjohn> and adjusts the map accordingly
02:36 -!- fmoo [~Adium@66.220.144.74] has quit [Ping timeout: 258 seconds]
02:37 < crazy2be> hmm it seems a waste to syncronize something like that
02:38 < crazy2be> but i'm getting random 404 errors with my reverse proxy
server, and i'm guessing it might be caused by the map returning that a value does
not exist
02:39 < Namegduf> If you mutex writes, or use channels to communicate after
setting values from the writer to the readers, it should cause it to be visible.
02:39 -!- JoeyA [~joeyadams@208.96.182.115] has joined #go-nuts
02:39 < Namegduf> Go's mutexes behave as a "full fence"
02:40 < Namegduf> I could be wrong, but that is my understanding.
02:40 < JoeyA> Does Go have something like void* in C? That is, a pointer to
any type (which may require an explicit cast to get to).
02:41 < cbeck> interface {}
02:41 < JoeyA> Ah, I see.
02:41 < crazy2be> Namegduf: well it's basically a contant right now
02:41 < crazy2be> i wonder if you can have const maps...
02:41 < JoeyA> That would be more type-safe than casting pointers, I would
imagine.
02:42 < crazy2be> JoeyA: yeah
02:42 < crazy2be> but also slower, i think
02:42 < skelterjohn> not significantly
02:42 < skelterjohn> your program would have to have every 5th operation be
a type cast to see a difference
02:42 < Namegduf> Not really more typesafe.
02:43 < crazy2be> standard usage is func (i interface{}) { st, ok :=
i.(SomeType) }
02:43 < Namegduf> You can check if it's a safe cast before you do it, but
that's your job to get right as required.
02:43 < skelterjohn> Namegduf: it is in that your program will never use
something as teh wrong type
02:43 < skelterjohn> it will bomb out
02:43 < skelterjohn> so your error will be "YOU DID IT WRONG"
02:43 < Namegduf> skelterjohn: I'm not sure better crash handling counts as
"more safe"
02:43 < skelterjohn> instead of something more subtle
02:43 < Namegduf> Nor easier debugging
02:43 < Namegduf> But that is true
02:43 < vsmatck> A panic is nicer than a segfault for sure.
02:43 < crazy2be> well i would say easier debugging for sure
02:44 < crazy2be> with void* it might not even segfault
02:44 < JoeyA> By more typesafe, I'm actually thinking along the lines of
implementing methods in that interface, and using those methods to work with
types.
02:44 < crazy2be> it might keep running
02:44 < Namegduf> JoeyA: That's significantly better than using interface{}
and fully typesafe.
02:44 < crazy2be> and you'll wonder why the heck it's coming out with
bizzare values
02:44 < Namegduf> And plenty fast; it's just like C++ virtual methods.
02:44 < Namegduf> A little slower than a regular function call but still
very fast.
02:45 < JoeyA> Semantically speaking, are interface dictionaries passed
dynamically or as parameters?
02:45 < Namegduf> Dictionaries?
02:45 < skelterjohn> you mean the method lookup tables?
02:45 < crazy2be> JoeyA: interface{}...?
02:45 < JoeyA> Yes.
02:45 < Namegduf> Interfaces are a two-member struct
02:45 < skelterjohn> when you assign something to an interface, the type is
also stuck in there
02:46 < Namegduf> Containing the data (or a pointer to the data, if it's
bigger than a word), and a pointer to an "itable"
02:46 < skelterjohn> that type data has information about what methods to
invoke
02:46 < Namegduf> Which contains a pointer to the type data, and a table of
method function pointers.
02:46 < JoeyA> okay, so it's not parametrically passed.
02:46 < skelterjohn> what does "parametrically passed" mean?
02:47 < crazy2be>
http://research.swtch.com/2009/12/go-data-structures-interfaces.html
02:47 < crazy2be> that describes it in detai
02:47 < crazy2be> l
02:47 < Namegduf> Yeah, it has nice diagrams, explains it better than me.
02:47 < JoeyA> I'm coming from Haskell.  In Haskell, type classes are
implemented by passing dictionaries as parameters (rather than embedding them into
values).
02:48 < Namegduf> Haskell's type system is a bit fancier, I think.
02:48 * vsmatck has tried to learn haskell a few times.
02:48 < JoeyA> For example, print :: Show a => a -> IO ()
02:48 < JoeyA> This means print's first argument is of any type a, provided
a has an instance Show written for it.
02:49 < JoeyA> the -> IO () means print returns an IO action
02:49 < JoeyA> Implicitly, the compiler turns this into something like:
02:49 < JoeyA> print :: (a -> String) -> a -> IO ()
02:49 < skelterjohn> my eyes hurt
02:49 < JoeyA> The first argument, (a -> String), is a function telling
print how to turn its argument into a string.
02:50 < skelterjohn> not my brain, my eyes O:-)
02:50 < Namegduf> I see what you mean.
02:50 < JoeyA> There are (at least) two ways to implement polymorphism.
02:50 < Namegduf> It passes the functions themselves as a curried dictionary
02:50 < JoeyA> C++ and go pass the "dictionary" (collection of functions
detailing how to use the type) alongside the value.
02:50 < JoeyA> Right
02:50 < Namegduf> No
02:51 < Namegduf> C++ does the same thing Go does.
02:51 < JoeyA> That's what I said, right?
02:51 < Namegduf> Oh, I see.
02:51 < JoeyA> they store it with the value.  I wasn't very clear.
02:51 < Namegduf> My mistake.
02:51 < skelterjohn> that sounds like what go does
02:51 < JoeyA> Haskell, on the other hand, passes the "dictionary" as a
parameter to a function.
02:51 < Namegduf> And use currying to avoid passing the value.
02:52 < Namegduf> Makes sense.
02:52 < JoeyA> The beauty of Haskell's system is that it's fairly easy to
implement a Haskell subset without type classes.  Without type classes, you don't
have to do anything special to implement polymorphism.
02:52 < JoeyA> If you make a function f x = x, it's type is forall a.  a
-> a
02:52 < JoeyA> It takes *any* a, and yields a value of the same type.
02:53 < JoeyA> f doesn't need any information about the type at all; it just
takes a pointer to x and spits it out.
02:54 < JoeyA> </offtopic>
02:56 -!- krutcha1 [~krutcha@S010600045a27676a.vs.shawcable.net] has quit [Quit:
Leaving]
02:58 -!- niemeyer [~niemeyer@189-10-219-9.pltce701.dsl.brasiltelecom.net.br] has
quit [Ping timeout: 240 seconds]
03:02 < JoeyA> How might I go about implementing a tagged union in Go?
03:02 < Namegduf> I suspect you'd take an interface{} and use a type switch.
03:03 < waqas> Go doesn't have generics, so you make do with interfaces
03:03 < Namegduf> Go has no unions.
03:07 < vsmatck> I think that's on the TODO tho.
03:10 < JoeyA> If I say `type List interface {}`, is this like a typedef?
03:11 < JoeyA> Or would I get a type error if I tried to convert an
interface{} to a List?
03:12 -!- keithcascio [~keithcasc@nat/google/x-vqacckyliltkiipx] has quit [Quit:
Leaving]
03:12 < Namegduf> In general, you would.
03:13 < skelterjohn> don't confuse it with typedef
03:13 < Namegduf> You get errors converting between two named types, at
least.
03:13 < skelterjohn> in C++, for example, if you typedef A B, A and B can be
used interchangeably
03:13 < Namegduf> Converting an anonymous to named I think is allowed.
03:13 < skelterjohn> this is not the case with "type A B" in go
03:13 -!- crodjer [~rohanjain@203.110.240.205] has joined #go-nuts
03:13 < JoeyA> okay, so interface{} really is a lot like void* in C? Namely,
you can convert it to/from different types without getting an error?
03:15 < Namegduf> No.
03:15 < Namegduf> type Foo int, you can assign int to Foo safely.
03:15 < Namegduf> I think.
03:15 < crazy2be> go is safe, you can't do things like that
03:15 < Namegduf> It's a generic thing between unnamed and named types.
03:20 < skelterjohn> if you "type Foo int; var x Foo; var y int = 5; x = y",
you'll get a compile error
03:20 < skelterjohn> but you can do a type conversion, "x = Foo(y)"
03:21 < skelterjohn> types are primarily (in my opinion) vehicles to assign
behavior to data
03:21 < skelterjohn> when you "type A B", A and B have the same data, but
not the same behavior
03:22 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has joined #go-nuts
03:24 < JoeyA> So, if I say type A interface{}; type B interface{}; var a A;
var b B; ...  b = a, I should get a type error?
03:25 < JoeyA> The reason I say "should" is because I actually get an
internal compiler error: http://ideone.com/WBOkN
03:25 < Namegduf> That indicates a compiler bug.  You should, yes.
03:27 < skelterjohn> interfaces are special...
03:29 < skelterjohn> http://pastebin.com/gpMMEuWj <- compiles
03:29 < skelterjohn> with interfaces, if a conversion is possible, it is
done implicitly
03:29 < skelterjohn> but if you change "interface{}" to "int" in that same
code, it will not compile
03:30 < skelterjohn> unless you do a = A(b); b = B(a)
03:30 < JoeyA> skelterjohn: http://www.ideone.com/reixA
03:30 < JoeyA> What version of go are you using?
03:30 < skelterjohn> tip
03:31 < skelterjohn> and 6g
03:31 < JoeyA> tip?  Google fails me here.
03:31 < dforsyth> head
03:31 < cbeck> tip or the last weekly?
03:31 < skelterjohn> sorry - the cutting edge version from the repository
03:31 < JoeyA> oh
03:31 < cbeck> ah
03:31 < skelterjohn> eh, whenever i last did hg pull -u
03:31 < skelterjohn> which i believe was this past thursday
03:31 < JoeyA> Why isn't it called "nose"?
03:32 < JoeyA> That would give "bleeding-edge" a whole new meaning .
03:32 < skelterjohn> heh
03:32 < skelterjohn> you should file an issue suggesting it
03:36 < JoeyA> http://code.google.com/p/go/issues/detail?id=1737
03:36 < JoeyA> (that's for the compiler bug)
03:37 -!- Stiletto [7f000001@69.195.144.4] has joined #go-nuts
03:37 -!- JusticeFries [~JusticeFr@c-24-9-171-36.hsd1.co.comcast.net] has joined
#go-nuts
03:37 -!- gedevan [~gedevan@83.167.106.253] has joined #go-nuts
03:38 -!- gedevan [~gedevan@83.167.106.253] has quit [Read error: Connection reset
by peer]
03:38 < JoeyA> Is it possible to assert that the types of two different
values are the same?
03:43 -!- Transformer [~Transform@ool-4a59e397.dyn.optonline.net] has joined
#go-nuts
03:46 -!- Transformer [~Transform@ool-4a59e397.dyn.optonline.net] has left
#go-nuts []
03:46 < crazy2be> JoeyA: obj1.(type) == obj2.(type) afaik
03:47 < JoeyA> Thanks.
03:47 < JoeyA> Is it possible to store the type of a value for comparison
later?
03:48 < plexdev> http://is.gd/v40B0s by [Russ Cox] in
go/misc/dashboard/godashboard/ -- dashboard: build most recent revision first
03:52 -!- dreadlorde [~dreadlord@c-24-11-39-160.hsd1.mi.comcast.net] has quit
[Ping timeout: 252 seconds]
03:54 < JoeyA> crazy2be: use of .(type) outside type switch
03:54 < crazy2be> JoeyA hmm
03:54 < crazy2be> you can do switch foo.(type)
03:55 < jessta_> yeah, that's not going to work
03:55 -!- telexicon [~telexicon@unaffiliated/chowmeined] has joined #go-nuts
03:55 < jessta_> JoeyA: perhaps the reflect package can help
03:59 -!- gaxxx [~woo@219.143.166.16] has quit [Remote host closed the connection]
03:59 -!- nkdnstbr [~nkdnstbr@cpe-173-172-231-83.rgv.res.rr.com] has joined
#go-nuts
04:00 -!- aho [~nya@fuld-590c73fb.pool.mediaWays.net] has quit [Read error:
Connection reset by peer]
04:00 -!- ako [~nya@fuld-590c73fb.pool.mediaWays.net] has joined #go-nuts
04:00 < nkdnstbr> Anyone familiar with XCB/XGB and creating dock windows?
04:05 -!- jrabbit [~babyseal@unaffiliated/jrabbit] has left #go-nuts []
04:10 -!- dj2 [~dj2@CPE001f5b35feb4-CM0014048e0344.cpe.net.cable.rogers.com] has
quit [Remote host closed the connection]
04:11 < JoeyA> Are structs assigned by value?
04:12 -!- ako [~nya@fuld-590c73fb.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
04:12 -!- gedevan [~gedevan@83.167.106.253] has joined #go-nuts
04:14 -!- krutcha1 [~krutcha@S010600045a27676a.vs.shawcable.net] has joined
#go-nuts
04:15 -!- crazy2be [~crazy2be@d209-89-248-73.abhsia.telus.net] has quit [Ping
timeout: 264 seconds]
04:18 -!- rejb [~rejb@unaffiliated/rejb] has quit [Disconnected by services]
04:18 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
04:19 -!- zozoR [~Morten@90.185.81.29] has joined #go-nuts
04:21 -!- l00t [~i-i3id3r_@20150129006.user.veloxzone.com.br] has quit [Quit:
Leaving]
04:21 < plexdev> http://is.gd/0MtRUq by [Russ Cox] in go/src/ --
all-qemu.bash: remove DISABLE_NET_TESTS
04:23 -!- foocraft [~dsc@dyn-86-36-41-74.wv.qatar.cmu.edu] has quit [Quit:
Leaving]
04:25 -!- jyxent [~jyxent@129.128.191.96] has quit [Read error: Operation timed
out]
04:25 -!- jyxent [~jyxent@129.128.191.96] has joined #go-nuts
04:30 < jessta_> JoeyA: yes
04:31 < jessta_> everything is assigned by value
04:31 < JoeyA> thanks
04:32 < JoeyA> When the address of a local variable is taken, does that
address remain valid when the variable goes out of scope?
04:33 < jessta_> yes
04:33 < jessta_> if you take the address of something it will be heap
allocated
04:35 < JoeyA> thanks
04:42 -!- Tv [~Tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
04:57 -!- adg [~nf@2001:470:21:20::4444:61d9] has quit [Read error: Operation
timed out]
04:58 -!- rphillips [~rphillips@unaffiliated/rphillips] has quit [Ping timeout:
248 seconds]
05:06 -!- zozoR [~Morten@90.185.81.29] has quit [Ping timeout: 260 seconds]
05:08 < plexdev> http://is.gd/VqyRQ5 by [Russ Cox] in 4 subdirs of go/ --
gc: fix order of operations for f() < g().
05:10 -!- Project_2501 [~Marvin@94.36.160.129] has joined #go-nuts
05:14 -!- JusticeFries [~JusticeFr@c-24-9-171-36.hsd1.co.comcast.net] has quit
[Quit: JusticeFries]
05:16 -!- JoeyA [~joeyadams@208.96.182.115] has quit [Quit: Leaving]
05:16 -!- edsrzf [~edsrzf@122-61-221-144.jetstream.xtra.co.nz] has joined #go-nuts
05:18 -!- kevlar [~kevlar@unaffiliated/eko] has quit [Quit: Leaving]
05:32 -!- waqas [~waqas@jaim.at] has left #go-nuts []
05:38 -!- kevlar [~kevlar@70-90-168-189-SFBACalifornia.hfc.comcastbusiness.net]
has joined #go-nuts
05:38 -!- kevlar [~kevlar@70-90-168-189-SFBACalifornia.hfc.comcastbusiness.net]
has quit [Changing host]
05:38 -!- kevlar [~kevlar@unaffiliated/eko] has joined #go-nuts
05:39 -!- dju_ [dju@fsf/member/dju] has joined #go-nuts
05:40 < plexdev> http://is.gd/ZIjmuj by [Brad Fitzpatrick] in
go/src/pkg/http/ -- http: make Client redirect policy configurable
05:42 -!- dju [dju@fsf/member/dju] has quit [Read error: Connection reset by peer]
05:51 -!- chressie [~chressie@dreggn.in-ulm.de] has quit [Quit: WeeChat 0.3.4]
05:59 -!- awidegreen [~quassel@c-cfc5e555.08-2-73746f39.cust.bredbandsbolaget.se]
has joined #go-nuts
06:06 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
06:08 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has joined #go-nuts
06:09 -!- chressie [~chressie@217.10.9.24] has joined #go-nuts
06:12 -!- edsrzf_ [~edsrzf@122-61-221-144.jetstream.xtra.co.nz] has joined
#go-nuts
06:13 -!- edsrzf [~edsrzf@122-61-221-144.jetstream.xtra.co.nz] has quit [Ping
timeout: 246 seconds]
06:17 -!- rphillips [~rphillips@unaffiliated/rphillips] has joined #go-nuts
06:29 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
06:35 -!- comex [comex@c-67-188-10-190.hsd1.ca.comcast.net] has quit [Ping
timeout: 276 seconds]
06:35 -!- ExtraSpice [XtraSpice@88.118.35.153] has joined #go-nuts
06:36 -!- comex [comex@c-67-188-10-190.hsd1.ca.comcast.net] has joined #go-nuts
06:42 -!- randfur [~androirc@58.145.148.89] has joined #go-nuts
06:44 -!- GeertJohan [~geertjoha@81.71.140.145] has joined #go-nuts
06:46 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined #go-nuts
06:50 -!- B0rder [~B0rder@114.246.101.75] has joined #go-nuts
06:50 -!- Project-2501 [~Marvin@82.84.75.159] has joined #go-nuts
06:52 -!- Tv [~Tv@cpe-76-168-227-45.socal.res.rr.com] has left #go-nuts []
06:53 -!- Project_2501 [~Marvin@94.36.160.129] has quit [Ping timeout: 260
seconds]
06:58 -!- randfur [~androirc@58.145.148.89] has quit [Ping timeout: 240 seconds]
06:58 -!- Paradox924X [~Paradox92@vaserv/irc/founder] has quit [Ping timeout: 260
seconds]
07:03 -!- joelkronander
[~joelkrona@c-bf2fe253.617-1-64736c22.cust.bredbandsbolaget.se] has quit [Quit:
joelkronander]
07:04 -!- dario [~dario@domina.zerties.org] has joined #go-nuts
07:11 -!- B0rder [~B0rder@114.246.101.75] has quit [Quit: 离开]
07:11 -!- Paradox924X [~Paradox92@c-68-35-229-34.hsd1.fl.comcast.net] has joined
#go-nuts
07:11 -!- Paradox924X [~Paradox92@c-68-35-229-34.hsd1.fl.comcast.net] has quit
[Changing host]
07:11 -!- Paradox924X [~Paradox92@vaserv/irc/founder] has joined #go-nuts
07:15 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined
#go-nuts
07:15 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
07:19 -!- B0rder [~B0rder@114.246.101.75] has joined #go-nuts
07:20 -!- kr [~Keith@c-24-5-193-165.hsd1.ca.comcast.net] has joined #go-nuts
07:25 -!- crodjer [~rohanjain@203.110.240.205] has quit [Remote host closed the
connection]
07:25 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has quit [Ping
timeout: 264 seconds]
07:28 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
07:30 -!- tvw [~tv@e176004116.adsl.alicedsl.de] has joined #go-nuts
07:32 < scyth> can anyone help with goprotobufs and Makefile and imports?
07:32 < scyth> not sure I get it from the README
07:35 < edsrzf> scyth: What's the problem?  I've never used goprotobufs, but
I can try to help.
07:37 < plexdev> http://is.gd/Fkbo0x by [Alex Brainman] in go/src/cmd/ld/ --
8l: do not emit empty dwarf pe sections
07:38 < scyth> edsrzf,
http://code.google.com/p/goprotobuf/source/browse/README
07:38 < scyth> here's the example ..  at the end
07:39 < scyth> how can target in Makefile can be the same as import in
other.go
07:40 < dforsyth> boooo init loop with a function map
07:40 < nkdnstbr> What's the proper way to call xgb.ChangeProperty in the
xcb bindings?  I've tried numerous, and the way which seems most logical, compiles
and runs without error.  But the GetPropertyReply contains nothing.  Current code:
http://pastie.org/1834315
07:41 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has joined #go-nuts
07:41 -!- mbejar [~mbejar@9.Red-79-159-118.staticIP.rima-tde.net] has joined
#go-nuts
07:42 -!- SecretAgent [sa@28.158.143.98.nitemare.name] has quit [Read error:
Operation timed out]
07:45 -!- SecretAgent [sa@28.158.143.98.nitemare.name] has joined #go-nuts
07:45 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
07:45 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined #go-nuts
07:48 -!- mbejar [~mbejar@9.Red-79-159-118.staticIP.rima-tde.net] has quit [Ping
timeout: 246 seconds]
07:51 < edsrzf> scyth: I'm not sure what you're asking
07:51 < scyth> edsrzf, from the example, in Makefile, TARGET is
"path/to/example"
07:52 < scyth> and it compiles test.pb.go and other.go
07:52 < scyth> while in other.go, there's import statement for
"path/to/example"
07:52 < edsrzf> Right
07:53 < edsrzf> I don't think that last part is supposed to be the contents
of other.go
07:53 < edsrzf> I think other.go is just a placeholder name for some other
file in the package.
07:53 < scyth> ah, I see
07:56 -!- kr [~Keith@c-24-5-193-165.hsd1.ca.comcast.net] has quit [Quit: WeeChat
0.3.2]
07:56 -!- hopso [~hopso@a91-154-5-21.elisa-laajakaista.fi] has joined #go-nuts
07:57 < vegai> trying to compile goinstall gostomp on os x
07:58 < vegai> http://pastie.org/1834360
07:59 < vegai> GOARCH="amd64" GOOS="darwin"
08:00 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
08:00 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has joined #go-nuts
08:01 < vegai> seems like all the errors are from MOVQs
08:03 < vegai> hmm, might be a local problem, of course
08:04 < edsrzf> Do you actually have a 64-bit processor?  ;)
08:04 < edsrzf> Never mind, that wouldn't matter for the error you're
getting.
08:04 < jessta_> vegai: that looks like goinstall is trying to build the go
runtime
08:05 -!- anticw [~anticw@c-67-169-68-180.hsd1.ca.comcast.net] has quit [Ping
timeout: 276 seconds]
08:05 < edsrzf> It also looks like it's trying to do something Windowsy
08:05 < vegai> I had older 6?  binaries in the PATH before the new ones
08:05 < edsrzf> How old?
08:05 < vegai> rebuilding everything with that insanity removed and trying
again...
08:05 < jessta_> good plan
08:05 < vegai> Aug 3 2010 :-D
08:06 < edsrzf> Hmmm...yeah, pretty old.  I'd try that rebuild.
08:06 < edsrzf> Newer toolchains have some sanity checks to prevent that
kind of thing from happening, but it probably wasn't there yet last August
08:07 < vegai> good thing the whole thing builds in minutes...
08:10 < plexdev> http://is.gd/Bu0wrM by [Alex Brainman] in 2 subdirs of
go/src/pkg/ -- os: fix race in ReadAt/WriteAt on Windows
08:15 < vegai> ah, there we go.  goinstall said nothing
08:15 < vegai> incidentally, does Andrew Gerrand (writer of the rather
minimal stomp client) hang around here
08:15 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
08:15 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined #go-nuts
08:18 -!- joelkronander [~joelkrona@130.236.243.164] has joined #go-nuts
08:23 < vegai> is Dial being revamped?
08:23 < vegai> net.Dial, specifically
08:24 < vegai> ah yes, they're stripping the second argument apparently
08:24 -!- prip [~foo@host188-121-dynamic.42-79-r.retail.telecomitalia.it] has quit
[Ping timeout: 240 seconds]
08:27 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has joined #go-nuts
08:28 -!- sebastianskejoe [~sebastian@188.114.142.217] has joined #go-nuts
08:30 -!- napsy [~luka@193.2.66.6] has joined #go-nuts
08:31 -!- g0bl1n [~g0blin@unaffiliated/g0bl1n] has quit [Remote host closed the
connection]
08:34 -!- a2800276 [~a2800276@80.187.216.28] has joined #go-nuts
08:34 < nkdnstbr> What's the proper way to call xgb.ChangeProperty in the
xcb bindings?  I've tried numerous, and the way which seems most logical, compiles
and runs without error.  But the GetPropertyReply contains nothing.  Current code:
http://pastie.org/1834315
08:37 -!- prip [~foo@host217-133-dynamic.43-79-r.retail.telecomitalia.it] has
joined #go-nuts
08:46 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined
#go-nuts
08:46 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
08:47 -!- Adys [~Adys@unaffiliated/adys] has quit [Remote host closed the
connection]
08:48 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
08:49 -!- nkdnstbr [~nkdnstbr@cpe-173-172-231-83.rgv.res.rr.com] has quit [Ping
timeout: 276 seconds]
08:50 -!- GeertJohan [~geertjoha@81.71.140.145] has quit [Remote host closed the
connection]
08:50 -!- GeertJohan [~geertjoha@s51478c91.adsl.wanadoo.nl] has joined #go-nuts
08:50 -!- tvw [~tv@e176004116.adsl.alicedsl.de] has quit [Remote host closed the
connection]
09:01 -!- xyproto [~alexander@77.40.159.131] has joined #go-nuts
09:13 -!- Scorchin [~Scorchin@host109-158-117-65.range109-158.btcentralplus.com]
has joined #go-nuts
09:16 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined
#go-nuts
09:16 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
09:20 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
09:27 -!- edsrzf [~edsrzf@122-61-221-144.jetstream.xtra.co.nz] has quit [Remote
host closed the connection]
09:30 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has quit [Ping
timeout: 258 seconds]
09:31 -!- pingveno_ [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has quit [Ping
timeout: 276 seconds]
09:33 -!- piranha [~piranha@D57D1AB3.static.ziggozakelijk.nl] has joined #go-nuts
09:37 -!- wrtp [~rog@92.17.70.99] has joined #go-nuts
09:44 -!- sebastianskejoe [~sebastian@188.114.142.217] has quit [Quit: Lost
terminal]
09:45 -!- xyproto [~alexander@77.40.159.131] has quit [Ping timeout: 240 seconds]
09:46 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
09:46 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined #go-nuts
09:47 -!- xyproto [~alexander@77.40.159.131] has joined #go-nuts
09:53 -!- Scorchin_ [~Scorchin@host109-156-219-145.range109-156.btcentralplus.com]
has joined #go-nuts
09:53 -!- Scorchin_ [~Scorchin@host109-156-219-145.range109-156.btcentralplus.com]
has quit [Client Quit]
09:55 -!- Scorchin [~Scorchin@host109-158-117-65.range109-158.btcentralplus.com]
has quit [Ping timeout: 250 seconds]
09:55 -!- boscop_ [~boscop@f055225062.adsl.alicedsl.de] has joined #go-nuts
09:58 -!- boscop [~boscop@f055222001.adsl.alicedsl.de] has quit [Ping timeout: 250
seconds]
10:08 -!- virtualsue [~chatzilla@nat/cisco/x-wgmpxbwygszdekjn] has joined #go-nuts
10:10 -!- conra [conra@213.195.238.238] has quit [Ping timeout: 260 seconds]
10:14 -!- Scorchin [~Scorchin@host109-156-219-145.range109-156.btcentralplus.com]
has joined #go-nuts
10:15 -!- anticw [~anticw@c-67-169-68-180.hsd1.ca.comcast.net] has joined #go-nuts
10:16 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
10:16 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined #go-nuts
10:17 < xyproto> aiju: you're on reddit http://www.reddit.com/r/javascript/
10:25 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
joined #go-nuts
10:26 -!- mbejar [~mbejar@9.Red-79-159-118.staticIP.rima-tde.net] has joined
#go-nuts
10:37 -!- hopso [~hopso@a91-154-5-21.elisa-laajakaista.fi] has quit [Remote host
closed the connection]
10:45 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has joined
#go-nuts
10:47 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined
#go-nuts
10:47 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
10:47 -!- zozoR [~Morten@90.185.81.29] has joined #go-nuts
10:52 -!- pingveno1 [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has joined
#go-nuts
10:54 -!- waqas [~waqas@jaim.at] has joined #go-nuts
10:55 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-167-251.clienti.tiscali.it]
has joined #go-nuts
10:57 -!- coud [coud@195.113.21.78] has joined #go-nuts
10:59 -!- Project-2501 [~Marvin@82.84.75.159] has quit [Ping timeout: 260 seconds]
11:01 -!- waqas [~waqas@jaim.at] has left #go-nuts []
11:02 -!- waqas [~waqas@jaim.at] has joined #go-nuts
11:10 -!- GeertJohan [~geertjoha@s51478c91.adsl.wanadoo.nl] has quit [Remote host
closed the connection]
11:10 -!- GeertJohan [~geertjoha@s51478c91.adsl.wanadoo.nl] has joined #go-nuts
11:15 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
11:17 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined
#go-nuts
11:17 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
11:18 -!- Soultaker [~Soultaker@hell.student.utwente.nl] has quit [Read error:
Operation timed out]
11:34 -!- Soultaker [~Soultaker@hell.student.utwente.nl] has joined #go-nuts
11:36 -!- crodjer [~rohanjain@203.110.240.205] has joined #go-nuts
11:37 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
11:38 -!- B0rder [~B0rder@114.246.101.75] has quit [Ping timeout: 276 seconds]
11:40 -!- artefon [~thiago@189.59.207.132] has joined #go-nuts
11:49 -!- waqas [~waqas@jaim.at] has left #go-nuts []
11:51 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-167-251.clienti.tiscali.it]
has quit [Ping timeout: 240 seconds]
11:55 -!- Project_2501 [~Marvin@82.84.67.93] has joined #go-nuts
11:57 -!- crodjer [~rohanjain@203.110.240.205] has left #go-nuts ["Leaving"]
11:57 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
11:57 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined
#go-nuts
12:00 -!- ios_ [~ios@180.191.88.226] has joined #go-nuts
12:00 -!- nictuku [~yvesj@unaffiliated/nictuku] has quit [Ping timeout: 252
seconds]
12:01 -!- ios_ [~ios@180.191.88.226] has quit [Client Quit]
12:11 < xyproto> How can I create a io.ReadWriter that is a client that
connects to a tcp socket?
12:12 < xyproto> And happy easter, btw.  Hope there were more easter bunnies
than self flagellation.
12:12 < aiju> haha
12:12 -!- nictuku [~yvesj@74.125.121.33] has joined #go-nuts
12:12 -!- nictuku [~yvesj@74.125.121.33] has quit [Changing host]
12:12 -!- nictuku [~yvesj@unaffiliated/nictuku] has joined #go-nuts
12:14 < Namegduf> xyproto: I'm not sure what you mean.  a net.TCPConn can be
used to meet that interface.
12:14 < xyproto> ok, found TCPConn, I'll try experimenting with that
12:15 < Namegduf> If you mean, how can you connect, then net.Dial is what
you want.
12:15 < Namegduf> And it returns a net.Conn, which can be used with a
ReadWriter.
12:26 -!- niemeyer [~niemeyer@189-10-219-9.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
12:26 < wrtp> xyproto: just use net.Dial
12:27 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined #go-nuts
12:27 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
12:29 < xyproto> wrtp: thanks, it worked with net.DialTCP, but I will take a
look at just net.Dial
12:29 < plexdev> http://is.gd/xLmRLB by [Russ Cox] in go/src/pkg/runtime/ --
runtime: more graceful out-of-memory crash
12:39 -!- mbejar [~mbejar@9.Red-79-159-118.staticIP.rima-tde.net] has quit [Ping
timeout: 248 seconds]
12:40 < xyproto> can crashing be graceful?  :P
12:47 -!- gtaylor [~gtaylor@99.126.136.139] has joined #go-nuts
12:51 < xyproto> does select make sending and receiving on channels
non-blocking?
12:51 < xyproto> "<-" is blocking, but "case <-" is non-blocking?
12:52 < Namegduf> select is non-blocking if and only if there is a default:
12:53 < exch> what he said ^
12:53 < xyproto> ok, thx
12:54 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has quit [Quit:
Leaving]
12:54 -!- waqas [~waqas@jaim.at] has joined #go-nuts
12:55 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts
12:58 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined
#go-nuts
12:58 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
13:05 -!- gtaylor [~gtaylor@99.126.136.139] has left #go-nuts []
13:10 -!- niemeyer [~niemeyer@189-10-219-9.pltce701.dsl.brasiltelecom.net.br] has
quit [Read error: Connection reset by peer]
13:12 -!- waqas [~waqas@jaim.at] has left #go-nuts []
13:12 -!- waqas [~waqas@jaim.at] has joined #go-nuts
13:19 -!- kuroneko [~chris@yayoi.xware.cx] has quit [Ping timeout: 246 seconds]
13:19 -!- kuroneko [~chris@yayoi.xware.cx] has joined #go-nuts
13:25 -!- rejb [~rejb@unaffiliated/rejb] has quit [Quit: .]
13:28 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
13:28 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
13:28 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined #go-nuts
13:29 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has joined #go-nuts
13:31 -!- iant [~iant@216.239.45.130] has quit [Ping timeout: 258 seconds]
13:39 -!- iant [~iant@67.218.109.241] has joined #go-nuts
13:39 -!- mode/#go-nuts [+v iant] by ChanServ
13:43 -!- napsy [~luka@193.2.66.6] has quit [Quit: Lost terminal]
13:45 -!- iant [~iant@67.218.109.241] has quit [Ping timeout: 250 seconds]
13:46 < plexdev> http://is.gd/Yfahck by [Albert Strasheim] in
go/src/pkg/syscall/ -- syscall: Mlock, Munlock, Mlockall, Munlockall on Linux.
13:46 -!- iant [~iant@216.239.45.130] has joined #go-nuts
13:46 -!- mode/#go-nuts [+v iant] by ChanServ
13:53 -!- coud [coud@195.113.21.78] has quit [Ping timeout: 260 seconds]
13:56 -!- coud [coud@eduroam78.ms.mff.cuni.cz] has joined #go-nuts
13:56 -!- dj2 [~dj2@216.16.242.254] has joined #go-nuts
13:58 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined
#go-nuts
13:58 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
13:59 -!- joelkronander [~joelkrona@130.236.243.164] has quit [Ping timeout: 240
seconds]
14:05 -!- mikespook1 [~mikespook@183.47.230.163] has quit [Quit: Leaving.]
14:09 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
14:13 -!- niemeyer [~niemeyer@189-10-219-9.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
14:16 -!- jbooth1 [~jay@209.249.216.2] has joined #go-nuts
14:22 < xyproto> How can I tell if a netchan is closed on the server-end or
not?
14:22 < xyproto> nil?  0?  closed?
14:23 -!- krutcha1 [~krutcha@S010600045a27676a.vs.shawcable.net] has quit [Quit:
Leaving]
14:26 <+iant> is the server end the sender or the receiver?
14:26 -!- a2800276 [~a2800276@80.187.216.28] has quit [Ping timeout: 258 seconds]
14:28 -!- TheMue_ [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has joined
#go-nuts
14:29 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
14:32 -!- waqas [~waqas@jaim.at] has left #go-nuts []
14:33 < xyproto> iant: the server is the sender
14:33 < plexdev> http://is.gd/54pUWe by [Adam Langley] in
go/src/pkg/crypto/x509/ -- crypto/x509: memorize chain building.
14:34 < xyproto> iant: I ended up sending a "strange value" (-1) from the
server, then checking for it on the client, but that does not feel right
14:34 <+iant> I think the general idea is that the sender is supposed to
know when it closes the netchan
14:34 < xyproto> iant: the sender knows, but how does the receiver know?
14:34 <+iant> oh, whether the receiver knows
14:34 <+iant> yeah, that seems like an omission
14:35 <+iant> actually, I see that the sender will send a payClosed message
and the receiver will close the associated channel
14:36 <+iant> you can just check whether the channel is closed in the usual
way
14:38 < xyproto> iant: what is the usual way?  closed() does not seem to
exist?
14:38 <+iant> these days if you write "x, ok = <-c" ok will be set to
true if you got a value or false if the channel is closed
14:38 -!- foocraft [~dsc@dyn-86-36-41-74.wv.qatar.cmu.edu] has joined #go-nuts
14:38 < xyproto> iant: aha, yes.  This is the information I was looking for.
Thank you :)
14:40 -!- Venom_X [~pjacobs@75-27-133-72.lightspeed.austtx.sbcglobal.net] has
joined #go-nuts
14:46 -!- r_linux [~r_linux@189.38.220.35] has joined #go-nuts
14:47 -!- GeertJohan [~geertjoha@s51478c91.adsl.wanadoo.nl] has quit [Quit:
Leaving.]
14:57 -!- iant [~iant@216.239.45.130] has quit [Quit: Leaving.]
14:59 -!- TheMue_ [~TheMue@213.168.217.78] has joined #go-nuts
14:59 -!- TheMue [~TheMue@wlan-hotspot-078.ewe-ip-backbone.de] has quit [Read
error: Connection reset by peer]
15:00 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has quit [Quit:
skelterjohn]
15:06 -!- AxiomShell [~AxiomShel@89.181.185.163] has joined #go-nuts
15:11 -!- coud [coud@eduroam78.ms.mff.cuni.cz] has quit [Ping timeout: 240
seconds]
15:16 -!- TheMue [~TheMue@213.168.217.78] has quit [Quit: TheMue]
15:16 < xyproto> if a function has a for {} that loops "forever", and
returns inside the {}, is it best practice to return an empty value of some sort
at the end of the function, to please the compiler, or change a pointer then
return instead of returning a vlue?
15:16 < xyproto> that is, receiving a pointer, changing the value and then
returning, as opposed to returning a value
15:17 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
quit [Quit: leaving]
15:19 < xyproto> trying to return via pointer lead to invalid memory address
or nil pointer dereference here, so that is obviously not a good idea?
15:19 < xyproto> client http://go.pastie.org/1835590
15:20 < Namegduf> xyproto: Just have a panic() and meaningless return
15:20 < xyproto> server http://go.pastie.org/1835591
15:20 < Namegduf> If the panic() is reached, programmer error has occurred
15:20 < Namegduf> Return makes the compiler happy.
15:20 < xyproto> the problem is with the receive function in the client
15:20 < Namegduf> I believe I've seen that used in the stdlib.
15:20 < Namegduf> Not 100%.
15:21 < xyproto> if I change the signature to "func receive(pitube chan int)
string {", I don't get the runtime error
15:21 < xyproto> (and return the string, instead of changing the pointer)
15:21 < kamaji> Does anyone know how to use reflect to create a slice of
interfaces from a slice of structs implementing that interface?
15:21 < xyproto> Why does this happen?
15:21 < kamaji> The mailing list seemed to indicate that could be done with
"SliceValue" but I don't really see how
15:22 < Namegduf> xyproto: Your pistring isn't initialised to point to
anything.
15:22 < Namegduf> Which means it defaults to a nil pointer.
15:22 < Namegduf> You pass that nil pointer in.
15:22 < homa_rano> xyproto: it also looks like your specific for {} can be
replaced with 'for value := range pitube {}'
15:22 < Namegduf> Then you try to dereference that pointer.
15:22 < Namegduf> That will crash.
15:23 < Namegduf> And no, that definitely is *not* idiomatic.
15:23 < xyproto> homa_rano: nice, thanks, I'll try that
15:23 < Namegduf> Just have a return to make the compiler happy
15:23 < homa_rano> xyproto: the range over a channel ends at the closing
automatically
15:23 < xyproto> homa_rano: I did not know that.  Great scott!
15:23 < Namegduf> Yeah.
15:24 < exch> kamaji: is this what you are after?
https://groups.google.com/forum/#!topic/golang-nuts/0zONnbwwhHU
15:24 < xyproto> homa_rano: I still wonder why it's so problematic to send a
pointer, though
15:25 < Namegduf> There's no problem with sending a pointer.
15:25 < Namegduf> You're sending a nil pointer, though.
15:25 < Namegduf> And then dereferencing it.
15:25 < Namegduf> That won't work.
15:26 < Namegduf> You can take an empty string and append to it.
15:26 < Namegduf> You can't take a nil pointer and add to the string it
points at.
15:26 < Namegduf> It doesn't point to a string.
15:26 < Namegduf> It's nil.
15:26 < kamaji> exch: kind of, but instead of []byte I need an interface, so
I think it's different?
15:26 < Namegduf> Thus, nil pointer dereference.
15:28 < kamaji> exch: I basically have this http://pastebin.com/tay5xMLU
15:28 < kamaji> exch: cannot use As (type []A) as type []I in function
argument
15:29 < exch> yea those are different types
15:29 < kamaji> So instead I could copy each A over as an I into a new slice
15:29 < exch> Not sure if the reflect/unsafe trickery is really any faster
than just manually copying the slice over to the new type
15:29 < kamaji> :\
15:29 < kamaji> arrrrrgh
15:29 < xyproto> homa_rano: the range version is faster as well (after some
quick and dirty benchmarking with the "time" command)
15:29 < Namegduf> []I and []A are different sizes for a given number of
elements
15:29 < Namegduf> And look different in memory
15:30 < Namegduf> []I isn't just a wrapper around []A, so you can't simply
box it.  It takes a copy of all the elements.
15:30 < kamaji> I know, but it's kind of annoying there's no shortcut to
reference a list like that
15:30 < kamaji> it seems like quite a common thing to want to do
15:30 < Namegduf> Not really.
15:30 < kamaji> really?
15:31 < Namegduf> You can't use a []I like a []A
15:31 -!- AxiomShell [~AxiomShel@89.181.185.163] has quit [Quit: Leaving]
15:31 < Namegduf> Or visa versa.
15:31 < Namegduf> You can't insert.
15:31 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.]
15:31 < Namegduf> A []I can contain multiple types.  A []A can only hold A.
15:31 < exch> (Almost) no implicit type conversions can be a bit of a pain
sometimes, ut I don't really encounter it that often
15:31 < Namegduf> (See the classic OO "Is a bag-of-oranges a type-of
bag-of-fruit?".  Short answer, no.)
15:32 < kamaji> well I get it
15:32 < kamaji> I just don't _like_ it :P
15:32 < Namegduf> I've never run into a case where I wanted a whole slice of
somethings where I didn't care about the type of those somethings.
15:33 < Namegduf> Yes, well, unfortunately the way computers work doesn't
bend to what you like
15:33 < kamaji> Namegduf: what about functions that take a slice?
15:33 < Namegduf> kamaji: I've never seen any that took a slice of interface
that regularly wanted to take a slice of an existing thing as it.
15:33 < Namegduf> The language could do it for you, but it's slower than
other wrapping, potentially very slow.
15:34 < exch> this is possible the worst case where I ran into the type
conversion issue.  It's part of a VM http://pastebin.com/B7UMh6sZ
15:34 < Namegduf> And fundamentally the types don't look similar, so the
conversion has to be done.
15:35 < Namegduf> That's not type conversion, really
15:35 < Namegduf> It's lack of generics
15:35 < Namegduf> No amount of automatic conversion could make that less
terrible
15:36 < Namegduf> (Actually, it's always being automatically converted in
every conversion there)
15:36 < Namegduf> (Aside type assertions)
15:37 < exch> If you are suggesting that those ops all work on interface{}
and Go takes care of the appropriate conversions, then no.  That's not the case
15:37 < Namegduf> No.
15:37 < Namegduf> I'm saying the huge amount of case statements is because
Go lacks generics.
15:37 < exch> I'm not sure if generics would really solve this
15:37 < Namegduf> calcMin(a T, bT)
15:37 < Namegduf> *calcMin(a T, b T)
15:38 < kamaji> wouldn't you have to define a calcMin for each type anyway?
15:38 -!- skelterjohn [~jasmuth@128.6.168.245] has joined #go-nuts
15:38 < exch> yes
15:38 < Namegduf> Depends on the generics implementation.
15:38 < Namegduf> I'd hope not.
15:39 < Namegduf> calcMin<int8>(a, b) could be calling syntax, for
example, in another language.
15:39 < Namegduf> Where a and b were both int8s.
15:39 < exch> there's the additional problem that calling a generic version
of calcX() assumes that a and b are always the same type.  The point of that code
is to deal with cases where this is not so
15:40 < exch> I suppose the call to it would fail though
15:40 < Namegduf> At compile-time.
15:40 < exch> which is the same as manually throwing an invalid operation
error
15:40 < Namegduf> Except at compile time.
15:40 < exch> this operates at runtime.  These input values come from a
stack which can contain anything
15:40 < Namegduf> Ah.
15:41 < Namegduf> Well, generics could simplify it significantly
15:41 < exch> possibly
15:41 < exch> It would probably always remain a messy bit of work
15:41 < Namegduf> Probably.
15:42 < Namegduf> I'm not sure what you can do when you don't know what the
type is at compile time.
15:42 < Namegduf> In fact, I think all that code is required for that.
15:43 -!- artefon [~thiago@189.59.207.132] has quit [Read error: Connection reset
by peer]
15:43 < Namegduf> The only alternative is first class types *and* generics.
15:43 < Namegduf> Which would let you retrieve the types, check if they
matched, and then invoke a correctly instantiated thing for the real comparison.
15:43 < exch> seems like it
15:44 < Namegduf> That's really what you're doing there.
15:44 < Namegduf> There might be a way to do the first, using reflection
15:44 < Namegduf> The type information is obviously there
15:45 < Namegduf> It's being used for the type switch
15:45 < skelterjohn> you also know the size of the data
15:45 < exch> That code only deals with same-type operations as well.  If I
wanted to allow 'implicit' conversions to allow int + float, it would require
nested type switches and that file would probably grow to monstrous sizes
15:45 < Namegduf> Just no way to use it to call a correctly instantiated
function.
15:45 < skelterjohn> so you could certainly write a shallow Equals(a, b
interface{}) bool functino
15:45 < Namegduf> Yes, but that's because what you're doing is pretty
complex
15:45 < Namegduf> Also implicit conversions are from hell
15:45 < exch> yes they are
15:46 < exch> hence why I left em out
15:46 < Namegduf> I'm having a hard time figuring out how to avoid repeating
this logic over and over.
15:46 < Namegduf> I don't think it's any property of Go aside possibly lack
of macros, heh.
15:46 -!- Stiletto [7f000001@69.195.144.4] has quit [Ping timeout: 240 seconds]
15:47 < exch> I haven't figured a better way yet.  Not for lack of trying
mind you :p
15:47 < Namegduf> It really is repetitive code differing only in type, but
the constraints are tricky and nasty and unfriendly to anything but
straightforward duplicating of text
15:48 < Namegduf> (That is what I actually use when I want to have a generic
data structure in Go. I use a build system thing to instantiate it.)
15:48 < Namegduf> (But it would be overkill here.)
15:48 < exch> The really nasty repitition is in the calcShl() and calcShr
functions
15:49 < exch> those have nested type switches to filter out the unsigned
integer types b might contain
15:50 < Namegduf> You can functionise that.
15:50 < Namegduf> ...maybe?
15:50 < Namegduf> Argh.
15:50 < exch> Only marginally.  'a' can be different types as well
15:50 < exch> so I would still need separate functions for each of those
15:51 -!- piranha [~piranha@D57D1AB3.static.ziggozakelijk.nl] has quit [Quit:
Computer has gone to sleep.]
15:51 < Namegduf> Yeah.
15:54 < skelterjohn> for my purposes, at least, i have found interface{} to
be sufficient.  the lack of type safety is a downer but deal-with-able.  the loss
of efficiency has yet to be noticeable in the context of the other things going on
15:59 -!- Soultaker [~Soultaker@hell.student.utwente.nl] has quit [Ping timeout:
240 seconds]
15:59 -!- Soultaker [~Soultaker@hell.student.utwente.nl] has joined #go-nuts
15:59 -!- crazy2be [~crazy2be@199.185.88.147] has joined #go-nuts
16:03 -!- Stiletto [7f000001@69.195.144.4] has joined #go-nuts
16:05 -!- crazy2be [~crazy2be@199.185.88.147] has quit [Ping timeout: 246 seconds]
16:05 -!- gedevan [~gedevan@83.167.106.253] has quit [Ping timeout: 240 seconds]
16:06 -!- nkdnstbr [~nkdnstbr@cpe-173-172-231-83.rgv.res.rr.com] has joined
#go-nuts
16:06 -!- iant [~iant@nat/google/x-jeiopnezdgzgoyhj] has joined #go-nuts
16:06 -!- mode/#go-nuts [+v iant] by ChanServ
16:08 -!- nkdnstbr [~nkdnstbr@cpe-173-172-231-83.rgv.res.rr.com] has quit [Client
Quit]
16:11 -!- Niedar [~bleh@ip68-99-166-222.hr.hr.cox.net] has quit [Read error:
Connection reset by peer]
16:13 -!- pharris [~Adium@rhgw.opentext.com] has joined #go-nuts
16:18 -!- Venom_X [~pjacobs@75-27-133-72.lightspeed.austtx.sbcglobal.net] has quit
[Quit: Venom_X]
16:23 -!- GeertJohan [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has joined
#go-nuts
16:32 -!- gedevan [~gedevan@83.167.106.253] has joined #go-nuts
16:34 -!- gedevan [~gedevan@83.167.106.253] has quit [Client Quit]
16:34 -!- gedevan [~gedevan@83.167.106.253] has joined #go-nuts
16:36 -!- crazy2be [~crazy2be@199.185.88.147] has joined #go-nuts
16:38 -!- wrtp [~rog@92.17.70.99] has quit [Quit: wrtp]
16:38 -!- crazy2be [~crazy2be@199.185.88.147] has quit [Remote host closed the
connection]
16:44 -!- wrtp [~rog@92.17.70.99] has joined #go-nuts
16:45 -!- aho [~nya@fuld-590c635c.pool.mediaWays.net] has joined #go-nuts
16:46 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts
16:49 -!- wrtp [~rog@92.17.70.99] has quit [Client Quit]
16:51 -!- artefon [~thiago@dhcp52.usuarios.dcc.ufmg.br] has joined #go-nuts
16:56 -!- iant [~iant@nat/google/x-jeiopnezdgzgoyhj] has quit [Quit: Leaving.]
16:57 < scyth> is there a way to do a len() on a *string, without having
another string variable with the value of original *string
16:58 < exch> len(*mystr) ?
16:58 < scyth> doesn't work
16:59 < skelterjohn> yes it does
17:00 < skelterjohn> http://pastebin.com/4hS648yc
17:00 < skelterjohn> prints 2
17:03 < scyth> that's two variables
17:05 < scyth> hm
17:05 < scyth> I think I know what happened here
17:06 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined
#go-nuts
17:07 < skelterjohn> well, i wanted to get a string pointer somehow
17:08 < skelterjohn> i assumed you already had one ready
17:08 < skelterjohn> but if you have a var y *string, you don't have to say
"x := *y; len(x)".  you can just say "len(*y)"
17:09 < skelterjohn> you can't take the address of a string literal, so if
you were asking if you have to store the actual string somewhere, then yes, you do
17:09 < skelterjohn> but this is a different issue than len()
17:10 < delinka> i.e.  len(*(&"z0mg")) //no worky
17:11 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Quit:
Leaving.]
17:13 < scyth> and how about slice 'iteration' on *string?  *mystr[5]
17:14 < scyth> I'm getting invalid operation, index of type *string
17:15 -!- huin [~huin@91.84.64.19] has joined #go-nuts
17:16 -!- keithcascio [~keithcasc@nat/google/x-vipfepxhhumsaeai] has joined
#go-nuts
17:17 < scyth> that's where I tried to put len() and error msg misled me
17:18 < exch> (*mystr)[5]
17:19 -!- mbejar [~mbejar@9.Red-79-159-118.staticIP.rima-tde.net] has joined
#go-nuts
17:20 < scyth> that's the one :) thanks
17:26 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has joined
#go-nuts
17:32 -!- saschpe [~quassel@opensuse/member/saschpe] has joined #go-nuts
17:36 -!- Niedar [~bleh@ip68-99-166-222.hr.hr.cox.net] has joined #go-nuts
17:38 -!- dahankzter [~henrik@92.244.3.192] has joined #go-nuts
17:41 -!- TheMue [~TheMue@p5DDF5238.dip.t-dialin.net] has joined #go-nuts
17:42 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has joined #go-nuts
17:43 < nictuku> isn't there something in the standard libraries that
provides what readFully() does in http://jan.newmarch.name/go/socket/chapter.html
? (network programming)
17:43 -!- tvw [~tv@212.79.9.150] has quit [Remote host closed the connection]
17:43 < aiju> yes
17:43 -!- a2800276 [~a2800276@xdsl-195-14-206-104.netcologne.de] has joined
#go-nuts
17:44 < aiju> io.ReadFull
17:45 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has quit
[Quit: Leaving.]
17:47 -!- hopso [5b9a092a@gateway/web/freenode/ip.91.154.9.42] has joined #go-nuts
17:49 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Quit:
peace in teh middle east]
17:50 -!- iant [~iant@nat/google/x-gpwkinzxfyvuysia] has joined #go-nuts
17:50 -!- mode/#go-nuts [+v iant] by ChanServ
17:53 < dahankzter> dang, mgo is not installable :(
17:54 < dahankzter> something in gobson that is broken
17:55 < TheMue> so, finishing the next step of my redis client
(publish/subscribe).  listening to tcp connection and multiple channels in
parallel should work now.
17:55 -!- imsplitbit [~imsplitbi@66.78.236.243] has joined #go-nuts
17:55 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has joined
#go-nuts
17:56 -!- m4dh4tt3r1
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has joined
#go-nuts
17:56 -!- virtualsue [~chatzilla@nat/cisco/x-wgmpxbwygszdekjn] has quit [Ping
timeout: 240 seconds]
17:57 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has quit
[Read error: No route to host]
17:57 -!- jyxent [~jyxent@129.128.191.96] has quit [Read error: Connection reset
by peer]
17:58 -!- Niedar [~bleh@ip68-99-166-222.hr.hr.cox.net] has quit [Read error:
Connection reset by peer]
18:00 -!- Niedar [~bleh@ip68-99-166-222.hr.hr.cox.net] has joined #go-nuts
18:01 -!- Netsplit *.net <-> *.split quits: werdan7, GilJ, pingveno1, rl,
plexdev, larva
18:01 -!- gedevan [~gedevan@83.167.106.253] has quit [Read error: Operation timed
out]
18:02 -!- Netsplit over, joins: GilJ
18:02 -!- Netsplit over, joins: larva
18:03 -!- jyxent [~jyxent@129.128.191.96] has joined #go-nuts
18:03 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
joined #go-nuts
18:04 -!- Netsplit over, joins: plexdev
18:04 < jessta_> dahankzter: installs fine here, which version of go are you
using?
18:04 -!- Netsplit over, joins: pingveno1
18:06 -!- rl [~rbl@84-74-142-37.dclient.hispeed.ch] has joined #go-nuts
18:08 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
18:09 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has joined #go-nuts
18:11 -!- m4dh4tt3r1
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has quit
[Quit: Leaving.]
18:11 -!- waqas [~waqas@jaim.at] has joined #go-nuts
18:13 -!- krutcha [~krutcha@remote.icron.com] has joined #go-nuts
18:13 < ptrb> Forgive me if this is a common question, but if I'm extending
some pkg.Type with my own functionality, I'm probably going to say "type MyType
pkg.Type" and then define func (p *MyType) Foo(...).  But then how do I coerce a t
:= pkg.NewType(...) to a MyType, so I can call t.Foo() without the compiler
complaining: "type pkg.Type has no method Foo"
18:14 < Namegduf> You don't.
18:14 < Namegduf> Do not consider "extending types" as an approach in
designing solutions to problems.
18:14 < ptrb> then what do I do?  type MyType struct { pkg.Type }?
18:14 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has joined
#go-nuts
18:14 < ptrb> It's a perfectly valid approach.
18:14 < Namegduf> You can do that.  But you're not extending that type,
you're embedding it.
18:15 < Namegduf> No, it isn't.
18:15 < ptrb> I understand the distinction.
18:15 < KirkMcDonald> Composition, not inheritance.
18:15 < ptrb> Yes, it is.  I'm not looking for a philosophical debate.
18:15 < KirkMcDonald> The philosophy directly informs the syntax.
18:15 -!- joelkronander
[~joelkrona@c-bf2fe253.617-1-64736c22.cust.bredbandsbolaget.se] has joined
#go-nuts
18:15 < Namegduf> In short, this isn't a problem.
18:16 < Namegduf> This is "I want to solve a problem in a particular way
that Go is not designed for, how do I do that?"
18:16 < Namegduf> You don't.
18:16 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
18:16 < Namegduf> You don't ask how you can use duck typing in Java and you
don't ask how you can get compile-time type checks in Python.
18:17 < ptrb> A library I wrote provides a data abstraction structure.  I
want to use that structure in a particular way, enforcing some restrictions on its
parameters.
18:17 < Namegduf> You can wrap it, if you like.  It sounds like poorly
structure code, though.
18:17 < Namegduf> *structured
18:17 < Namegduf> Since you're needing wrappers.
18:18 < ptrb> My last two sentences describe a perfectly valid and coherent
software architecture.
18:18 < jessta_> ptrb: yes, embeding is likely what you want
18:18 < Namegduf> Yes, they do.  In an Object Oriented language.
18:18 < ptrb> Maybe wrapping isn't the way to go.  In which case I'm all
ears as to how to move forward.
18:19 < Namegduf> Just focus on Actually Writing Code To Provide A Function
18:19 < Namegduf> In good Go, you should have very little code which is not
that.
18:19 < ptrb> Hey I've Already Done That Now I Want To Use It In A
Particular Way
18:20 < Namegduf> No, you want to alter how it behaves so you can use it
differently later when solving a problem.
18:20 < Namegduf> That is not solving a problem.
18:20 < Namegduf> You'll notice the stdlib does not routinely contain APIs
wrapped by things slightly modifying those APIs.
18:20 < Namegduf> The stdlib is a good guide to idiomatic Go.
18:20 < ptrb> How do you get any of that from what I've....  you know what,
forget it.  I'll ask again when you're AFK.
18:21 < Namegduf> Look, if you want to write code in an OO style, why not
just stick to Java?
18:21 < Namegduf> It's more efficient than trying to twist a language not
designed for it into the job.
18:21 < ptrb> I'm sure there's an answer to my question hidden away beneath
all that snark and derision, but I've neither the time nor inclination to extract
it.
18:21 < Namegduf> Your question was "how I extend types"
18:22 < Namegduf> The answer is "There is nothing in Go defined as
'extending types'."
18:22 < Namegduf> You need to clarify your question.
18:22 < Namegduf> Embedding can do some things, but very strongly not do
others, that extending a type in other languages can do.
18:22 < Namegduf> (You have no dynamic dispatch)
18:22 < krutcha> the stdlib, much like this discussion, is often absent
examples of use :P perhaps a constructive boiled-down example would help here
18:23 < aiju> you call THAT snark?
18:23 < aiju> Namegduf is being nice
18:23 -!- a2800276_ [~a2800276@xdsl-195-14-206-249.netcologne.de] has joined
#go-nuts
18:24 -!- hopso [5b9a092a@gateway/web/freenode/ip.91.154.9.42] has quit [Ping
timeout: 252 seconds]
18:24 < Namegduf> Looking at your specific code, yes, you need to wrap a
struct around it, and then assign to the .Type member for the embedded type.
18:24 < Namegduf> Defined types do not inherit methods.
18:25 < Namegduf> Embedded types do, but they also ignore everything outside
the embedded type in their own methods.  It's syntactic sugar for
x.member.Method() which also affects interfaces satisfied.
18:26 -!- a2800276 [~a2800276@xdsl-195-14-206-104.netcologne.de] has quit [Ping
timeout: 248 seconds]
18:27 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
18:28 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has quit [Ping
timeout: 248 seconds]
18:31 -!- mbejar [~mbejar@9.Red-79-159-118.staticIP.rima-tde.net] has quit [Ping
timeout: 264 seconds]
18:35 -!- artefon [~thiago@dhcp52.usuarios.dcc.ufmg.br] has quit [Read error:
Operation timed out]
18:35 -!- artefon [~thiago@dhcp52.usuarios.dcc.ufmg.br] has joined #go-nuts
18:36 -!- awidegreen_ [~quassel@178.63.120.5] has joined #go-nuts
18:36 -!- hopso [5b9a092a@gateway/web/freenode/ip.91.154.9.42] has joined #go-nuts
18:36 -!- awidegreen [~quassel@c-cfc5e555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Ping timeout: 240 seconds]
18:38 -!- Project-2501 [~Marvin@82.84.80.8] has joined #go-nuts
18:39 < tux21b> does anyone know some web projects which are a) build for
real usage and b) looking for volunteers?  :)
18:40 < ampleyfly> what's a web project?
18:40 < aiju> a project involving spiders
18:40 < ampleyfly> :)
18:41 < tux21b> yeah ;)...  no, i am talking about some kind of web
application
18:41 < tux21b> might be a wiki, bulletin board, blog or something simpler
:)
18:42 -!- imsplitbit [~imsplitbi@66.78.236.243] has quit [Quit: Leaving...]
18:42 -!- Project_2501 [~Marvin@82.84.67.93] has quit [Ping timeout: 276 seconds]
18:44 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has quit
[Ping timeout: 260 seconds]
18:46 -!- imsplitbit [~imsplitbi@sccc-66-78-236-243.smartcity.com] has joined
#go-nuts
18:48 < hopso> Does "hg clone https://go.googlecode.com/hg/ go" get the very
latest, weekly or release source?
18:48 < pTonnerre> The repository
18:48 < pTonnerre> It should check out the very latest code by default but
you have all of it
18:49 < hopso> So the src/all.bash should build the latest?
18:50 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
18:51 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving]
18:51 < kamaji> How do i specify a method in an interface to have a pointer
receiver?
18:52 < |Craig|> kamaji: I believe interfaces are referance types
18:52 < |Craig|> to they are already kinda like pointers
18:52 -!- artefon [~thiago@dhcp52.usuarios.dcc.ufmg.br] has quit [Quit: bye]
18:53 < |Craig|> I'm not sure if thats what your asking though, I'm a bit
behind on the terminology
18:54 -!- gedevan [~gedevan@83.167.106.253] has joined #go-nuts
18:54 < kamaji> errr kind of
18:54 < kamaji> I'm just a bit thrown by an error
18:54 < krutcha> I'm not sure you'd specify that in the interface, but
rather when you choose what receiver to implement the interface on
18:54 < krutcha> or am I missing what you mean
18:54 < kamaji> no that's kind of it, i'm just not sure why i'm getting the
error
18:54 < waqas> var x map[string]T; x["something"] = t; // does the map store
a reference or a copy?
18:54 < kamaji> Foo does not implement Bar (Baz method requires pointer
receiver)
18:54 < kamaji> not really sure what to make of it
18:55 < hopso> waqas: Copy, I think.
18:55 < kamaji> which one requires a pointer receiver?
18:55 < hopso> As in if you modify t, x["something"] doesn't change.
18:55 < krutcha> kamaji: when you called x Foo; x.Bar() try (&x).Bar()
18:55 < tux21b> waqas, depends on T. if T is a value type it will copy
18:57 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has joined #go-nuts
18:57 < krutcha> sounds like the interface containing Bar() was defined on
(*Foo), not on (Foo)
18:57 < krutcha> or somethin'
18:57 < kamaji> krutcha: oh ...
18:57 < kamaji> yeah
18:57 < kamaji> I forgot that my Foos were not pointers
18:57 < kamaji> thanks :P
19:02 -!- sjansen [~sjansen@ip65-44-231-178.z231-44-65.customer.algx.net] has
joined #go-nuts
19:06 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
quit [Read error: Connection reset by peer]
19:06 -!- virtualsue [~chatzilla@nat/cisco/x-jsttdcbucifshfci] has joined #go-nuts
19:08 -!- imsplitbit [~imsplitbi@sccc-66-78-236-243.smartcity.com] has quit [Quit:
Leaving...]
19:25 -!- tvw [~tv@e176004116.adsl.alicedsl.de] has joined #go-nuts
19:26 < skelterjohn> a map[K]T will only store Ts
19:27 < skelterjohn> if T happens to be a pointer, it will store the value
of that pointer
19:38 < plexdev> http://is.gd/7Pgnsz by [Brad Fitzpatrick] in
go/src/pkg/http/ -- http: new tests + panic hunting issue 1725
19:43 -!- boscop_ [~boscop@f055252008.adsl.alicedsl.de] has joined #go-nuts
19:45 -!- boscop [~boscop@f055225062.adsl.alicedsl.de] has quit [Ping timeout: 250
seconds]
19:45 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
19:47 -!- boscop__ [~boscop@f055070149.adsl.alicedsl.de] has joined #go-nuts
19:50 -!- boscop_ [~boscop@f055252008.adsl.alicedsl.de] has quit [Ping timeout:
250 seconds]
19:51 -!- boscop__ [~boscop@f055070149.adsl.alicedsl.de] has quit [Client Quit]
19:53 < kamaji> Can a slice of pointers to struct be converted implicitly to
a slice of Interface?
19:55 < kamaji> the answer: Nope
19:55 < kamaji> New question: why!
19:56 < dahankzter> switch v := val.(type) {...  doesnt this work anymore?
19:56 < dahankzter> val is reflect.Value
19:57 < taruti> because the reflect api changed
19:57 < taruti> switch val.Kind { ...
19:57 < dahankzter> Kind!  cool thx!
19:57 < aiju> they removed type switches?
19:57 < hopso> I just noticed my all.bash just hangs
19:57 < taruti> aiju: no, just changed the reflect api.
19:58 < aiju> oic
19:59 < hopso> Is it a known bug that all.bash simply hangs when trying to
build go using go_mingw by jpoirier?
20:03 < skelterjohn> when does it hang?
20:03 -!- res99 [~anonymous@201.237.130.70] has quit [Quit: res99]
20:03 < skelterjohn> if it's on testing, try to run just make.bash
20:03 < skelterjohn> then you at least build go
20:04 -!- arun_ [~arun@unaffiliated/sindian] has quit [Ping timeout: 250 seconds]
20:04 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has joined
#go-nuts
20:04 < hopso> skelterjohn: Right after typing ./all.bash
20:04 < hopso> No output at all
20:05 < skelterjohn> what about ifyou run make.bash
20:05 < hopso> It's creating new instances bash.exe continuously so I'll
just check the script soon
20:05 < hopso> Let me try that
20:06 < hopso> Same thing happens
20:06 -!- gedevan [~gedevan@83.167.106.253] has quit [Ping timeout: 252 seconds]
20:09 -!- virtualsue [~chatzilla@nat/cisco/x-jsttdcbucifshfci] has quit [Ping
timeout: 240 seconds]
20:10 -!- fmoo [~Adium@c-76-102-41-101.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
20:10 -!- KBme [~KBme@2001:470:1f13:94::3] has quit [Read error: Operation timed
out]
20:14 -!- zozoR [~Morten@90.185.81.29] has quit [Remote host closed the
connection]
20:17 -!- arun_ [~arun@unaffiliated/sindian] has joined #go-nuts
20:18 -!- skelterjohn [~jasmuth@128.6.168.245] has quit [Quit: skelterjohn]
20:19 -!- KBme [~KBme@2001:470:1f13:94::3] has joined #go-nuts
20:20 -!- saschpe [~quassel@opensuse/member/saschpe] has quit [Remote host closed
the connection]
20:21 < jessta_> kamaji: because a pointer to struct isn't the same size as
an interface
20:22 < huin> kamaji: an interface has a memory layout in itself
20:23 < huin> kamaji:
http://research.swtch.com/2009/12/go-data-structures-interfaces.html <- i found
that very enlightening in understanding what interfaces did and how they worked
20:25 -!- waqas [~waqas@jaim.at] has left #go-nuts []
20:27 -!- fmoo [~Adium@66.220.144.74] has joined #go-nuts
20:30 < kamaji> jessta_, huin, but a pointer to an interface type would be
20:31 < TheMue> Ah, great, publish/subscribe of my Redis client works fine.
20:31 < huin> kamaji: what do you mean?
20:35 -!- TheMue [~TheMue@p5DDF5238.dip.t-dialin.net] has quit [Quit: TheMue]
20:35 -!- awidegreen_ [~quassel@178.63.120.5] has quit [Ping timeout: 260 seconds]
20:35 < kamaji> huin: well I was thinking that if you have a slice of
pointers then it could do the implicit conversion on each value, like when you
pass a struct to a function taking an interface
20:36 < kamaji> i'm now thinking that's wrong because you'd have to know the
actual type to do the conversion
20:37 -!- ab3 [~abe@83.101.90.66] has joined #go-nuts
20:37 < ab3> hello
20:37 < huin> kamaji: if i understand you correctly, yeah
20:38 < kamaji> and that's because of the itable function pointer thing in
that article
20:38 < kamaji> (which was a really great link btw, thanks)
20:39 < huin> someone else linked me it in here when i ran afoul of
misunderstanding interfaces :)
20:39 < ab3> I don't understand the map syntax, why is it something like
map[string]int instead of lets say map[string, int]
20:39 < aiju> ab3: it matches array types
20:39 < aiju> [5]int
20:39 < huin> ab3: i think about it as the [] containing the type you put
inside the [] when you're using it
20:40 < huin> ab3: and a map evaluates to the type on the end, like
functions do
20:40 < kamaji> oh that reminds me actually, is there a way to specify a []
type without knowing if it's slice or map?
20:40 < huin> nope
20:40 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has quit [Quit:
Linkinus - http://linkinus.com]
20:40 < huin> well...  you might be able to use interface{}
20:40 < huin> depends what you want
20:41 < huin> but then interface{} can hold anything
20:41 < kamaji> I just meant a general array storage type indexed by int
that might be sparse or dense
20:42 < huin> not that i can think of...  you could make new types that
derive from map[int]Foo or []Foo, add a Get(index int) method to both and have
that in an interface, maybe?
20:42 < kamaji> oh i'll just use gomatrix, I was just wondering if such
notation was possible
20:42 < kamaji> it's basically got what you just said
20:42 -!- imsplitbit [~imsplitbi@12.43.172.10] has joined #go-nuts
20:43 < kamaji> can just do 1xN row matrices
20:43 < huin> hm
20:43 < huin> can't do Get(indices...  int) huh?
20:43 < kamaji> just wonderin'
20:43 < kamaji> I don't follow
20:43 < kamaji> why multiple indices?
20:44 < huin> multiple dimensions
20:44 -!- mbejar [~mbejar@9.Red-79-159-118.staticIP.rima-tde.net] has joined
#go-nuts
20:44 < kamaji> you mean like for a tensor?
20:44 < kamaji> sorry i'm a bit lost :p
20:44 < kamaji> gomatrix just has Get(i, j)
20:44 < huin> so am i at the mention of "tensor" :)
20:45 < kamaji> I only know they're like matrices with an arbitrary number
of dimensions and I could be wrong :D
20:45 < huin> also it's late and i should go to bed before i say dumb stuff,
assuming i haven't already :)
20:45 < huin> kamaji: yeah, sounds consistent with what i meant
20:45 < kamaji> fuuuck no, you have provided awesome help :D
20:45 < huin> kamaji: you're wanting MxN then i guess..  i overshot into
multi-dimensions.  oops
20:46 < kamaji> generalising like a boss :P
20:46 < huin> heh
20:46 < huin> only been using Go for 5 months ;)
20:46 < kamaji> nah I just need vectors really
20:46 < kamaji> how much code has stopped working due to language changes?
20:46 < kamaji> just curious :D
20:46 < huin> very little
20:46 < huin> the latest was fixed by gofix
20:46 < kamaji> oh nice
20:47 < huin> (standard library change, technically)
20:47 < kamaji> I was a bit worried about that
20:47 < huin> so it hasn't been hard work keeping up
20:47 < kamaji> encouraging
20:47 -!- iant [~iant@nat/google/x-gpwkinzxfyvuysia] has quit [Quit: Leaving.]
20:48 -!- fmoo [~Adium@66.220.144.74] has quit [Quit: Leaving.]
20:49 -!- fmoo [~Adium@66.220.144.74] has joined #go-nuts
20:52 -!- napsy [~luka@88.200.96.18] has quit [Quit: leaving]
20:52 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
20:55 -!- iant [~iant@nat/google/x-ulruxtxjkremarvt] has joined #go-nuts
20:55 -!- mode/#go-nuts [+v iant] by ChanServ
20:56 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
20:56 -!- imsplitbit [~imsplitbi@12.43.172.10] has quit [Quit: Leaving...]
20:57 -!- huin [~huin@91.84.64.19] has quit [Quit: bedtime]
20:59 -!- dj2_ [~dj2@216.16.242.254] has joined #go-nuts
21:00 -!- dj2 [~dj2@216.16.242.254] has quit [Ping timeout: 260 seconds]
21:06 -!- hopso_ [5b9a092a@gateway/web/freenode/ip.91.154.9.42] has joined
#go-nuts
21:07 -!- hopso [5b9a092a@gateway/web/freenode/ip.91.154.9.42] has quit [Ping
timeout: 253 seconds]
21:18 < hopso_> How can I build the go and the packages without all the
tests?
21:21 -!- dj2_ [~dj2@216.16.242.254] has quit [Remote host closed the connection]
21:22 -!- chimes [~chimes@24.104.130.118] has joined #go-nuts
21:23 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
joined #go-nuts
21:23 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
21:28 < ptrb> "foo.go:5: import
/Users/peter/src/go/pkg/darwin_amd64/github.com/petar/GoLLRB/llrb.a: not a go
object file" >:[
21:30 < aiju> delete the file, GOTO 10
21:31 < ptrb> same
21:31 < ptrb> well, same after I re-goinstall
21:33 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
21:33 < hopso> Far off topic but...  what kind of anti-cheat can be disabled
by noping a single call?
21:33 < hopso> In an online game, that is.
21:41 -!- napsy [~luka@88.200.96.18] has quit [Quit: Lost terminal]
21:42 -!- Venom_X_ [~pjacobs@75-27-133-72.lightspeed.austtx.sbcglobal.net] has
joined #go-nuts
21:44 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Ping timeout: 250 seconds]
21:44 -!- dahankzter [~henrik@92.244.3.192] has quit [Quit: Leaving.]
21:47 -!- joelkronander
[~joelkrona@c-bf2fe253.617-1-64736c22.cust.bredbandsbolaget.se] has quit [Quit:
joelkronander]
21:47 < kamaji> hopso: one that relies on the client for some reason?  :D
21:50 -!- KBme [~KBme@2001:470:1f13:94::3] has quit [Read error: Operation timed
out]
21:53 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has joined
#go-nuts
21:53 < hopso> kamaji: Yup but I find it funny how the server doesn't care
wheter the anti-cheat is running or not.
21:55 -!- jbooth1 [~jay@209.249.216.2] has quit [Quit: Leaving.]
21:56 -!- KBme [~KBme@2001:470:1f13:94::3] has joined #go-nuts
21:59 -!- kr [~Keith@204.14.152.118] has joined #go-nuts
22:01 -!- ExtraSpice [XtraSpice@88.118.35.153] has quit [Read error: Connection
reset by peer]
22:03 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has joined
#go-nuts
22:04 -!- bakkal [~hawk@41.141.225.221] has quit [Read error: Connection reset by
peer]
22:08 -!- imsplitbit [~imsplitbi@66.78.236.243] has joined #go-nuts
22:11 -!- davisp [~davisp@couchdb/developer/davisp] has quit [Quit: Terminated
with extreme prejudice - dircproxy 1.0.5]
22:12 < plexdev> http://is.gd/h3Fsjv by [Rob Pike] in go/src/pkg/rpc/ --
rpc: allow the argument (first arg of method) to be a value rather than a pointer.
22:12 -!- davisp [~davisp@couchdb/developer/davisp] has joined #go-nuts
22:14 -!- r_linux [~r_linux@189.38.220.35] has quit [Quit: Lost terminal]
22:17 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
22:20 -!- ako [~nya@fuld-590c74dd.pool.mediaWays.net] has joined #go-nuts
22:21 < jeremy_c> How do I determine if a map has a given key?
22:23 -!- aho [~nya@fuld-590c635c.pool.mediaWays.net] has quit [Ping timeout: 250
seconds]
22:23 < hopso> v, ok := map["key"] // ok == false, if the key doesn't exist
22:23 < hopso> And true if it exists, of course.
22:23 -!- virtualsue [~chatzilla@host81-139-80-186.in-addr.btopenworld.com] has
quit [Quit: ChatZilla 0.9.86.1 [Firefox 4.0/20110318052756]]
22:24 < jeremy_c> oh, that's simple enough.  It would be kind of nice to say
that in the lang spec, would avoid some questions maybe.  Thanks hopso
22:24 <+iant> jeremy_c: it is in the language spec; see
http://golang.org/doc/go_spec.html#Indexes
22:25 < jeremy_c> ah, I see.  I just saw the TOC for Map type and was
looking under the Map type docs.  Didn't think to look in the Indexes section,
guess it makes sense.
22:26 < jeremy_c> Guess I should really read the whole doc, but I get the
basics (hello world :-)) and get too eager to develop something useful :-/
22:39 -!- kr [~Keith@204.14.152.118] has quit [Ping timeout: 240 seconds]
22:43 -!- firwen [~firwen@2a01:e34:eea3:7e10:4a5b:39ff:fe51:e8ae] has quit [Remote
host closed the connection]
22:47 -!- ako [~nya@fuld-590c7733.pool.mediaWays.net] has joined #go-nuts
22:48 -!- aho [~nya@fuld-590c74dd.pool.mediaWays.net] has quit [Disconnected by
services]
22:48 < krutcha> if you extract a string by slicing another string, does it
continue to reference the original memory?
22:52 -!- imsplitbit [~imsplitbi@66.78.236.243] has quit [Quit: Leaving...]
22:56 -!- iant [~iant@nat/google/x-ulruxtxjkremarvt] has quit [Quit: Leaving.]
23:02 -!- Project-2501 [~Marvin@82.84.80.8] has quit [Quit: E se abbasso questa
leva che succ...]
23:05 -!- Venom_X [~pjacobs@75-27-133-72.lightspeed.austtx.sbcglobal.net] has quit
[Quit: Venom_X]
23:05 -!- skelterjohn [~jasmuth@c-24-0-2-70.hsd1.nj.comcast.net] has quit [Quit:
skelterjohn]
23:08 < jessta_> krutcha: yes
23:09 < krutcha> but the new strings are immutable and thus bounded from
referencing the rest of the original source?
23:10 -!- mbejar [~mbejar@9.Red-79-159-118.staticIP.rima-tde.net] has quit [Quit:
mbejar]
23:10 < ab3> hello
23:10 < krutcha> basically I was tokenizing a string, got back some pieces,
but wanted to take one of those tokens "plus some" from the original string
23:10 < ab3> is there an easy way to read a fd and get newlines?
23:11 < aiju> yes
23:11 < aiju> bufio
23:11 -!- kr [~Keith@204.14.152.118] has joined #go-nuts
23:13 < ab3> ok thx
23:14 < ab3> the go doc can be a bit confusing to navigate
23:16 < ab3> python made me laizy in this respect.
23:17 -!- KBme [~KBme@2001:470:1f13:94::3] has quit [Read error: Operation timed
out]
23:21 -!- a2800276 [~a2800276@xdsl-195-14-206-249.netcologne.de] has quit [Quit:
a2800276]
23:22 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has quit
[Quit: Leaving.]
23:22 -!- KBme [~KBme@2001:470:1f13:94::3] has joined #go-nuts
23:26 -!- dave [~dfc@eth59-167-133-99.static.internode.on.net] has joined #go-nuts
23:26 -!- nkdnstbr [~nkdnstbr@cpe-173-172-231-83.rgv.res.rr.com] has joined
#go-nuts
23:29 < plexdev> http://is.gd/daadOx by [Rob Pike] in go/src/pkg/rpc/ --
rpc: run benchmarks over HTTP as well as direct network connections.
23:29 -!- krutcha [~krutcha@remote.icron.com] has quit [Quit: Leaving]
23:30 -!- kr [~Keith@204.14.152.118] has quit [Quit: WeeChat 0.3.2]
23:30 -!- kr [~Keith@204.14.152.118] has joined #go-nuts
23:32 < jessta_> ab3: doesn't python also have docs that you need to read?
23:32 -!- imsplitbit [~imsplitbi@66.78.236.243] has joined #go-nuts
23:32 -!- Scorchin [~Scorchin@host109-156-219-145.range109-156.btcentralplus.com]
has quit [Quit: Scorchin]
23:36 -!- iant [~iant@66.109.105.216] has joined #go-nuts
23:36 -!- mode/#go-nuts [+v iant] by ChanServ
23:36 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Ping timeout: 240 seconds]
23:37 < ab3> jessta_: yes, bu you can find stuff much easyier, there is no
mention of bufio in either io of ioutil
23:38 < aiju> the package list is not long
23:39 < ab3> I am not under any impression that i can write go without
reading doc, you suggesting otherwise is bordering on trolling
23:39 < hopso> Taking a while to read the packages page well is totally
worth it
23:40 < ab3> aiju: are you kidding me
23:40 < hopso> I read it carefully some time ago and realised I had written
lots of unnecessary code.
23:40 < aiju> ab3: no
23:41 < aiju> ab3: esp.  if you ignore all the special purpose package
(basically everything crypto and such)
23:41 < aiju> +s
23:44 -!- tvw [~tv@e176004116.adsl.alicedsl.de] has quit [Remote host closed the
connection]
23:44 -!- imsplitbit [~imsplitbi@66.78.236.243] has quit [Quit: Leaving...]
23:45 -!- GeertJohan [~Squarc@D978EC5D.cm-3-1d.dynamic.ziggo.nl] has quit [Quit:
Leaving.]
23:47 < jessta_> ab3: bufio is in bufio
23:47 -!- hopso [5b9a092a@gateway/web/freenode/ip.91.154.9.42] has quit [Ping
timeout: 252 seconds]
23:47 < jessta_> you can type 'godoc bufio' in a shell
23:49 -!- Tuller [~tuller@c-69-143-48-210.hsd1.va.comcast.net] has joined #go-nuts
23:53 < ab3> jessta_: thx your helpful remark is helpful
23:56 -!- mbejar [~mbejar@9.Red-79-159-118.staticIP.rima-tde.net] has joined
#go-nuts
23:57 -!- Tuller [~tuller@c-69-143-48-210.hsd1.va.comcast.net] has quit [Quit:
muffins]
--- Log closed Wed Apr 27 00:00:50 2011