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

--- Log opened Sun Aug 08 00:00:05 2010
00:10 -!- grncdr [~stephen@sdo.csc.UVic.CA] has quit [Ping timeout: 265 seconds]
00:10 -!- grncdr [~stephen@sdo.csc.UVic.CA] has joined #go-nuts
00:15 -!- Ginto8 [~joe@pool-173-61-45-40.cmdnnj.fios.verizon.net] has joined
#go-nuts
00:18 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has quit [Quit: Lost
terminal]
00:19 -!- MizardX [~MizardX@unaffiliated/mizardx] has quit [Ping timeout: 240
seconds]
00:19 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has left #go-nuts
["Leaving..."]
00:24 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
00:30 -!- diegoviola [~diego@190.23.52.64] has joined #go-nuts
00:31 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts
00:31 -!- diegoviola [~diego@190.23.52.64] has left #go-nuts []
00:36 -!- tvw [~tv@e176011006.adsl.alicedsl.de] has quit [Ping timeout: 265
seconds]
00:37 -!- Tiger__ [~chatzilla@118.126.12.53] has quit [Ping timeout: 248 seconds]
00:52 -!- grncdr [~stephen@sdo.csc.UVic.CA] has quit [Remote host closed the
connection]
00:53 -!- grncdr [~stephen@sdo.csc.UVic.CA] has joined #go-nuts
01:00 -!- nettok [~quassel@200.119.150.30] has joined #go-nuts
01:02 -!- grncdr [~stephen@sdo.csc.UVic.CA] has quit [Ping timeout: 260 seconds]
01:02 -!- grncdr [~stephen@sdo.csc.UVic.CA] has joined #go-nuts
01:08 -!- Wiz126 [~Wiz126@24.229.245.72.res-cmts.sm.ptd.net] has quit [Ping
timeout: 240 seconds]
01:09 -!- grncdr [~stephen@sdo.csc.UVic.CA] has quit [Ping timeout: 240 seconds]
01:09 -!- Wiz126 [~Wiz126@24.229.245.72.res-cmts.sm.ptd.net] has joined #go-nuts
01:10 -!- grncdr [~stephen@sdo.csc.UVic.CA] has joined #go-nuts
01:10 -!- nighty^ [~nighty@x122091.ppp.asahi-net.or.jp] has joined #go-nuts
01:16 -!- grncdr [~stephen@sdo.csc.UVic.CA] has quit [Ping timeout: 245 seconds]
01:17 -!- grncdr [~stephen@sdo.csc.UVic.CA] has joined #go-nuts
01:25 -!- diegoviola [~diego@190.23.52.64] has joined #go-nuts
01:34 -!- grncdr [~stephen@sdo.csc.UVic.CA] has quit [Ping timeout: 265 seconds]
01:38 -!- dacc [~dan@c-67-171-32-251.hsd1.wa.comcast.net] has joined #go-nuts
01:39 -!- grncdr [~stephen@sdo.csc.UVic.CA] has joined #go-nuts
01:40 < dacc> do I need to do anything to get the "C" package?  doesn't seem
to be getting installed
01:41 < i__> you need to use cgo
01:41 < dacc> oh right, makes sense -- thanks
01:43 < i__> it's not a real package, it just tells cgo to include the files
above the import
01:46 < dacc> i'm trying to compile the readline bindings on darwin.
getting: "readline.go:6[readline.cgo1.go:8]: undefined: _C_char"
01:47 -!- SRabbelier [~SRabbelie@ip138-114-211-87.adsl2.static.versatel.nl] has
quit [Ping timeout: 276 seconds]
01:47 < dacc> looks like that's the very first C type it tries to declare a
variable with
01:47 -!- SRabbelier [~SRabbelie@ip138-114-211-87.adsl2.static.versatel.nl] has
joined #go-nuts
01:48 < dacc> http://bitbucket.org/taruti/go-readline
01:51 < i__> try to change that to *C.char
01:52 -!- carllerche [~carllerch@208.87.61.203] has quit [Quit: carllerche]
01:52 -!- boscop_ [~boscop@f055001174.adsl.alicedsl.de] has joined #go-nuts
01:53 -!- grncdr [~stephen@sdo.csc.UVic.CA] has quit [Ping timeout: 276 seconds]
01:54 -!- grncdr [~stephen@sdo.csc.UVic.CA] has joined #go-nuts
01:55 -!- boscop [~boscop@g226252192.adsl.alicedsl.de] has quit [Ping timeout: 265
seconds]
01:57 < dacc> hmm, same =\
01:58 < dacc> oh hey, *C.char works
02:01 < diegoviola> I'm a web developer, how can Go help me?
02:02 < diegoviola> I'm currently using ruby for all my web development and
server-side stuff
02:02 < jessta> diegoviola: Go is faster and lighter than ruby
02:02 < jessta> with better support for concurrency
02:02 < diegoviola> interesting
02:02 -!- gnuvince [~vince@70.35.167.165] has quit [Ping timeout: 246 seconds]
02:03 < jessta> it's also statically typed, so there are less runtime type
errors
02:03 -!- gnuvince [~vince@70.35.168.147] has joined #go-nuts
02:04 < jessta> diegoviola: for web development you might want to look at:
http://www.getwebgo.com/
02:05 < jessta> it's only the begining of a webdev framework, but all the
parts are there
02:08 < diegoviola> thanks
02:10 -!- getisboy [~Family@c-24-62-121-0.hsd1.ma.comcast.net] has joined #go-nuts
02:10 -!- nettok [~quassel@200.119.150.30] has left #go-nuts []
02:21 -!- gnuvince [~vince@70.35.168.147] has quit [Quit: Via SOAP!  VIA SOAP!!]
02:21 -!- gnuvince [~vince@70.35.162.157] has joined #go-nuts
02:30 < Makoryu> Is there a working definition of "systems programming" as
the Go authors understand it?
02:38 < jessta> Makoryu: the wikipedia definition seems to cover it pretty
well
02:41 -!- gnuvince [~vince@70.35.162.157] has quit [Ping timeout: 245 seconds]
02:41 < jessta> I'm amazed that people pick up on that as an issue
02:42 -!- gnuvince [~vince@72.0.215.137] has joined #go-nuts
02:47 < Makoryu> That was curiosity, not an accusation of incompetence
02:49 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has quit [Ping timeout:
246 seconds]
02:49 < Makoryu> Though any language that wasn't already mainstream four
years ago will get more than its share of weird flamewars
02:54 < jessta> yeah, lots of flamewars and bikesheds
02:57 < diegoviola> i hear "Go will replace C" and stuff like that, what do
you think of this?
02:58 < Makoryu> For some things, sure, it could
02:59 < Makoryu> Though, most of the C code that Go could replace could also
be replaced by Haskell
03:02 < Makoryu> diegoviola: Nobody really wants to replace C right now in
the (very important) niches where it's really necessary
03:02 < jessta> diegoviola: Go has replaced C for me
03:03 < diegoviola> nice
03:03 < diegoviola> how can I give Go a try?
03:04 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Read error: Operation
timed out]
03:04 * diegoviola going to golang.org
03:04 < jessta> diegoviola: watch the videos, read "effective Go" and read
the whole spec
03:04 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
03:06 < diegoviola> ok, does go has an interactive shell?  similar to irb in
ruby?
03:06 < Makoryu> No.
03:06 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Ping
timeout: 264 seconds]
03:08 < jessta> diegoviola: it has exp/eval, but it doesn't allow for the
import of packages
03:08 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
03:08 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Excess
Flood]
03:08 < jessta> because Go currently has no dynamic loading
03:09 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
03:09 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Excess
Flood]
03:09 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
03:09 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Excess
Flood]
03:09 -!- getisboy [~Family@c-24-62-121-0.hsd1.ma.comcast.net] has left #go-nuts
[]
03:10 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
03:35 -!- dacc [~dan@c-67-171-32-251.hsd1.wa.comcast.net] has quit [Quit: dacc]
03:45 -!- allengeorge [~allengeor@74.12.150.7] has quit [Quit: allengeorge]
03:53 -!- dacresni [~dacresni@adsl-70-130-154-21.dsl.stlsmo.swbell.net] has joined
#go-nuts
03:53 < dacresni> im having trouble reading these function declarations im
use to c and python
03:53 < dacresni> func (file *File) Read(b []byte) (n int, err Error)
03:54 < dacresni> the docs say reads up to len(b) bytes but
03:54 < smw> but?
03:54 < dacresni> is b the buffer variable or a number you gave it as the
number of bytes to read
03:55 < dacresni> sorry, it was a long line
03:55 < Makoryu> dacresni: "(file *File)" is the equivalent of "self" in
Python
03:55 < Makoryu> dacresni: "(n int, err Error)" are the return values
03:55 < dacresni> that explains a lot thanks
03:56 < dacresni> so then b isn array of bytes
03:56 < Makoryu> Yes
03:56 < dacresni> right?
03:56 < dacresni> thanks
03:56 < dacresni> ok, so, i have to give it a byte array and it will
automatically try to fill that buffer, cool
03:57 < jessta> dacresni: b is a slice
03:57 < jessta> a byte slice
03:57 < Makoryu> Oh, yeah
03:57 < Makoryu> dacresni: An array variable can actually have any of
several types in Go
03:57 < dacresni> so where do i declare the memory i want to read the file
into?
03:58 < jessta> dacresni: you make a slice and pass it in to Read()
04:01 < jessta> so, b:= make([]byte, 10, 10); num,err := file.Read(b)
04:01 < dacresni> hmm
04:01 < jessta> and read will block until it's read 10 bytes or had an error
04:01 < dacresni> ah
04:02 < smw> dacresni, EOF is an error
04:02 -!- plexdev [~plexdev@arthur.espians.com] has quit [Remote host closed the
connection]
04:02 < dacresni> ah, ok
04:03 < smw> dacresni, so are many other things of course.  But that is the
most likely
04:03 < dacresni> right
04:03 < smw> s/likely/common
04:04 -!- plexdev [~plexdev@arthur.espians.com] has joined #go-nuts
04:07 < dacresni> is anyone planning/working on a gui binding for this
language?
04:07 < dacresni> i know that wasn't its design intent
04:08 < jessta> there are gtk bindings
04:08 < dacresni> already?
04:08 < dacresni> hmm
04:08 < dacresni> and QT is a little tied to c++ at the moment to support a
different compiled languate
04:08 < smw> dacresni, I can not think of many languages that were made for
gui :-)
04:08 < diegoviola> why is Qt so tied to C++?
04:09 < diegoviola> I wish it wasn't
04:09 < smw> the issue is that QT is built in C++
04:09 < dacresni> they have their own object class
04:09 < smw> gtk is built in C
04:09 < jessta> dacresni: http://github.com/mattn/go-gtk
04:10 < diegoviola> is it impossible to make a widget and make it language
independant?
04:10 < jessta> I think Go has swig support now, so QT bindings should be
possible
04:10 < dacresni> the hole MOC thing in QT is essentially templating on top
of templates
04:10 < dacresni> there is a meta templating in the preprocessor
04:10 < dacresni> then there's the templating in the language itself
04:11 -!- SingAlong [~akash@117.192.197.161] has joined #go-nuts
04:11 < SingAlong> hi all
04:11 < dacresni> ah
04:11 < dacresni> hello
04:11 < smw> Lets all SingAlong
04:11 < SingAlong> in what language should I write libraries for go?  In C
or go itself?
04:11 < smw> go
04:12 < smw> go is not like python where libs are written in another
language for performance reasons.
04:12 < SingAlong> smw: I thought I could contribute by writing a lib to
connect to some db.  Can anyone provide some starting point?  Never written a lib
for a db in any language
04:12 < smw> although, even python likes python code over C
04:12 < smw> SingAlong, which db?
04:13 < SingAlong> smw: I'm thinking sqlite.  Coz it's small and nice :)
04:13 < smw> there are already C bindings I think.
04:13 < jessta> SingAlong: there are bindings for a few db already, sqlite,
mysql, postgres
04:13 < SingAlong> ah!  any other libs that dont exist?  gd?
04:13 < dacresni> so, jessta why would i use make instead of new?
04:14 < jessta> dacresni: make() makes things, new allocates memory
04:14 < jessta> dacresni: you make slices, maps and channels.
04:15 < smw> SingAlong, I want a decent http client lib.  Look at the http
package.
04:15 < dacresni> but i just want to allocate memory,
04:15 < dacresni> once
04:15 < dacresni> I'll be making repeted calls to read
04:15 < smw> SingAlong, it needs serious help.
04:15 < SingAlong> jessta: a doubt, when i write a bindings for some lib
like gd, do i just execute the OS command and get the resulting output?
04:15 < SingAlong> smw: you mean a wrapper for the already existing http lib
to make it easier to use?
04:16 < dacresni> SingAlong: gd ? whats that?
04:16 < smw> SingAlong, the actual lib has issues.  You can not make a
request object and send it :-\
04:16 < SingAlong> dacresni: GD. the image processing lib.  Like imagemagik
04:16 < jessta> dacresni: slices,maps and channels require construction than
just allocating memory, that's what make does
04:17 < smw> SingAlong, sorry.  "struct" not "object"
04:17 < SingAlong> dacresni: http://www.libgd.org/
04:17 < dacresni> im taking small steps here, I am recreating a project i
did for my OS class in GO so i can learn the language
04:17 < jessta> dacresni: you can just reuse the slice you made with each
call to Read
04:17 < dacresni> ah
04:18 < dacresni> ok, cause the assignment was to open a file and count the
occurance of a certain charactar in it
04:18 < jessta> dacresni: or you can make a slice that has a large capacity
and slice that as needed
04:19 -!- jdp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has joined #go-nuts
04:20 < smw> SingAlong, making the http client lib useful seems like a great
project
04:20 < SingAlong> smw: thanks!  :)
04:21 < smw> SingAlong, if you want, I can give you specifics of what is
wrong with it or what features I can think of.
04:26 < dacresni> so sense i want to compare 1 byte of my array at a time, i
should do slab:=make(byte[],1,1024) ?
04:29 < dacresni> woops
04:29 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
04:29 < dacresni> slab:=make([]byte,1,1024
04:34 -!- SingAlong [~akash@117.192.197.161] has quit [Ping timeout: 265 seconds]
04:40 < dacresni> reading the portion of the docs on slices is really
confusing when you're constantly thinking about python slices
04:40 < dacresni> i need to get rid of that
04:44 < dacresni> the pkg dir of golang.org is getting worringly long, there
are about 4 datatypes from the c++ STL have been ported
04:44 < dacresni> which i think is going against the purpose of the language
04:45 < dacresni> like python.  you are able to do most of what u need to do
with the native datastructures
04:45 < dacresni> and there arent' that man\y of them
04:46 < exch> luckily you don't have to use any of them
04:47 < jessta> dacresni: python also loses alot by not having fine grained
control about how those native datastructures work
04:48 < jessta> pythons list is a vector, a vector is slow if all you need
is a slice
04:48 < dacresni> u mean the user doesn't have fine graned controle
04:48 < dacresni> ?
04:48 < dacresni> because how they are made is quite neat
04:49 < dacresni> and when u use them properly, you dont need fine graned
controll
04:49 < dacresni> if u want that, you should be using c++ or c
04:49 < jessta> or Go
04:49 < dacresni> like, if you need to over right the allocator
04:50 < dacresni> of your specific type of your container template class,
you put that parameter into the template delcaration
04:53 -!- Kylarr [Kyle@122-148-63-115.static.dsl.dodo.com.au] has quit []
04:53 < jessta> if you need a linked list, you'd still need to implement it
in python
04:58 < dacresni> why would u?
04:58 < dacresni> its a list
04:58 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: I ♥ Unicode]
04:59 < jessta> dacresni: but in a python list isn't a linked list
04:59 < dacresni> then what is it?
05:00 < jessta> it's a vector
05:00 < dacresni> and why does it matter ?
05:00 < dacresni> cause its still a list
05:00 < dacresni> links imply actuall use of pointers
05:00 -!- SingAlong [~akash@117.192.197.161] has joined #go-nuts
05:00 < dacresni> and ability to manipulate them
05:00 < dacresni> appending is still O(1)
05:00 -!- smw [~smw@pool-71-183-88-124.nycmny.fios.verizon.net] has quit [Remote
host closed the connection]
05:00 < dacresni> and indexing is stll O(n)
05:01 < dacresni> actually O(n/2)
05:01 < jessta> and inserting?
05:01 -!- nighty^ [~nighty@x122091.ppp.asahi-net.or.jp] has quit [Read error:
Connection reset by peer]
05:01 < dacresni> O(1)
05:02 < dacresni> you should read how python does memory
05:03 < dacresni> the only time you should have to think about python is
doing memory is when you're using immutable types
05:03 -!- scm [justme@d056009.adsl.hansenet.de] has quit [Ping timeout: 252
seconds]
05:03 < dacresni> otherwise you should really only be thinking about the
algorithm not the underlying datastructures
05:05 -!- scm [justme@d070010.adsl.hansenet.de] has joined #go-nuts
05:05 < dacresni> you could impliment union find in python but to actaully
get the crazy algorithm, you must either start implimenting it as an extention or
start creating classes
05:05 < dacresni> which is overdoing it
05:27 < KirkMcDonald> Inserting into a Python list is O(n).
05:27 < KirkMcDonald> Indexing a Python list is O(1).
05:28 < KirkMcDonald> Appending is amortized O(1).
05:32 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
05:37 < dacresni> why?
05:38 < dacresni> i thought python lists were linked behind scenes
05:38 < dacresni> why shouldn't insertion be constant time?
05:40 < KirkMcDonald> dacresni: They are not.
05:40 < KirkMcDonald> dacresni: They are dynamic arrays.
05:40 < dacresni> first explain what a dynamic array is, then explain how
they can do that with hetergenious lists
05:40 < dacresni> please
05:41 < KirkMcDonald> A dynamic array is an array which can change its size.
05:42 < KirkMcDonald> In Go terms, you would have a slice over an underlying
storage array.  Appending to the slice past the end of the array involves
allocating a new array twice the size of the old, and copying the data over.
05:43 < KirkMcDonald> This causes appends to happen in amortized constant
time.  The cost of the copy is amortized over the effectively free appends in all
other cases.
05:44 -!- dacc [~dan@c-67-171-32-251.hsd1.wa.comcast.net] has joined #go-nuts
05:46 < KirkMcDonald> Thus: O(1) indexing, O(n) inserts (since an insertion
needs to move all of the later entries over), and so on.
05:46 < dacresni> ok, but sense python is written in c, (at least the
builtin part) why dont u explain it in c terms
05:46 < dacresni> kidding
05:49 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
05:49 < dacresni> oh well,
05:50 < dacresni> so are there guidelines on when to use var and when not to
05:50 < dacresni> written somewhere?
05:52 < KirkMcDonald> Not really.
05:52 < KirkMcDonald> If it's a package-level variable, you have to use it.
05:52 < KirkMcDonald> If you don't have a specific initializer, you have to
use it.  (Though that's unusual.)
05:59 -!- zozoR [~zozoR@x1-6-00-0e-2e-a3-e0-23.k377.webspeed.dk] has joined
#go-nuts
06:03 < dacresni> thanks,
06:03 < dacresni> that helps a lot
06:04 < dacresni> well, you've all been a grate help
06:04 < dacresni> c ya
06:04 -!- dacresni [~dacresni@adsl-70-130-154-21.dsl.stlsmo.swbell.net] has left
#go-nuts []
06:05 -!- Makoryu [~vt920@pool-71-174-191-10.bstnma.fios.verizon.net] has quit []
06:06 < dacc> any idea how to treat a StringVector like a []string?  from my
limited knowledge I thought this would work: http://gist.github.com/513646
06:09 < KirkMcDonald> dacc: Notice that what you've got there isn't a
StringVector, but a *StringVector.
06:10 < dacc> KirkMcDonald: ah there we go: []string(*v)
06:10 < dacc> thanks =)
06:11 < xb95> fascinating, you have to have the opening curly braces on the
line that starts the block.  "func main()\n{" is invalid to 6g
06:13 < cbeck> xb95: yup, because func main()\n{ -> func main();\n{ when
you compile
06:14 < cbeck> http://golang.org/doc/go_spec.html#Semicolons
06:15 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 264 seconds]
06:16 < xb95> cbeck: ah-hah, thanks for that link.  I was going crazy trying
to find somewhere that indicate this.  particularly because the error I ran into
at first was "((node CMPSTR)) || ((node CMPSTR)) not used
06:16 < xb95> when I was trying to build a multi-line if statement
06:16 < xb95> it makes more sense now.
06:17 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
06:19 < cbeck> I did exactly the same thing
06:19 < xb95> hah
06:32 -!- awidegreen [~quassel@62.176.237.78] has joined #go-nuts
06:32 < taruti> are "for range" loops with slices optimized with gc?
06:32 < KirkMcDonald> taruti: What do you mean?
06:34 < taruti> KirkMcDonald: are "for i:=0; i<len(A); i++ { foo(A[i]) }
" and "for v := range A { foo(v) }" equivalent
06:34 < KirkMcDonald> I would expect so.
06:35 -!- ghiu [~gu@93-32-144-8.ip33.fastwebnet.it] has joined #go-nuts
06:36 < KirkMcDonald> (Though it's "for _, v := range A".)
06:37 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
#go-nuts
06:39 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Remote host
closed the connection]
06:41 < taruti> hmm, after testing the range one produces slower code atm
06:43 < KirkMcDonald> I don't think there's any reason why it should.
06:44 < cbeck> the v will be a copy of the element at A[i], I imagine
there's a fair bit of overhead there
06:44 < KirkMcDonald> cbeck: Depends on what kind of thing it is.
06:44 < KirkMcDonald> If the elements are pointers...
06:45 < KirkMcDonald> And, anyway, foo(A[i]) will make a copy, too, yes?
06:45 < cbeck> KirkMcDonald: Then it'll be a copyof the pointer, so less
overhead certainly
06:45 < cbeck> True
06:45 < cbeck> But then you're talking 2 copies vs.  one
06:46 < KirkMcDonald> A sufficiently intelligent opimizer could remove one
of those copies, heh.
06:46 < KirkMcDonald> optimizer*
06:46 < cbeck> I'm curious what the type of A was in taruti's tests
06:46 < jessta> cbeck: you could do, for i,_:= range A {foo(A[i]}
06:46 < cbeck> jessta: I do, and you can omit the , _
06:47 < jessta> I like my '_'s, I like to know when I'm ignoring something
06:48 < cbeck> fair enough
06:49 < jessta> if I had it my way, every function the returns something
would be required to have that assigned to something
06:49 -!- SingAlong [~akash@117.192.197.161] has quit [Ping timeout: 252 seconds]
06:51 < jessta> I think go makes it a little too easy to secretly ignore
errors
06:55 < taruti> cbeck: http://pastebin.com/dSwftnsh
06:56 -!- g0bl1n [~anonymous@a213-22-18-58.cpe.netcabo.pt] has joined #go-nuts
07:17 -!- SingAlong [~akash@117.192.197.161] has joined #go-nuts
07:17 -!- kanru [~kanru@61-228-156-150.dynamic.hinet.net] has quit [Ping timeout:
264 seconds]
07:21 < cbeck> jessta: I'd certainly like to see an analogue of -Wall which
might do just that
07:22 -!- g0bl1n [~anonymous@a213-22-18-58.cpe.netcabo.pt] has quit [Quit: g0bl1n]
07:25 -!- MizardX [~MizardX@unaffiliated/mizardx] has joined #go-nuts
07:27 -!- carllerche [~carllerch@208.87.61.203] has joined #go-nuts
07:34 -!- tvw [~tv@e176003151.adsl.alicedsl.de] has joined #go-nuts
07:35 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Ping
timeout: 240 seconds]
07:51 -!- TR2N [email@89-180-152-111.net.novis.pt] has quit [Quit: Time left until
the Epochalypse: 27yrs 23wks 3days 1hr 21mins 27secs]
08:00 -!- SingAlong [~akash@117.192.197.161] has quit [Ping timeout: 248 seconds]
08:01 -!- aho [~nya@fuld-4d00d5da.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
08:05 < MizardX> fmt.Sprintf("%q", string([]int{int(b)}))
08:07 -!- Wiz126 [~Wiz126@24.229.245.72.res-cmts.sm.ptd.net] has quit [Ping
timeout: 276 seconds]
08:07 -!- Wiz126 [~Wiz126@24.229.245.72.res-cmts.sm.ptd.net] has joined #go-nuts
08:07 -!- nighty^ [~nighty@x122091.ppp.asahi-net.or.jp] has joined #go-nuts
08:08 -!- kanru [~kanru@61-228-155-24.dynamic.hinet.net] has joined #go-nuts
08:25 -!- path[l] [UPP@120.138.102.50] has quit [Quit: path[l]]
08:27 -!- snearch [~snearch@f053007064.adsl.alicedsl.de] has joined #go-nuts
08:31 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-180-250.clienti.tiscali.it] has
joined #go-nuts
08:38 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.2]
09:02 -!- carllerche [~carllerch@208.87.61.203] has quit [Quit: carllerche]
09:08 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 276 seconds]
09:09 < araujo> anybody knows how to use the method: func (v
*InterfaceValue) Set(x Value) ??
09:09 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
#go-nuts
09:13 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Read error:
Connection timed out]
09:14 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
09:14 * araujo wonders if his last message arrived
09:14 < araujo> anybody knows how to use the method: func (v
*InterfaceValue) Set(x Value) ??
09:19 < manveru> araujo: from the reflect package?
09:19 < araujo> Correct manveru
09:19 < manveru> uh, that stuff was twisted...
09:19 < araujo> manveru, all the issues fall to create a valid
"*reflect.InterfaceValue" that I can properly use it seems
09:19 < araujo> hehehe yeah don't tell me :P
09:20 < manveru> i think you can use NewValue
09:20 < araujo> I have tried plenty of combination ...  and nothing yet ...
:(
09:20 < manveru> wanna show the code?
09:20 < ghiu> hi, sorry for the dumb question, but why "\n" doesnt work as
exped?  i mean, how do i put a line end in a string?
09:21 -!- boscop_ [~boscop@f055001174.adsl.alicedsl.de] has left #go-nuts []
09:21 < manveru> ghiu: it works
09:21 -!- boscop [~boscop@f055001174.adsl.alicedsl.de] has joined #go-nuts
09:22 < araujo> interfaceValue :=
reflect.NewValue(new(reflect.InterfaceValue))
09:22 < ghiu> oh, it wasn't working with the `` notation
09:22 < araujo> manveru, that gives me a : *reflect.PtrValue Type
09:23 < araujo> manveru, I am trying like that right now...
09:25 < manveru> araujo: no, code i can work with :)
09:25 < manveru> i have no idea what you're trying to do
09:26 < manveru> you can paste and execute go code at http://ideone.com/
09:26 < araujo> manveru, ooh, it is a bit big, but, if you stay around, I
could code a snippet fast
09:26 < manveru> yes please
09:27 < manveru> i'll have to leave for a bit in half an hour...  but i can
answer later anyway
09:27 < araujo> thanks ok, i do it :)
09:32 < ghiu> hey, any hit why this "ioutil.WriteFile(sessionFile,
make([]byte, 0), 660)" fails to write permissions and i get this?  "--w----r--"
09:34 < manveru> ghiu: 0660
09:34 < manveru> file permissions are octal
09:34 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has quit [Quit:
slashus2]
09:35 < ghiu> oh, ok
09:35 < ghiu> thanks :)
09:36 < araujo> http://ideone.com/ugBul
09:36 < araujo> manveru, basically that
09:37 < araujo> I commented the line of what I want to do, but like that it
cannot be done ...  pretty much the issue I have
09:37 < manveru> uh
09:37 < araujo> (and that website is very cool :D)
09:39 < manveru> i don't think that you can replace the value of an int...
09:39 < manveru> what's your usecase?
09:41 < araujo> manveru, I want to use Call() , with an array of
InterfaceValues
09:41 < araujo> pretty much it
09:41 < manveru> Call?
09:41 < araujo> so I am trying to convert everything to InterfaceValue
09:42 < araujo> func (fv *FuncValue) Call(in []Value) []Value
09:42 < araujo> from reflect too
09:42 < manveru> how on earth did you end up with an array of
InterfaceValue?
09:42 < KirkMcDonald> Perhaps the function accepts a series of interfaces.
09:42 < manveru> i mean...  i know it's possible, but why?
09:43 < araujo> manveru, that is what I want to do, I still don't end up
with that
09:43 < araujo> KirkMcDonald, Correct
09:43 < araujo> the function accepts interfaces
09:48 < ghiu> how can i read the directory content?
09:49 < ghiu> i've seen readdir, but it is a method of a file type.  what
file should i open?  the directory itself?  with what kind of persmissions?
09:54 < vrtical> ioutil.ReadDir would seem to be what you want
09:54 < vrtical> func ReadDir(dirname string) ([]*os.FileInfo, os.Error)
09:54 < ghiu> oh, thanks, missed it
09:59 -!- SingAlong [~akash@117.192.197.161] has joined #go-nuts
09:59 < KirkMcDonald> araujo: I've found a stupid way to do it.
10:00 < KirkMcDonald> araujo: http://paste.pocoo.org/show/247584/
10:03 < araujo> KirkMcDonald, I am all ears (eyes) :D
10:04 < KirkMcDonald> If you get a Value of *I, then indirect that Value,
you get what you need.
10:06 -!- diegoviola [~diego@190.23.52.64] has quit [Quit: ""I die for my nation"
— Francisco Solano López"]
10:07 < araujo> KirkMcDonald, ooh, and I get the interface{} ?
10:08 -!- ikaros [~ikaros@188.107.214.192] has joined #go-nuts
10:12 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
10:13 -!- kw- [~user@d86-33-191-122.cust.tele2.at] has joined #go-nuts
10:14 -!- photron [~photron@port-92-201-58-166.dynamic.qsc.de] has joined #go-nuts
10:18 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined
#go-nuts
10:21 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts
10:21 -!- jA_cOp [~yakobu@unaffiliated/ja-cop/x-9478493] has joined #go-nuts
10:22 -!- General13372 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has quit
[Ping timeout: 246 seconds]
10:22 -!- ghiu [~gu@93-32-144-8.ip33.fastwebnet.it] has quit [Quit: ghiu]
10:28 < araujo> KirkMcDonald, that seems to work ..  mmmmm let's see
10:34 < araujo> It worked!!!!
10:34 < araujo> for { KirkMcDonald += 1 }
10:37 < araujo> pretty much the secret is in the &interfaceValue ....
10:37 < araujo> mmm..  interesting
10:42 < SingAlong> is there a way to generate unique random strings?
10:51 < Namegduf> Keep a map of already used values.
10:51 < Namegduf> Keep an int64, starting at 0.
10:52 < Namegduf> Every time you generate one, increment it until you find
an unused value, then stringify.
10:52 < Namegduf> Works with wrapping over in the distant future.
10:53 < SingAlong> Namegduf: I dont want just numbers.  I was looking for
alphanumeric strings.
10:53 < Namegduf> Base 64 encode it at "stringify".
10:54 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Read error:
Connection reset by peer]
10:55 < Namegduf> That guarantees uniqueness, but at the cost of keeping
record of all already used values, which will be heavy if you generate lots.
10:55 < Namegduf> If you don't need a strict guarantee, you can drop the
map.
10:55 < Namegduf> Obviously, if you're using them somewhere else, you can
check said somewhere else in place of having a local map.
10:56 < Namegduf> If you don't want strings more than a short length, you
can put a lower cap on the int64 than its true maximum.
10:58 < Namegduf> You can also use hashes, which don't need storage of
previous values; they don't guarantee uniqueness, but the risk of collision is
very, very low.  The cons are that they require unique input each time, which is
easy to make likely (with the time added) and hard to guarantee, and that they're
very long.
11:04 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Ping timeout: 276 seconds]
11:17 -!- ghiu [~gu@93-32-144-8.ip33.fastwebnet.it] has joined #go-nuts
11:30 -!- mahemoff [~mahemoff@87-194-3-205.bethere.co.uk] has joined #go-nuts
11:32 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
11:50 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
11:52 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
12:06 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
12:11 -!- kw- [~user@d86-33-191-122.cust.tele2.at] has quit [Ping timeout: 265
seconds]
12:23 -!- anon412315 [debian-tor@gateway/tor-sasl/digitalwatches] has joined
#go-nuts
12:31 -!- DigitalWatches [debian-tor@gateway/tor-sasl/digitalwatches] has quit
[Quit: leaving]
12:33 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
12:43 -!- Maxdamantus [~m@203-97-238-106.cable.telstraclear.net] has quit [Ping
timeout: 260 seconds]
12:43 -!- Maxdamantus [~m@203-97-238-106.cable.telstraclear.net] has joined
#go-nuts
12:53 -!- Ina [~ina@75.150.229.190] has quit [Ping timeout: 265 seconds]
12:55 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Ping timeout: 240 seconds]
12:58 -!- ikaros [~ikaros@188.107.214.192] has quit [Quit: Leave the magic to
Houdini]
12:58 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 276 seconds]
13:09 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
#go-nuts
13:15 < araujo> there exist something like a "C union" in Go ?
13:16 < exch> nope
13:16 < exch> Would be nice to have though
13:19 < napsy> you have constants for that
13:19 < napsy> + the iota operator
13:20 -!- jA_cOp [~yakobu@unaffiliated/ja-cop/x-9478493] has quit [Ping timeout:
240 seconds]
13:20 < Ginto8> well also you *can* use interfaces for a similar (albeit
definitely not the same) effect
13:28 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Read error:
Connection timed out]
13:29 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
13:31 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Excess Flood]
13:31 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
13:34 -!- jA_cOp [~yakobu@unaffiliated/ja-cop/x-9478493] has joined #go-nuts
13:36 < araujo> golang.org is down?
13:37 < exch> works for me
13:38 < araujo> hi exch
13:38 < exch> hey
13:42 < araujo> exch, I guess there is no "C union" equivalents in Go?
13:43 < exch> There are ways to simulate it, but not as efficiently as in C
13:43 < araujo> I see
13:50 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.2]
13:50 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
14:09 -!- ghiu [~gu@93-32-144-8.ip33.fastwebnet.it] has quit [Quit: ghiu]
14:13 -!- temoto [~temoto@81.19.90.19] has joined #go-nuts
14:14 < taruti> there are dirty efficient simulations available also ;)
14:14 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: I ♥ Unicode]
14:14 < taruti> unsafe.Pointer and ;)
14:15 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
14:20 -!- snearch [~snearch@f053007064.adsl.alicedsl.de] has quit [Quit:
Verlassend]
14:22 < uriel> araujo: I think somethinglike that is being considered and is
in the roadmap
14:23 < araujo> uriel, that'd be nice
14:32 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has joined #go-nuts
14:40 -!- skelterjohn [~jasmuth@c-76-116-182-139.hsd1.nj.comcast.net] has joined
#go-nuts
14:40 < araujo> is there any way to use a method as a first class object?  ,
I want to pass a method to a function
14:42 < skelterjohn> yes
14:42 -!- Tiger_ [~chatzilla@118.126.12.53] has joined #go-nuts
14:42 < skelterjohn> the type "func(a int) int" is valid for a function that
takes and returns an int, for instance
14:42 < skelterjohn> or by method do you mean a function with a receiver
type?
14:43 < skelterjohn> in which case i think that is an unimplemented part of
the language spec?  maybe?
14:43 -!- kanru [~kanru@61-228-155-24.dynamic.hinet.net] has quit [Quit: WeeChat
0.3.2]
14:43 < skelterjohn> not sure
14:44 -!- temoto [~temoto@81.19.90.19] has left #go-nuts ["Leaving"]
14:47 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
14:47 -!- ghiu [~gu@93-32-159-72.ip34.fastwebnet.it] has joined #go-nuts
14:47 -!- SingAlong [~akash@117.192.197.161] has quit [Quit: leaving]
14:48 -!- welterde [~welterde@not.welterde.de] has quit [Read error: Operation
timed out]
14:53 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 240 seconds]
14:56 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Ping timeout: 240 seconds]
15:02 -!- ronnyy [~quassel@p4FF1DA23.dip.t-dialin.net] has joined #go-nuts
15:07 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has left #go-nuts []
15:07 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has joined #go-nuts
15:12 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has quit [Quit: Leaving.]
15:12 -!- ikaros [~ikaros@188.107.214.192] has joined #go-nuts
15:12 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
15:12 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has joined #go-nuts
15:14 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has quit [Client Quit]
15:16 < araujo> skelterjohn, that is what i mean, a method that has a
receiver type
15:27 -!- welterde [~welterde@not.welterde.de] has joined #go-nuts
15:27 -!- jcao219 [7c7e9efa@gateway/web/freenode/ip.124.126.158.250] has joined
#go-nuts
15:30 -!- ghiu [~gu@93-32-159-72.ip34.fastwebnet.it] has quit [Quit: ghiu]
15:30 -!- jcao219 [7c7e9efa@gateway/web/freenode/ip.124.126.158.250] has quit
[Quit: bye]
15:31 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has joined #go-nuts
15:36 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
15:41 < jcao219> hi
15:41 < jcao219> i'm on windows, running Go with mingw
15:41 < jcao219> i noticed that after compiling
15:41 < jcao219> the output file size is relatively large
15:41 < jcao219> especially if you import "fmt"
15:41 < jcao219> is this the case on other platforms too?
15:46 < skelterjohn> yes - dynamic linking is something that is on the
"future" list for go
15:48 < jcao219> oh okay
15:48 < jcao219> i tried using upx also
15:49 < jcao219> for small programs, packed executable works
15:49 < jcao219> but most of the time it crashes
15:49 < jcao219> probably because go uses gc
15:49 < jcao219> which is really cool
15:51 < Namegduf> How large is the output file?
15:51 < Namegduf> About 700KB with fmt imported is typical on Linux 64bit,
for me.
15:52 < jcao219> hmm let me see, i can't remember exactly
15:52 < jcao219> yes about 700kb
15:56 -!- prip [~foo@host136-122-dynamic.47-79-r.retail.telecomitalia.it] has quit
[Quit: Leaving]
15:58 -!- atsampson [~ats@212.183.140.18] has quit [Ping timeout: 260 seconds]
16:02 -!- ronnyy [~quassel@p4FF1DA23.dip.t-dialin.net] has quit [Remote host
closed the connection]
16:03 -!- ronnyy [~quassel@p4FF1DA23.dip.t-dialin.net] has joined #go-nuts
16:10 -!- atsampson [~ats@212.183.140.32] has joined #go-nuts
16:10 -!- ghiu [~gu@93-32-177-145.ip34.fastwebnet.it] has joined #go-nuts
16:10 -!- ghiu [~gu@93-32-177-145.ip34.fastwebnet.it] has quit [Client Quit]
16:14 -!- macroron [~ron@c-98-242-168-49.hsd1.fl.comcast.net] has joined #go-nuts
16:15 -!- atsampson [~ats@212.183.140.32] has quit [Ping timeout: 240 seconds]
16:17 -!- atsampson [~ats@212.183.140.16] has joined #go-nuts
16:25 -!- jessta [~jessta@124-168-53-96.dyn.iinet.net.au] has quit [Read error:
Operation timed out]
16:26 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
16:34 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has quit [Quit: sleepy, i'm in
china]
16:40 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has joined #go-nuts
16:42 -!- rickard [rickard@v-412-ostermalm-206.bitnet.nu] has joined #go-nuts
16:45 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has joined #go-nuts
16:57 -!- navigator [~navigator@p54897447.dip.t-dialin.net] has joined #go-nuts
17:13 -!- jdp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has quit []
17:16 -!- Ginto8 [~joe@pool-173-61-45-40.cmdnnj.fios.verizon.net] has quit [Ping
timeout: 265 seconds]
17:18 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
17:18 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Excess
Flood]
17:18 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
17:18 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Excess
Flood]
17:21 -!- jessta_ [~jessta@124-168-53-96.dyn.iinet.net.au] has joined #go-nuts
17:26 -!- rickard [rickard@v-412-ostermalm-206.bitnet.nu] has quit [Read error:
Operation timed out]
17:29 -!- jessta_ [~jessta@124-168-53-96.dyn.iinet.net.au] has quit [Quit:
leaving]
17:33 -!- virtualsue [~chatzilla@93-97-62-8.zone5.bethere.co.uk] has joined
#go-nuts
17:40 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Read error:
Connection timed out]
17:41 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
17:48 -!- path[l] [UPP@120.138.102.50] has joined #go-nuts
17:51 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Ping timeout: 240 seconds]
17:52 -!- RobertLJ [~quassel@c-68-44-163-191.hsd1.nj.comcast.net] has joined
#go-nuts
17:59 -!- jcao219 [~Jimmy_Cao@124.126.158.250] has quit [Quit: bedtime.]
18:10 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has joined #go-nuts
18:10 -!- virtualsue [~chatzilla@93-97-62-8.zone5.bethere.co.uk] has quit [Ping
timeout: 245 seconds]
18:14 -!- rickard [rickard@v-412-ostermalm-206.bitnet.nu] has joined #go-nuts
18:15 -!- aho [~nya@fuld-4d00d74d.pool.mediaWays.net] has joined #go-nuts
18:15 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Read error:
Connection reset by peer]
18:17 -!- ghiu [~gu@93-32-148-18.ip34.fastwebnet.it] has joined #go-nuts
18:17 < ghiu> has any of you used web.go?
18:25 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
18:31 -!- jorisros [~joris@s5590d661.adsl.wanadoo.nl] has joined #go-nuts
18:31 -!- rickard [rickard@v-412-ostermalm-206.bitnet.nu] has left #go-nuts []
18:31 -!- rickard [rickard@v-412-ostermalm-206.bitnet.nu] has joined #go-nuts
18:34 -!- g0bl1n [~anonymous@a213-22-18-58.cpe.netcabo.pt] has joined #go-nuts
18:34 -!- dacc_ [~dan@c-67-171-32-251.hsd1.wa.comcast.net] has joined #go-nuts
18:35 < taruti> ghiu: yes
18:36 < araujo> whoever mentioned for some ways (even dirty and awful) about
how to emulate unions, speak now :P
18:37 -!- dacc [~dan@c-67-171-32-251.hsd1.wa.comcast.net] has quit [Ping timeout:
252 seconds]
18:37 < jorisros> hi, im quite new to programming with go, and i am building
a simple webserver with http.  My question is: how can i read the ipadress of the
client?
18:40 -!- g0bl1n [~anonymous@a213-22-18-58.cpe.netcabo.pt] has quit [Quit: g0bl1n]
18:40 < exch> jorisros: the http.Conn you get from a request has a
'RemoteAddr' field.  It has the client ip
18:41 < vrtical> ghiu: I got as far as installing web.go and running the
'hello world'-style program from the tutorial.  I can confirm that it installs
easily and works.
18:41 < vrtical> I'd be interested to hear if people here /like/ web.go, or
if they've all 'rolled their own' or whatever.
18:45 < exch> I prefer to roll my own.  i dont need all the fcgi bits and
bobs
18:48 < taruti> araujo: unsafe.Pointer
18:49 -!- mahemoff_ [~mahemoff@87-194-3-205.bethere.co.uk] has joined #go-nuts
18:49 < taruti> araujo: ((*b)unsafe.Pointer(aptr))
18:49 -!- path[l] [UPP@120.138.102.50] has quit [Ping timeout: 265 seconds]
18:49 < taruti> vrtical: I use web.go but it is lacking in some things, but
certainly promising
18:50 < ghiu> i'm asking because i'm contributing to it
18:51 < taruti> handling multipart forms would be nice
18:51 -!- mahemoff [~mahemoff@87-194-3-205.bethere.co.uk] has quit [Ping timeout:
276 seconds]
18:51 < ghiu> i discussed the other day with the owner of the project about
the need for a forum or something where to discuss it
18:51 -!- gid [~gid@220-253-29-69.VIC.netspace.net.au] has quit [Quit: Leaving.]
18:52 < taruti> why not simply messages to golang titles as "[web.go]
Foobar" ?
18:52 < ghiu> it may turn out useful if there are enough people interested
in it
18:52 < araujo> taruti, that would give me a was-born-to-be-free pointer
right?  :P
18:53 < taruti> araujo: yes
18:53 < exch> it'll give you a potential for a lot of grief, but yea.  Also
that :p
18:53 -!- allengeorge [~allengeor@74.12.150.7] has joined #go-nuts
18:53 < taruti> araujo: that you can cast into nicer more tamed varieties
18:55 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has quit [Ping timeout:
248 seconds]
18:56 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts
19:01 -!- ronnyy [~quassel@p4FF1DA23.dip.t-dialin.net] has quit [Remote host
closed the connection]
19:11 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has quit [Ping timeout:
252 seconds]
19:11 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts
19:15 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
19:16 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has quit [Ping timeout:
246 seconds]
19:16 -!- rickard [rickard@v-412-ostermalm-206.bitnet.nu] has left #go-nuts []
19:16 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts
19:17 -!- rickard2 [rickard@v-412-ostermalm-206.bitnet.nu] has joined #go-nuts
19:17 < rickard2> Hi all, could someone please take a quick look at this
http://pastebin.ca/1913407?  io.ReadAll returns 0 bytes
19:18 < rickard2> res.ContentLength is about 13k
19:18 < nsf> rickard2: you're passing a null slice to it
19:18 < nsf> of course it will not read anything
19:18 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has quit [Client Quit]
19:18 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts
19:19 < nsf> use ioutil.ReadAll
19:20 < rickard2> thank you very much, that solved it
19:24 -!- Fish [~Fish@9fans.fr] has joined #go-nuts
19:32 -!- sacho_ [~sacho@79-100-57-33.btc-net.bg] has joined #go-nuts
19:33 -!- sacho [~sacho@95-42-108-60.btc-net.bg] has quit [Ping timeout: 248
seconds]
19:40 < ghiu> is there anything like type inherence in go?  or how to
emulate it?
19:40 < nsf> there is a thing called type embedding
19:41 < nsf> http://golang.org/doc/go_spec.html#Struct_types
19:41 < nsf> see here, part about anonymous field
19:41 < nsf> fields*
19:42 < nsf> shortly: you can compose types within a structure and their
method sets are being imported into your structure method set
19:44 < ghiu> so, if i have a type called Animal { voice string }
19:44 < ghiu> (a structure)
19:44 < ghiu> and i want to do a dog
19:44 < ghiu> type dog struct { Animal }
19:45 < ghiu> does dog have voice
19:45 < ghiu> or do i have to say dog.Animal.voice?
19:46 -!- ghiu [~gu@93-32-148-18.ip34.fastwebnet.it] has quit [Quit: ghiu]
19:46 < MizardX> patient
19:47 < taruti> meh
19:47 < taruti> couldn't wait 2 minutes..
19:48 -!- ghiu [~gu@93-32-148-18.ip34.fastwebnet.it] has joined #go-nuts
19:48 < ghiu> back
19:48 < taruti> ghiu: "yes"
19:48 < taruti> dog.voice works
19:48 < ghiu> oh, ok
19:48 -!- macroron [~ron@c-98-242-168-49.hsd1.fl.comcast.net] has quit [Quit:
Leaving]
19:49 < taruti> Is "rand" seeded from "crypto/rand" ?
19:51 < taruti> apparently not
19:51 < ghiu> taruti: hmmm, doesn't seem to work though
19:52 < taruti> ghiu: pastebin
19:54 < ghiu> http://pastebin.com/GENkaf4y
19:56 < MizardX> ghiu: http://ideone.com/etpa1
19:57 < vrtical> ghiu: weird, works for me (8g/linux)
19:57 < ghiu> not here, 6g macosx
19:58 < taruti> that seems ok
19:58 < ghiu> ehm....
19:58 < taruti> ghiu: have you got a recent go implementation?
19:58 < ghiu> i wrote sring >_<
19:58 < ghiu> fool mw
19:58 < ghiu> me
19:58 < taruti> ah :)
19:58 < taruti> good that it was solved
19:59 < taruti> gc error messages are not very good
19:59 < ghiu> but
19:59 < ghiu> even if dog has methods and fields of animal
19:59 < ghiu> it is not an animal
19:59 < ghiu> is it?
19:59 < ghiu> if a function accepts Animal as paramether
20:00 < ghiu> i can't pass dog
20:01 -!- Ginto8 [~joe@pool-173-61-45-40.cmdnnj.fios.verizon.net] has joined
#go-nuts
20:01 < taruti> yes
20:01 -!- brrant [~brrant@97-124-200-64.hlrn.qwest.net] has joined #go-nuts
20:01 < taruti> but you can pass fifi.Animal
20:02 < ghiu> ok, i see
20:02 -!- Ginto8 [~joe@pool-173-61-45-40.cmdnnj.fios.verizon.net] has left
#go-nuts []
20:03 < ghiu> thanks for the explanation
20:03 < taruti> but typically in such a situation one would be using
interfaces
20:04 < ghiu> i know, but interfaces lack the ability of defining shared
fields, as they only works on methods
20:04 < taruti> yes
20:05 < vrtical> we're kind of stating the obvious here aren't we?  This
weird kind of OO is one of the features of Go, and if it had full classes that
inherited from one another it would be like the other languages.
20:06 < Namegduf> Go isn't OO.
20:06 < Namegduf> Or, rather, it's not so much a kind of OO, as separate
implementations of some of the features of OO.
20:06 < taruti> Go is OO but a different kind of OO
20:07 < taruti> OO is not "java-like" things
20:07 < photron> well, Go is not OO in they why that other languages use
classes for OO
20:07 < taruti> e.g.  CLOS is an another way to do OO
20:07 < Namegduf> I am familiar with OO
20:07 < vrtical> "Go is profoundly object-oriented' - Rob Pike in one of the
Go talks.
20:07 < nsf> please don't use term OO
20:07 < nsf> it's bad
20:07 < nsf> :)
20:07 < exch> oOOOooOooooOoOOoOoo
20:07 < exch> who cares :p
20:08 < KirkMcDonald> There are objects.  We don't ask about the language's
orientation.
20:08 < nsf> people often misunderstand each other when this term is
involved :)
20:08 < taruti> or JS
20:08 < taruti> OO doesn't need any stinking classes
20:08 < photron> the interface stuff in Go implements proper subtyping and
thats superior to class-based OO
20:10 < Namegduf> Where's the objects?
20:12 < Namegduf> I have to say that it doesn't seem object orientated
because of the definition of the word orientated, coupled with the word object
occuring a total of once in the language specification.
20:12 < Namegduf> In "Like arrays, slices are always one-dimensional but may
be composed to construct higher-dimensional objects."
20:12 -!- tgall_foo [~tgall@gentoo/developer/dr-who] has joined #go-nuts
20:12 < araujo> I think Go could be considered a OO language
20:15 < Namegduf> I think it implements some features that object orientated
languages also typically provide, but it doesn't seem to be focused around the
concept of objects, around object modeling, or even OO features.  It has a couple
of typical ones, but the arguments for them being there don't seem to involve any
kind of object-based abstraction.
20:15 < Namegduf> But the term is muddled enough it could mean anything, so
meh.
20:16 -!- tgall_foo [~tgall@gentoo/developer/dr-who] has quit [Ping timeout: 240
seconds]
20:17 < araujo> I think the main reason it doesn't show like a OO language
is that there are "more" cool stuff in Go to talk about (yeah Go routines one),
and also because I think its creators are not interested to spread it as such ...
20:17 < araujo> even though I think it has its OO features as to be
considered one
20:20 -!- brrant [~brrant@97-124-200-64.hlrn.qwest.net] has quit [Quit: Leaving]
20:21 -!- tgall_foo [~tgall@gentoo/developer/dr-who] has joined #go-nuts
20:24 -!- carllerche [~carllerch@208.87.61.203] has joined #go-nuts
20:25 -!- sacho_ [~sacho@79-100-57-33.btc-net.bg] has quit [Ping timeout: 265
seconds]
20:26 -!- carllerche [~carllerch@208.87.61.203] has quit [Client Quit]
20:27 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has quit [Quit:
slashus2]
20:35 < Project_2501> http://img710.imageshack.us/img710/381/dsc6122y.jpg
20:35 < Project_2501> oooops wrong chan
20:35 < Project_2501> sorry :/
20:40 -!- sacho_ [~sacho@79-100-57-33.btc-net.bg] has joined #go-nuts
20:43 -!- carllerche [~carllerch@208.87.61.203] has joined #go-nuts
20:52 -!- snearch [~snearch@f053007064.adsl.alicedsl.de] has joined #go-nuts
20:53 -!- snearch [~snearch@f053007064.adsl.alicedsl.de] has quit [Client Quit]
21:00 -!- jorisros [~joris@s5590d661.adsl.wanadoo.nl] has quit [Remote host closed
the connection]
21:03 -!- jorisros [~joris@s5590d661.adsl.wanadoo.nl] has joined #go-nuts
21:04 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving]
21:05 < rickard2> anyone know how to use the character "-" in a character
class in golangs regexp package?  I get "bad range in character class" when i try
the method described in http://www.regular-expressions.info/charclass.html
(putting the hyphen at the beginning or end of the class)..
21:05 < rickard2> escaping it doesn't seem to work either
21:05 < rickard2> main.go:34: unknown escape sequence: -
21:14 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-180-250.clienti.tiscali.it] has
quit [Quit: E se abbasso questa leva che succ...]
21:15 -!- carllerche [~carllerch@208.87.61.203] has quit [Quit: carllerche]
21:21 -!- zozoR [~zozoR@x1-6-00-0e-2e-a3-e0-23.k377.webspeed.dk] has quit [Quit:
Morten.  Desu~]
21:28 -!- RobertLJ [~quassel@c-68-44-163-191.hsd1.nj.comcast.net] has quit [Remote
host closed the connection]
21:31 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
21:31 < KirkMcDonald> rickard2: Go's regexp package is incredibly
simplistic.
21:31 < KirkMcDonald> rickard2: It would not surprise me in the least if it
did not support this.
21:32 < rickard2> I can't seem to get it to work as expected
21:32 < KirkMcDonald> rickard2: As I understand it, the current regexp
package is just a placeholder, and eventually RE2 or somesuch will make its way
in.
21:32 < rickard2> also matching \ in a character class seems broken
21:32 < rickard2> ok, so no need filing an issue?
21:33 < KirkMcDonald> No reason not to file an issue.  :-)
21:33 < rickard2> :) well, we'll see if I have time to create a simpler
example, maybe tomorrow
21:35 < rickard2> :D even \x5C doesn't work
21:37 < ghiu> has any of you benchmarked go as a web server?
21:38 < ghiu> i'm doing some no-brain benchmark
21:38 < ghiu> and the simplest server seems as fast as python's
21:38 < ghiu> and it is quite surprising, as python is, well, not the
fastest language
21:38 < taruti> it is not optimized at all
21:39 < ghiu> you mean go?
21:42 < taruti> the go web server impl
21:44 -!- Fish [~Fish@9fans.fr] has quit [Remote host closed the connection]
21:49 -!- Davidian1024 [~Davidian1@cpe-98-27-192-193.neo.res.rr.com] has quit
[Remote host closed the connection]
21:56 -!- Davidian1024 [~Davidian1@cpe-98-27-192-193.neo.res.rr.com] has joined
#go-nuts
22:02 -!- tensorpudding [~user@99.70.202.65] has joined #go-nuts
22:02 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
22:13 < KirkMcDonald> ghiu: I would expect a simple web server to be I/O
bound.
22:14 < Namegduf> As I understand it, there are significant differences
between web servers.
22:17 -!- tensorpudding [~user@99.70.202.65] has quit [Remote host closed the
connection]
22:18 -!- General13372 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined
#go-nuts
22:18 -!- tensorpudding [~user@99.70.202.65] has joined #go-nuts
22:22 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has quit
[Ping timeout: 264 seconds]
22:26 -!- awidegreen [~quassel@62.176.237.78] has quit [Remote host closed the
connection]
22:32 -!- navigator [~navigator@p54897447.dip.t-dialin.net] has quit [Quit:
Leaving]
22:34 -!- mahemoff_ [~mahemoff@74.125.121.49] has joined #go-nuts
22:34 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Ping timeout: 252 seconds]
22:36 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
22:37 -!- mahemoff [~mahemoff@87-194-3-205.bethere.co.uk] has quit [Ping timeout:
276 seconds]
23:08 -!- ghiu [~gu@93-32-148-18.ip34.fastwebnet.it] has quit [Quit: ghiu]
23:15 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
23:33 -!- ikaros [~ikaros@188.107.214.192] has quit [Quit: Leave the magic to
Houdini]
23:52 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
23:57 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
--- Log closed Mon Aug 09 00:00:05 2010