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

--- Log opened Thu Mar 17 00:00:09 2011
--- Day changed Thu Mar 17 2011
00:00 -!- iant [~iant@67.218.107.6] has joined #go-nuts
00:00 -!- mode/#go-nuts [+v iant] by ChanServ
00:02 -!- mfoemmel [~mfoemmel@chml01.drwholdings.com] has quit [Remote host closed
the connection]
00:03 < kamaji> Right, i'm off
00:03 < kamaji> thanks skelterjohn!
00:03 < skelterjohn> thank you
00:04 < kamaji> the pleasure was all mine :D
00:04 < kamaji> I'm going to go fly imaginary planes around on the internet
00:04 -!- kamaji [~kamaji@cpc2-aztw22-2-0-cust775.aztw.cable.virginmedia.com] has
quit [Quit: neeeeeeoooooooooowwwwww]
00:04 < steven> str1ngs: no.
00:04 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts
00:05 < steven> im not big on code-generation, but people seem to like it.
but scaffoling isnt popular where i work.
00:06 < steven> sadly, if you want to do anything fun in Go, you have to
either import the slow "reflect" package or the unsafe "unsafe" package.
00:06 < steven> but its still fun :)
00:08 < Namegduf> The variety of definitions of "fun" around here...
00:08 < skelterjohn> ruby uses the slow "reflect" package for every
operation it performs
00:08 < skelterjohn> so, there's a trade-off
00:09 -!- boscop [~boscop@g226231181.adsl.alicedsl.de] has quit [Ping timeout: 252
seconds]
00:10 < xulfer> Slow and ruby generally tend to go hand in hand :P
00:11 < Namegduf> Ruby doesn't consider it a tradeoff, it actively seeks
slow and unsafe
00:11 < Namegduf> :P
00:12 < xulfer> Indeed
00:12 < xulfer> Slow and steady wins the race paradigm
00:13 < skelterjohn> slow and wobbly
00:14 < Namegduf> It's more fun
00:14 < Namegduf> In Ruby you don't shoot your foot off, because you start
out hopping.
00:15 < Namegduf> :P
00:16 < skelterjohn> you can't quite get your balance to aim well enough to
shoot your own foot
00:19 < skelterjohn> we should let the people in #ruby know
00:22 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
00:22 < crazy2be> is there some utility to rename identifiers in all my
source files?
00:23 < skelterjohn> gofmt can do some simple find/replace
00:23 < skelterjohn> but don't trust it to refactor code
00:23 < skelterjohn> i'm working on an IDE that would, one day, have this
sort of ability
00:23 < skelterjohn> but it's in the super alpha stages
00:32 -!- Project-2501 [~Marvin@82.84.76.206] has quit [Quit: E se abbasso questa
leva che succ...]
00:33 < crazy2be> i would love to be able to right-click->rename
00:33 < crazy2be> but that would be non-trivial to implement
00:33 < crazy2be> so i'd settle for a gorename Blar Foo
00:35 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Quit:
muffins]
00:35 -!- nettok [~quassel@200.119.150.25] has joined #go-nuts
00:41 < crazy2be> well i guess it would have to be gorename Blar Foo blar.go
00:42 < crazy2be> but in any case you could kinda do that with a sed script,
it would just replace all of it, not just identifiers
00:42 < crazy2be> which is usually fine, and less work than replacing them
all manually
00:42 -!- m4dh4tt3r [~Adium@adsl-76-205-56-41.dsl.pltn13.sbcglobal.net] has joined
#go-nuts
00:43 < Namegduf> crazy2be: gofmt will do what you're thinking of
00:47 < skelterjohn> this method has false positives
00:47 < skelterjohn> to do it properly you need to analyze the source tree
00:49 -!- mikespook [~mikespook@183.47.228.38] has joined #go-nuts
00:56 < Namegduf> Yes.
00:57 < Namegduf> You need to replace what a given instance of the
identifier refers to
00:57 < Namegduf> Which means figuring that out.
00:57 < Namegduf> Two structs with common member names would be a problem.
01:00 -!- iant [~iant@67.218.107.6] has quit [Quit: Leaving.]
01:07 < steven> what languages did you guys all come from before Go?
01:08 < steven> for me, it was C++, ObjC, C, Python, and Ruby, in that order
01:08 < exch> C# mostly
01:09 < KirkMcDonald> BASIC, C++, Python, D, mostly.
01:09 < KirkMcDonald> And C is in there somewhere.
01:11 -!- saturnfive [~saturnfiv@210.74.155.131] has joined #go-nuts
01:13 < Namegduf> C/C++ followed by a mixture of other languages mostly used
only for a single project.
01:13 < Namegduf> Perl, PHP (yuck, was modifying existing stuff), Python,
Java...
01:14 < Namegduf> The only one of those I could see wanting to use as a
language was Python, and even then it was annoying.
01:14 -!- cafesofie [~user@ool-4a5a6ee5.dyn.optonline.net] has joined #go-nuts
01:15 -!- m4dh4tt3r [~Adium@adsl-76-205-56-41.dsl.pltn13.sbcglobal.net] has quit
[Ping timeout: 252 seconds]
01:17 < steven> oh yeah i forgot about QBasic all those years ago hehe
01:18 < steven> one thing im noticing that an interpreted language like ruby
has over a compiled language is the ability to run scripts (like rakefiles) that
"link" against (or "require") the main application
01:18 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has joined
#go-nuts
01:18 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has left
#go-nuts []
01:19 < steven> which you can do easily in something like ruby (although not
without drawbacks, like accidentally loading and executing code you dont want to)
but i cant think of a reasonable way to do it in Go
01:19 < steven> thats probably the biggest hump im going to have to try and
work around if i go through with this rails-clone in Go
01:31 -!- nettok_ [~quassel@200.119.155.202] has joined #go-nuts
01:34 -!- nettok [~quassel@200.119.150.25] has quit [Ping timeout: 276 seconds]
01:35 < KirkMcDonald> You are referring to "monkeypatching"?
01:38 -!- itrekkie [~itrekkie@ip70-190-110-197.ph.ph.cox.net] has quit [Quit:
itrekkie]
01:46 -!- TheColonial [~oj@115-64-213-55.static.tpgi.com.au] has joined #go-nuts
01:50 -!- jdpo [~joe@66-169-204-189.dhcp.ftwo.tx.charter.com] has joined #go-nuts
01:50 -!- jdpo [~joe@66-169-204-189.dhcp.ftwo.tx.charter.com] has quit [Remote
host closed the connection]
01:51 -!- jdpo [~joe@66-169-204-189.dhcp.ftwo.tx.charter.com] has joined #go-nuts
01:54 < steven> no.
01:55 < steven> for example, KirkMcDonald, look at "rake db:create" and
"rake db:migrate"..  those are useful commands to be run once in a while, but they
are "disconnected" from the main binary, only using its configuration
01:55 < Namegduf> I think he's refering to loading of external code at
runtime, in general, as well as external code that links, does stuff, and unlinks
itself
01:55 < steven> similarly, you might have some rake tasks which need to
actually load the classes available inside the main binary, and do some work on
them
01:55 -!- saracen [~saracen@81-5-140-201.dsl.eclipse.net.uk] has quit [Ping
timeout: 276 seconds]
01:55 < steven> well, what i mean is simple:
01:56 < steven> "scripts" which are lightweight but need to link against the
main binary's codebase
01:56 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts
01:56 -!- mode/#go-nuts [+v iant] by ChanServ
01:56 < Namegduf> I don't think that's what you mean.
01:56 < Namegduf> I think you're misusing the word link, because that's
trivial
01:57 < steven> at work, i have a script i use almost daily..  it loads our
webapp and triggers one method which triggers a chain of events.
01:57 < Namegduf> You just make your "scripts" import the packages from the
main program you want to link in.
01:57 < Namegduf> That doesn't sound like linking.
01:57 < steven> i cant think of how to do this in Go without adding that
command directly to the binary itself.
01:57 < Namegduf> That sounds like executing in the same memory space
01:57 < steven> Namegduf: but what if the code it needs to use is *inside*
the main package?
01:57 < Namegduf> Then take it out of the main package?
01:57 < steven> its not that it needs to use the same memory space, no.
01:58 < steven> it needs access to the same classes and methods.
01:58 < steven> ok i mght be misunderstanding something:
01:58 < Namegduf> Then put your types and methods outside of main
01:58 < Namegduf> It's not hard, and a "stub" main is not unusual
01:58 < steven> when you have a multi-file Go program, can each file say
"package main" at the top?
01:58 < Namegduf> Yes, in which case you have a single package with multiple
files.
01:59 < steven> ok.
01:59 < Namegduf> All of which share a namespace and have no encapsulation
boundaries.
01:59 < steven> can you have several files, one of which says "package main"
and implements main(), but others say "package foo" and are all in the same
target?
01:59 < steven> (without making foo a genuine package with its own makefile
and own target)
01:59 < Namegduf> No, it is a separate package and needs to be built as
such.
02:00 < Namegduf> You can tell because it has a different package name.
02:00 < Namegduf> Not complicated, you see.
02:00 < Namegduf> If you want to access all but your main function from an
alternative package main linked with it
02:00 < Namegduf> You put everything else outside of the main package
02:01 < Namegduf> It's not hard, and your requirements suggest you're
dealing with a significantly sized codebase anyway.
02:01 < steven> i think i have an idea.
02:02 < steven> i should be treating the codebase as a package, and have a
small isolated "server" binary whose main() function just delegates running to the
actual webapp package
02:02 < Namegduf> Argh
02:02 < Namegduf> No
02:02 < steven> that "server" binary can even be boilerplate.
02:02 < steven> sure, why not?
02:02 < Namegduf> You should treat the codebase as multiple packages
02:02 < steven> uh..
02:02 < steven> im confused now
02:03 < Namegduf> Packages are modules, packages are separate encapsulated
bits of a program doing different tasks.
02:03 < Namegduf> Having one big package means everything is public to
everything, everything is global to everything, and your program isn't divided
into modules at all.
02:04 < Namegduf> Past a couple of thousand, maybe a few thousand lines,
that really sucks.
02:04 < Namegduf> You should be able to decomposed into different parts
implementing different bits of the overall function.
02:05 < Namegduf> *decompose it
02:05 -!- jdpo [~joe@66-169-204-189.dhcp.ftwo.tx.charter.com] has quit [Quit:
Bye!]
02:05 < Namegduf> What you're saying for package main in particular makes
sense, but in Go separate files are mostly just for convenience, they're all
compiled like they are one big file.
02:06 < Namegduf> Within the same package.
02:06 < Namegduf> Imported packages are file local, but I don't think
anything else is.
02:06 < cbeck> Except for import declarations
02:06 < cbeck> heh, nm then
02:06 < Namegduf> Yeah.
02:07 -!- ww_ [~ww@river.styx.org] has joined #go-nuts
02:08 -!- Cromulent [~Cromulent@cpc8-reig4-2-0-cust24.6-3.cable.virginmedia.com]
has joined #go-nuts
02:09 -!- ww [~ww@river.styx.org] has quit [Read error: Connection reset by peer]
02:09 -!- shvntr [~shvntr@113.84.149.214] has joined #go-nuts
02:13 -!- niekie [~niek@CAcert/Assurer/niekie] has quit [Read error: Operation
timed out]
02:15 -!- i___ [~none@69.164.206.224] has quit [Read error: Operation timed out]
02:15 -!- niekie [~niek@CAcert/Assurer/niekie] has joined #go-nuts
02:16 -!- ww [~ww@river.styx.org] has joined #go-nuts
02:16 -!- ww_ [~ww@river.styx.org] has quit [Ping timeout: 252 seconds]
02:18 -!- bXi [bluepunk@irssi.co.uk] has quit [Ping timeout: 276 seconds]
02:18 -!- i__ [~none@69.164.206.224] has joined #go-nuts
02:23 -!- bXi [bluepunk@irssi.co.uk] has joined #go-nuts
02:37 -!- cafesofie [~user@ool-4a5a6ee5.dyn.optonline.net] has quit [Remote host
closed the connection]
02:45 < steven> the idea is, Namegduf, i would want to be able to write
"scripts" that import my main codebase and act on it.  the best way to do that is
to make my main codebase a package (via Make.pkg) rather than an executable
command (via Make.cmd).
02:45 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has joined #go-nuts
02:46 < steven> and if thats the case, and i want to run the contents of my
main codebase as well (the codebase represents a dynamic webserver), then it
should have a "server" executable as well, which links to it and simply delegates
running to the pkg via the main() func
02:47 < Namegduf> That works, but I think anything worthy of the word
"codebase" is probably large enough that you should be splitting it into multiple
packages.
02:47 < Namegduf> So that part shouldn't be one huge package anyway.
02:47 < steven> possibly.
02:48 < steven> im thinking of what we have at work, and honestly yeah, a
lot of it is separate packages.
02:48 < Namegduf> But yeah, have a large amount of library, stub server
startup, then you can import your stuff and use it from other executables
02:48 < Namegduf> Fairly simple.
02:49 < steven> i just had an idea for yet another way to run Go files as
"scripts"
02:49 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping
timeout: 255 seconds]
02:49 < steven> (ie, "ruby scrpt.rb")
02:49 < steven> (thus, "gorun scrpt.go")
02:49 < Namegduf> A simple shell script which builds and runs?
02:49 < Namegduf> I think it's been thrown together
02:49 < steven> but one more thing:
02:49 -!- iant [~iant@216.239.45.130] has joined #go-nuts
02:49 -!- mode/#go-nuts [+v iant] by ChanServ
02:49 < steven> its outfile would be a hidden file, so you wouldnt see it
02:50 < steven> although thats horrible
02:50 < Namegduf> You can run it and then rm it
02:50 < steven> well im thinking along the lines of not having to recompile
each run
02:50 * Namegduf shrugs
02:50 < steven> although honestly, how long does a compile usually take?  it
seems negligable
02:50 < Namegduf> Doesn't bother you with Ruby, does it?  :P
02:50 < steven> like 0.2 seconds..
02:50 < steven> exactly my point.
02:50 < steven> do any of these other go-runners do this?
02:51 < steven> ie, rm exec
02:51 -!- acegrimm [~acegrimm@c-75-68-194-59.hsd1.vt.comcast.net] has joined
#go-nuts
02:51 < exch> there's been a few like that
02:51 < acegrimm> chugalug
02:51 < steven> make && ./a.out && rm a.out
02:52 < steven> i never understood makefile syntax
02:52 < exch> that doesnt really make a scripting target though.  I think
(at leats for me), the benefit of an embeddable scripting language is that you can
run it within the context of the host app and have it interact with said hostapp.
Youd need a Go interpreter for that
02:52 < Namegduf> Key word: Embeddable
02:53 < steven> exch: what im thinking though is that the main codebase is a
package, not an app
02:53 < exch> yes
02:53 < steven> think of a blog, for instance.
02:53 < Namegduf> This looks like a super-shell script
02:53 < Namegduf> Similar to the way Perl is used
02:53 < Namegduf> Rather than an embeddable one
02:53 < Namegduf> The gorun thing, I mean.
02:54 < steven> the blog-specific logic is a package called "myblog".  the
code that runs it as a server is a single go file whose TARG is "server".  then
you can just write some "scripts" that import "myblog" and do stuff with it as
needed.
02:54 < steven> lemme see..  i have an idea
02:55 < acegrimm> is it a chatroom for cheez-its?
02:55 < Namegduf> That sounds good.
02:55 < acegrimm> yah right?
02:56 < acegrimm> ****ing love em cheese snacks
02:56 < steven> does 6g take stdin instead of file args?
02:56 < Namegduf> I'm not sure.
02:56 < steven> will test.
03:00 < steven> nope.  shizzle.
03:00 < acegrimm> shizzam
03:00 < acegrimm> strizzoke up in the brizzane
03:03 -!- binarypie [~binarypie@c-67-180-203-88.hsd1.ca.comcast.net] has joined
#go-nuts
03:04 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has quit [Quit:
Linkinus - http://linkinus.com]
03:11 -!- genbattle [~nick@203-114-137-9.wir.sta.inspire.net.nz] has joined
#go-nuts
03:15 -!- shvntr [~shvntr@113.84.149.214] has quit [Ping timeout: 250 seconds]
03:22 < steven> https://gist.github.com/873778
03:22 < steven> tehehe
03:23 < steven> now to extract it out as a script of its own (so it doesnt
clutter the .go file or require it to itself be executable) and make use of temp
directories..
03:25 -!- niemeyer_away
[~niemeyer@201-11-241-43.pltce701.dsl.brasiltelecom.net.br] has quit [Ping
timeout: 255 seconds]
03:28 -!- shvntr [~shvntr@113.84.149.214] has joined #go-nuts
03:39 -!- genbattle [~nick@203-114-137-9.wir.sta.inspire.net.nz] has quit [Quit:
Leaving]
03:39 -!- nettok_ [~quassel@200.119.155.202] has quit [Ping timeout: 240 seconds]
03:39 < steven> done: https://gist.github.com/873793
03:40 -!- acegrimm [~acegrimm@c-75-68-194-59.hsd1.vt.comcast.net] has left
#go-nuts []
03:41 -!- Cromulent [~Cromulent@cpc8-reig4-2-0-cust24.6-3.cable.virginmedia.com]
has quit [Quit: Cromulent]
03:41 -!- lmoura [~lauromour@187.113.104.86] has quit [Ping timeout: 255 seconds]
03:42 -!- schmrkc [~marcus@sxemacs/devel/schme] has quit [Read error: Operation
timed out]
03:43 -!- lmoura [~lauromour@186.215.206.130] has joined #go-nuts
03:46 < steven> whoa.  goscript is overly complex for this task
03:48 < steven> gorun is too.
03:52 -!- binarypie [~binarypie@c-67-180-203-88.hsd1.ca.comcast.net] has quit
[Remote host closed the connection]
03:56 -!- schmrkc [~marcus@c83-254-205-76.bredband.comhem.se] has joined #go-nuts
03:56 -!- schmrkc [~marcus@c83-254-205-76.bredband.comhem.se] has quit [Changing
host]
03:56 -!- schmrkc [~marcus@sxemacs/devel/schme] has joined #go-nuts
03:58 -!- gogogrrl_ [~max@p5DE8D63E.dip.t-dialin.net] has joined #go-nuts
04:01 -!- schmrkc [~marcus@sxemacs/devel/schme] has quit [Ping timeout: 260
seconds]
04:01 -!- gogogrrl [~max@p5DE8E0AB.dip.t-dialin.net] has quit [Ping timeout: 240
seconds]
04:02 -!- shvntr [~shvntr@113.84.149.214] has quit [Ping timeout: 250 seconds]
04:07 -!- shvntr [~shvntr@113.84.149.214] has joined #go-nuts
04:07 -!- schmrkc [~marcus@c83-254-205-76.bredband.comhem.se] has joined #go-nuts
04:07 -!- schmrkc [~marcus@c83-254-205-76.bredband.comhem.se] has quit [Changing
host]
04:07 -!- schmrkc [~marcus@sxemacs/devel/schme] has joined #go-nuts
04:14 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 246 seconds]
04:23 -!- crazy2be [~crazy2be@d209-89-248-73.abhsia.telus.net] has quit [Remote
host closed the connection]
04:23 -!- cenuij [~cenuij@base/student/cenuij] has quit [Remote host closed the
connection]
04:27 < steven> well i didnt like gorun or goscript, i prefer this:
https://github.com/sdegutis/godo
04:28 -!- edsrzf [~chickench@122-61-221-144.jetstream.xtra.co.nz] has joined
#go-nuts
04:29 -!- vpit3833 [~user@203.111.33.203] has quit [Read error: Connection reset
by peer]
04:29 -!- vpit3833 [~user@203.111.33.203] has joined #go-nuts
04:31 -!- cenuij [~cenuij@78.112.41.178] has joined #go-nuts
04:31 -!- cenuij [~cenuij@78.112.41.178] has quit [Changing host]
04:31 -!- cenuij [~cenuij@base/student/cenuij] has joined #go-nuts
04:31 < steven> a go program for this task is overkill
04:31 < steven> not to mention unportable, since it needs to be recompiled
for every platform.
04:32 < steven> however, i now need a way to figure out which arch to use,
so i know whether to use 6g or 8g or 5g, etc
04:33 < exch> $GOARCH/$GOOS
04:33 < steven> right, but if they arent set, what do i default to?
04:34 < steven> is amd64 a safe bet?
04:34 < exch> if they are not set, you either dont have a valid Go
environment, which means you can't build anyway.  Or someone uses some different
build setup..  which would man the same I guess
04:34 < edsrzf> Parse the output of uname?  That's what the make scripts do.
04:34 < steven> so they need to be set for go to work in the first place?
04:34 < steven> i can require that much at least?
04:34 < exch> steven: not sure.  they used to.  But that might have changed
04:34 < steven> ok
04:34 < steven> well im excitd.
04:34 < steven> yay.
04:35 < exch> http://golang.org/doc/install.html#environment this has some
onfo on what you can expect to exist
04:35 < exch> *info
04:36 < exch> I would go with GOHOST* instead.  Go allows you to
crosscompile to a different arch, which means that GOARCH/GOOS might be set to
something incompatible
04:37 < steven> nice
04:38 < steven> yeah im gonna use GOHOSTARCH
04:38 < steven> thanks
04:44 -!- alkavan [~alkavan@IGLD-84-229-168-230.inter.net.il] has quit [Read
error: Connection timed out]
04:45 -!- alkavan [~alkavan@IGLD-84-229-168-230.inter.net.il] has joined #go-nuts
04:51 -!- aho [~nya@fuld-4d00d6a1.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
05:03 -!- stalled [~stalled@unaffiliated/stalled] has quit [Ping timeout: 252
seconds]
05:19 -!- edsrzf [~chickench@122-61-221-144.jetstream.xtra.co.nz] has quit [Quit:
reboot]
05:27 -!- stalled [~stalled@unaffiliated/stalled] has joined #go-nuts
05:28 -!- ExtraSpice [XtraSpice@78-62-101-194.static.zebra.lt] has joined #go-nuts
05:32 -!- fabled [~fabled@mail.fi.jw.org] has joined #go-nuts
05:46 -!- zozoR [~Morten@563476e6.rev.stofanet.dk] has joined #go-nuts
06:00 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
06:07 -!- plexdev [~plexdev@arthur.espians.com] has joined #go-nuts
06:31 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
06:40 -!- dfc [~dfc@sydfibre2.atlassian.com] has quit [Ping timeout: 255 seconds]
06:40 -!- jessta [~jessta@li7-205.members.linode.com] has quit [Read error:
Operation timed out]
06:40 -!- jessta [~jessta@li7-205.members.linode.com] has joined #go-nuts
06:40 -!- saracen [~saracen@81-5-140-201.dsl.eclipse.net.uk] has joined #go-nuts
06:43 -!- zozoR [~Morten@563476e6.rev.stofanet.dk] has quit [Remote host closed
the connection]
06:48 -!- drhodes [~none@drhodes.xen.prgmr.com] has quit [Ping timeout: 276
seconds]
06:50 -!- drhodes [~none@drhodes.xen.prgmr.com] has joined #go-nuts
06:59 -!- tensorpudding [~user@99.148.205.193] has quit [Read error: Connection
reset by peer]
07:18 -!- neshaug [~oyvind@213.239.108.5] has joined #go-nuts
07:30 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
07:34 -!- sakesun [~sakesun@ppp-124-121-11-195.revip2.asianet.co.th] has joined
#go-nuts
07:40 -!- foocraft [~dsc@86.36.42.29] has quit [Ping timeout: 250 seconds]
07:42 -!- foocraft [~dsc@86.36.42.29] has joined #go-nuts
07:43 -!- wrtp [~rog@92.17.17.88] has joined #go-nuts
07:46 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has joined #go-nuts
08:00 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
08:03 -!- niemeyer_away
[~niemeyer@201-11-241-43.pltce701.dsl.brasiltelecom.net.br] has joined #go-nuts
08:04 -!- ronnyy [~quassel@p4FF1C54B.dip0.t-ipconnect.de] has joined #go-nuts
08:05 -!- adu [~ajr@softbank220043138128.bbtec.net] has joined #go-nuts
08:15 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
08:17 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
08:24 -!- dgrijalva [~dgrijalva@76-218-201-161.lightspeed.sntcca.sbcglobal.net]
has joined #go-nuts
08:25 -!- adu [~ajr@softbank220043138128.bbtec.net] has quit [Quit: adu]
08:26 < dgrijalva> question: I'm trying to use the gob package to
save/restore some state.  When decoding, i keep getting an error: type mismatch in
decoder...
08:26 -!- saracen [~saracen@81-5-140-201.dsl.eclipse.net.uk] has quit [Quit:
leaving]
08:26 < dgrijalva> are there examples of how to use gob to encode/decode
custom struct types anywhere?
08:29 < dgrijalva> also, gob.Debug appears to not be available to me.  do i
have to do something for that?
08:36 < dgrijalva> hello?
08:39 -!- napsy [~luka@193.2.66.6] has joined #go-nuts
08:46 -!- Mulleteer [mulleteer@hikisten.miesten.leiri.org] has joined #go-nuts
08:52 < Mulleteer> hi, how I can get specific error code when socket read
returns errror?  things I've tried so far: http://pastebin.com/LuuZXSJ5
08:53 -!- boscop [~boscop@g226231181.adsl.alicedsl.de] has joined #go-nuts
08:56 -!- rtharper [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed
the connection]
09:00 < wrtp> dgrijalva: have you got some code that you could show to demo
the problem?
09:01 < dgrijalva> let me put something together really quick...
09:02 < wrtp> Mulleteer: have you tried this?  if err, ok :=
err.(net.Error); ok && err.Timeout() {
09:08 < Mulleteer> let me try it now
09:08 < Mulleteer> but I'm actually more interested of the actual error
code, not just that it's timeout
09:10 < Mulleteer> wrtp, that works but according to documentation Read
returns os.Error, not net.Error
09:11 < dgrijalva> http://pastie.textmate.org/private/byk5dw6kvsxhp9csgpcw
09:11 < dgrijalva> there we go
09:11 < dgrijalva> getting a different error this time
09:11 < dgrijalva> but an error still
09:14 < dgrijalva> it decodes the first pair just fine, then blows up
09:15 -!- Project-2501 [~Marvin@82.84.67.35] has joined #go-nuts
09:16 < dgrijalva> for me, this code spits out "error decoding value for key
three: extra data in the buffer"
09:18 < dgrijalva> ooh, i think i found a fix
09:18 < dgrijalva> if i create a new decoder after each key/value pair, it
seems to work
09:19 < dgrijalva> why that matters is a mystery
09:19 < dgrijalva> any thoughts?
09:20 -!- vrasidakos [~vrasidako@77.49.172.189] has joined #go-nuts
09:22 -!- napsy [~luka@193.2.66.6] has quit [Quit: Lost terminal]
09:23 < nickbp> does it matter that youre calling NewEncoder repeatedly (i
dont know anything about this encoder thing)
09:23 < dgrijalva> it seems to only work when I do call NewEncoder
repeatedly
09:24 -!- adu [~ajr@softbank220043138128.bbtec.net] has joined #go-nuts
09:27 -!- niemeyer [~niemeyer@201-11-241-43.pltce701.dsl.brasiltelecom.net.br] has
quit [Ping timeout: 255 seconds]
09:28 < Mulleteer> wrtp, your snippet works but can you advice how to
extract the actual error code?  e.g.  EAGAIN, EPIPE, ..
09:33 -!- mikespook [~mikespook@183.47.228.38] has quit [Quit: Leaving.]
09:35 -!- snearch [~snearch@f053001191.adsl.alicedsl.de] has joined #go-nuts
09:36 -!- napsy [~luka@193.2.66.6] has joined #go-nuts
09:38 -!- vrasidakos [~vrasidako@77.49.172.189] has quit [Ping timeout: 250
seconds]
09:40 -!- niemeyer [~niemeyer@201-66-179-18.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
09:40 -!- inv_arp [~junya@74.63.255.72] has quit [Ping timeout: 276 seconds]
09:44 -!- hachiya [~hachiya@encyclical.net] has quit [Remote host closed the
connection]
09:44 -!- hachiya [~hachiya@encyclical.net] has joined #go-nuts
09:46 < wrtp> Mulleteer: the first thing to do is find out the actual type
of the error, e.g.  by using fmt.Printf("%T", err)
09:46 < wrtp> BTW, why do you want to find out the actual error code?
09:47 < Mulleteer> I need to know if socket was closed on timeout,
gracefully or by tcp reset
09:48 < Mulleteer> the error is type '*net.OpError'
09:48 < Mulleteer> so..  e, ok := err.(*net.OpError); ok && e.Error ==
OS.EAGAIN
09:48 < Mulleteer> works!, thanks wrtp
09:48 < wrtp> np
09:49 -!- hachiya [~hachiya@encyclical.net] has quit [Ping timeout: 250 seconds]
09:50 < wrtp> Mulleteer: i think that's why the Timeout and Temporary
methods were defined.
09:50 < wrtp> (they have the advantage that your program would potentially
work under windows too)
09:53 < Mulleteer> yes, I just need to log actual code for diagnostics
09:58 -!- kr [~kr@c-24-5-193-165.hsd1.ca.comcast.net] has joined #go-nuts
09:58 -!- rtharper [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
10:02 < wrtp> Mulleteer: if you're just logging, then surely you could just
log the error text
10:02 < wrtp> that way it'll work for any error at all
10:04 -!- shakesoda [~colby@c-67-168-136-89.hsd1.wa.comcast.net] has quit [Quit:
shakesoda]
10:07 -!- sakesun [~sakesun@ppp-124-121-11-195.revip2.asianet.co.th] has quit
[Remote host closed the connection]
10:08 -!- hachiya [~hachiya@encyclical.net] has joined #go-nuts
10:08 -!- inv_arp [~junya@74.63.255.72] has joined #go-nuts
10:08 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
joined #go-nuts
10:15 -!- hachiya [~hachiya@encyclical.net] has quit [Read error: Operation timed
out]
10:15 -!- hachiya [~hachiya@encyclical.net] has joined #go-nuts
10:16 -!- sauerbraten [~sauerbrat@p508CADC5.dip.t-dialin.net] has joined #go-nuts
10:18 -!- saturnfive [~saturnfiv@210.74.155.131] has quit [Read error: Connection
reset by peer]
10:21 -!- kr [~kr@c-24-5-193-165.hsd1.ca.comcast.net] has quit [Quit: WeeChat
0.3.2]
10:23 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
quit [Ping timeout: 250 seconds]
10:24 -!- dgrijalva [~dgrijalva@76-218-201-161.lightspeed.sntcca.sbcglobal.net]
has quit [Quit: dgrijalva]
10:26 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
joined #go-nuts
10:28 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 240 seconds]
10:32 -!- ronnyy [~quassel@p4FF1C54B.dip0.t-ipconnect.de] has quit [Remote host
closed the connection]
10:35 -!- adu [~ajr@softbank220043138128.bbtec.net] has quit [Quit: adu]
10:39 -!- Cromulent [~Cromulent@cpc8-reig4-2-0-cust24.6-3.cable.virginmedia.com]
has joined #go-nuts
10:41 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
11:04 -!- Cromulent [~Cromulent@cpc8-reig4-2-0-cust24.6-3.cable.virginmedia.com]
has quit [Quit: Cromulent]
11:31 -!- alkavan [~alkavan@IGLD-84-229-168-230.inter.net.il] has quit
[Disconnected by services]
11:31 -!- alkavan [~alkavan@IGLD-84-229-168-230.inter.net.il] has joined #go-nuts
11:32 -!- snearch [~snearch@f053001191.adsl.alicedsl.de] has quit [Quit:
Verlassend]
11:32 -!- alkavan [~alkavan@IGLD-84-229-168-230.inter.net.il] has quit
[Disconnected by services]
11:32 -!- alkavan_ [~alkavan@IGLD-84-229-168-230.inter.net.il] has joined #go-nuts
11:36 -!- TheColonial [~oj@115-64-213-55.static.tpgi.com.au] has quit [Quit:
leaving]
11:39 -!- artefon [~thiago@189.59.129.11.dynamic.adsl.gvt.net.br] has joined
#go-nuts
11:39 -!- niemeyer [~niemeyer@201-66-179-18.pltce701.dsl.brasiltelecom.net.br] has
quit [Ping timeout: 255 seconds]
11:53 -!- adu [~ajr@softbank220043138128.bbtec.net] has joined #go-nuts
12:03 -!- foocraft [~dsc@86.36.42.29] has quit [Ping timeout: 250 seconds]
12:03 -!- kamaji [~kamaji@cpc2-aztw22-2-0-cust775.aztw.cable.virginmedia.com] has
joined #go-nuts
12:10 -!- jgonzalez [~jgonzalez@173-14-137-134-NewEngland.hfc.comcastbusiness.net]
has joined #go-nuts
12:14 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
quit [Quit: Quitte]
12:19 -!- adu [~ajr@softbank220043138128.bbtec.net] has quit [Quit: adu]
12:34 -!- SirPsychoS [~sp@c-24-13-132-130.hsd1.il.comcast.net] has quit [Ping
timeout: 255 seconds]
12:34 -!- SirPsychoS [~sp@c-24-13-132-130.hsd1.il.comcast.net] has joined #go-nuts
12:46 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 240 seconds]
12:49 < str1ngs> func ForkIn() hmmm this name seems wrong :(
12:56 < xyproto> str1ngs: in what regard?
12:57 < str1ngs> xyproto: just a funny play on words
13:02 < str1ngs> the program I'm making uses alot of forks...  right now.
so I made a Fork struck to make calling forks easier.  but I quickly learned that
changing pwd was really bad and I'd have to be explicit about the wd.  so ForkIn
was born
13:05 < xyproto> str1ngs: funny like fsck?
13:05 < xyproto>
http://justin-goldberg.blogspot.com/2008/04/unzip-strip-touch-finger-grep-mount.html
13:05 < xyproto> :P
13:05 < str1ngs> aye
13:05 < str1ngs> or funny like $ man curl
13:05 < xyproto> :)
13:07 < str1ngs> actually I kind feal dumb I'm not sure why I was changing
the running wd.  thinking to much like bash I think
13:07 -!- Mulleteer [mulleteer@hikisten.miesten.leiri.org] has left #go-nuts []
13:09 < str1ngs> anyways the whole plan is when I'm done.  you wont need
bash.  just the static binary make and a C compiler and you can bootstrap a whole
system
13:09 < str1ngs> and probably busybox or something
13:09 < steven> any of you use gorun or goscript?
13:12 < steven> i thought it was a bit excessive that both gorun and
goscript are written in Go, so i wrote a more minimal version called godo:
https://github.com/sdegutis/godo
13:13 -!- plainhao [~plainhao@208.75.85.237] has joined #go-nuts
13:18 -!- pharris [~Adium@rhgw.opentext.com] has joined #go-nuts
13:21 -!- napsy [~luka@193.2.66.6] has quit [Quit: Lost terminal]
13:23 -!- wrtp [~rog@92.17.17.88] has quit [Quit: wrtp]
13:27 -!- visof [~visof@41.233.121.162] has joined #go-nuts
13:27 -!- visof [~visof@41.233.121.162] has quit [Changing host]
13:27 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
13:31 -!- zozoR [~Morten@563476e6.rev.stofanet.dk] has joined #go-nuts
13:33 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
joined #go-nuts
13:36 < xyproto> hi good people.  What does "variadic.go:18: cannot use
numbers (type []int) as type []interface { } in function argument
13:36 < xyproto> " mean?
13:37 < xyproto> this is the short source I'm trying to compile:
http://pastebin.com/AFK18Tva
13:43 < skelterjohn> just what it says
13:43 < skelterjohn> fmt.Println has param type x ...interface{}
13:43 < xyproto> skelterjohn: what is type []interface { }
13:43 < xyproto> it's the curly braces I don't understand the meaning of, in
that error messaage
13:43 < xyproto> *message
13:43 < skelterjohn> interface{} is a catch-all type
13:44 < skelterjohn> anything can be an interface{}
13:44 < skelterjohn> it's an interface that requires no methods
13:44 < xyproto> so, why can't my "numbers" variable be a interface{}?
13:44 < xyproto> I'm baffled.
13:44 < skelterjohn> it could be an interface{}
13:44 < skelterjohn> just not an []interface
13:44 < skelterjohn> []interface{}
13:45 < xyproto> okay, if I understand you correctly, an []int is not an
[]interface{} and an int is not an interface{}.  But why?
13:45 < skelterjohn> int is an interface{}
13:45 < xyproto> My understanding of interfaces is limited.
13:45 < xyproto> (for now)
13:45 < skelterjohn> but []int is not an []interface{}
13:45 < xyproto> that surprises me.
13:45 < skelterjohn> think of memory layout
13:46 < skelterjohn> what is the memory layout of an []int
13:46 < xyproto> struct and pointers?
13:46 < xyproto> I would have to read the go source code.
13:46 < skelterjohn> it's a struct with two ints and a pointer to an int
array, right
13:47 < xyproto> ok, right.
13:47 < skelterjohn> that int array is something that is X*n long, where X
is the size of the int, and n is the number of them
13:47 < xyproto> right
13:48 < skelterjohn> now, what's an []interface{} ?
13:48 < xyproto> I don't know.
13:48 < skelterjohn> it's a struct with two ints and a pointer to an
interface{} array
13:48 < xyproto> I can read up and come back.  :)
13:48 < skelterjohn> same thing
13:48 < xyproto> ok, great
13:49 < skelterjohn> and the interface{} is a data structure with type
information and a pointer to "something" of that type
13:49 < skelterjohn> so, to turn a []int into an []interface{}, you'd need
to go through each int in the slice and individually pop it into an interface{}
13:49 < xyproto> hm, ok
13:49 < skelterjohn> you can't just take a []int and say "actually, i want
to use this as an []interface{}"
13:50 < skelterjohn> because its memory layout is incompatible
13:50 < xyproto> but, all the information is there?
13:50 < skelterjohn> yes, so you can *create* an []interface{} from an []int
13:50 < skelterjohn> but it is an algorithmic process
13:50 < skelterjohn> that involves a loop and memory allocation
13:50 < xyproto> I see.
13:50 < xyproto> Okay, I think I almost get this.  But, how about int and
interface{}?
13:51 < xyproto> How come they are interchangeable?
13:51 < xyproto> (or feels like it)
13:51 < xyproto> is it because []int is a "container structure", while int
is not?
13:51 < skelterjohn> because the go spec says you can put anything into an
interface, as long as it has the right methods
13:51 < skelterjohn> you can put []int into an []interface{}
13:51 < skelterjohn> so it has nothing to do with the []int
13:52 < skelterjohn> err
13:52 < skelterjohn> i made a typo
13:52 < xyproto> np
13:52 < skelterjohn> you can put []int into an interface{}
13:52 < skelterjohn> that's what i meant to say
13:52 < xyproto> aha
13:52 < skelterjohn> go does implicit and silent conversion of types to
appropriate *interface* types
13:52 < skelterjohn> []interface{} is not an interface
13:52 < xyproto> okay, so a list of interfaces is completely different from
a single interface, and a single interface corresponds to a single type, and both
int and []int are types, not collections of types?
13:52 < skelterjohn> it's a list of interfaces
13:52 < xyproto> I get it!  Thanks :)
13:53 < skelterjohn> []int is both a type and something that happens to
collect a bunch of types
13:53 < xyproto> I see
13:53 < skelterjohn> great!
13:53 < xyproto> Now I just have to figure out how to fix my program :)
13:53 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
13:53 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
13:53 < xyproto> The beginning of this, was me trying to understand the
variadic syntax in Go
13:54 < xyproto> ...  in function declarations seems easy enough
13:54 -!- gr0gmint [~quassel@87.61.162.99] has joined #go-nuts
13:54 < xyproto> but passing in ...  in a function call was worse
13:56 < skelterjohn> your pastie would work if the types matches
13:56 < skelterjohn> mathced
13:56 < skelterjohn> you know what i mean
13:56 < xyproto> yes, ok
13:58 < xyproto> why does these two lines give "unexpected type"?
13:58 < xyproto> func sum(values ...int) int {
13:58 < xyproto> fmt.Println(type(values))
13:59 < xyproto> I would expect the type of values to be []interface{} ?
13:59 < skelterjohn> values is type []int
13:59 < skelterjohn> i don't know what type(X) does
13:59 < skelterjohn> i mean, i can guess from the name
13:59 < skelterjohn> but i had never heard of that function
14:00 < xyproto> My bad, I seem to have made it up.
14:00 < skelterjohn> oh - haha
14:00 < skelterjohn> it's "unexpected type"
14:00 < xyproto> :)
14:00 < skelterjohn> because it didn't expect "type" there
14:01 < xyproto> :D
14:01 < skelterjohn> funny
14:01 < skelterjohn> fmt.Printf("%T", X) will print X's type
14:01 < xyproto> funny and confusing
14:01 < xyproto> ok, great :)
14:01 < skelterjohn> (not fmt.Println)
14:02 < xyproto> With these two lines:
14:02 < xyproto> func sum(values ...int) int {
14:02 < xyproto> fmt.Printf("%T", values)
14:02 < xyproto> I get:
14:02 < xyproto> variadic.go:8: to pass 'values' as ...interface { }, use
'values...'
14:02 < xyproto> variadic.go:8: cannot use values (type []int) as type
[]interface { } in function argument
14:03 < xyproto> Which may explain my predicament?
14:03 < xyproto> I guess it should be values...  int instead?
14:03 < skelterjohn> the compiler is being short sighted with its suggestion
14:03 < str1ngs> xyproto: values...
14:03 < skelterjohn> it doesn't realize that the types don't match - only
that you're passing a slice where it wants a variadic type
14:04 < skelterjohn> steven: you can use runtime.GOOS and runtime.GOARCH to
know what platform you're on
14:04 < steven> oh hi
14:04 < steven> i just got to work :)
14:04 < skelterjohn> i'm psychic
14:04 < skelterjohn> or i just got up and read backscroll
14:04 < steven> skelterjohn: so btw im not sure what you're saying that for
or against
14:05 < steven> are you giving a reason why it should be a Go utility
instead of a script?
14:05 < skelterjohn> steven: however, i now need a way to figure out which
arch to use, so i know whether to use 6g or 8g or 5g, etc
14:05 < skelterjohn> no, just saying how you can find this out if $GOARCH or
$GOOS aren't set
14:05 < skelterjohn> runtime.GOOS/GOARCH is definitive as to the platform
you are currently running on
14:05 < steven> well if those arent set, they wont be able to compile Go
apps in the first place
14:05 < skelterjohn> the envs can be anything
14:05 < str1ngs> skelterjohn: it wont work on windows for one.  atleast not
with out cygwin or some sh
14:05 < steven> right?
14:05 < skelterjohn> sure they can
14:05 < steven> how so
14:06 < skelterjohn> because GOOS and GOARCH do not need to be set at all :)
14:06 < xyproto> str1ngs: I tried "values...  int" and "values ...int".
They both say the same
14:06 < steven> then how can you compile stuff without those set?
14:06 < xyproto> (same error message)
14:06 < skelterjohn> because 6g and 6l are clever
14:06 < skelterjohn> and default to the platform *they* were built on
14:07 < skelterjohn> and i don't know anything about the windows issue
str1ngs mentions
14:07 < steven> oh.
14:07 < str1ngs> xyproto: you need to use sum(values ...interface{})
14:07 < xyproto> skelterjohn: it's strange, an otherwise working program
with "..." breaks when I introduce fmt.Printf("%T", values).
14:07 < steven> so i can default to 6g if $GOHOSTARCH isnt set?
14:07 < skelterjohn> you can default to 6g if runtime.GOARCH=="amd64"
14:08 < steven> im saying, from outside of a go program
14:08 < skelterjohn> oh - you are not doing this from go code, i see
14:08 < str1ngs> skelterjohn: you cant assume windows has sh.  it doesnt.
it might if say you use mingw or cygwin
14:08 < steven> did you see my repo for godo?
14:08 < skelterjohn> then i don't have a good solution thought up
14:08 < skelterjohn> no
14:08 < skelterjohn> str1ngs: i didn't say anything about sh
14:09 < skelterjohn> i just said that runtime.GOOS will identify the OS
you're running on
14:09 < str1ngs> I know thats my reasoning why useing sh is not a good idea
though
14:10 < str1ngs> unless you just plan to target *nix which is fine to
14:11 < steven> of course i do.
14:11 < steven> who supports windows?
14:11 < steven> i dont know anyone who does
14:12 < str1ngs> python ruby perl
14:12 < skelterjohn> i do, for gb
14:12 < steven> meh
14:12 < skelterjohn> gb is one of the few options for people to build go
code on windows without installing cygwin or mingw
14:12 < skelterjohn> because they can't use makefiles
14:12 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
14:13 < str1ngs> skelterjohn: you can use makefiles with windows sdk.  dunno
if can build go with the sdk though
14:13 < skelterjohn> i don't have windows, so this is hearsay from a few of
my users
14:14 < str1ngs> most people that use windows and go though would probably
have a cygwin or mingw enviroment.  actually last time I checked only mingw works
14:14 < steven> heresay?
14:14 < steven> oh
14:15 < skelterjohn> "most" is not all
14:15 < skelterjohn> and i know of at least two who don't
14:15 < steven> ok theres 2 people im not supporting ever.
14:15 < str1ngs> co what compiler are they using?  or there using binary
versions of go?
14:15 -!- skejoe [~skejoe@188.114.142.162] has quit [Quit: Lost terminal]
14:15 < steven> they should just use mac os x :)
14:15 < skelterjohn> binary versions of go
14:16 < str1ngs> mac os x is funky to
14:16 < str1ngs> 5$ for xcode 4.0...  lol?
14:17 < steven> better than whatever MS charges
14:17 < steven> anyway whatever
14:17 < pharris> skelterjohn: Thanks for gb -on-Windows, by the way.
14:17 < skelterjohn> 3 users!
14:17 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
14:17 < skelterjohn> :)
14:18 < pharris> skelterjohn: MS does ship "nmake" with their tools, but it
doesn't quite use the same syntax as "make", much less "gmake", so it's not useful
in a cross platform context.
14:18 < skelterjohn> hooray ms
14:24 < str1ngs> steven: anyways aside from a pet project.  if the community
really would like to see a go interpreter, which I think would be nice myself.  it
would probably be best to rally around one project and do it right.  and not have
3 implementations that do the samething.
14:26 -!- visof [~visof@unaffiliated/visof] has quit [Read error: Connection reset
by peer]
14:27 < exch> I'd love to help with thta, but I really dont have anough
knowledge of decent interpreter design
14:30 < str1ngs> I think the compile on the fly approach makes the most
sense.  which I think both goscript and gorun both use.
14:45 < steven> str1ngs: im not talking about a go interpreter.
14:45 < steven> btw, chmod +x this file and run it:
https://gist.github.com/873778
14:46 < steven> its a self-compiling go "script" ;)
14:46 -!- jbooth1 [~jay@209.249.216.2] has joined #go-nuts
14:53 -!- skelterjohn [~jasmuth@c-68-46-33-145.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
14:59 -!- artefon [~thiago@189.59.129.11.dynamic.adsl.gvt.net.br] has quit [Quit:
bye]
15:03 < xyproto> Ok, my quest for understanding "variadic" in Go has led me
to a compiler panic.  Does anybody else get a panic from this program?
http://pastebin.com/zHvrbXtZ
15:07 < str1ngs> steven: neato
15:09 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has quit [Read
error: Connection reset by peer]
15:09 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
15:10 < kamaji> Does "type Vector []interface{}" mean it's an array of
interface{} ?
15:10 < aiju> no, a slice
15:10 < kamaji> I'm still not sure how it can dynamically change its size
though
15:10 < aiju> magic
15:10 < kamaji> lol
15:10 < aiju> well, what do you want to hear?
15:10 < aiju> you can always allocate more memory
15:11 < kamaji> well if I add an element to the vector, it changes its size
behind the scenes, right?
15:11 < kamaji> if it goes over capacity, anyway
15:12 < kamaji> So if Vector is a []interface{}, how does it change its own
value to refer to the newly allocated memory?
15:14 -!- boscop [~boscop@g226231181.adsl.alicedsl.de] has quit [Read error:
Connection reset by peer]
15:15 -!- boscop [~boscop@f055213017.adsl.alicedsl.de] has joined #go-nuts
15:16 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has quit [Read
error: Connection reset by peer]
15:17 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
15:17 -!- shvntr [~shvntr@113.84.149.214] has quit [Read error: Connection reset
by peer]
15:20 < steven> for a long time i did not understand what "reference types"
meant, regarding slices maps and channels
15:21 < steven> now that i have a better understanding of how non-reference
types (ie normal types and pointer types) work, reference types make perfect sense
15:21 < steven> wait no, now that im trying to explain it, i dont understand
it again
15:22 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
15:22 < kamaji> hehe
15:22 -!- niemeyer [~niemeyer@201-66-179-18.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
15:27 < steven> i know that any argument being passed to a function (and
*possibly* just assigned to another variable?) has a copy of it made and thats
whats actually passed to a function
15:28 < steven> when its a pointer passed to a function, the rule still
applies so that pointer itself is copied.  but copying pointers is (1) cheap, and
(2) does NOT affect the underlying data that it actually points to
15:29 < steven> so if you have A is a pointer to an int, pointing currently
to 0xFADEDCAB, which holds "3" in it right now, and you copy that pointer, it
still points to 0xFADEDCAB
15:29 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has joined #go-nuts
15:30 < steven> but i dont understand why slices, for example, cant just be
structs that contain a pointer to an array, along with a len and cap value
15:31 < steven> oh i think i see why.  granted you maintain a consistent
pointer to the array, but the len and cap values might change
15:31 < aiju> slices are just structs, basically
15:31 < steven> hmm, so why not just make the slice struct contain 3 ptrs?
one to the array, one to len, and one to cap
15:31 < aiju> struct { Data *type ; Len, Cap uint32 }
15:31 < aiju> the internal structure of a slice is just that
15:31 < steven> right.  why not just make it struct { Data *type, Len, Cap
*uint32 } instead?
15:32 < aiju> why should one?
15:32 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
15:32 < steven> then it wouldnt have to be reference type anymore
15:32 < steven> it could just be a normal type
15:32 < aiju> it's not a reference type
15:32 < steven> a slice?
15:32 < steven> yes it is.
15:32 < aiju> slices are just values, like pointers
15:32 < steven> thats why you make it with make()
15:33 < aiju> make(*type) has been discussed as a possible syntax addition
15:33 < steven> look in the FAQ at "Why are maps, slices, and channels
references while arrays are values?"
15:33 < aiju> because the FAQ is wrong )
15:33 < aiju> *:)
15:33 < aiju> or rather, they use a funny definition of reference type
15:33 < aiju> which includes pointers
15:33 < steven> uhh..
15:33 < steven> wtf?
15:34 < steven> then are you saying the spec is wrong too?
15:34 < steven> "Slices, maps and channels are reference types that do not
require the extra indirection of an allocation with new."
15:34 < steven> http://golang.org/doc/go_spec.html
15:35 < skelterjohn> there seems to be a vocabulary mismatch here
15:35 < skelterjohn> perhaps you should both define "reference type"
15:36 < steven> im using whatever definitoin the spec is using
15:36 < steven> im just referencing the spec when i use that term
15:36 < skelterjohn> if you can't define it, then you don't really know what
the spec is saying when they use that term
15:36 < steven> i didnt say i cant
15:37 < aiju> i have no clue what kind of funny thing they mean by reference
type
15:37 < aiju> really, a slice is just a pointer with a length (and a cap)
15:38 < steven> i understand it like this: its basically a pointer under the
hood, but you access it like a value.
15:38 < aiju> steven: it is just a damn pointer
15:38 < skelterjohn> if you have a slice X
15:38 < skelterjohn> and you say Y:=X
15:38 < skelterjohn> and then say Y = Y[1:]
15:38 < skelterjohn> it doesn't change X
15:38 < steven> except you cant do *slice
15:38 < aiju> yeah
15:38 < skelterjohn> therefore, slices aren't reference types?
15:38 < steven> you just do slice.
15:38 < aiju> skelterjohn: difficult to say
15:39 < aiju> you can spend endless almost philosophical discussions with
such manners
15:39 < aiju> steven: no
15:39 < aiju> steven: just slice is the slice
15:39 < aiju> just like just pointer is the pointer
15:39 < aiju> slice[n] and *pointer are kind of analog operations
15:39 < steven> no, its quite simple.  its a pointer, except you cant access
its value directly like you can with a normal pointer.
15:39 < aiju> what "value"?
15:39 < aiju> you mean the address?
15:39 < aiju> you can't access that with a Go pointer either
15:39 < steven> var a []int; *a // ILLEGAL
15:39 < aiju> (unless you do unsafe)
15:40 < aiju> steven: yeah, because it's a[0]
15:40 < steven> var b *int; *b; // LEGAL
15:40 < aiju> or a[n]
15:40 < aiju> different syntax, similar thing
15:40 < steven> var c *[]int; *c[0] // LEGAL
15:40 < steven> i know im right, im just not explaining what i mean
proplerly
15:40 < steven> we're both saying the same thing
15:41 < steven> im just bad at communicating.
15:41 < aiju> well, it's you trying to understand it
15:41 < xyproto> you are both wonderful human beings <3
15:41 < aiju> haha
15:41 < xyproto> :)
15:42 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined
#go-nuts
15:42 < exch> It would be nice if goinstall could handle tags when pulling a
repo.  Specially now with the weekly/monthly releases.  I write my stuff for
weeklies, but it doesn't guarantee the code will work with the latest monthly
15:43 < exch> If I start tagging my stuff to indicate which Go version it
belongs to, goinstall could use that to pull a compatible version
15:43 < steven> xyproto: <3
15:43 < xyproto> :D
15:43 < steven> God bless you xyproto
15:44 -!- rtharper [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed
the connection]
15:47 -!- ronnyy [~quassel@p4FF1C54B.dip0.t-ipconnect.de] has joined #go-nuts
15:48 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
quit [Quit: Quitte]
15:50 -!- gr0gmint [~quassel@87.61.162.99] has quit [Remote host closed the
connection]
15:54 -!- shvntr [~shvntr@123.64.95.86] has joined #go-nuts
15:54 < str1ngs> exch: I think it can handle tags
15:55 < skelterjohn> ??
15:55 < skelterjohn> how does goinstall handle tags
15:55 < exch> I'll have to investigate then
15:55 < str1ngs> only tags named release though
15:56 < str1ngs> When downloading or updating, goinstall first looks for a
tag or branch named "release".  If there is one, it uses that version of the code.
Otherwise it uses the default version selected by the version control system,
typically HEAD for git, tip for Mercurial.
15:56 < skelterjohn> very interesting
15:56 < skelterjohn> thanks
15:56 < str1ngs> np
15:56 < exch> mm that doesnt solve the issue unfortunately :(
15:56 < skelterjohn> it'd be nice if you could specify which tag to use
15:56 < str1ngs> it does if you name your tag release :P
15:57 < skelterjohn> you'd need both a release and a weekly tag
15:57 < skelterjohn> to make this make sense
15:57 < exch> yes
15:58 < str1ngs> imp it should just handle branches.  atleast in git tags is
really just a branch.  I dunno about hg
15:58 < str1ngs> imo*
15:58 < exch> branches would work as well
15:58 < exch> Just have goinstall check for either release or weekly,
depending on what revision is currently on the system
15:58 < skelterjohn> start a mailing list thread - i'll back you up :)
15:59 < skelterjohn> but i'm going to lunch right now
15:59 -!- wrtp [~rog@92.17.17.88] has joined #go-nuts
15:59 < str1ngs> weekly and release default names is bad
15:59 < str1ngs> what if you have a branch called devel that you want to use
15:59 < skelterjohn> that's why arbitrary tags would be nice
16:00 < str1ngs> haveing it look for weekly and release ..  is good though
16:00 < str1ngs> being able to say what tag/branch is even better
16:00 < skelterjohn> specify weekly or release or nothing -> tip
16:00 < str1ngs> but I dont know how bzr and hg handles tags
16:00 -!- m4dh4tt3r [~Adium@135.sub-75-208-75.myvzw.com] has joined #go-nuts
16:01 < str1ngs> exch: is this a git repo?
16:01 < exch> yes
16:01 < str1ngs> I guess you can make a tag called weekly.  then clone it to
release
16:02 < skelterjohn> exch: at one point i tried to start a convention of
repos/version/package
16:02 < str1ngs> redundant and still doesnt handle your weekly vs release
16:02 < exch> I think we could use one
16:02 < skelterjohn> and you could have, eg, repos/release/mypackage
16:02 -!- artefon [~thiago@dhcp26.usuarios.dcc.ufmg.br] has joined #go-nuts
16:02 < skelterjohn> and you could have, eg, repos/weekly/mypackage
16:02 < skelterjohn> repos/1.0/mypackage
16:02 < skelterjohn> etc
16:02 < skelterjohn> and repos/mypackage for dev tip
16:02 < skelterjohn> or even repos/dev
16:02 < skelterjohn> but i'm not charismatic enough to make people do things
16:02 < str1ngs> time to start hacking goinstall :P
16:03 < exch> moar charm
16:03 < skelterjohn> it'd be easier to catch on if goinstall had the
convention built in
16:03 < exch> ya
16:03 < str1ngs> which convention?
16:03 < skelterjohn> the one i just outlined
16:04 < str1ngs> ah yo mean for url layout
16:04 < str1ngs> hmm branches tags same effect without have to rework url's
16:05 < skelterjohn> yes
16:05 < skelterjohn> but easier for vcs newbs like me
16:05 < str1ngs> ah ok sorry I forget I'm a git fanatic
16:05 < str1ngs> learn branches they are good :P
16:08 < str1ngs> exch: I also should phrased it.  create a branch called
weekly then branch it release.
16:08 < str1ngs> no need to clone but its an option to
16:08 < exch> I to need to learn branches.  Never really use em myself.  I
guess it's about time I do
16:12 < str1ngs> what this google tech talk by Randal Schwartz
http://www.youtube.com/watch?v=8dhZ9BXQgc4
16:12 < str1ngs> he gives the best example of what branch really is atleast
in terms of git
16:13 < str1ngs> dont mind all my fail typos :P
16:13 -!- shvntr [~shvntr@123.64.95.86] has quit [Quit: leaving]
16:14 < exch> cool.  I'll have a look
16:29 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
16:30 -!- rtharper [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
16:31 < steven> guys guys guys guys guys
16:31 < steven> how can you import a package that has a relative path to
your Makefile?
16:32 < steven> (ie, assuming all your source files are in one directory,
along with your Makefile)
16:32 -!- zimsim [~simon@87.72.77.195] has joined #go-nuts
16:33 < exch> importing in go or in the makefile?
16:33 < exch> actually, you can specify relative paths in both
16:35 < steven> in go
16:35 < wrtp> steven: it's not recommended
16:35 < steven> oooh right, ./
16:35 < steven> wrtp: neither is using reflect as heavily as i do in GoRM
16:35 < steven> ;)
16:35 < wrtp> neither of what?
16:36 < steven> thats not recommended either
16:36 < steven> nm.
16:36 < exch> If you need to link a package from a nonstandard location,
it's probably best to pass the appropriate paths to the Go compiler/linker with
the -I and -L flags
16:36 < steven> cool
16:36 < steven> 6g -I for include, 6l -L for link?
16:37 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has joined
#go-nuts
16:40 -!- tgall_foo [~tgall@206.9.88.154] has quit [Quit: Leaving]
16:42 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has quit [Ping
timeout: 248 seconds]
16:45 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has quit [Quit:
Leaving]
16:48 -!- tgall_foo [~tgall@206.9.88.154] has joined #go-nuts
16:48 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has joined
#go-nuts
16:49 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
16:50 < skelterjohn> steven: you can import "../something" or
"./nestedsomething"
16:50 < steven> right.
16:50 < skelterjohn> but you shouldn't
16:50 < skelterjohn> instead, you should use gb :)
16:50 < skelterjohn> or, when they get around to finishing it, goinstall
16:51 < steven> whats gb
16:53 -!- artefon [~thiago@dhcp26.usuarios.dcc.ufmg.br] has quit [Quit: bye]
16:54 < skelterjohn> http://go-gb.googlecode.com
16:54 < skelterjohn> a build tool i made to help with this sort of thing
16:56 < skelterjohn> niemeyer: i have some goinstall requests for goneat.org
- gomatrix.googlecode.com/hg/matrix, gostat.googlecode.com/hg/stat
gohash.googlecode.com/hg/
16:56 < niemeyer> skelterjohn: Super, will add them
16:56 < skelterjohn> :) then i can just link goneat on the project page for
doc
16:57 < skelterjohn> i appreciate it
17:00 < niemeyer> skelterjohn: Does gohash has something after the hg/?
17:00 < niemeyer> s/has/have
17:00 < skelterjohn> a bunch of different things
17:00 < skelterjohn> hashmap, hashset, haslessmap, hashlessset
17:00 < niemeyer> Ah, ok
17:00 < skelterjohn> should have said /*
17:00 < skelterjohn> how quickly will it be up on goneat?
17:01 < niemeyer> skelterjohn: I'm doing it now, so should be up in a few
minutes
17:01 < skelterjohn> cool
17:02 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has quit [Ping
timeout: 240 seconds]
17:04 < steven> the 6l options arent very descriptive, im not sure how to
use them
17:05 < steven> is there a go-version of rubygems?
17:05 < steven> and rvm?  and bundler?
17:06 -!- ShadowIce
[~pyoro@HSI-KBW-109-193-120-162.hsi7.kabel-badenwuerttemberg.de] has joined
#go-nuts
17:06 -!- ShadowIce
[~pyoro@HSI-KBW-109-193-120-162.hsi7.kabel-badenwuerttemberg.de] has quit
[Changing host]
17:06 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
17:07 -!- g0bl1n [~g0blin@unaffiliated/g0bl1n] has joined #go-nuts
17:09 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has joined
#go-nuts
17:09 < skelterjohn> what are you trying to do with 6l?
17:10 < skelterjohn> 6g and 6l are set up so that you shouldn't really use
many options
17:11 < niemeyer> skelterjohn:
http://goneat.org/pkg/gomatrix.googlecode.com/hg/matrix/
17:11 < skelterjohn> great!
17:11 < niemeyer> skelterjohn: Automatically updated every few minutes
17:11 < niemeyer> The others are up as well
17:11 < skelterjohn> aha - i see that my instructions to gb get picked up by
godoc
17:11 < skelterjohn> perhaps i should change how that works a bit
17:12 < niemeyer> skelterjohn: The target stuff?
17:12 < skelterjohn> yes
17:12 < skelterjohn> is there something you can put in a comment to make
godoc ignore it?
17:13 < niemeyer> skelterjohn: As long as the comment is not right before
the package line, it won't be rendered
17:13 < skelterjohn> well, that's where gb wants it to be :)
17:13 < niemeyer> skelterjohn: Well..  :-)
17:13 < skelterjohn> at the moment
17:13 < niemeyer> Right :)
17:13 < skelterjohn> how often will goneat pull new versions from the repos?
17:14 < niemeyer> skelterjohn: Right *now*, every 5 minutes..  I may have to
increase that a bit in the future
17:14 < skelterjohn> wow - i would have said once a day
17:14 < skelterjohn> that's a lot of data
17:14 < niemeyer> skelterjohn: Hah, not for tip..
17:14 < niemeyer> skelterjohn: Not really..
17:14 < skelterjohn> well i guess not - it only sends deltas
17:14 < niemeyer> skelterjohn: It's not checking things out every 5
minutes..  it's checking for updates
17:14 < skelterjohn> cool
17:17 -!- artefon [~thiago@dhcp26.usuarios.dcc.ufmg.br] has joined #go-nuts
17:17 -!- m4dh4tt3r [~Adium@135.sub-75-208-75.myvzw.com] has quit [Ping timeout:
240 seconds]
17:21 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has quit [Ping
timeout: 252 seconds]
17:22 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has joined
#go-nuts
17:27 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has joined
#go-nuts
17:27 < kamaji> niemeyer: Ooh, thanks for that documentation
17:28 < kamaji> oh....  503~
17:28 < niemeyer> kamaji: No problem
17:28 < niemeyer> kamaji: Well, that is a problem :)
17:28 < kamaji> nope it's working now...
17:28 < kamaji> "No server is available to handle this request" = too many
requests?
17:29 < niemeyer> Ugh..
17:29 < niemeyer> Oops
17:29 < kamaji> Is it possible to take a slice of nonconsecutive elements in
an array?
17:29 < niemeyer> That looks pretty bad
17:29 < niemeyer> throw: runtime: address space conflict
17:29 < kamaji> Seems to be working now though
17:29 < skelterjohn> kamaji: no
17:29 < niemeyer> godoc is exploding in really bad ways
17:30 < kamaji> hurk
17:30 < skelterjohn> you can create a new slice
17:30 < niemeyer> Let me update godoc
17:30 -!- Venom_X [~pjacobs@rrcs-97-77-122-106.sw.biz.rr.com] has joined #go-nuts
17:30 < skelterjohn> but remember - looking at a slice looks at a contiguous
array of data
17:30 < niemeyer> To the current weekly
17:33 < str1ngs> you gone killed godoc!
17:34 < skelterjohn> boo
17:35 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has quit [Ping
timeout: 250 seconds]
17:37 < str1ngs> I just installed dpkg on archlinux so umm ya seems we are
all in the mood for breaking things
17:42 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has joined
#go-nuts
17:42 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
17:44 -!- g0bl1n [~g0blin@unaffiliated/g0bl1n] has quit [Quit: g0bl1n]
17:48 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has quit [Ping
timeout: 260 seconds]
17:49 < kamaji> oh I could get a slice of slices
17:49 < kamaji> since i'm using the slices from gomatrix anyway
17:49 < kamaji> But I don't really need to do that anymore anyway :P
17:52 < plexdev> http://is.gd/7GDUW2 by [Russ Cox] in go/src/pkg/time/ --
time: isolate syscall reference in sys.go
17:53 < plexdev> http://is.gd/75Jwf8 by [Rob Pike] in go/src/pkg/gob/ --
gob: eliminate two more allocations in decode.
17:55 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has joined
#go-nuts
17:55 -!- shakesoda [~colby@c-24-19-215-56.hsd1.wa.comcast.net] has quit [Client
Quit]
17:55 < skelterjohn> kamaji: if you use gomatrix, you can take submatrices
easily
17:55 < skelterjohn> if you want, for instance, a column vector, you can get
it without reslicing things, even under the hood
17:56 < skelterjohn> well, sorry taht is misleading
17:56 < skelterjohn> it reslices, but it doesn't copy data
17:56 -!- binarypie [~binarypie@adsl-99-35-135-146.dsl.pltn13.sbcglobal.net] has
joined #go-nuts
17:59 < kamaji> skelterjohn: with the Arrays() function, right?
17:59 -!- cenuij [~cenuij@base/student/cenuij] has quit [Remote host closed the
connection]
18:00 < kamaji> oh, getCol and getRow
18:00 < kamaji> fair enough :)
18:00 < skelterjohn> no - with the *densematrix.GetMatrix
18:00 < skelterjohn> if you then want a [][]float64, you can use Arrays()
18:01 < skelterjohn> there is no getCol/getRow...
18:01 < skelterjohn> at least not exposed
18:02 < kamaji> oh, hence the lowercase, heh
18:02 < kamaji> shwoops
18:03 < kamaji> oh sorry I meant GetColVector
18:03 < kamaji> which just calls GetMatrix anyway
18:03 < kamaji> so yeah...
18:03 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
18:04 < skelterjohn> yes, that will do what you want
18:04 -!- alkavan_ [~alkavan@IGLD-84-229-168-230.inter.net.il] has quit [Read
error: Connection reset by peer]
18:04 -!- alkavan_ [~alkavan@IGLD-84-229-168-230.inter.net.il] has joined #go-nuts
18:09 < plexdev> http://is.gd/HJ7Wvi by [Caine Tighe] in go/src/pkg/os/ --
os: remove fstat TODO
18:15 < niemeyer> skelterjohn, kamaji: Cool..  it'll now kick godoc again
immediately on crashes.  This is the crash:
http://code.google.com/p/go/issues/detail?id=1618
18:16 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has joined #go-nuts
18:17 < skelterjohn> turns out gb and godoc don't have to collide - gb looks
for *any* comment before the package statement that begins with "target:"
18:18 < skelterjohn> godoc looks at the first sentence of the *last* comment
before package
18:19 * exch just stripped 300 lines of code and retained the same functionality.
<- definition of a good code day.
18:19 < niemeyer> skelterjohn: Even more strict than that..  the last
comment without any spaces between that and the package line
18:20 < kamaji> exch: nice one :D
18:21 < kamaji> What flavour code?
18:22 < exch> javascript
18:23 < steven> foo
18:25 < skelterjohn> well...you can make js just one line
18:25 < exch> not that kind of stripping
18:25 < skelterjohn> :)
18:25 < exch> actually removing code
18:25 < skelterjohn> i kid
18:27 < exch> the stripped code was some legacy library someone else wrote a
long time ago.  Turns out I dont actually need it anymore.  It also solved the
memory leak problem I couldn't track down earlier.  it was doing some rather
wasteful stuff
18:30 < bartbes> the wasteful stuff being javascript?  :P
18:30 < skelterjohn> burn!
18:30 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Ping timeout: 250 seconds]
18:31 < exch> well, apart from js's own wastefulness :p
18:31 -!- SirPsychoS [~sp@c-24-13-132-130.hsd1.il.comcast.net] has quit [Read
error: Operation timed out]
18:37 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
18:37 -!- rlab_ [~Miranda@91.200.158.34] has joined #go-nuts
18:37 -!- sauerbraten [~sauerbrat@p508CADC5.dip.t-dialin.net] has quit [Remote
host closed the connection]
18:38 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 260 seconds]
18:38 < steven> ive updated godo to shell out all the hard work to make :)
18:39 < steven> https://github.com/sdegutis/godo/blob/master/godo
18:39 < steven> which means it knows whether you want to use 6g or 8g etc
18:40 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
18:41 < skelterjohn> i have been thinking about creating a package to build
go source
18:41 < skelterjohn> oh - godo wouldn't be able to use it
18:41 < skelterjohn> since it is a bash script
18:41 < skelterjohn> c'est la vie
18:44 < steven> uh, what?
18:44 -!- waqas [~waqas@jaim.at] has joined #go-nuts
18:44 < skelterjohn> godo is a script, right?  not go source
18:44 < skelterjohn> at least, the link you posted looks like a scrip
18:44 < skelterjohn> t
18:45 < steven> right.  gorun and goscript do similar things but are written
in Go
18:45 < steven> what i have is a portable shell script :)
18:45 < steven> right tool for the right job
18:45 < skelterjohn> so if i developed a package for building go source, it
would not be something godo could use
18:45 < skelterjohn> that's all
18:46 < steven> ok
18:46 < steven> what would your package do?  what need would it solve?
18:46 < waqas> Err, what argument type does print/println take?
18:46 < steven> waqas: do not use them
18:46 < skelterjohn> waqas anything
18:46 < steven> use fmt.Println
18:46 < skelterjohn> and what steven said
18:46 < steven> waqas: only after you understand how fmt.Println works and
have been using go for weeks, then you can use println
18:46 -!- imsplitbit [~imsplitbi@64.39.4.132] has joined #go-nuts
18:46 < steven> s/weeks/months/
18:46 < steven> deal?
18:46 < skelterjohn> lol, that's pretty silly :)
18:46 < steven> deal.
18:47 < steven> skelterjohn: well?
18:47 < waqas> steven: No, no deal.  I want to use println!
18:47 < steven> re: above
18:47 < steven> waqas: look:
18:47 < steven> "Current implementations provide several built-in functions
useful during bootstrapping.  These functions are documented for completeness but
are not guaranteed to stay in the language.  They do not return a result."
18:47 < steven> print and println are described there.
18:47 < skelterjohn> oh, didn't know that
18:47 < skelterjohn> thanks
18:47 < steven> in the spec.
18:47 < steven> http://golang.org/doc/go_spec.html
18:48 < steven> skelterjohn: sure.
18:48 < waqas> Yep, I read that while trying to figure out what I need to
make my struct printable
18:48 < steven> waqas: look at the fmt package
18:48 < steven> it explains it.
18:48 < skelterjohn> waqas: print/println won't help you there
18:48 < steven> http://golang.org/pkg/fmt/
18:48 < steven> its already printable :)
18:48 < skelterjohn> if you pass something to fmt.Println, and it has a
String() method, then it will all work
18:48 < steven> although i think if you define a String() method on it, a
little magic happens
18:48 < waqas> steven: Thanks, that's much more useful advice :)
18:48 < steven> though i cant remember where i found that tip
18:48 < steven> so i wouldnt trust its credibility if i were you
18:49 < waqas> Basically, I added String(), but it complained, and I didn't
see what it wanted in the docs.
18:49 < steven> BUT, generally you shouldnt need that, #+v is usually
sufficient
18:49 < skelterjohn> because print/println don't know about .String()
18:49 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
18:49 < skelterjohn> what is #+v
18:49 < skelterjohn> %v?
18:50 < steven> i meant %+v
18:50 < skelterjohn> what does the + add
18:50 < steven> %v the value in a default format.  when printing structs,
the plus flag (%+v) adds field names
18:50 < skelterjohn> interesting
18:50 < |Craig|> waqas: http://golang.org/pkg/fmt/#Stringer
18:50 < steven> yeah, my advice is good
18:50 < exch> %v prints a value, %+v prints fieldnames of a struct along
with value.  and %#v prints a full definition of the struct.  basically Go code
representation
18:50 < steven> |Craig|: ahh thanks.
18:50 < exch> %v and %+v call obj.String() if it's defined
18:51 < steven> but what the heck is GoStringer?
18:51 < waqas> |Craig|: Sure.  That works with fmt.*, but not with print/ln
18:51 < steven> i dont get it..  "go syntax"?
18:51 < steven> waqas: dont use print/ln
18:51 < steven> use fmt
18:51 < steven> those 2 functions are meant for bootstrapping
18:51 < waqas> steven: Why?  It feels more cutting edge.
18:52 < waqas> But anyway, I'll give in this time.
18:52 < skelterjohn> because of what steven quoted from the spec
18:52 < skelterjohn> i view that as a definitive reason to not use
print/println
18:53 < skelterjohn> also, print/println go to stderr rather than stdout
18:53 -!- artefon [~thiago@dhcp26.usuarios.dcc.ufmg.br] has quit [Read error:
Operation timed out]
18:54 < |Craig|> print/println lack fancy features, and may vanish from the
language
18:54 < skelterjohn> the one nice thing about print/println is you don't
have to import anything, and if you just want to add a quick tag to see if some
code is getting executed, it can be handy
18:54 -!- zozoR [~Morten@563476e6.rev.stofanet.dk] has quit [Remote host closed
the connection]
18:55 < waqas> skelterjohn: Indeed, that's how it got in my test code.  A
file which did various things with no imports.
18:55 < skelterjohn> downside is you can't use it to do pretty-print of your
data
18:56 < skelterjohn> if it's a pointer, you're getting a hex numer
18:56 < skelterjohn> number
18:56 < plexdev> http://is.gd/eMLDOM by [Alex Brainman] in
go/src/pkg/go/scanner/ -- go/scanner: to interpret line comments with Windows
filenames
18:59 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has joined #go-nuts
19:05 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Ping timeout: 250 seconds]
19:05 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
19:06 < str1ngs> gcc 4.6 will support go..  woot
19:07 < skelterjohn> hasn't gcc supported go for a while?
19:07 < str1ngs> officially
19:07 < skelterjohn> hasn't gcc officially supported go for a while?  :)
19:07 < str1ngs> not as a release no
19:07 < pharris> skelterjohn: Only in trunk.  4.6 will be the first gcc with
a number to support go.
19:07 < skelterjohn> gotcha
19:08 < str1ngs> ok now I have to build gcc ..
19:08 < str1ngs> worst cross canadian toolchain
19:11 -!- alkavan_ [~alkavan@IGLD-84-229-168-230.inter.net.il] has quit [Read
error: Connection reset by peer]
19:11 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
19:12 -!- alkavan_ [~alkavan@IGLD-84-229-168-230.inter.net.il] has joined #go-nuts
19:12 -!- waqas [~waqas@jaim.at] has left #go-nuts []
19:12 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has quit [Remote host
closed the connection]
19:15 < steven> skelterjohn: i use println once in a while, but only for
edge cases
19:15 < steven> quicker than importing fmt and deleting that import when im
done debugging
19:17 < steven> hey guys
19:17 < steven> godo now allows multiple files :)
19:17 < steven> https://github.com/sdegutis/godo/blob/master/godo
19:17 -!- waqas [~waqas@jaim.at] has joined #go-nuts
19:18 < skelterjohn> can you #!  it?
19:19 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts
19:20 < str1ngs> steven: println is fine for debugging but after reading the
spec the other day use fmt outside of debugging
19:20 < steven> skelterjohn: yes
19:21 < steven> str1ngs: exactly.
19:21 < steven> never use println/print in code you expect to run outside of
debugging.
19:22 < str1ngs> steven: I've been meaning to trackdown in the source the
code for print and println just to see exactly what they do
19:22 < waqas> I was thinking of doing just that before joining here.
19:23 < skelterjohn>
http://code.google.com/p/go/source/browse/src/pkg/runtime/print.c
19:27 < waqas> Am I right in assuming that there is no dead code elimination
at all?
19:28 < steven> waqas: what?
19:29 < waqas> Well, most of my code isn't in main(), but is called from it.
Commenting everything in main() doesn't change the compiled executable's size at
all.
19:30 < skelterjohn> that would indicate that there *is* dead code
elimination
19:31 < skelterjohn> assuming the code you commented out cannot be executed
19:31 < skelterjohn> otherwise, commenting it out would reduce the file size
19:31 < steven> hmm interesting
19:31 < skelterjohn> btw the vast majority of the data in your binary comes
from imports, not the code you write in main()
19:32 < waqas> There are two functions.  func dostuff(), and main().  main
just calls dostuff.  Commenting the call in main doesn't reduce the size any.  And
yes, there are imports, but shouldn't they get eliminated as well?
19:32 < kamaji> It should error if the imports aren't being used, shouldn't
it?
19:33 < waqas> dostuff() is still using the imports.  nothing is using
dostuff().
19:33 < skelterjohn> i see
19:33 < skelterjohn> doing that kind of analysis would slow the compiler
down a lot
19:34 < skelterjohn> well, maybe not that bad
19:34 < skelterjohn> not bad at all, actually - easy to just keep track of
whether or not a function is called
19:34 < waqas> Right, just making sure what I'm seeing is what I think I'm
seeing.
19:34 < skelterjohn> and remove functions that are never called
19:35 < skelterjohn> oh - they probably don't do this removal, right
19:35 < waqas> It was just somewhat unexpected.
19:35 < skelterjohn> it's a young compiler
19:35 < skelterjohn> first things first
19:35 < waqas> Sure, understandable.
19:35 < pharris> I seem to recall a thread on the mailing list about dead
code elimination not working as well as it ought to, since the reflection
information is holding a reference to everything.  But I can't find the thread
now.
19:35 < skelterjohn> binary size is very low on their list of priorities
19:36 < steven> gorun and goscript are rewriting a lot of the work that
google's Make.inc already did for us.
19:37 < steven> not a good idea.
19:37 < skelterjohn> go wants to not depend on makefiles, eventually
19:37 < skelterjohn> so, good idea :)
19:38 < steven> until such point, its a good idea to reuse the work they've
done instead of rewriting it
19:38 < homa_rano> also importing fmt and calling fmt.Println will always
pull in all the unicode tables, as some arguments to Println might need them
19:38 < steven> and at such point, im sure they will have more work that we
can piggyback on, even if it isnt in makefile form
19:38 -!- tensorpudding [~user@99.148.205.193] has joined #go-nuts
19:38 < skelterjohn> what do they do, just run 6g and then 6l?  not super
taxing
19:39 < steven> they automatically figure out which compiler to use
19:39 < steven> 6g or 5g or 8g etc
19:39 < steven> which both gorun and goscript replicate:
19:39 < skelterjohn> switch runtime.GOARCH
19:39 < steven>
http://bazaar.launchpad.net/~niemeyer/gorun/trunk/view/head:/gorun.go
19:39 < steven>
https://github.com/kless/goscript/commit/f7eba9714bd43172a77037f689cb3bd4c96d0b2f
19:39 < aiju> 20:40 < skelterjohn> go wants to not depend on
makefiles, eventually
19:39 < aiju> really?  yuck
19:39 < steven> yeah, but thats dumb, to not use the work someone else did,
for no good reason
19:39 < steven> godo just shells out the work to the makefile
19:40 < steven> https://github.com/sdegutis/godo/blob/master/godo
19:40 < skelterjohn> perhaps a reason is not everyone has make
19:40 < steven> they should get it.
19:40 < aiju> wow?  really?
19:40 < steven> its not hard to get
19:40 < waqas> I dislike make.
19:40 < aiju> there are people on the planet running a (admittedly remotely)
UNIX-based OS without make?
19:40 < skelterjohn> no
19:40 < skelterjohn> windows
19:41 < skelterjohn> but then, they can't use godo anyway
19:41 < skelterjohn> since it's a shell script :)
19:41 < steven> aiju: which os are you refering to
19:41 < skelterjohn> aiju wasn't referring to an os
19:41 < skelterjohn> he was askign if one existed
19:41 < steven> im not sure about that
19:41 < skelterjohn> he was responding to me, not to you
19:41 < skelterjohn> or at least, that's how i read it
19:41 < steven> hey aiju im confused by what you meant
19:42 < aiju> steven: "HOLY CRAP PEOPLE DON'T HAVE MAKE?"
19:42 < skelterjohn> i read wrong, then
19:42 -!- ptolomy233 [d8ef2d04@gateway/web/freenode/ip.216.239.45.4] has joined
#go-nuts
19:42 < steven> cool
19:43 < skelterjohn> then...yeah, what os unix-based make-free os is out
there?
19:43 -!- waqas [~waqas@jaim.at] has left #go-nuts []
19:44 -!- ronnyy [~quassel@p4FF1C54B.dip0.t-ipconnect.de] has quit [Remote host
closed the connection]
19:44 -!- waqas [~waqas@jaim.at] has joined #go-nuts
19:49 -!- ptolomy233 [d8ef2d04@gateway/web/freenode/ip.216.239.45.4] has quit
[Ping timeout: 252 seconds]
19:51 -!- ptolomy2333 [d8ef2d04@gateway/web/freenode/ip.216.239.45.4] has joined
#go-nuts
19:57 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
19:58 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
19:59 -!- rlab_ [~Miranda@91.200.158.34] has quit [Ping timeout: 246 seconds]
20:00 -!- ronnyy [~quassel@p4FF1C54B.dip0.t-ipconnect.de] has joined #go-nuts
20:00 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Quit:
hcatlin]
20:02 -!- alkavan_ [~alkavan@IGLD-84-229-168-230.inter.net.il] has quit [Read
error: Connection reset by peer]
20:03 -!- alkavan_ [~alkavan@IGLD-84-229-168-230.inter.net.il] has joined #go-nuts
20:04 < ptolomy2333> Has anyone made an attempt at creating a Norvig
Spelling Corrector port (http://norvig.com/spell-correct.html) in Go?
20:06 -!- ronnyy [~quassel@p4FF1C54B.dip0.t-ipconnect.de] has quit [Remote host
closed the connection]
20:07 < ptolomy2333> It seems like a good syntactical benchmark of basic
string and map handling.
20:08 < kamaji> ptolomy2333: doesn't look like it
20:08 < ptolomy2333> I made an attempt, but it was surprisingly ugly, so I'd
rather not share it.  :)
20:09 < kamaji> just put an "UGLY CODE" disclaimer on it?  :D
20:09 < niemeyer> goneat.org is going down for maintenance: memory bump.
20:10 < ptolomy2333> Well, the main problem is that I wrote it to not be
inefficient.  The original and most clones read everything into memory, don't
handle errors, and make all sorts of copies.
20:11 < ptolomy2333> Maybe I'll try again with clarity as the goal and see
if I can get Mr Norvig to post it on his page.
20:13 < steven> as long as you use pointers, you should be fine ;)
20:14 < steven> WTF GONEAT.ORG IS DOWN
20:14 < steven> ...oh
20:14 < steven> jk ;)
20:15 < niemeyer> steven: :-)
20:15 < steven> whats that site about btw?
20:15 < steven> never heard of it
20:16 < steven> and is it written in go?  :)
20:16 -!- artefon [~thiago@189.59.184.213.dynamic.adsl.gvt.net.br] has joined
#go-nuts
20:16 < aiju> steven: it's written in ..  python
20:16 < steven> jk?
20:16 < niemeyer> LOL..  yeah :)
20:16 < aiju> no
20:16 < steven> niemeyer: btw your work inspired me:
https://github.com/sdegutis/godo/blob/master/godo
20:17 < niemeyer> steven: It's godoc..  with automatically updated
documentation for weekly and tip
20:17 < niemeyer> steven: Also includes documentation for some community
packages
20:17 < steven> o cool
20:17 < steven> lemme know when its back up :)
20:18 -!- binarypie [~binarypie@adsl-99-35-135-146.dsl.pltn13.sbcglobal.net] has
quit [Remote host closed the connection]
20:18 < niemeyer> steven: Any reason for not using gorun?
20:18 < steven> yeah, i didnt like it being an executable.
20:18 < niemeyer> steven: You mean, like..  you don't like it being a *Go*
executable?
20:19 < steven> also im not a fan of the way gorun is doing a lot of the
work that Make.inc already does for us
20:19 < steven> no, i mean, mine is just a script
20:19 < steven> which relies on the fact that you have /usr/bin/env sh
20:19 < steven> (the real executable)
20:19 < niemeyer> steven: LOL, ok..  I'll stop trying to understand now
20:20 < steven> ok
20:20 < steven> i just think bash is the right tool for this job, not Go
20:20 < aiju> 21:22 < steven> which relies on the fact that you have
/usr/bin/env sh
20:20 < steven> err, sh, not bash
20:20 < aiju> you can just use /bin/sh
20:20 < aiju> and you shouldn't use /bin/sh if you mean bash
20:20 < steven> didnt know.
20:20 < steven> im using zsh
20:20 < steven> ;)
20:20 < steven> but i intentionally wrote it as portable as i know how, so
it should work shell-independently for the most part
20:21 < aiju> "porting a shell is easier than porting a shell script" (Larry
Wall)
20:21 < steven> heh
20:21 -!- SirPsychoS [~sp@c-24-13-132-130.hsd1.il.comcast.net] has joined #go-nuts
20:21 < steven> anyway yeah, i just think sh is the right tool for this job,
not Go
20:22 < aiju> what's this thing anyway?
20:22 < aiju> yet another Go build tool?
20:22 < steven> aiju: https://github.com/sdegutis/godo/blob/master/README.md
20:22 < aiju> yuck
20:22 < steven> why
20:22 < aiju> is Go turning into a scripting language now?
20:23 < steven> i want to be able to run a quick test once in a while
without having to setup a makefile and deal with executables
20:23 < steven> so yeah.  i want to sometimes run a go script
20:23 < steven> not everyones gonna like it.
20:24 < str1ngs> niemeyer: I ment to make a suggest about gorun.  I dont
think putting build files in $HOME is a good idea.  I think the work dir would be
better
20:24 < kamaji> it's not even really a script is it?  it's just compiling
and running for you
20:24 < niemeyer> str1ngs: Which work dir?
20:24 < steven> str1ngs: did you look at how mine does it?
20:24 < aiju> 8g test.go && 8l test.8 && ./8.out, christ
20:24 < str1ngs> niemeyer: the one the script file is in
20:24 < niemeyer> str1ngs: and what's the problem with ~/.gorun?
20:24 < kamaji> aiju: or, "godo file.go"
20:24 < niemeyer> str1ngs: Doesn't work..  breaks if the location is not
writable
20:24 < steven> str1ngs: it puts them in a temporary dir, builds it there,
runs it, and deletes the whole temp dir when its done.
20:25 < str1ngs> niemeyer: why would the script file dir not be writable?
20:25 < kamaji> str1ngs: system install
20:25 < niemeyer> str1ngs: Because that's a very common thing in a unix
filesystem!?
20:25 < steven> aiju:
https://github.com/sdegutis/godo/blob/07b9c2b0615c0661fd96099339d82041c212b264/godo#L30
20:25 < str1ngs> thats even work.  if the file is run by root???
20:25 < steven> aiju: problem with that is, when do you know whether it
should be 6g or 8g or 5g?
20:25 < str1ngs> worst*
20:25 < kamaji> str1ngs: no it's just prevented writing by anyone else
20:25 < kamaji> it's not +s
20:26 -!- pothos_ [~pothos@111-240-164-94.dynamic.hinet.net] has joined #go-nuts
20:26 -!- ptolomy2333 [d8ef2d04@gateway/web/freenode/ip.216.239.45.4] has quit
[Ping timeout: 252 seconds]
20:26 < kamaji> steven: ~/.godorc ? :)
20:26 < steven> no, i solved the problem already
20:26 < kamaji> oh ok
20:26 < steven> i just create a Makefile and let make do it
20:26 < niemeyer> Holy crap..
20:26 < steven> since Make.inc already does this stuff for us.
20:27 < kamaji> fair point
20:27 < niemeyer> steven: I suggest awk as well
20:27 < str1ngs> niemeyer: I can agree on $HOME being the right spot even
more so for a sytem run script.
20:27 < str1ngs> cant*
20:27 < steven> this is my current version:
20:27 < steven> https://github.com/sdegutis/godo/blob/master/godo
20:27 < aiju> you could just use /tmp
20:27 < steven> it is.
20:27 < steven> echo $TMPDIR
20:27 < steven> run that in your shell
20:27 < steven> its actually /var/ssomething for me
20:27 < steven> but you get the idea
20:27 < aiju> no value ;P
20:27 -!- pothos [~pothos@111-240-171-211.dynamic.hinet.net] has quit [Ping
timeout: 260 seconds]
20:27 < steven> niemeyer: for what?
20:27 < steven> aiju: really?
20:27 < steven> srsly?
20:27 < aiju> yes
20:27 < kamaji> steven: same here
20:27 < steven> no value?
20:27 < steven> huh.
20:28 < steven> make sure there is no E
20:28 < aiju> zsh on Debian
20:28 < steven> $TMPDIR, not $TEMPDIR
20:28 < kamaji> yep, checked
20:28 < steven> hmm.
20:28 < niemeyer> steven: Use awk, it will solve that problem too..
20:28 < kamaji> zsh on arch linux
20:28 < |Craig|> steven: I get
/var/folders/M4/M4oCK5IpHAucjm-kozc7uk+++TI/-Tmp-/ on my mac, works there
20:28 < steven> well in that case, itll fallback and create the temp dir in
the current directory
20:28 < steven> which is fine, since the tempdir is not likely to already
exist
20:28 < steven> |Craig|: me too
20:28 < str1ngs> kamaji: you use zsh on archlinux??  what is wrong with you
man :P
20:28 < SirPsychoS> idea: ioutil.TempFile("", "godo")
20:28 < steven> niemeyer: what was your first suggestion for awk about?
20:29 < kamaji> str1ngs: what's wrong with that?!
20:29 < kamaji> what did I do ;_;
20:29 * SirPsychoS uses zsh on arch linux as well
20:29 < niemeyer> steven: It was about a joke
20:29 < steven> o
20:29 < steven> i dont get it.
20:29 < str1ngs> kamaji: archlinux is bash country.  pray you dont use emacs
:P
20:29 < kamaji> I _LOVE_ emacs!
20:29 < kamaji> not really
20:29 < kamaji> I already have RSI
20:30 < str1ngs> niemeyer: also think about it it this way what if you have
to run a script as root?
20:30 -!- waqas [~waqas@jaim.at] has left #go-nuts []
20:30 < steven> http://en.wikipedia.org/wiki/TMPDIR
20:30 -!- pharris [~Adium@rhgw.opentext.com] has quit [Quit: Leaving.]
20:30 < niemeyer> str1ngs: What's the problem?
20:30 < steven> "Other forms sometimes accepted are TEMP, TEMPDIR and TMP,
but these alternatives are used more commonly by non-POSIX operating systems or
non-conformant programs."
20:30 < kamaji> steven: I've none of those
20:30 < SirPsychoS> erm, TMPDIR isn't set on my system, and I haven't done
anything to un-set it
20:30 < steven> "TMPDIR is specified in various Unix and similar standards,
e.g.  per the Single UNIX Specification."
20:30 < steven> get a real unix ;)
20:30 < aiju> hahahahah
20:31 < steven> like mac os x :)
20:31 < aiju> SUS is a bunch of shit
20:31 < str1ngs> niemeyer: well I goto use gorun next thing this is a bunch
of cruft in my HOME.  if you run it as root its going to stuff stuff in /root .
20:31 < steven> right on
20:31 < aiju> OS X might be as far as you can get from UNIX
20:32 < niemeyer> str1ngs: Yeah, it stuffs stuffs into a well known
location, and cleans the stuffed stuff properly every once in a while, rather than
stuffing stuff all around your system
20:32 < steven> "From its sixth release, Mac OS X v10.5 "Leopard" and
onward, every release of Mac OS X gained UNIX 03 certification while running on
Intel processors."
20:32 < str1ngs> niemeyer: hey I'm just trying to make a suggestion.  there
must be a better way
20:33 < aiju> steven: they added *multiple data streams* to files
20:33 < niemeyer> str1ngs: Yeah, and I'm trying to point out that there's
not only nothing wrong with the current approach, but your suggestion actually
presents real problems.
20:33 < str1ngs> niemeyer: what problem is that?
20:33 < steven> what suggestion is str1ngs making?
20:34 < niemeyer> str1ngs: Read only filesystem, namespacing per user,
cleaning up old/unused files, etc.
20:34 < str1ngs> there is nothing I know that would stuff binaries in /root
ever
20:34 < steven> i still think farming out the work of compiling and linking
and determining which compiler/linker to use to `make` is still the right way to
go
20:34 < str1ngs> niemeyer: thats what tmpdir is for
20:34 < niemeyer> str1ngs: Heh..  look further.
20:35 < aiju> could you just dump your shit into /tmp, please?
20:35 < steven> $TMPDIR ftw
20:35 < steven> it defaults to .
20:35 < steven> which is safe
20:35 -!- tvw [~tv@212.79.9.150] has quit [Read error: Connection reset by peer]
20:36 < aiju> why not /tmp?
20:36 < str1ngs> niemeyer: its only a suggestion
20:36 < steven> although on REAL os's, $TMPDIR is /tmp
20:36 < steven> or /var/tmp
20:36 < aiju> hahahahahaha
20:36 < niemeyer> str1ngs: It's only a comment on your suggestion
20:36 < aiju> steven: is there ANY reason not to use /tmp?
20:36 < niemeyer> Man, both of those threads are really not taking us
anywhere..  I'll do something productive.
20:36 < steven> you might not have write access to it aiju
20:37 < aiju> what?
20:37 < niemeyer> I mean it
20:37 < str1ngs> if you dont have write access to /tmp your system is broke
20:37 < steven> ok
20:37 < steven> niemeyer: is your site bac up yet?
20:37 < str1ngs> there are users that dont even use $HOME.  which then makes
gorun broke
20:37 < niemeyer> steven: Almost..  migration is done, just waiting for boot
up
20:37 < steven> k
20:38 < steven> niemeyer: migration for godoc?
20:38 < steven> weird
20:39 < niemeyer> steven: Migration of the machine running goneat.org to a
better powered one
20:40 < niemeyer> It's up!
20:40 < homa_rano> niemeyer: goneat doesn't seem to have a build version
advertised at the bottom of the page
20:40 < steven> yay!
20:40 < niemeyer> homa_rano: Indeed, and I have no idea why..  hmmm
20:40 < steven> yay, http://goneat.org/pkg/path/filepath/#EvalSymlinks
20:41 < aiju> steven: dangerous function
20:41 < steven> launchpad.net is a package?
20:41 < steven> aiju: then why did adg add it?
20:41 < aiju> could be helpful, but nevertheless dangerous
20:42 < skelterjohn> launchpad.net is a prefix for any package hosted on
launchpad.net
20:42 < skelterjohn> it's goinstall stuff
20:42 < aiju> and programs treating symlinks special are an abomination
20:42 < steven> niemeyer: your yaml pkg is getting added to the stdlib?
20:42 < steven> o
20:42 < niemeyer> steven: Not that I know of
20:43 < plexdev> http://is.gd/e3ulE5 by [Ian Lance Taylor] in
go/src/pkg/net/ -- net: Don't force epoll/kqueue to wake up in order to add new
events.
20:45 < steven> k
21:00 < kamaji> :|
21:00 < kamaji> how do I declare an array of strings?
21:01 < skelterjohn> x := [...]string{s1, s2}
21:01 < kamaji> strings []strings{"foo", "bar"}
21:01 < steven> kamaji: you usually dont want an array though
21:01 < steven> kamaji: you usually want a slice.
21:01 < skelterjohn> []string{s1, s2} IS A SLICE OF STRINGS
21:01 < skelterjohn> oops
21:01 < skelterjohn> hit caps by accident
21:01 < steven> hehe
21:01 < kamaji> my face: :( -> :)
21:02 < kamaji> ok so I can't do x := []string{s1,s2}
21:02 < kamaji> ?
21:02 < aiju> sure you can
21:02 < skelterjohn> that's a slice instead of an array, that's all
21:02 < kamaji> can I put s1, s2 on different lines?
21:02 < skelterjohn> and in general, use slice if you don't care about
memory layout
21:02 < kamaji> It's erroring for some reason, i've probably messed up
somewhere
21:02 < aiju> yes
21:02 < skelterjohn> yes, end the line with a comma
21:02 < aiju> you have to add trailing commas
21:02 < skelterjohn> end BOTH lines with commas
21:02 < skelterjohn> otherwise it inserts a semicolon
21:03 < kamaji> oh wait, it's in a const block.....
21:03 < kamaji> Is that illegal?
21:04 < skelterjohn> can't have it in a const block
21:04 < kamaji> right, ok
21:04 < steven> kamaji: read this:
http://golang.org/doc/effective_go.html#arrays
21:04 < steven> "But even this style isn't idiomatic Go. Slices are."
21:06 < Namegduf> A YAML package in the stdlib would be nice
21:06 < steven> yeah i agree
21:06 < Namegduf> Not sure if it belongs, but it is a perfectly acceptable
config format, unlike JSON
21:06 < steven> id hate to force my config files for my framework to be JSON
21:06 < steven> YAML is nicer for that sort of thing
21:06 < Namegduf> You will need a third-party config lib right now.
21:07 < Namegduf> Or your own, of course.
21:07 < steven> right
21:07 < kamaji> What about protocol buffers?
21:10 < niemeyer> Namegduf: goinstall launchpad.net/goyaml..  as simple as
that :)
21:10 < niemeyer> Even though it'll soon be goinstall
launchpad.net/goyaml/yaml, so that the package name is "yaml"
21:11 < skelterjohn> well, package name is whatever you put as the package
name in the source
21:11 < skelterjohn> but programmers like the last item of the path to be
the package name
21:11 < skelterjohn> less confusing that way
21:11 < Namegduf> Also you don't have to specify anything in the source that
way.
21:11 < Namegduf> It's nicer not to.
21:13 < niemeyer> Right
21:16 < kamaji> can I pass the -I flag to 6g with the Makefile?
21:17 < skelterjohn> yes
21:17 < skelterjohn> GC += -I something
21:17 < skelterjohn> in the makefile
21:17 < kamaji> cheers
21:18 < kamaji> aw, didn't work..  I'm just trying to use a .a file that's
not installed in goroot
21:18 < skelterjohn> and LD += -L that-same-something
21:18 < skelterjohn> :)
21:19 < skelterjohn> what is the abs path to the .a file, and what is your
import string?
21:19 < skelterjohn> if you import "X"
21:19 < skelterjohn> and X is in /Y/X.a
21:19 < skelterjohn> then you can -I /Y
21:19 < skelterjohn> and -L /Y
21:19 < kamaji> oops, I put it in the wrong makefile
21:19 < kamaji> /cry
21:19 < kamaji> Thanks :P
21:20 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-153-93.clienti.tiscali.it]
has joined #go-nuts
21:21 < matti_> what's the best way to search for help on Google Go, given
the commonality in its name?
21:21 < kamaji> matti_: golang
21:22 < matti_> oh ok, do people find most of the stuff at golang?
21:22 -!- Venom_X [~pjacobs@rrcs-97-77-122-106.sw.biz.rr.com] has quit [Quit:
Venom_X]
21:22 -!- Project-2501 [~Marvin@82.84.67.35] has quit [Ping timeout: 246 seconds]
21:22 < rm445> matti_: this might help too
http://go-lang.cat-v.org/go-search
21:22 < skelterjohn> no - use the word "golang" where you might have used
the word "go"
21:22 < matti_> oh gotcha skelterjohn
21:23 < matti_> rm445: will check that out thanks
21:23 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
21:23 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
21:24 < kamaji> Hrm, still not finding the .a in the current directory
21:24 < skelterjohn> kamaji: what's the absolute path of the .a file, from
where are you running make, and what is the import string?
21:24 < kamaji> skelterjohn: it's in the same directory i'm running make
21:25 < kamaji> skelterjohn: and the import is just import("packagename")
21:25 < skelterjohn> and in that directory you have packagename.a?
21:25 < kamaji> yea
21:25 < skelterjohn> and GC += -I .
21:25 < skelterjohn> LD += -L .
21:25 < skelterjohn> ?
21:25 < kamaji> Yep
21:25 < skelterjohn> what's the error message
21:25 -!- waqas [~waqas@jaim.at] has joined #go-nuts
21:26 < kamaji> not package main (package mypackage)
21:26 < skelterjohn> what
21:26 < kamaji> sorry, full thing is: 6l: _go_.6: not package main (package
mypackage)
21:27 -!- rtharper [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed
the connection]
21:27 < skelterjohn> what are you passing to 6l?
21:28 < kamaji> hang on a sec, I might have found it
21:28 < kamaji> 6l -L . -o run _go_.6
21:29 < skelterjohn> and the source file you use to make it is package
mypackage?
21:29 < rm445> kamaji: I've not been following your questions, but I think
you always feed 6l the object file of your package main
21:29 < skelterjohn> because that's not allowed - has to be package main
21:29 < rm445> (which pulls in any other packages automatically)
21:30 < steven> what does goinstall do?
21:31 < skelterjohn> at the moment, it downloads packages from VCS and
builds them in $GOROOT/src
21:31 < steven> o i found it.
21:31 < steven> thanks
21:32 -!- wrtp [~rog@92.17.17.88] has quit [Quit: wrtp]
21:33 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
21:34 -!- imsplitbit [~imsplitbi@64.39.4.132] has quit [Quit: Bye!]
21:35 < steven> boo
21:37 < skelterjohn> ?
21:41 < steven> very tired.  dunno why.
21:41 < steven> need apple i guess.
21:47 -!- wrtp [~rog@92.17.17.88] has joined #go-nuts
21:48 -!- vpit3833 [~user@203.111.33.203] has quit [Read error: Connection reset
by peer]
21:48 -!- vpit3833 [~user@203.111.33.203] has joined #go-nuts
21:53 -!- artefon [~thiago@189.59.184.213.dynamic.adsl.gvt.net.br] has quit [Quit:
bye]
21:59 < kamaji> I figured out the package issue, I think rm445 was right-
the other packages' files were interfering
21:59 < kamaji> Now I have this: panic: regexp: compiling "[^\s]+": illegal
backslash escape
21:59 < kamaji> is \s not the "whitespace" character in a regex?
22:01 < skelterjohn> the s is being escaped before regexp gets it
22:01 < skelterjohn> use `[^\s]+` instead
22:01 < skelterjohn> that's the raw string, no escapes
22:02 < skelterjohn> either that or "[^\\s]+"
22:02 < skelterjohn> the former way is convention
22:02 < kamaji> oh sorry, I did "[^\\s]+" in the code
22:02 < kamaji> the error comes out as the former
22:02 < skelterjohn> then i don't know
22:05 < exch> go's regexp is very simple.  it doesnt recognize stuff like \s
\w \d
22:05 < exch> use [ \t]
22:09 < kamaji> isn't \t just tab?
22:09 < exch> yes
22:10 < kamaji> oh right, I ignored the space
22:10 < kamaji> hehe
22:29 -!- plainhao [~plainhao@208.75.85.237] has quit [Quit: plainhao]
22:30 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
22:30 < plexdev> http://is.gd/0MloYH by [Rob Pike] in go/src/pkg/flag/ --
flag: fix example in doc comment.
22:32 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Ping timeout: 255 seconds]
22:38 -!- shakesoda [~colby@c-67-168-136-89.hsd1.wa.comcast.net] has joined
#go-nuts
22:38 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
22:45 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Ping
timeout: 246 seconds]
22:46 -!- dfc [~dfc@sydfibre2.atlassian.com] has joined #go-nuts
22:47 < plexdev> http://is.gd/HnfIBn by [Robert Griesemer] in
go/src/pkg/go/parser/ -- go/parser: fix memory leak by making a copy of token
literals
22:54 -!- wrtp [~rog@92.17.17.88] has quit [Quit: wrtp]
22:55 -!- wrtp [~rog@92.17.17.88] has joined #go-nuts
22:56 < Xenith> I don't suppose its possible to get at the socket descriptor
with a net.Listener or net.TCPListener, and then later reattach to that descriptor
with a new Listener?
22:56 -!- wrtp [~rog@92.17.17.88] has quit [Client Quit]
22:57 -!- boscop [~boscop@f055213017.adsl.alicedsl.de] has quit [Ping timeout: 260
seconds]
22:59 < dfc> Xenith: i think it is possible
23:00 < dfc> you can construct an os.File from an existing Fd
23:00 < dfc> having said that i'm not sure if I know the exact api reference
23:06 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
23:08 -!- tensorpudding [~user@99.148.205.193] has quit [Read error: Connection
reset by peer]
23:09 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
23:16 -!- aho [~nya@fuld-590c74d0.pool.mediaWays.net] has joined #go-nuts
23:18 -!- napsy [~luka@88.200.96.18] has quit [Quit: Lost terminal]
23:19 < plexdev> http://is.gd/62ENap by [Alex Brainman] in
go/src/pkg/path/filepath/ -- filepath: do not run TestEvalSymlinks on Windows
23:27 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has quit
[Quit: Leaving.]
23:27 -!- jgonzalez [~jgonzalez@173-14-137-134-NewEngland.hfc.comcastbusiness.net]
has quit [Ping timeout: 276 seconds]
23:29 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Ping timeout: 276 seconds]
23:30 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-153-93.clienti.tiscali.it]
has quit [Quit: E se abbasso questa leva che succ...]
23:35 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
23:36 -!- m4dh4tt3r [~Adium@29.sub-75-210-236.myvzw.com] has joined #go-nuts
23:38 -!- waqas [~waqas@jaim.at] has left #go-nuts []
23:51 < plexdev> http://is.gd/uycAsJ by [Ken Thompson] in go/src/cmd/gc/ --
sinit.c: recursion in sinit
23:52 -!- tensorpudding [~user@99.148.205.193] has joined #go-nuts
--- Log closed Fri Mar 18 00:00:55 2011