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

--- Log opened Thu Jan 27 00:00:05 2011
00:06 -!- devrim [~Adium@] has quit [Quit: Leaving.]
00:11 -!- adu_ [~ajr@pool-173-73-1-173.washdc.fios.verizon.net] has joined
00:12 -!- adu [~ajr@pool-72-83-254-159.washdc.fios.verizon.net] has quit [Ping
timeout: 240 seconds]
00:15 -!- adu [~ajr@pool-173-66-10-202.washdc.fios.verizon.net] has joined
00:17 -!- adu_ [~ajr@pool-173-73-1-173.washdc.fios.verizon.net] has quit [Ping
timeout: 240 seconds]
00:19 -!- ildorn [~ildorn@vpnclient-241-246.extern.uni-ulm.de] has quit [Read
error: Connection reset by peer]
00:19 -!- adu [~ajr@pool-173-66-10-202.washdc.fios.verizon.net] has quit [Ping
timeout: 240 seconds]
00:21 -!- idr [~idr@g230125222.adsl.alicedsl.de] has quit [Remote host closed the
00:27 -!- jodaro` [~user@poquito.divinia.com] has quit [Ping timeout: 255 seconds]
00:29 -!- iant [~iant@nat/google/x-hhcrnmkakhopbdhd] has quit [Ping timeout: 241
00:31 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
00:34 -!- iant [~iant@] has joined #go-nuts
00:34 -!- mode/#go-nuts [+v iant] by ChanServ
00:35 -!- iant [~iant@] has quit [Client Quit]
00:35 -!- thiago__ [~thiago@] has joined #go-nuts
00:35 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
00:36 -!- iant [~iant@] has joined #go-nuts
00:36 -!- mode/#go-nuts [+v iant] by ChanServ
00:37 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has quit
00:39 -!- ildorn [~ildorn@dslb-188-105-116-027.pools.arcor-ip.net] has joined
00:44 < plexdev> http://is.gd/h1Zv0F by [Andrew Gerrand] in
go/doc/codelab/wiki/ -- doc/codelab/wiki: replace curl with a Go program
00:48 -!- franksalim [~frank@108-65-76-174.lightspeed.sntcca.sbcglobal.net] has
joined #go-nuts
00:50 -!- meanburrito920 [~john@] has joined #go-nuts
00:50 -!- meanburrito920 [~john@] has quit [Changing host]
00:50 -!- meanburrito920 [~john@unaffiliated/meanburrito920] has joined #go-nuts
00:53 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts
00:55 -!- Scorchin [~Scorchin@host86-148-179-0.range86-148.btcentralplus.com] has
quit [Quit: Scorchin]
01:02 -!- gabriel9 [~gabriel9@] has quit [Remote host closed the
01:20 -!- saturnfive [~saturnfiv@] has joined #go-nuts
01:30 -!- decaf [~mehmet@] has joined #go-nuts
01:31 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Remote
host closed the connection]
01:35 < decaf> anyone tried this doc?
01:35 < decaf> it seems, fields of page struct has to be uppercase
01:36 -!- felipe [~felipe@unaffiliated/felipe] has quit [Quit: felipe]
01:40 -!- thiago__ [~thiago@] has quit [Quit: bye]
01:42 < skelterjohn> decaf: What exactly are you asking?
01:43 < decaf> didn't work for me, variables in templates, with "not
exported" error
01:44 < skelterjohn> I need some context
01:45 -!- CrazyThinker [~san@unaffiliated/mosva] has quit [Ping timeout: 240
01:45 < skelterjohn> for instance, what didn't work for you
01:46 < decaf> edit page of wiki for example
01:46 < skelterjohn> is this something to do with godoc?
01:47 < decaf> sorry
01:47 < decaf> http://golang.org/doc/codelab/wiki/
01:48 < decaf> I tought I pasted this first
01:49 < skelterjohn> are you doing this via multiple packages?
01:49 < skelterjohn> perhaps, one package for your code and another main
package to make an executable?
01:49 < decaf> no, only one source file
01:49 < skelterjohn> the export issue only arises when you are doing things
between packages
01:49 < skelterjohn> could you put the source file in a pastebin?  I can try
to compile it
01:50 < skelterjohn> then i'd have a better idea of what's going on
01:50 < decaf> http://golang.org/doc/codelab/wiki/final.go I used this one
in secont try, to make sure code is correctly written
01:52 < skelterjohn> i wish those line numbers weren't there...
01:52 < skelterjohn> what line number is the compile error?
01:52 -!- meanburrito920 [~john@unaffiliated/meanburrito920] has quit [Ping
timeout: 240 seconds]
01:52 -!- adu [~ajr@pool-71-191-154-210.washdc.fios.verizon.net] has joined
01:53 < decaf> use vim, ctrl+v :)
01:53 -!- meanburrito920 [~john@] has joined #go-nuts
01:53 -!- meanburrito920 [~john@] has quit [Changing host]
01:53 -!- meanburrito920 [~john@unaffiliated/meanburrito920] has joined #go-nuts
01:53 < skelterjohn> can't stand vim
01:53 < skelterjohn> but that's another conversation
01:54 < decaf> there is no compile error
01:54 < decaf> it doesn't render templates
01:55 -!- m4dh4tt3r [~Adium@70-36-245-216.dsl.static.sonic.net] has quit [Quit:
01:55 < skelterjohn> oh
01:55 < skelterjohn> if there is no compile error then it's not an export
01:56 < skelterjohn> that is purely compile-time
01:56 < rm445> I just tried it, if you run the executable you get:
<h1>Editing line 7: name not exported: title in type *main.page
01:57 < skelterjohn> i guess it's doing some reflect stuff?
01:57 < skelterjohn> which kinda invalidates what i said a second ago
01:57 -!- jodaro` [~user@poquito.divinia.com] has joined #go-nuts
01:57 -!- meanburrito920 [~john@unaffiliated/meanburrito920] has quit [Client
02:00 -!- iant [~iant@] has quit [Quit: Leaving.]
02:06 -!- niemeyer [~niemeyer@189-10-208-149.pltce701.dsl.brasiltelecom.net.br]
has quit [Ping timeout: 240 seconds]
02:11 -!- adu [~ajr@pool-71-191-154-210.washdc.fios.verizon.net] has quit [Quit:
02:14 -!- adu [~ajr@pool-71-191-154-210.washdc.fios.verizon.net] has joined
02:29 -!- exch [~exch@h78233.upc-h.chello.nl] has quit [Ping timeout: 240 seconds]
02:30 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
joined #go-nuts
02:31 -!- exch [~exch@h78233.upc-h.chello.nl] has joined #go-nuts
02:31 -!- ildorn1 [~ildorn@dslb-188-099-197-114.pools.arcor-ip.net] has joined
02:33 -!- ildorn [~ildorn@dslb-188-105-116-027.pools.arcor-ip.net] has quit [Ping
timeout: 276 seconds]
02:38 -!- felipe [~felipe@unaffiliated/felipe] has joined #go-nuts
02:39 -!- m4dh4tt3r [~Adium@adsl-76-205-56-82.dsl.pltn13.sbcglobal.net] has joined
02:39 -!- m4dh4tt3r1 [~Adium@217.sub-75-210-4.myvzw.com] has joined #go-nuts
02:44 -!- m4dh4tt3r [~Adium@adsl-76-205-56-82.dsl.pltn13.sbcglobal.net] has quit
[Ping timeout: 272 seconds]
03:22 -!- decaf [~mehmet@] has quit [Quit: Leaving.]
03:25 -!- adu [~ajr@pool-71-191-154-210.washdc.fios.verizon.net] has quit [Quit:
03:31 < plexdev> http://is.gd/bBnCIr by [Robert Griesemer] in
go/src/cmd/gofmt/ -- gofmt -r: match(...) arguments may be nil; add missing guards
03:36 -!- adu [~ajr@pool-71-191-154-210.washdc.fios.verizon.net] has joined
03:36 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts
03:36 -!- mode/#go-nuts [+v iant] by ChanServ
03:36 -!- fzzbt [~fuzzybyte@] has quit [Ping timeout: 240 seconds]
03:50 < Broady>
03:50 < Broady> watch adg talking live
03:54 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has quit [Quit:
03:54 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
03:56 -!- ymasory [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has quit [Remote
host closed the connection]
04:00 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
joined #go-nuts
04:03 -!- quantumelixir [~chillu@] has quit [Ping timeout: 240
04:05 -!- quantumelixir [~chillu@] has joined #go-nuts
04:05 -!- camnaes [~cm@c-69-255-143-16.hsd1.md.comcast.net] has quit [Quit: ]
04:12 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 241
04:13 -!- jodaro [~user@70-36-136-156.dsl.dynamic.sonic.net] has joined #go-nuts
04:24 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
04:43 -!- jodaro [~user@70-36-136-156.dsl.dynamic.sonic.net] has left #go-nuts
["ERC Version 5.3 (IRC client for Emacs)"]
04:43 -!- jodaro` [~user@poquito.divinia.com] has quit [Quit: ERC Version 5.3 (IRC
client for Emacs)]
04:44 -!- m4dh4tt3r1 [~Adium@217.sub-75-210-4.myvzw.com] has quit [Ping timeout:
255 seconds]
04:44 -!- jodaro [~user@70-36-136-156.dsl.dynamic.sonic.net] has joined #go-nuts
04:47 -!- SmoothPorcupine [~smooth@] has joined #go-nuts
04:50 < SmoothPorcupine> Okay who's the one who was giving me grief about Go
being simple and that some statements can't be expressions?
04:50 < SmoothPorcupine> Or the other way around or whatever.  That the
difference is valid.
04:56 < cbeck> Huh?
04:57 < cbeck> statement != expression, whats the issue?
04:58 < adu> that's what lines are for
04:58 < adu> and I think it makes up for it with the BLA x = y; z {} syntax
05:01 < cbeck> If you want to get all denotational about it, statements map
an environment to a new environment, expressions map an environment to a value.
05:02 < adu> anyways, I think Go is not simple enough
05:02 < SmoothPorcupine> Issue?
05:03 < SmoothPorcupine> I guess if there's an issue, it's that people are
allergic to advanced control flow.
05:03 < SmoothPorcupine> "I can't understand how this flows without reading
the code, RAAAAAGE!"
05:03 < adu> and advanced synchronization primitives
05:04 < adu> channels are way cool
05:04 < SmoothPorcupine> But there was someone earlier telling me there are
certain things that cannot be used as values.
05:04 < adu> what, like unicorns?
05:05 < SmoothPorcupine> No, like i++ or something I think.
05:05 < Boney> cbeck is right.
05:05 < Boney> I also add that seperation of statements and expressions is a
good thing and aids in debugging.
05:05 < Boney> consider
05:05 < SmoothPorcupine> somecall(someint++) isn't valid I think.
05:05 < SmoothPorcupine> Not sure.
05:06 < Boney> x = f(y++, y++);
05:06 < SmoothPorcupine> It is?
05:07 < Boney> yeah sure, different programmers can resionably disagree
about what they think the above language should do.
05:07 < Boney> that is they'd have to refer to the language spec.
05:07 < Boney> if you make it illegal to embed a statement within an
expression you solve this problem.
05:08 < SmoothPorcupine> People arguing is a problem?
05:08 < SmoothPorcupine> But let's be direct: That applies globally.
05:08 < Boney> this makes reading code and debugging easier - the two things
that contribute the most to a programmer's time.
05:08 < SmoothPorcupine> f(y(),y())
05:08 < Boney> does y() modify y?
05:09 < Boney> it may modify the environment (in most languages) which I
beleive is bad.
05:09 < Boney> I prefer pure declarative languages.
05:09 < SmoothPorcupine> No.
05:11 < SmoothPorcupine> I don't see how it matters if it does or doesn't.
05:11 < SmoothPorcupine> y is called twice.
05:12 < SmoothPorcupine> But, oh no!  How can I tell what order they are
executed in!
05:12 < SmoothPorcupine> What if the calls are reversed and I get the wrong
return value?!
05:13 < SmoothPorcupine> The call on the left is executed first and it's
return value will be used as the first parameter to f.
05:13 < SmoothPorcupine> This is all before the second call to y.
05:16 < SmoothPorcupine> Really there's only one way f(y++,y++) is gonna go
down unless the same uncertainty applies to f(y(),y()).
05:26 < SmoothPorcupine> Ah it was Namegduf.
05:28 -!- keithcascio [~keithcasc@nat/google/x-qfxpxiurtesaqvos] has quit [Quit:
05:29 < SmoothPorcupine> Well so anyway, I figured out the return value for
the remaining statements I couldn't think of a real return value for.
05:29 < SmoothPorcupine> Sorta.
05:30 < SmoothPorcupine> Not entirely sure how it works for some goto cases.
05:34 < SmoothPorcupine> What's the nice thing panic does?
05:35 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Quit: JusticeFries]
05:35 -!- fzzbt [~fuzzybyte@] has joined #go-nuts
05:37 < SmoothPorcupine> When did each of these features come into the
language: panic(); defer ...; recover()
05:38 < cbeck> defer was there since release, as I think was panic
05:38 < cbeck> recover was maybe 10mo ago?
05:40 < SmoothPorcupine> Yeah too bad about that.
05:44 < SmoothPorcupine> Actually I'm quite curious.  What was the final
thought that got recover() 'designed'?
05:49 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has quit [Read error:
Operation timed out]
06:03 < plexdev> http://is.gd/2EbNL1 by [Robert Griesemer] in
go/src/pkg/go/token/ -- token/position: added SetLinesForContent
06:03 < plexdev> http://is.gd/nfytwj by [Robert Griesemer] in
go/src/cmd/godoc/ -- godoc: full text index for whitelisted non-Go files
06:20 < plexdev> http://is.gd/vd7O1a by [Robert Griesemer] in
go/src/pkg/go/scanner/ -- go/scanner: fix build (adjust scanner EOF linecount)
06:22 <+iant> SmoothPorcupine: I think the final points were 1) let's make
it only meaningful in a function run by defer, and 2) it gives us a clean way to
return a status from a goroutine which panics
06:25 < taruti> is there a cleaner way of saying fmt.Sprintf("%v",x) ?
06:25 < j3parker> when building 6g i get "net.TestDialGoogle
06:25 < j3parker> err, a FAIL in there
06:25 < j3parker> due to a timeout
06:26 < j3parker> for an ip which seems to timeout from everywhere
06:26 < j3parker>
06:27 < j3parker> is there a way to just uh, ignore the tests?  :P
06:32 -!- adu [~ajr@pool-71-191-154-210.washdc.fios.verizon.net] has quit [Quit:
06:37 < j3parker> removing the dialgoogle and timeout tests "solved" my
06:37 < j3parker> i will investigate what is going on tomorrow; sleep now.
06:38 -!- tdc [~santegoed@host86-143-115-73.range86-143.btcentralplus.com] has
joined #go-nuts
06:40 -!- gobeginner [~nwood@cpc2-lee23-0-0-cust152.7-1.cable.virginmedia.com] has
joined #go-nuts
06:41 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
06:42 < SmoothPorcupine> iant, as opposed to...?
06:43 <+iant> j3parker: fixed in current sources; set DISABLE_NET_TESTS to
disable temporarily
06:43 <+iant> SmoothPorcupine: not sure what you mean
06:43 < SmoothPorcupine> Go didn't ship with a way to stop panics for a
06:44 < SmoothPorcupine> It's not really something you just forget to do.
06:44 <+iant> Because we hadn't figure out what we thought it should look
06:44 < SmoothPorcupine> Right, because you hadn't decided to even do it.
06:44 -!- tdc [~santegoed@host86-143-115-73.range86-143.btcentralplus.com] has
quit [Quit: tdc]
06:44 < SmoothPorcupine> If you had, you would.
06:44 <+iant> that was one of the choices on the table, yes
06:44 < SmoothPorcupine> As you do now.
06:44 <+iant> we had a sketch of a plan for how to do it before the release
06:44 <+iant> but it wasn't quite right
06:45 <+iant> we hadn't thought of only running recover in a defer function
06:45 <+iant> and we hadn't realize the way it would let us pick up
goroutine status, which was another ongoing issue
06:45 < SmoothPorcupine> I want to know what finally got it into the
language, where it deliberately was not.
06:45 <+iant> well, that's my answer
06:46 <+iant> the language is continuing to evolve
06:46 <+iant> as you can see from the mailing list
06:46 <+iant> we didn't make a deliberate choice to say "there is no way to
catch a panic"
06:46 <+iant> we made a deliberate choice to say "we're not sure what the
right way is, or even whether we want to do it"
06:47 < SmoothPorcupine> I'm just wondering if it was an arbitrary lapse in
judgment like, "Oh well.  I guess it's time to do 'exceptions,'" or was there some
logic behind it that I don't see?
06:48 <+iant> You seem to be disbelieving my statements, but I'm not sure
06:48 <+iant> for example, generics continue to be an open issue
06:49 <+iant> it may be that the decision is to not add generics
06:49 < SmoothPorcupine> Isn't the initial release date a decision?
06:49 <+iant> it may be that we add generics at some point
06:49 <+iant> sure, it was a decision that the language was good enough that
other people could get useful work done in it
06:49 <+iant> and it was a decision that it was time to get more input
06:50 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
joined #go-nuts
06:50 < SmoothPorcupine> So you chose just going public?  :P
06:50 <+iant> it was the plan all along
06:50 < SmoothPorcupine> I mean, there are many ways to get input.
06:50 <+iant> it was public inside Google before it was public outside
Google, if that is what you mean
06:51 <+iant> but there was no point to having a proprietary language
06:51 < SmoothPorcupine> Not wanting to turn Go into an incompatibility
mess, you also want to minimize feature removal, which becomes considerably harder
the longer the language is in "use."
06:51 <+iant> doing it open source was always the plan
06:51 <+iant> we're still willing to remove features
06:52 <+iant> I agree that compatibility is a consideration, but not yet a
major one
06:52 <+iant> as I'm sure all Go developers are painfully aware
06:52 < SmoothPorcupine> Not as willing as you were when it'd only piss
people inside Google off, though.
06:52 <+iant> I'm not sure it makes too much difference, to be honest
06:52 <+iant> maybe a little
06:52 <+iant> but not much
06:52 < SmoothPorcupine> Eh, I hope.
06:53 <+iant> in practice it's actually more painful for us to break code
inside Google
06:53 < gobeginner> do you have a feel for how long the language feature
set/syntax will take to settle down a bit?  6 months, a year, 5 years?
06:53 < SmoothPorcupine> So did you ever think /why/ exceptions cause pain?
06:53 <+iant> as in that case the programmers affected can walk over and
yell at us in person
06:53 < SmoothPorcupine> As opposed to simple, "They do."
06:53 < SmoothPorcupine> simply*
06:54 <+iant> gobeginner: I think a year, but it's hard to know and I'm not
in charge
06:54 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Quit:
06:54 <+iant> SmoothPorcupine: http://golang.org/doc/go_faq.html#exceptions
06:57 < SmoothPorcupine> "Instead of exceptions, it has a couple of built-in
functions to signal and recover from truly exceptional conditions."
06:57 < SmoothPorcupine> Come on, be honest with me here.  This is
06:58 <+iant> it's a different way of thinking about them than in a language
like C++, but, yes, it is exceptions
06:58 <+iant> they are dynamic rather than syntactic
06:58 < SmoothPorcupine> Er, oh, I guess maybe that's not someething you'd
want to say publicly...
06:58 <+iant> is this not public?
06:58 <+iant> obviously I only speak for myself
06:59 <+iant> You seem to have a bit of a chip on your shoulder; did I do
something to upset you?
07:00 < SmoothPorcupine> No, you're just the one that responded who gives
the impression he knows what he's talking about.
07:00 < SmoothPorcupine> I'm sorry for coming off as abrasive if I am.
07:01 <+iant> not so much abrasive as cynical; I guess "chip on your
shoulder" wasn't really the right phrase
07:01 <+iant> I'm just having fun with this work
07:01 < SmoothPorcupine> So, now, are you saying that the "convoluted code"
resulting from exceptions is created by exception being syntactic, as opposed to
07:02 < SmoothPorcupine> Essentially, the "why" I asked earlier would be,
"Syntax complexity."
07:02 <+iant> I think that I personally would say that it's more a state of
07:02 < SmoothPorcupine> Hehehe, good answer.  :P
07:03 <+iant> the throw catch syntax, and throw specifications on functions,
make it seems that exceptions can be controlled
07:03 <+iant> people start to build exceptions into their API
07:04 -!- dforsyth_ [~dforsyth@bastion.inap.yelpcorp.com] has quit [Quit: Computer
has gone to sleep.]
07:04 <+iant> I think the hope is that with a function called "panic" that
is less likely to happen
07:04 <+iant> but yes, the mechanisms have similar power
07:04 -!- wrtp [~rog@] has joined #go-nuts
07:04 <+iant> though of course defer is used for many things other than just
recovering from a panic
07:05 < SmoothPorcupine> Okay, but then, wouldn't a better aim be to make
exceptions controllable?
07:05 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
07:06 <+iant> I'm not sure that there is a language which has done that
07:06 < SmoothPorcupine> *ahem*
07:06 < SmoothPorcupine> :P
07:06 <+iant> panic/recover seems to address the needs that we see
07:06 < SmoothPorcupine> Oh, I'm sure that it does.  :P
07:07 <+iant> I'm sorry for missing your reference, but what language are
you thinking of?
07:07 < SmoothPorcupine> Go.
07:07 < SmoothPorcupine> :P
07:07 <+iant> ha, OK
07:07 < SmoothPorcupine> The idea is that Go could be a language that does
exceptions proper.
07:08 <+iant> We're open to ideas, but I think in this space it would have
to be a really good idea
07:09 < SmoothPorcupine> I haven't formally conceptualized the specifics,
but my "raw" idea is to make them resumable.
07:10 <+iant> C++ exceptions are resumable as I understand the term, by just
using "throw;"
07:10 < SmoothPorcupine> "No such file?  I know how to fix that.  Let me
just run this and...  There!  No need to panic."
07:11 < SmoothPorcupine> The thing about exceptions is they arbitrarity
unwind the stack, yeah?
07:11 <+iant> well, they unwind the stack a bit, at least
07:12 <+iant> I see what you mean by resumable
07:12 < SmoothPorcupine> But that's it.  There's never been a way to undo
that damage.
07:12 <+iant> we've designed Go so that that kind of thing could be done at
some point if we can figure out a way to make it work
07:13 <+iant> the deferred functions actually run without unwinding the
07:13 < SmoothPorcupine> Well, first you'd need a use case.
07:13 <+iant> then we unwind after one of them calls recover
07:13 <+iant> yeah
07:13 < SmoothPorcupine> But, how will you get a sense of a "valid" use of
"exceptions" if they are discouraged?  :P
07:14 <+iant> we look for ways that we find it frustrating or inefficient to
write in Go
07:15 < SmoothPorcupine> Exceptions are simply another method of flow
control, with a unique ability.
07:15 < SmoothPorcupine> That's the way I see it, anyway.
07:16 <+iant> sure
07:16 < SmoothPorcupine> A flow control in which you traverse long distances
of stack.
07:16 < SmoothPorcupine> A "valid" use for them only arise in large systems,
as I see it.
07:16 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
joined #go-nuts
07:17 < SmoothPorcupine> Actually, now that I think of it, I have made such
a system...
07:17 < SmoothPorcupine> Oh yeah that was the old input sytem I trashed.
07:17 < SmoothPorcupine> system*
07:18 < SmoothPorcupine> arises*
07:19 < SmoothPorcupine> Well anyway, what brought me here was I wanted to
break from a function and return a function that would continue the execution
after the break.
07:20 <+iant> call-with-current-continuation
07:20 <+iant> Go doesn't make that kind of code particularly simple
07:20 <+iant> we tend to use goroutines and channels instead
07:21 < SmoothPorcupine> Despite that the flow control is "wonky," I
actually think this would make my code as clear as possible.
07:21 < SmoothPorcupine> Yeah this is in Ruby.
07:21 -!- chressie [~chressie@dreggn.in-ulm.de] has quit [Quit: WeeChat 0.3.4]
07:21 < gobeginner> If I followed the earlier part of this discussion the
intention of panic/defer,recover rather than try/catch is to shift developer
behavior from "Exceptions are for general error handling use them where you like"
to "panic/recover is for genuinely exceptional cases use the 'comma,ok' return
syntax to handle predicable errors".
07:21 < gobeginner> Do Google have enough production Go code not
written/reviewed by the core language developers to show if the renaming is having
the intended effect on developers behavior?
07:22 <+iant> Not a good sample case as Google C++ developers don't use
exceptions either
07:24 < SmoothPorcupine> What I'm working on is an HTTP server, where I see
5 unique events: request line, header, end of headers, body, and end of body.
07:26 < SmoothPorcupine> I may be ready to return a response after the
request line, or I may want to delay in case a Host is selected, in which case I
wait for the end of headers.
07:27 -!- chressie [~chressie@dreggn.in-ulm.de] has joined #go-nuts
07:27 < SmoothPorcupine> Or maybe I need to process the body to generate a
07:30 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 240 seconds]
07:33 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
07:33 < SmoothPorcupine> response.*
07:36 -!- gobeginner [~nwood@cpc2-lee23-0-0-cust152.7-1.cable.virginmedia.com] has
quit [Ping timeout: 240 seconds]
07:36 < SmoothPorcupine> The only thing giving my flow control here any hint
of apparence is that I don't randomize the case: blocks.
07:37 < SmoothPorcupine> the order of*
07:43 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 276 seconds]
07:45 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
07:51 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
07:52 -!- gobeginner [~nwood@] has joined #go-nuts
07:53 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 255 seconds]
07:54 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
07:55 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
07:56 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
07:59 -!- zozoR [~zozoR@56346ed3.rev.stofanet.dk] has joined #go-nuts
08:06 < wrtp> SmoothPorcupine: have you looked at the http package?
08:07 < SmoothPorcupine> wrtp, in Go or Ruby?  Sorta and yes.  They both
08:08 < SmoothPorcupine> What's more, every HTTP library I've come across
08:10 < wrtp> what sucks about the Go http package?  (i'm not saying it
doesn't, mind, i'm just interested)
08:14 -!- ildorn1 [~ildorn@dslb-188-099-197-114.pools.arcor-ip.net] has quit
[Quit: Leaving.]
08:15 < SmoothPorcupine> Well for one, Request and Response aren't Message.
08:18 -!- nettok [~quassel@] has quit [Ping timeout: 246 seconds]
08:20 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
08:21 < SmoothPorcupine> I'll just throw this out there.
08:22 < SmoothPorcupine> package somepack ...  panic ConfFile { f =
file.Open("conf","r") }
08:22 < SmoothPorcupine> recover somepack.ConfFile {
file.Copy("someconf","conf") }
08:23 -!- Skola [~ik@5352A3FB.cm-6-3c.dynamic.ziggo.nl] has joined #go-nuts
08:23 < SmoothPorcupine> Obviously you'd not want to be calling is panic,
but you get the idea.  (I hope.)
08:25 < wrtp> what do you mean by "Request and Response aren't Message"?
08:26 < wrtp> what's "Message"?
08:26 < SmoothPorcupine> Aside from the request line and the response line,
requests and responses are indentical.
08:26 < SmoothPorcupine> "HTTP Message"
08:27 -!- skejoe [~skejoe@] has joined #go-nuts
08:27 < wrtp> the difference is that a server receives one and sends the
08:28 < SmoothPorcupine> Actually that's not complete.  The mechanism
file.Open uses to tripped the panic/recover isn't shown.
08:28 -!- Cyd [~zinc@unaffiliated/cydd] has joined #go-nuts
08:28 < SmoothPorcupine> wrtp, and what does a client do?
08:28 < SmoothPorcupine> trip*
08:28 < SmoothPorcupine> triggger*
08:28 < SmoothPorcupine> trigger*
08:29 < Cyd> how about you shut up
08:29 < Cyd> SmoothPorcupine
08:29 < SmoothPorcupine> Why?
08:29 < Cyd> cause
08:29 < Cyd> who do you think you are
08:30 < Cyd> acting all big and tough
08:30 < SmoothPorcupine> Maybe panic ConfFile file.Exists("conf") or
08:30 < SmoothPorcupine> Who do you think I am?
08:30 < wrtp> you're right, they are similar.  but different enough to be
different types.
08:31 -!- rlab [~Miranda@] has joined #go-nuts
08:31 < SmoothPorcupine> s/are/have embedded field/
08:32 < wrtp> ?
08:33 < SmoothPorcupine> In my server I actually moved request/reponse line
parsing into another struct{...  req,res Message ...}
08:33 < wrtp> if you want them both to implement Message, that implies that
sometimes you want to deal with both requests and responses without knowing which
one you're using.  when do you want to do that?
08:33 < SmoothPorcupine> I'm not saying that's necessarily valid or wise,
just something I'm trying.
08:34 < wrtp> it doesn't seem like a reason that the http package sucks
08:34 < SmoothPorcupine> When reading everything after the request/response
08:34 < wrtp> just a reasonable API decision
08:34 < SmoothPorcupine> It is indentical in all behaviors.
08:35 < wrtp> when reading everything after the request/response line, both
Request and Response have Body, which behaves identically in both cases.
08:35 < SmoothPorcupine> So does header parsing.
08:36 < SmoothPorcupine> The syntax is literally identical.
08:36 < taruti> Has anyone got example code creating a x509.Certificate?
08:36 < SmoothPorcupine> Many of the headers share the exact same behavior.
08:36 < wrtp> same thing - any header parsing can work on a header of type
map[string]string.  no need to depend on Request or Response
08:37 < taruti> ah, x509 has that as a test
08:37 < SmoothPorcupine> Cyd, I think I'm someone who can make logical
08:38 < SmoothPorcupine> Now who do /you/ think I am?
08:38 < Cyd> LISTEN
08:38 < Cyd> im sorry
08:38 < Cyd> :,(
08:39 -!- idr [~idr@e179146032.adsl.alicedsl.de] has joined #go-nuts
08:39 < SmoothPorcupine> Too late, I forgave you already.  :P
08:39 < Cyd> ily :D
08:39 < Cyd> <3
08:40 < wrtp> i think AddHeader and GetHeader should probably work on
map[string]string, not just on Response.
08:40 < wrtp> but they're fairly trivial functions anyway
08:41 < wrtp> it's still not a reason that the whole package sucks.
08:42 -!- Cyd [~zinc@unaffiliated/cydd] has quit []
08:43 -!- boscop [~boscop@f055249227.adsl.alicedsl.de] has joined #go-nuts
08:43 < SmoothPorcupine> To me, and what I have thus far not been able to
find, an HTTP library ought to be able to read and write requests and responses.
08:43 < SmoothPorcupine> That is, an HTTP library does parsing for both a
client and a server.
08:44 < gobeginner> SmoothPorcupine: instead of the restart-in-place
behavior you're after for error handling couldn't you just use function returns or
channel messages and a compensate/replay approach?
08:44 < gobeginner> server---request--->handlerA --request--->
08:44 < gobeginner> handlerB encounters no file error
08:44 < gobeginner> handlerA <-- noFile-- handlerB
08:44 < gobeginner> handlerA ----missingFileCompensation--->handlerC
08:44 < gobeginner> handlerA <-----ok--------------------------------
08:44 < gobeginner> handlerA --request---> handlerB
08:44 < gobeginner> server<---result---- handlerA <----result---
08:44 < gobeginner> It would be slower than your requested change since all
the logic in handlerB to the point of noFile is being replayed in the second call
to it admittedly.
08:44 < gobeginner> wonder if that is readable on other folks terminals...
08:46 < SmoothPorcupine> I'm not really using exceptions all that much for
the HTTP server.
08:48 < SmoothPorcupine> Currently the code exceptions on parse errors, but
I haven't tested that yet.
08:50 < SmoothPorcupine> What I wanted on that is to do some kind of `return
continue` thing that I don't really understand yet.
08:51 < wrtp> SmoothPorcupine: are you talking about something like the
common lisp condition/restart system?
08:51 < SmoothPorcupine> It'd return a func() that when called would
continue the function after the `return continue` statement.
08:52 < SmoothPorcupine> wrtp, not familiar with that.
08:52 < wrtp> sounds quite similar
08:52 < SmoothPorcupine> But I don't really expect Go to start turning all
statement into expressions.  :P
08:53 < wrtp> that's not the point.  the point is that in lisp, you can
raise a condition, have some handler handle it, and then pass control back to the
code that raised it
08:54 < SmoothPorcupine> Thinking about stack-destroying control flow
mechanisms just made me think of panic/recover.
08:54 < wrtp> it can lead to quite convoluted control flow
08:55 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts
08:56 < wrtp> in Go you can use goroutines to achieve the same effect.
08:56 < SmoothPorcupine> And if there's no handler?
08:56 < wrtp> then it's just like a normal exception.
08:57 < wrtp> or did you mean when using goroutines?
08:57 < SmoothPorcupine> I meant in lisp.
08:57 < wrtp> what i said, then
08:57 < wrtp> you could have a look at
09:00 < wrtp> common lisp is a language worth learning, BTW, just because
it's got ideas used in so many other languages.
09:06 < SmoothPorcupine> Urgh.  I can't read lisp.
09:07 < wrtp> it's worth perservering
09:07 -!- snearch [~snearch@f053000207.adsl.alicedsl.de] has joined #go-nuts
09:07 < wrtp> get hold of Pete Seibel's "Practical Common Lisp".  it's a
great intro.
09:08 < SmoothPorcupine> Can't I learn ideas without learning lisp?
09:09 < wrtp> if the ideas are framed in lisp, then it's worth learning that
language (or at least a little of it)
09:09 < wrtp> it's not hard
09:09 < mpl> SmoothPorcupine: http://smgl.fr.eu.org/mpl/pics/funnay/lisp.png
09:11 < wrtp> ;-)
09:11 < SmoothPorcupine> Is that a function call or a method declaration?
09:11 < mpl> no idea, I don't know lisp either :)
09:13 < wrtp> it's scheme, i think.
09:13 < wrtp> the point about lisp is that you can't read it without knowing
what the names mean.
09:14 < wrtp> that's where the hyperspec is essential:
09:14 < wrtp> for common lisp anyway
09:14 < SmoothPorcupine> I thought the point of lisp was that it was easy to
parse, algorithmically speaking.
09:15 < wrtp> yes, but algorithmically speaking doesn't mean that you can
understand what the code is doing
09:16 < wrtp> the uniform syntax has other advantages.
09:16 < SmoothPorcupine> If you can give a shorter example of that feature
than a CVS parser, well hey.
09:17 -!- skejoe [~skejoe@] has quit [Quit: Lost terminal]
09:17 < taruti> still no luck with certificates
09:18 < taruti> has anyone created a certificate and succesfully used that
with tls+http?
09:19 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
09:27 < taruti> got it :)
09:30 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has quit
[Quit: Ex-Chat]
09:30 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has joined
09:36 < wrtp> taruti: could you paste a working example please?
09:36 < wrtp> what was the bit you were getting wrong?
09:39 -!- tvw [~tv@] has joined #go-nuts
09:41 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
09:47 -!- gid1 [~gid@220-253-33-186.VIC.netspace.net.au] has joined #go-nuts
09:48 -!- gid [~gid@220.253-197-230.VIC.netspace.net.au] has quit [Ping timeout:
272 seconds]
09:48 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
joined #go-nuts
09:54 < SmoothPorcupine> "If not for this restriction, this code: ...  would
copy standard input into a copy of buf, not into buf itself.  This is almost never
the desired behavior."
09:54 < SmoothPorcupine> That's another thing I wonder about.
09:55 < SmoothPorcupine> If you almost never want to pass a copy as an
argument, why not make everything pointers and have dup()?
09:56 < wrtp> where's that sentence from?
09:56 < SmoothPorcupine>
09:57 < wrtp> BTW here's a better description of the CL condition system:
09:59 < wrtp> SmoothPorcupine: "why not make everything pointers?" - that's
kind of the point.  the Read method on bytes.Buffer takes a pointer.
10:00 < wrtp> if you've just made a copy of the Buffer, there's not much
point in calling the Read method on a pointer to that.
10:00 < wrtp> and that's what io.Copy(buf, os.Stdin) would do (if you were
actually allowed to copy bytes.Buffer, that is)
10:01 < SmoothPorcupine> Yeah, pointers are what you want to pass 99% of the
10:01 < wrtp> there are good counter examples
10:01 < SmoothPorcupine> Yes, but they only happen 1% of the time.
10:01 < wrtp> here's an example http://golang.org/pkg/image/#Point
10:02 < wrtp> here's another one, which is used quite a lot:
10:03 < SmoothPorcupine> Obviously numbers don't have to be pointers.
10:04 < wrtp> yeah, but numbers are just another value.
10:04 < wrtp> why is a struct different from a number
10:04 < wrtp> ?
10:05 < SmoothPorcupine> For Point, how would that interface be ruined if
structs were always pointers?
10:06 < SmoothPorcupine> You wouldn't need to be calling dup() to pass the
arguments to every function, it's just change the code internally.
10:06 < SmoothPorcupine> it'd*
10:07 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
joined #go-nuts
10:07 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
10:07 < SmoothPorcupine> A struct is different because it contains numbers.
10:07 < wrtp> it would mean that each call that created a new point would
need a new allocation
10:07 < SmoothPorcupine> As opposed to being a number.
10:07 < wrtp> what about struct { i int }
10:07 < wrtp> currently it's as efficient to pass that around as to pass an
10:08 < SmoothPorcupine> Er, isn't each call in the current one creating
three copies for each function?
10:09 < wrtp> yes.  but that's just copying two words for each one.  by way
of comparison, a slice holds three words.
10:10 < SmoothPorcupine> That's the solution to the other problem created by
making pointers for number containers the default.
10:10 < wrtp> what's the solution?
10:10 < SmoothPorcupine> struct{int}
10:10 < wrtp> i don't understand
10:11 < SmoothPorcupine> dup() is the other solution.
10:11 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 240 seconds]
10:11 < SmoothPorcupine> 99% of the time, you want pointers to the things
containing numbers, yes?
10:12 < wrtp> no
10:12 < SmoothPorcupine> >50% of the time?
10:12 < wrtp> you could say that about passing any value around.  when do
you want a pointer to the value, and when do you want the value itself?
10:13 < wrtp> it depends on the type.
10:13 < SmoothPorcupine> You want the pointer when the "value" is multiple
10:13 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
10:13 < SmoothPorcupine> When the value is a number, you just want the
10:13 < SmoothPorcupine> 99% of the time.
10:13 < wrtp> so you'd make a distinction between struct {i int} and
struct{i, j int} ?
10:13 < zozoR> pointers are more efficient, unless you pass around primitive
10:14 < SmoothPorcupine> Yes.
10:14 < wrtp> not necessarily
10:14 < SmoothPorcupine> Or kinda, depend on what you mean.
10:14 < wrtp> it can depend on the garbage collector
10:14 -!- virtualsue [~chatzilla@nat/cisco/x-symflgmwlvpftrgv] has joined #go-nuts
10:14 < wrtp> and copying a value is much cheaper if you don't have to do a
new allocation
10:15 < wrtp> so if you're making lots of copies, a non-pointer type makes
10:15 < SmoothPorcupine> Don't you?
10:15 < SmoothPorcupine> This is Go and not C.
10:15 < wrtp> x := struct{a, b int}; y := x
10:15 < wrtp> no allocations
10:15 < SmoothPorcupine> No?
10:16 < wrtp> no
10:16 < wrtp> i meant x := struct{a, b int}{}; y := x of course
10:16 < SmoothPorcupine> f := func(){x.a++}
10:16 < wrtp> ok, well using variables from a closure or taking their
address is different
10:17 < SmoothPorcupine> x := struct{a, b int};y := &x
10:17 < wrtp> sure
10:17 < SmoothPorcupine> Er, +{}
10:17 < wrtp> if you want a pointer, you're going to get one
10:17 < wrtp> and pointers == allocation
10:17 < SmoothPorcupine> Okay, but what happens there?
10:18 < wrtp> the compiler sees that the address of x is taken, and
allocates it on the heap not the stack
10:22 < SmoothPorcupine> What does this do?  y := *&x
10:23 -!- wrtp [~rog@] has quit [Ping timeout: 240 seconds]
10:26 -!- saturnfive [~saturnfiv@] has quit [Read error: Connection
reset by peer]
10:27 -!- bmizerany [~bmizerany@] has quit [Remote host closed the
10:28 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 240 seconds]
10:29 -!- wrtp [~rog@] has joined #go-nuts
10:30 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
10:30 < SmoothPorcupine> wrtp, what does this do?  y := *&x
10:30 < aiju> haha
10:30 < aiju> why would anyone do that?  :P
10:31 < Ina> aiju, I can see someone using it on an exam question.
10:31 < aiju> oh wait, yeah it's putting x on the heap
10:31 < SmoothPorcupine> To make the compiler go out of it's way to make
slower code I guess.
10:32 -!- qutron_xyxy [~xxx@] has joined #go-nuts
10:32 < SmoothPorcupine> Even with that?
10:32 < aiju> SmoothPorcupine: i have no clue
10:32 < aiju> it could be simply optimized away
10:33 < aiju> yes, it is
10:35 -!- qutron_xyxy [~xxx@] has quit [Remote host closed the
10:36 < SmoothPorcupine> Well if the compiler is making decisions about what
goes on the heap and what goes on the stack, it could instead base those decisions
on if something is returned, used in a closure, or dup()'d.
10:41 < wrtp> SmoothPorcupine: it's exactly the same as y = x
10:42 -!- rlab_ [~Miranda@] has joined #go-nuts
10:43 < wrtp> SmoothPorcupine: it's not necessarily stack vs heap.  it's
pointer vs non-pointer
10:44 < wrtp> oh, i see some of my previous messages may have been lost
10:44 < wrtp> i'll repeat
10:44 < wrtp> the compiler sees that the address of x is taken, and
allocates it on the heap not the stack
10:44 < wrtp> also, about values, memory cache behaviour is important.
10:44 < wrtp> if we've got type T struct {x, y int} then there's a
considerable difference between type S1 {a, b *T} and type S2 {a, b T}
10:45 -!- rlab [~Miranda@] has quit [Ping timeout: 255 seconds]
10:46 < SmoothPorcupine> Yes, that would be an issue, is struct equality
were defined, or you could Read to fill structs.
10:47 < SmoothPorcupine> if*
10:57 -!- rlab_ [~Miranda@] has quit [Read error: Connection reset by
11:00 < wrtp> even more significant, what about []T vs []*T ?
11:03 -!- rlab [~Miranda@] has joined #go-nuts
11:08 < SmoothPorcupine> When do you ever want []T?
11:12 < wrtp> what about this, from the image package?  type RGBA struct {
11:12 < wrtp> // Pix holds the image's pixels.  The pixel at (x, y) is
11:12 < wrtp> Pix []RGBAColor
11:12 < wrtp> Stride int
11:12 < wrtp> // Rect is the image's bounds.
11:12 < wrtp> Rect Rectangle
11:12 < wrtp> }
11:13 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has quit [Ping
timeout: 240 seconds]
11:14 < SmoothPorcupine> What difference would it make if it were
11:14 < wrtp> type RGBAColor struct {R, G, B, A uint8}
11:15 < wrtp> well, on a 64 bit machine, it would use up *at least* 3 times
the space
11:15 < wrtp> and that's if heap allocation is perfectly efficient, which it
is not
11:16 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined
11:16 < wrtp> also each time you looked at a pixel you'd have to do a
pointer indirection
11:16 < SmoothPorcupine> Let's put it this way.
11:16 < wrtp> and you couldn't copy pixels with a simple memmove
11:17 < Namegduf> It would remove the ability to control memory layout.
11:17 < SmoothPorcupine> If the compiler makes it []RGBAColor, but the code
handles them like pointers, when do you need to use dup()?
11:18 < wrtp> how can the compiler be that clever?
11:18 < aiju> the compiler is a bit clever when it comes to adding pointer
11:18 < aiju> cf.  the identical use of *Struct and Struct
11:19 < wrtp> if i've got var pix []RGBAColor and i do pix[0] = pix[3], how
can the compiler know where i want that to make a copy of the underlying value or
11:19 < wrtp> aiju: that's an easy, locally based decision
11:20 < SmoothPorcupine> Doesn't really need to be.  The only case I can
think of is if you want to store the same T in two arrays.
11:20 < Namegduf> Or in another variable.
11:20 < wrtp> pix[0].X = 99; pix[3] = pix[0]; pix[3].X = 100;
11:20 < wrtp> what should that print?
11:21 < aiju> 99
11:21 < aiju> structs are assigned by value
11:21 < wrtp> indeed
11:21 -!- tensorpudding [~user@] has quit [Read error: Connection
reset by peer]
11:21 < wrtp> but SmoothPorcupine is saying that the code should handle
those like pointers
11:21 < aiju> if pix were []*RGBAColor it would print 100
11:21 < Namegduf> I don't understand why you'd want it.
11:21 < wrtp> i don't either
11:22 < Namegduf> Go has explicit pointers.
11:22 < SmoothPorcupine> Not two arrays, but two array slots then.
11:22 < Namegduf> This is just a random instance of it.
11:22 < SmoothPorcupine> Namegduf, that's what I wonder about.
11:22 < SmoothPorcupine> Why?
11:22 < Namegduf> Go doesn't do anything magic.
11:22 < SmoothPorcupine> 99% of the time that's what you want.
11:22 < wrtp> SmoothPorcupine: i really don't understand why you want to get
rid of value structs
11:22 < wrtp> 99% isn't good enough
11:22 < SmoothPorcupine> Outside of the cases I mentioned above.
11:23 < wrtp> and it's not true anyway
11:23 < Namegduf> Because it's the same behaviour as everything else.
11:23 < wrtp> in some places, (e.g.  image) it's more like 10%
11:23 < Namegduf> A slice behaves exactly the same whether it's storing
pointers or structs or ints.
11:23 < SmoothPorcupine> Image is array, arrays are contigious in memory.
11:24 < SmoothPorcupine> That's why they are arrays..
11:24 < SmoothPorcupine> .*
11:24 < Namegduf> They wouldn't if it was an array of pointers.
11:24 < wrtp> +1
11:24 -!- shvntr [~shvntr@] has joined #go-nuts
11:24 < Namegduf> While the array would be contigious, the data pointed to
by each entry would not be.
11:26 < SmoothPorcupine> When do you need an array of pointers?
11:26 < Namegduf> Often.
11:26 < SmoothPorcupine> Then an example should be easy to provide.
11:26 < Namegduf> A slice referring to a bunch of items stored elsewhere is
11:27 < SmoothPorcupine> ''
11:27 < Namegduf> Sometimes, quite often, the same value needs to be
referred to from multiple places.
11:28 < SmoothPorcupine> ''
11:28 < Namegduf> WHENEVER that happens, a pointer must be used.  Also,
copying large structs around is slow, so those want pointers.  This cases happen
inside slices and arrays as often as outside.
11:28 < wrtp> the mapping of go types to memory layout is very
straightforward to understand.  all these have exactly the same memory
characteristics: [2]byte; struct {a, b byte}; uint16
11:28 -!- niemeyer [~niemeyer@189-10-208-149.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
11:28 < wrtp> that consistency counts for a lot
11:29 < wrtp> making a struct look like a pointer just "because it's what
you want most of the time" loses that consistency
11:29 < SmoothPorcupine> Outside of what I said above, when?
11:29 < Namegduf> I just said.
11:29 < SmoothPorcupine> Namegduf, you didn't speak code.
11:30 < wrtp> http://golang.org/src/pkg/time/sleep.go
11:30 < wrtp> as one recent example
11:30 < wrtp> any time you want to store a collection of references to
objects you might want a slice of pointers
11:31 < Namegduf> Arrays and slices have simple, well-defined behaviour
regardless of the type they contain.  Pointers, orthagonally, have well defined
behaviour, as do structs.  This would require special-casing, remove consistency,
and make it more complicated to reason with.
11:31 < wrtp> var events []*event
11:32 < aiju> making a struct a pointer is thoroughly evil
11:32 < aiju> a struct is simply a collection of values
11:33 < wrtp> more code: find $GOROOT/src -name '*.go' | xargs grep '\[]\*'
| wc -l
11:33 < wrtp> 432
11:34 < wrtp> at least 432 places where arrays of pointers are useful
11:34 < aiju> does it hurt that much to type that extra *?
11:34 < SmoothPorcupine> And event list argumebly ought to be a linked list.
11:34 < SmoothPorcupine> An*
11:34 < SmoothPorcupine> I'm not suggesting a change /should/ happen.
11:35 < SmoothPorcupine> I'm wondering why it is the way it is.
11:35 < SmoothPorcupine> As opposed to say, the other way around.
11:35 < aiju> because it's simple and consistent?
11:35 < taruti> Is there a reason why os.Exit is not implemented via a
special panic?
11:35 < aiju> taruti: why should it?
11:35 < Namegduf> Catching all panics is fairly common.
11:35 < wrtp> SmoothPorcupine: why should an event list be a linked list?
11:36 < taruti> aiju: to execute deferred actions
11:36 < SmoothPorcupine> wrtp, ease of list modification.
11:37 < wrtp> SmoothPorcupine: you can modify arrays easily too
11:37 < Namegduf> SmoothPorcupine: It's the way it is, because the way it is
is what you get when you put the rules for slices/arrays, the rules for pointers,
and the rules for structs together.
11:37 < SmoothPorcupine> Let's say you want to remove the second event.
11:37 < Namegduf> That's an application-specific concern.
11:37 < Namegduf> You may or may not want that capability.
11:37 < SmoothPorcupine> Namegduf, I'm asking that.
11:37 < SmoothPorcupine> I know that.
11:37 < Namegduf> A design should be used appropriate to your actual needs.
11:37 < wrtp> e[1] = e[len(e)-1]; e = e[:len(e)-1]
11:37 < SmoothPorcupine> I'm asking WHY.
11:38 < Namegduf> Why what?
11:38 < wrtp> that removes the second event
11:38 < Namegduf> Why those rules all combine like that?
11:38 < wrtp> Namegduf: two conversations at once!
11:38 < wrtp> i thought he/she was asking why the list of events was an
array not a linked list...
11:39 < SmoothPorcupine> wrtp, okay you don't mind moving the array forward.
11:39 < taruti> Has anyone implemented a panic-exit?
11:39 < SmoothPorcupine> How about I want to remove the item in the middle?
11:39 < wrtp> that doesn't move the array forward
11:39 < wrtp> it works for any n
11:39 < aiju> taruti: yes
11:39 < aiju> panic("exit")
11:39 < wrtp> e[n] = [len(e)-1]; e = e[:len(e)-1]
11:39 < taruti> haha
11:39 < Namegduf> taruti: You could just panic() directly.  You would need
to catch it to make it clean, though.
11:40 < taruti> Namegduf: yes, just unsure if someone has already nicely
packaged this
11:40 < wrtp> taruti: what about go func(){os.Exit(0)} ?
11:40 < Namegduf> I'm not sure how you could package it nicely
11:40 < wrtp> nothing could catch that panic
11:40 < SmoothPorcupine> Namegduf, let's put it simply, "Why aren't pointers
the default?"
11:41 < Namegduf> Because Go provides control of memory layout.
11:41 < SmoothPorcupine> Since duplication is used so little by comparison.
11:41 < wrtp> SmoothPorcupine: because a pointer points to a value.  you can
have a value without a pointer, but not the other way around
11:41 < Namegduf> It also provides obvious meaning to what x = y does.
11:41 < SmoothPorcupine> nil?  :P
11:42 < wrtp> that's got a value.  the value is nil.
11:42 < SmoothPorcupine> That's another thing that bugs me.  Why can I not
Read directly into structs?
11:42 < wrtp> SmoothPorcupine: because there are millions of ways that
structs can be encoded
11:43 < Namegduf> Because it's horrifically unportable
11:43 < Namegduf> Pick a portable encoding
11:43 < Namegduf> Use that
11:43 < SmoothPorcupine> That just means structs aren't portable.
11:43 < SmoothPorcupine> Which, kinda defeats the purpose, doesn't it?
11:43 < wrtp> SmoothPorcupine: there are lots of ways you can go from a
Reader to a struct
11:43 < Namegduf> No, it does not mean that.
11:43 < wrtp> structs are portable
11:43 < Namegduf> If you really want to, you can.  You just have to use
11:44 < wrtp> the particular memory layout that a struct is given on a
particular machine by a particular compiler is not portable
11:44 < Namegduf> Read it into a byte array, use unsafe to treat it as an
instance of the struct.
11:44 < Namegduf> Horribly unportable, which is why unsafe is and should be
11:44 < wrtp> SmoothPorcupine: what does it mean to Read into a struct {i
**int} ?
11:45 < SmoothPorcupine> You don't store memeory pointers on disk.
11:45 < SmoothPorcupine> memory*
11:45 < aiju> if you want to read in a struct, use encoding.binary
11:45 < SmoothPorcupine> (Swap notwithstanding.)
11:45 < aiju> that does exactly what you want
11:45 < aiju> and is portable
11:46 < wrtp> if you're talking about disk storage, there will be some
defined external format, and you'll need to conform to that.
11:46 < SmoothPorcupine> The idea is that the struct IS the format.
11:46 < Namegduf> The struct is not a format.
11:46 < SmoothPorcupine> And ought to be able to be copied to memory
11:46 < SmoothPorcupine> "Able"
11:46 < aiju> structs look different on all machines
11:46 < Namegduf> A given struct will be compiled to different formats on
different machines.
11:46 < SmoothPorcupine> "ought to be able"
11:47 < aiju> e.g.  endianness
11:47 < aiju> or alignment
11:47 < Namegduf> Go back in time
11:47 < SmoothPorcupine> "ought"
11:47 < SmoothPorcupine> Namegduf, I'm trying.  );
11:47 < aiju> Namegduf: VAX mixed endianness?  :)
11:47 < Namegduf> Convince the entire industry what you think "ought" to be
the case
11:47 < Namegduf> And then it's relevant.
11:47 < SmoothPorcupine> Oh.
11:48 < SmoothPorcupine> I don't need to go back in time for that.
11:48 < Namegduf> Aside that, what you think ought to be the case doesn't
matter.  Machines have different endianness, different type sizes different
alignment rules.
11:48 < Namegduf> Only the middle one is possibly influenceable by Go.
11:49 < aiju> Go could force little endian storage on all machines!
11:49 < SmoothPorcupine> Does encoding.binary just read to the memory if the
architecture allows it?
11:49 < Namegduf> It converts.
11:49 < aiju> SmoothPorcupine: no
11:49 < Namegduf> To a standard encoding.
11:49 < aiju> binary.Read(file, &struct, binary.LittleEndian)
11:49 < aiju> i might have mixed up argument order
11:50 * wrtp thinks that SmoothPorcupine might just be trolling.
11:51 < SmoothPorcupine> I share many common traits with a troll, by my
wonder about why pointers is genuine.
11:52 < aiju> the Plan 9 os package is terrible UNIX centered
11:52 < Namegduf> Required to permit control of memory layout, semantics of
copying via assignment.
11:52 < Namegduf> os in general is UNIX-centred, it has to try to provide
the same stuff
11:52 < taruti> wrote the exit wrapper if anyone is interested
11:52 < aiju> well, e.g.  it forces numeric uids
11:53 < SmoothPorcupine> Wait, so if read()ing straight to memory will never
be done, why do you need to control memory layout?
11:53 < taruti> aiju: a cleaner solution needs generics
11:53 < aiju> we have those, they are called interfaces
11:53 < wrtp> aiju: yeah, that's a problem
11:54 < wrtp> SmoothPorcupine: because excess memory usage leads to slow
11:54 < wrtp> i don't see how generics would help the fact that FileInfo.Uid
is an int
11:54 -!- jkakar [~jkakar@252.Red-88-0-173.dynamicIP.rima-tde.net] has quit [Quit:
11:55 < wrtp> SmoothPorcupine: and keeping things together in memory can
speed things up enormously with modern processors
11:55 < aiju> just make an interface providing an Equal method or similar
11:55 < SmoothPorcupine> wrtp, modern processors obsolete optimization.
11:55 < Namegduf> Implementing algorithms that do what you tell them to do
with memory, plus cache consciousness, etc.
11:56 < wrtp> aiju: yeah, i think that making uid_t into an interface inside
os might be a good idea
11:56 < wrtp> SmoothPorcupine: ha ha ha ha!
11:56 * wrtp is still laughing.
11:56 < jumzi> SmoothPorcupine is allways trolling :p
11:57 < wrtp> yeah, it's quite entertaining though
11:57 < aiju> that's why Windows 7 boots slower than fucking UNIX V6
11:57 -!- jkakar [~jkakar@252.Red-88-0-173.dynamicIP.rima-tde.net] has joined
11:57 < aiju> despite the machine being over 3000 times faster
11:57 < SmoothPorcupine> Let's just supposed it was reversed.
11:57 < jumzi> lol unix v6 IS JUST 9K LINES OF CODES
11:57 < aiju> jumzi: UNIX V6 is ~70 KLOC
11:57 < SmoothPorcupine> If you want something embedded, struct{*int}.
11:57 < aiju> jumzi: the kernel is not the OS ;)
11:58 < jumzi> meh
11:58 < jumzi> You know what i mean *sobs*
11:58 < aiju> if you want a language without pointers, go play with Python
11:58 < SmoothPorcupine> Ruby.
11:58 < aiju> after you got frustrated with crying at the compiler what
should be passed by value and what by reference, come back :P
11:58 < SmoothPorcupine> But I'm not saying that.
11:59 < aiju> s/compiler/interpreter/
11:59 < SmoothPorcupine> Not now at least.
11:59 < Namegduf> If you want a language where performance is considered
irrelevant, go use Ruby, yes.
11:59 < jumzi> anyhow, where do the OS ends?
11:59 < aiju> jumzi: at the disk limit
11:59 < SmoothPorcupine> Namegduf, performance is very important in Ruby.
11:59 < aiju> i.e.  when the disk is full
11:59 < jumzi> lol
11:59 < SmoothPorcupine> Development performance.  ;)
11:59 < aiju> yes, slowing down development is important
12:00 < aiju> doesn't ruby have a .Second() method or some other shit on
12:00 < SmoothPorcupine> No.
12:00 < jumzi> i looked at ruby
12:00 < jumzi> ...once
12:00 < aiju> orthogonality is for wimps
12:01 < jumzi> <instert whatever statement> is overrated
12:01 < SmoothPorcupine> Somehow I've never needed to bother looking up what
orthogonality means with regard to programming.
12:01 < jumzi> damn
12:01 -!- millergarym_ [~chatzilla@203-219-89-242.static.tpgi.com.au] has joined
12:01 < SmoothPorcupine> Despite not knowing what it means.
12:01 < aiju> it means being able to actually know the language
12:01 -!- millergarym [~chatzilla@203-219-89-242.static.tpgi.com.au] has quit
[Read error: Connection reset by peer]
12:01 < Namegduf> You should, it's a good thing.
12:01 < aiju> and not just the scratch around on the surface of a huge
bloated library turd
12:02 < aiju> (cf.  Java)
12:02 < SmoothPorcupine> What does it mean to know a language?
12:03 < jumzi> SmoothPorcupine: You're going all philosophical on me!
12:03 < SmoothPorcupine> I wasn't the one that said it.
12:03 < jumzi> Yes you where
12:05 -!- gid1 [~gid@220-253-33-186.VIC.netspace.net.au] has quit [Quit: Leaving.]
12:06 -!- gid [~gid@220-253-33-186.VIC.netspace.net.au] has joined #go-nuts
12:08 < quantumelixir> /join #euler
12:08 -!- decaf [~mehmet@] has joined #go-nuts
12:12 -!- xash [~xash@d126119.adsl.hansenet.de] has joined #go-nuts
12:14 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
joined #go-nuts
12:14 < quantumelixir> Anyone here had some luck building gccgo?
12:15 < wrtp> quantumelixir: what platform?
12:15 < quantumelixir> wrtp: debian
12:15 < quantumelixir> I managed to get a binary .deb build but I don't have
root privileges on that machine :(
12:15 < quantumelixir> and compiling was a big pain..
12:16 < quantumelixir> I installed mpc, gmp, mpfr and then finally gccgo
refused to build
12:16 < quantumelixir> wrtp: 64 bit
12:17 < aiju> alpha?
12:17 -!- ukai [~ukai@nat/google/x-pzllkunxmbnuayey] has quit [Ping timeout: 240
12:17 -!- ukai [~ukai@nat/google/x-dgyswzrngstlwhuk] has joined #go-nuts
12:18 < quantumelixir> alpha?  I checked out the lastest svn revision
12:18 < wrtp> i've only tried on a mac, and it failed.
12:18 < aiju> quantumelixir: i was referring to the platform :P
12:18 < aiju> quantumelixir: 64-bit is a stupid ambiguous marketing term
12:18 < quantumelixir> ok..
12:19 < quantumelixir> wrtp: what did it fail with?
12:19 < aiju> quantumelixir: why not use 6g?
12:19 < quantumelixir> wrtp: anything to do with undefined references to
"lexer_line" or "yyend"?
12:20 < quantumelixir> aiju: just interested in how good the compiler is
12:20 < quantumelixir> I've heard some fairly vague things being said about
the gccgo compiler
12:20 < quantumelixir> I'd like to ascertain how much of it is true
12:21 -!- skejoe [~skejoe@] has joined #go-nuts
12:22 < SmoothPorcupine> wrtp.  the second link is much better.
12:22 < wrtp> quantumelixir: well, good luck
12:22 < wrtp> SmoothPorcupine: good.
12:22 < SmoothPorcupine> I'm sure it all makes sense within lisp.
12:23 < wrtp> SmoothPorcupine: well, lisp isn't too different from other
languages.  the main differences are the syntax and the macro system.
12:23 < wrtp> and the condition system could work in other languages too.
12:23 < SmoothPorcupine> Basic concept is the same, yeah.  Some panics can
be handled higher up so there's no need to panic.
12:23 < wrtp> yeah
12:24 < wrtp> but in go, you'd probably do that by having the panicing
routine send a message down a channel asking how to handle the problem.
12:24 < wrtp> then the handler can be inside another goroutine
12:25 < SmoothPorcupine> Or just pass an closure.
12:25 < SmoothPorcupine> a*
12:26 < wrtp> pass a closure where?
12:26 < SmoothPorcupine> But, as I said way up there, I imagine the "valid"
use case for exceptions is in large systems.
12:26 < wrtp> why do you imagine that?
12:26 < SmoothPorcupine> Where flow control has to pass through large
regions of stack.
12:26 < wrtp> i think the larger the system, the less you want exceptions
12:27 < SmoothPorcupine> wrtp, scroll up I don't have time to repeat all
that I said.
12:27 < SmoothPorcupine> The conversation was mainly (only?) between iant
and I.
12:28 < wrtp> i think i came online after that discussion
12:29 < SmoothPorcupine> I think giving them names like labels in the idea I
posted way back there is probably the way to start thinking about how to do
exception proper.
12:29 < SmoothPorcupine> idea code*
12:30 < SmoothPorcupine> "exceptions"*
12:30 -!- erus_ [50b135f2@gateway/web/freenode/ip.] has joined
12:30 < taruti> How is one supposed to read unix datagrams?
12:31 < erus_> How do I tell 8l to build a package?
12:31 < erus_> without using make
12:32 < wrtp> do you mean having a special syntax for exceptions?
12:33 < SmoothPorcupine> wrtp, you joined mid-conversation but you get most
of the important stuff.
12:33 < Ina> wrtp, I believe he's talking 'try ...  catch' blocks (or
12:33 < SmoothPorcupine> Ina, no, more like prevent blocks.
12:38 < wrtp> i've just looked at your conversation with iant above, and i
can't see you gave any reasons for exceptions being more valid on large systems.
12:38 -!- visof [~visof@] has joined #go-nuts
12:38 -!- visof [~visof@] has quit [Changing host]
12:38 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
12:39 -!- visof [~visof@unaffiliated/visof] has quit [Client Quit]
12:39 <@adg> indeed.  why not just handle errors?
12:39 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
12:40 < wrtp> SmoothPorcupine: you said earlier: "Well anyway, what brought
me here was I wanted to
12:40 < wrtp> break from a function and return a function that would
continue the execution
12:40 < wrtp> after the break."
12:40 < wrtp> why did you want to break from the function?
12:40 < SmoothPorcupine> That is unrelated to exceptions.
12:40 -!- Skola [~ik@5352A3FB.cm-6-3c.dynamic.ziggo.nl] has quit [Quit: ciao]
12:41 < wrtp> ok, i thought it was related, sorry.
12:41 < SmoothPorcupine> 'A "valid" use for them only arises in large
systems, as I see it.'
12:41 < SmoothPorcupine> They are not valid simply because you have a large
12:42 < wrtp> go on.  have you got anything to back up that thought?
12:42 < SmoothPorcupine> No.
12:42 < wrtp> right
12:43 < SmoothPorcupine> Are "valid" use cases for exceptions, assuming they
exist, supposed to arise in small systems that can be easily refactored to work
without them?
12:43 < taruti> Is it an error that ListenUnixgram returns an UDPConn
instead of an UnixConn?
12:43 < taruti> Reading unixgrams from an UDPConn is an error :(
12:43 < wrtp> SmoothPorcupine: they can arise in small systems that can be
made simpler with them
12:44 < wrtp> SmoothPorcupine: for example if you're writing a recursive
descent parser, it's easier just to panic (and catch it at the top) than to handle
errors on every recursive call
12:44 < SmoothPorcupine> Sure, when in small systems the recovery function
is small and workable.
12:45 < SmoothPorcupine> If there is recovery needed at all.
12:45 < gobeginner> ***trolling*** goto?
12:45 < aiju> gobeginner: goto is great, once you stop being a bigot
12:46 < gobeginner> I've used it where it made sense and very clearly
documented the fact
12:47 < SmoothPorcupine>
http://go-lang.cat-v.org/irc-logs/go-nuts/2011-01-27 05:44 marks when the
exceptions conversation really starts.
12:47 -!- femtoo [~femto@95-89-198-16-dynip.superkabel.de] has joined #go-nuts
12:47 < aiju> dat exception discussion
12:48 < wrtp> SmoothPorcupine: yeah, i read it
12:48 -!- niekie [~niek@CAcert/Assurer/niekie] has quit [Ping timeout: 245
12:48 < quantumelixir> Why is the default "int" on a 64 bit machine only
32bits in size?
12:48 < quantumelixir> Is there a way to change this behaviour?
12:48 < aiju> quantumelixir: why should it be else?
12:49 < quantumelixir> aiju: So that I don't have to explicitly typecase
every single time I use it
12:49 < aiju> what are you doing with it?
12:49 < quantumelixir> numerical kind of stuff..
12:49 < wrtp> quantumelixir: 32 bit ints take less memory and are just as
12:49 < SmoothPorcupine> wrtp, you show up at 07:04.
12:49 < quantumelixir> it's not about speed
12:49 < aiju> use int64 if you want 64-bit
12:49 < Namegduf> If you care how big it is, then you presumably care even
if you're on a 32bit system, right?
12:49 -!- decaf [~mehmet@] has quit [Quit: Leaving.]
12:49 < SmoothPorcupine> Oh hey look at the time.
12:49 < wrtp> SmoothPorcupine: yeah, i read it in the logs
12:49 < SmoothPorcupine> Ah.
12:49 < quantumelixir> with 32bits my answers keep overflowing and all kinds
of unexpected behaviour happens
12:50 < aiju> quantumelixir: then use int64
12:50 < Namegduf> You'll need int64 on all architectures, then
12:50 < aiju> 1,$s/\<int\>/int64/ the mighty ed!
12:50 < quantumelixir> aiju: Yeah..  but it's *really* painful to do the
12:50 < wrtp> quantumelixir: go only guarantees 32 bit ints.  if you need 64
bits, then you need to use int64
12:50 < quantumelixir> my eyes hurt :(
12:50 < aiju> quantumelixir: what typecasting?
12:50 < aiju> int64 works just like int
12:50 < quantumelixir> for instance..  for i := int664(0); i < blah; i++
12:51 -!- rlab [~Miranda@] has quit [Ping timeout: 240 seconds]
12:51 < aiju> var i int64
12:51 < KBme> or var i int64
12:51 < Namegduf> That's longer
12:51 < KBme> oops
12:51 < wrtp> nah, i'd do it like quantumelixir did
12:51 < Namegduf> But that's not so bad, it's just defining what type you're
12:51 < quantumelixir> But, it's so much easier to do it the way gcc does it
-- C programs use 64bit ints by default!
12:51 < aiju> wtf
12:51 < aiju> no
12:52 < aiju> C programs use 32bit ints
12:52 < Namegduf> Only on x86_64.
12:52 < wrtp> quantumelixir: but then your program will break on 32 bit
12:52 < KBme> oh, he wants: pragma ( int_is_actually_int64_please = true )
12:52 < aiju> Linux uses LP64
12:52 < quantumelixir> aiju: oh?
12:52 < quantumelixir> KBme: :D
12:52 < aiju> meaning only long and pointer are 64 bits
12:52 < Namegduf> Doing what you want will still leave your program
12:52 < Namegduf> time.Seconds() returns an int64
12:53 < wrtp> quantumelixir: if you find yourself doing a lot of int64(0),
you could do: const Z = int64(0)
12:53 < wrtp> then for i := Z; i < blah; i++ { }
12:53 < aiju> wrtp: constants should be named anyway
12:53 < aiju> const ONE = 1
12:53 < aiju> const TWO = 2
12:53 < KBme> heh
12:53 < Namegduf> int64(0) is not that long.
12:53 < quantumelixir> aiju: won't solve my problem -- which is having i
interact with int64
12:53 < wrtp> i agree, but i was just pointing out a possibility, that's 7
chars shorter
12:53 -!- SmoothPorcupine [~smooth@] has left #go-nuts ["I'd like
to see waht became of an exception system like that."]
12:54 < KBme> aiju: and const ONE64 = int64(1)
12:54 < Namegduf> Ding dong the troll is dead
12:54 < Namegduf> :P
12:54 < wrtp> sigh
12:55 < aiju> i wonder if i can just wipe all cgo code in the gofy kernel
12:55 < wrtp> can you have cgo code in a Make.cmd makefile?
12:56 < KBme> no
12:56 < KBme> or?
12:56 < wrtp> yeah, looks like no
12:56 < quantumelixir> the pkg/big library is really lacking..  for instance
I can't do the equivalent of x += y
12:56 < KBme> no, what i remember is that you can't install cgo stuff with
goinstall, but i think it's for the same reason
12:56 < quantumelixir> I must do something like x = x + y
12:57 < quantumelixir> don't know why there is no inplace increment
12:57 < quantumelixir> the method to do addition (Add) returns a new
12:57 < aiju> wtf Go has operator overloading?
12:57 < quantumelixir> aiju: no no..  conceptually
12:57 < Namegduf> No.
12:58 < wrtp> quantumelixir: x.Add(x, y)
12:58 < wrtp> that's an in place increment
12:58 < quantumelixir> !
12:58 < quantumelixir> wiat a sec
12:58 < quantumelixir> I was fairly certain that it wasn't there
12:58 < wrtp> it's always been there.
12:58 < aiju> aaaaaaaaaah stack switching
12:58 -!- niekie [~niek@CAcert/Assurer/niekie] has joined #go-nuts
12:58 < quantumelixir> major fail on my part then, sorry
12:58 < aiju> it makes me head ache
13:00 -!- rlab [~Miranda@] has joined #go-nuts
13:02 < quantumelixir> hehe..  can you tell what this code does:
13:02 < KBme> eww
13:02 < KBme> :D
13:03 < aiju> can you tall what this code does:
13:03 < quantumelixir> correct answer: no!
13:03 < quantumelixir> :D
13:03 < quantumelixir> wait..  let me see
13:04 < quantumelixir> aah..  obfuscation..  below the belt :P
13:05 < quantumelixir> aiju: it would have been fun if the url wasn't such a
13:06 < quantumelixir> aiju: indent fails miserably when I give your code as
13:06 < aiju> haha
13:06 < aiju> :P
13:07 < quantumelixir> anyways..  if you wrote the numbers 1, 2, 3, ..  in
sequence then that function d(n) returns the digit at the nth place
13:09 < quantumelixir> aiju: does that compile?
13:09 < plexdev> http://is.gd/h90ucz by [Yasuhiro Matsumoto] in
go/misc/vim/syntax/ -- misc/vim/syntax: set large value to 'syntax sync'.
13:09 < wrtp> i always liked this one: http://www.de.ioccc.org/1989/roemer.c
13:09 < aiju> quantumelixir: with gcc
13:09 < quantumelixir> aiju: where's the main()?
13:09 < aiju> right at the startß
13:09 < aiju> oh
13:09 < aiju> oops, no
13:09 < aiju> you need to add a main
13:10 < aiju> it compiles, but it doesn't link ;)
13:10 < quantumelixir> with what args to s()?
13:10 < aiju> pointer to first and last element of an int array
13:10 < quantumelixir> ah..  pedant!
13:10 < aiju> if you add main() it runs fine
13:10 < quantumelixir> wrtp: looks beautiful..  but then you have to look
13:11 < wrtp> yeah.  sadly it no longer seems to work
13:11 < quantumelixir> what was the intended effect?
13:12 < aiju> i can't say this often enough RDMSR/WRMSR is fucking retarded
13:13 < wrtp> quantumelixir: it calculated e
13:13 < quantumelixir> aiju: what does that code s(a,b) do?
13:13 < aiju> quantumelixir: quicksort a list of numbers
13:14 < quantumelixir> ok..  interesting
13:14 < quantumelixir> the swapping is a big hint I suppose
13:15 < quantumelixir> anyways..  I have some gre prep to do :( :(
13:15 < aiju> gre prep?
13:15 < aiju> oh i love Go runtime comments
13:15 < quantumelixir> "graduate record examination"
13:15 < aiju> // make sure g != nil
13:15 < aiju> no check or anything
13:17 < aiju> it loads a register and ignores the value … wtf
13:25 -!- DerHorst [~Horst@e176102061.adsl.alicedsl.de] has joined #go-nuts
13:25 < plexdev> http://is.gd/B28nNJ by [Andrew Gerrand] in
go/doc/codelab/wiki/ -- doc/codelab/wiki: tests use available TCP port
13:26 -!- mosva [~mosva@unaffiliated/mosva] has joined #go-nuts
13:30 -!- gid [~gid@220-253-33-186.VIC.netspace.net.au] has quit [Quit: Leaving.]
13:36 -!- erus_ [50b135f2@gateway/web/freenode/ip.] has quit [Ping
timeout: 265 seconds]
13:41 < aiju> any idiomatic type for a channel signalling completion?
13:42 < plexdev> http://is.gd/6Rrnrk by [Wei Guangjing] in go/src/cmd/ld/ --
8l: fix ldpe sym name length == 8 strdup incorrect.
13:42 < plexdev> http://is.gd/tGk0YQ by [Wei Guangjing] in 2 subdirs of
go/src/cmd/ -- 8l: add PE dynexport
13:42 < KBme> bool?
13:44 < skelterjohn> aiju: chan bool
13:47 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
13:53 < wrtp> i usually use bool
13:53 < wrtp> another possibility is struct{}
13:55 -!- CrazyThinker [~san@unaffiliated/mosva] has joined #go-nuts
14:01 < Namegduf> I wonder what struct{} actually turns into.
14:02 < aiju> null pointer or similar
14:03 < aiju> hm a single null byte
14:08 < wrtp> same as false
14:09 < wrtp> it's just got a longer constructor: struct{}{}
14:10 < aiju> can i use a channel in both directions?
14:10 -!- qjcg [~qjcg@] has joined #go-nuts
14:11 < KBme> if you don't specify the direction, yeah
14:11 < KBme> noone does anyways
14:11 < KBme> you can theoretically do make(<-chan, len)
14:11 < KBme> or make(chan <-, len)
14:12 < KBme> (check the spec)
14:13 -!- erus_ [50b135f2@gateway/web/freenode/ip.] has joined
14:14 < erus_> Whats a decent build system for Go? (works on windows,
14:14 < aiju> make
14:15 < erus_> the Make.pkg file in go/src doesnt seem to like windows
14:15 < aiju> uh hu
14:16 < erus_> I get make: *** [_obj/s3dm.a] Error 1
14:19 < aiju> erus_: that line is useless
14:19 < erus_> i know how can i debug it
14:20 < aiju> start with nopasting the whole output :P
14:20 < gobeginner> if you have a bi-directional buffered channel with N
slots in the buffer is that N messages buffered in both directions or two buffers
of N message one at each end?
14:21 < jnwhiteh> there's one buffer
14:21 < gobeginner> thanks
14:21 < jnwhiteh> it can hold a max of N messages
14:21 < erus_> http://paste.ubuntu.com/559015/ aiju
14:21 < skelterjohn> erus_: try go-gb.googlecode.com
14:21 < erus_> Makefile here
14:21 < jnwhiteh> once you reach N, it becomes a syncronous channel,
although the message in is not the same as the message out
14:22 < skelterjohn> i don't have windows, but someone tested it on windows,
14:22 < erus_> ok thanks skelterjohn
14:22 < skelterjohn> and if you find a problem, let me know so i can fix it
14:22 < aiju> erus_: uh
14:23 < skelterjohn> erus_, aiju: looked like an issue of \ vs /
14:23 < aiju> could be
14:23 < skelterjohn> which make should be able to handle
14:25 -!- root___ [~root@] has joined #go-nuts
14:27 < xash> Erstmal wichtig: Nicht mehr die Festplatte benutzen
14:27 < xash> Nix drauff schreiben oder so
14:27 < xash> Ups, sorry!  :-(
14:30 -!- im2ee [im2ee@gateway/shell/bshellz.net/x-drbzkwbpxtveekiq] has joined
14:35 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has quit [Ping
timeout: 264 seconds]
14:36 -!- shvntr [~shvntr@] has quit [Ping timeout: 246 seconds]
14:37 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has joined
14:38 -!- shvntr [~shvntr@] has joined #go-nuts
14:39 -!- cafesofie [~cafesofie@rnwifi-164-107-92-100.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
14:41 -!- pharris [~Adium@rhgw.opentext.com] has joined #go-nuts
14:45 -!- root___ [~root@] has quit [Quit: Lost terminal]
14:47 -!- emjayess [~emjayess@pix1.i29.net] has joined #go-nuts
14:49 -!- ExtraSpice [~XtraSpice@] has joined #go-nuts
15:02 -!- emjayess [~emjayess@pix1.i29.net] has quit [Quit: Leaving]
15:02 -!- clip9 [clip9@er.en.svarteper.com] has joined #go-nuts
15:03 -!- erus__ [50b135f2@gateway/web/freenode/ip.] has joined
15:06 -!- erus_ [50b135f2@gateway/web/freenode/ip.] has quit [Ping
timeout: 265 seconds]
15:07 -!- fabled [~fabled@mail.fi.jw.org] has quit [Quit: Ex-Chat]
15:15 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
15:16 -!- cafesofie [~cafesofie@dhcp-140-254-202-160.osuwireless.ohio-state.edu]
has joined #go-nuts
15:20 -!- nettok [~quassel@] has joined #go-nuts
15:23 -!- DerHorst [~Horst@e176102061.adsl.alicedsl.de] has quit [Remote host
closed the connection]
15:28 -!- enherit [~enherit@h-72-244-170-106.lsanca54.static.covad.net] has joined
15:45 -!- Belg [~kim@gw-gbg.ilait.se] has joined #go-nuts
15:50 < wrtp> am i right in saying that all init functions in a package are
always called before any init functions in packages that depend on it?
15:50 -!- idr [~idr@e179146032.adsl.alicedsl.de] has quit [Read error: Connection
reset by peer]
15:50 < aiju> wrtp: yes
15:50 < wrtp> the spec doesn't seem to say to explicitly
15:50 < wrtp> s/to/so/
15:51 -!- imsplitbit [~imsplitbi@] has joined #go-nuts
15:51 < wrtp> but i can't see how it would work properly otherwise
15:52 < Namegduf> "If a package has imports, the imported packages are
initialized before initializing the package itself.  If multiple packages import a
package P, P will be initialized only once."
15:52 < skelterjohn> if you depend on a package, your init can call
functions from that package.  but those functions can't be called before that
package's init
15:53 < Namegduf> From the "Program execution" part of the spec.
15:54 -!- marten_ [~marten@] has joined #go-nuts
15:55 -!- emiel_ [~emiel_@82-197-205-84.dsl.cambrium.nl] has joined #go-nuts
15:56 -!- visof [~visof@unaffiliated/visof] has quit [Ping timeout: 260 seconds]
15:56 -!- mattn_jp [~mattn@112-68-73-14f1.hyg1.eonet.ne.jp] has joined #go-nuts
16:02 -!- skejoe [~skejoe@] has quit [Quit: Lost terminal]
16:05 < wrtp> Namegduf: ah yes.  how could i have missed that?!
16:18 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has joined
16:18 < Belg> Is there a way for people to register packages on the package
dashboard, or do they just add stuff there manually and when they feel like it?
Too much old cruft there that doesn't build anymore..
16:19 < skelterjohn> on the top right of the package list there is an entry
16:19 < skelterjohn> i believe adg gets notified of things submitted there
and will add them
16:20 < Belg> skelterjohn: Really?  I must be cross-eyed or something, I
never saw that.
16:20 < skelterjohn> :)
16:20 < skelterjohn> it's in the place where ads often go
16:20 < skelterjohn> you may have trained yourself to have a blind spot
16:20 < emiel_> :)
16:20 < Belg> Ah, it's under "Projects".
16:20 < skelterjohn> oh i'm sorry, yes
16:20 < Belg> No, I saw the tabs, I just didn't get that it'd be under
Projects.  thanks :)
16:20 < skelterjohn> not the package list
16:23 < skelterjohn> Belg: what project are you submitting?
16:26 < Belg> skelterjohn: Nothing yet, I was just curious how the process
worked.  I got kind of burned by first using goconfig, then goconf, and now
neither of them builds, and they're both still on the dashboard.  Somebody made a
working fork for goconf, but it's not listed.  It seems like a shame, since I
figure many people use the dashboard as a starting point when they're starting to
play with Go.
16:26 < skelterjohn> what do goconfig and goconf do?
16:27 < Belg> They're just simple configuration file parsers, but very
useful :)
16:30 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
16:32 -!- mosva [~mosva@unaffiliated/mosva] has quit [Quit: mosva]
16:36 -!- CrazyThinker [~san@unaffiliated/mosva] has quit [Ping timeout: 260
16:36 -!- TheSeeker2 [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has
joined #go-nuts
16:37 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has quit
[Disconnected by services]
16:38 -!- shvntr [~shvntr@] has quit [Quit: leaving]
16:38 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
16:41 -!- Renich [~Renich@] has joined #go-nuts
16:41 < Renich> I am...
16:41 < Renich> guys, need some advice
16:42 < Renich> anybody here familiar with spec files?  (rpm)
16:42 < Renich> I have a problem.  FHS and go might not be best friends...
16:43 < Renich> anyway, do I need to put src into $GOROOT??  can't I put it
somewhere like /usr/share/go or /usr/src/go ?
16:43 < skelterjohn> src for what?
16:43 < skelterjohn> your own project?
16:43 < Renich> or, is only Make.inc necessary for all this?
16:43 < Renich> skelterjohn: well, I dunno
16:44 < Renich> skelterjohn: I noticed web.go uses the Make.inc file
16:44 < skelterjohn> if you write some go source, generally you don't put it
into $GOROOT/src
16:44 < Renich> skelterjohn: and the Make.pkg
16:44 < Renich> skelterjohn: no, sorry, I'm not explaining it right
16:44 < skelterjohn> Make.inc specifies how to compile things
16:44 < skelterjohn> Make.cmd or Make.pkg specifies what to compile
16:44 < skelterjohn> so you really need both
16:44 < Renich> skelterjohn: I'm trying to package go for fedora
16:44 < skelterjohn> oh i see
16:45 < Renich> skelterjohn: so, I wanted to put things where they should be
according to FHS
16:45 -!- idr [~idr@e179146032.adsl.alicedsl.de] has joined #go-nuts
16:45 < Renich> skelterjohn: that's the problemo...  src shouldn't be in
/usr/lib64/go ...  get me?
16:46 < Renich> and, as far as I can see, there is no $GOSRC env var
16:46 < Renich> skelterjohn: should a project need all the source or only
the Make.* failes?
16:46 < skelterjohn> yeah...
16:46 < skelterjohn> well i know one thing at least will break if you don't
put it in $GOROOT/src
16:46 < skelterjohn> and that is godoc
16:47 < Renich> skelterjohn: maybe these can be copied into lib64/go
16:47 < Renich> skelterjohn: and web.go too
16:47 < skelterjohn> building a project outside of the core shouldn't need
any of the source from the standard library
16:48 < Renich> skelterjohn: yeah but, still, godoc needs Make.inc, right?
so...  what to do...  ;=s
16:48 < Renich> maybe asking for a $GOSRC in the feature request secton?  ;)
16:48 < skelterjohn> i think you should have it just copy the whole thing
into somewhere and call it $GOROOT
16:48 < skelterjohn> but i don't know much about red hat's system
16:49 < Renich> skelterjohn: yeah, well, the problem is that source files
shouldn't go in /usr/lib64/go (where libs are) nor in /usr/bin (where bins are)
16:50 < skelterjohn> how about /usr/local/go
16:50 < Renich> skelterjohn: it will work if I just copy src into $GOROOT
16:50 < Renich> skelterjohn: well, that would be fine if I didn't package go
for fedora and only for myself
16:50 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has quit [Read
error: Operation timed out]
16:50 < Renich> skelterjohn: I mean, it's a wanabe package...  not yet in
the repos...  ;)
16:51 < gobeginner> :w
16:51 < skelterjohn> yeah, i don't really know what standard practice is.
maybe someone else will chime in
16:51 < Renich> I'll try and make a feature request and send a patch...  see
if they like it
16:52 -!- enherit [~enherit@h-72-244-170-106.lsanca54.static.covad.net] has quit
[Quit: leaving]
16:52 < skelterjohn> anyone having problems with github?  trying to push,
and "ssh: connect to host githib.com port 22: Operation timed out"
16:52 < Renich> brb
16:52 < Namegduf> I wish there was some configuration file parser in the
stdlib.  It seems wide enough in usefulness.
16:54 < Belg> Namegduf: Seconded..
16:54 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has joined
16:54 < fzzbt> githib.com?
16:55 < Namegduf> I also wish it wasn't ini-file based, but that's a
personal thing
16:55 < Namegduf> For most applications what matters is *some* format.
16:55 -!- erus__ [50b135f2@gateway/web/freenode/ip.] has quit [Ping
timeout: 265 seconds]
16:55 < taruti> ndb-style parsing!
16:55 < skelterjohn> fzzbt: yes
16:56 -!- femtoo [~femto@95-89-198-16-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
16:59 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has joined #go-nuts
17:01 -!- rlab [~Miranda@] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
17:03 < uriel> adg: silly question, but why not allow comments in the Go
17:04 -!- tvw [~tv@] has quit [Remote host closed the connection]
17:08 -!- Project_2501 [~Marvin@] has joined #go-nuts
17:14 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping
timeout: 240 seconds]
17:14 -!- iant [~iant@] has joined #go-nuts
17:14 -!- mode/#go-nuts [+v iant] by ChanServ
17:32 -!- Venom_X [~pjacobs@] has joined #go-nuts
17:37 -!- photron [~photron@port-92-201-62-229.dynamic.qsc.de] has joined #go-nuts
17:38 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has joined #go-nuts
17:42 -!- marten_ [~marten@] has quit [Quit: marten_]
17:43 -!- marten [~marten@] has joined #go-nuts
17:43 -!- marten [~marten@] has quit [Client Quit]
17:44 -!- femtoo [~femto@95-89-198-16-dynip.superkabel.de] has joined #go-nuts
17:49 -!- qjcg [~qjcg@] has quit [Quit: qjcg]
18:05 -!- zozoR [~zozoR@56346ed3.rev.stofanet.dk] has quit [Quit: Morten.  Desu~]
18:08 -!- zozoR [~zozoR@56346ed3.rev.stofanet.dk] has joined #go-nuts
18:12 -!- Venom_X [~pjacobs@] has quit [Ping timeout: 276 seconds]
18:15 -!- wobsite [~ian@68-112-244-225.dhcp.oxfr.ma.charter.com] has joined
18:20 -!- tvw [~tv@e176002055.adsl.alicedsl.de] has joined #go-nuts
18:25 -!- idr [~idr@e179146032.adsl.alicedsl.de] has quit [Disconnected by
18:25 -!- mattn_jp [~mattn@112-68-73-14f1.hyg1.eonet.ne.jp] has quit [Quit:
18:25 -!- idr0 [~idr@e179146032.adsl.alicedsl.de] has joined #go-nuts
18:25 < wobsite> Hey, so building a hello world program on my linux/amd64
machine is resulting a 1.8M executable.  this seemed kinda big to me, so I had a
look on the mailing list, all I could find was someone griping about 700K
executables for the same thing on darwin/amd64.  I get that statically linked
excetuables are going to be a bit bigger, and the fmt library brings it a fair
amount of stuff, but 1.8M still seems kinda huge.  6l's -s flag brings i
18:26 -!- TheMue [~TheMue@p5DDF67F0.dip.t-dialin.net] has joined #go-nuts
18:26 < Namegduf> It has debugging information attached.
18:26 < Namegduf> The large "Hello World" in no way indicates that real
applications are overly huge.
18:27 < aiju> real applications are just massively huge, not overly huge
18:28 < Tonnerre> Wasn't there some guy who wrote a hello world in ELF which
was just a couple of bytes large?
18:28 < aiju> Tonnerre: it just set the return status
18:28 -!- femtoo [~femto@95-89-198-16-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
18:28 < Tonnerre> Ah ok, it was true, not hello
18:28 < aiju> high level languages tend to have huge binaries, go play with
assembly if you want small binaries :P
18:29 < Namegduf> A lot of it is debug information, I think, because it used
to be 700K, and that's the only thing that could change it that much, I think.
18:30 < wobsite> ok.
18:30 < Namegduf> My ~10,000 line program compiles to 3.6MB
18:30 < wobsite> that's encouraging at least.
18:30 < Namegduf> With the same debug information
18:30 < aiju> ELF is nearly twice as large as a.out here :D
18:30 < aiju> 234K kernel
18:30 < aiju> 429K kernel.elf
18:30 < niemeyer> jnwhiteh: http://codereview.appspot.com/4071044/
18:32 -!- AndyP_ [~andyp@baud.org.uk] has quit [Ping timeout: 240 seconds]
18:41 -!- dal33tdvr [~jrs311@mac-rm242-0205.wilbur.Lehigh.EDU] has joined #go-nuts
18:45 < dal33tdvr> does anyone know of a way to install go on solaris 10?
18:45 <+iant> dal33tdvr: gccgo is pretty close to working on Solaris
18:45 <+iant> I don't think 6g/8g work there, though
18:45 <+iant> of course it would be great if somebody did a port
18:46 < aiju> i'd like a VAX port
18:46 <+iant> you are far more likely to get that from gccgo than from gc
18:46 < dal33tdvr> i have 8g working, the binary that 8l produces is
18:46 <+iant> dal33tdvr: yeah, that's the kind of thing that will happen
18:47 -!- Darxus [~darxus@panic.chaosreigns.com] has joined #go-nuts
18:49 -!- qjcg [~qjcg@] has joined #go-nuts
18:58 -!- cafesofie [~cafesofie@dhcp-140-254-202-160.osuwireless.ohio-state.edu]
has quit [Remote host closed the connection]
19:04 < skelterjohn> yeah, i'd imagine porting the compiler to be much more
straightforward than porting the linker
19:04 < aiju> SPARC?
19:05 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has joined
19:05 -!- keithgcascio [~keithcasc@nat/google/x-vfldxnnjaujbcecy] has joined
19:05 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-165-36.clienti.tiscali.it] has
joined #go-nuts
19:05 < skelterjohn> is that directed at me?
19:06 < skelterjohn> if so, i don't understand the question
19:08 < skelterjohn> but i said the Xg compiler would be more
straightforward because, as far as i know, it compiles to a special go format of
binary, and the linker then turns it into something usable by the machine
19:08 -!- virtualsue [~chatzilla@nat/cisco/x-symflgmwlvpftrgv] has quit [Ping
timeout: 265 seconds]
19:09 -!- gobeginner [~nwood@] has quit [Quit: Leaving.]
19:09 -!- Project_2501 [~Marvin@] has quit [Ping timeout: 265 seconds]
19:10 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
quit [Quit: leaving]
19:12 -!- artefon [~thiagon@] has quit [Quit: Leaving]
19:15 < plexdev> http://is.gd/S37r2W by [Gustavo Niemeyer] in go/src/cmd/6l/
-- 6l: Relocate CMOV* instructions
19:16 -!- cafesofie [~cafesofie@rnwifi-164-107-92-233.resnet.ohio-state.edu] has
joined #go-nuts
19:17 -!- cafesofie [~cafesofie@rnwifi-164-107-92-233.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
19:17 -!- Venom_X [~pjacobs@] has joined #go-nuts
19:17 < dario_> how can 8g say append was undefined ...  isnt that built-in
19:19 < wrtp> god cgo errors are so unhelpful!
19:19 < Darxus> I was worrying about the licensing situation, but it looks
like google doesn't actually get anything that every recipient of the software
doesn't get?
19:20 < Darxus> So it's more like a BSD type license, and not a (scary) open
core situation?
19:20 < skelterjohn> dario_: hg pull -u?
19:22 -!- qjcg [~qjcg@] has quit [Quit: qjcg]
19:24 < quantumelixir> iant: I tried building gccgo on a debian system after
installing gmp, mpfr and mpc but the build failed with an "undefine reference to
lexer_line", yyend, etc..  any ideas?
19:25 -!- dforsyth_ [~dforsyth@bastion.inap.yelpcorp.com] has joined #go-nuts
19:25 -!- eikenberry [~jae@ivanova.zhar.net] has quit [Ping timeout: 240 seconds]
19:25 < quantumelixir> I have the full error log somewhere around
19:25 < taruti> quantumelixir: do you have flex and bison installed?
19:25 <+iant> Darxus: yes, Go is under a BSD-style license
19:25 < quantumelixir> taruti: I did install bison
19:25 -!- saschpe [~quassel@opensuse/member/saschpe] has joined #go-nuts
19:25 <+iant> quantumelixir: did you install flex?
19:25 < quantumelixir> but I don't think it provides "yyend"
19:25 < quantumelixir> iant: I didn't
19:25 <+iant> you need it
19:26 < quantumelixir> oh, from?
19:26 <+iant> it's a GNU program
19:26 < quantumelixir> oh ok
19:26 <+iant> ftp.gnu.org/gnu/flex
19:26 -!- eikenberry [~jae@ivanova.zhar.net] has joined #go-nuts
19:26 <+iant> probably in Solaris repos too if there are Solaris repos
19:26 < quantumelixir> got it thanks
19:27 < quantumelixir> how close is the compiler to the specification?
19:27 -!- mhi^ [~mhi^@fob.spline.inf.fu-berlin.de] has joined #go-nuts
19:29 < jnwhiteh> niemeyer: taking a look now
19:29 < niemeyer> jnwhiteh: That's one of the issues solved..  there's
another one which I must look at later
19:30 < jnwhiteh> niemeyer: whats the other one?
19:30 < niemeyer> jnwhiteh: The other one is related to hidden symbols..
you can avoid it by avoiding them
19:30 < Darxus> iant: Thanks.
19:31 < niemeyer> jnwhiteh: I know of an interesting approach to solve it,
but I have hit an unrelated bug in the linker which will require more attention
19:31 <+iant> quantumelixir: gccgo follows the language spec pretty much
19:31 < quantumelixir> iant: I just installed flex 2.5.35 but the build
still fails.  How do I check if libfl.a provides lexer_line, yyend, etc..
19:31 < quantumelixir> iant: oh neat
19:31 <+iant> you probably need to restart the build from scratch
19:31 <+iant> but what is being built when it fails?
19:31 < quantumelixir> gccgo
19:31 < quantumelixir> all the dependencies build properly
19:31 <+iant> I mean what file
19:32 < jnwhiteh> niemeyer: ah well, at least it's keeping your occupied =)
19:32 < taruti> just delete the objdir and restart.
19:32 < niemeyer> jnwhiteh: Yeah, it's killing my free time :-)
19:32 < taruti> installing dependencies does not help unless one nukes the
19:33 < quantumelixir> iant: http://pastebin.mozilla.org/982480 line 9
19:33 <+iant> yes, install flex, remove your build directory, and start over
19:33 < jnwhiteh> niemeyer: I've been benchmarking the Go http package all
19:33 < niemeyer> jnwhiteh: Why?
19:33 < jnwhiteh> all sorts of fun :P
19:33 < Darxus> What if a program uses source from the go language and other
software that requires saying who the copyright belongs to?  Saying "Copyright
2011 The Go Authors." for source you do not own copyright to would not be
19:34 < niemeyer> jnwhiteh: What results did you get so far?
19:34 < quantumelixir> why does svn status take so long?
19:34 < jnwhiteh> my concurrency research uses Go as the target language and
the web server architecture that I'm writing a paper about currently needs to be
benchmarked against something..  so I'm using the http.Handle() server as my base
result for 'Go' code.
19:35 < skelterjohn> Darxus: there is a file somewhere that lists the go
19:35 < aiju> 6g is a shame
19:35 < jnwhiteh> niemeyer: on the setup I have right now which is one
server, two clients on a local GB switch the server can handle about 6000 requests
per second (600 connections with 10 requests per connection) before things start
to go awry
19:35 < skelterjohn> you could import that file
19:35 < aiju> it takes about one second to compile my 101619 line file
19:35 < aiju> ridiculous, they call THAT a compiler?
19:35 < skelterjohn> how long did it take you to type that source?
19:35 < jnwhiteh> niemeyer: just added the GB switch recently, was hitting
the network bottleneck on a 100Mb switch so only have run a few tests so far
19:35 < aiju> skelterjohn: it's a hexdump of a binary
19:35 < niemeyer> jnwhiteh: Nice :)
19:35 < Darxus> skelterjohn: That doesn't make "Copyright 2011 The Go
Authors." appropriate.  "Copyright 2011 The Go Authors [and some other people]."
might be appropriate.  Is that acceptable?
19:36 < jnwhiteh> all I need to show is that my architecture doesn't
introduce TOO much overhead on top of the stock package
19:36 < jnwhiteh> the comparisons against other servers will be intersting
19:36 < jnwhiteh> especially for non-trivial server constructions
19:36 < skelterjohn> Darxus: I dunno, I'm not a go author :)
19:36 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has quit [Quit:
19:36 < jnwhiteh> luckily my server wasn't written for performance, it was
written to make doing difficult things easier to do =)
19:37 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has joined
19:42 -!- ymasory [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has joined
19:42 -!- decaf [~mehmet@] has joined #go-nuts
19:45 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts
19:47 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
19:51 < quantumelixir> iant: I installed flex and I'm adding flex/lib/ to my
LD_LIBRARY_PATH before running make but the build still fails
19:52 <+iant> did you restart from scratch?
19:52 <+iant> i.e., run configure in a new empty directory?
19:52 < quantumelixir> I'm doing an in-source build
19:52 <+iant> oh, don't do that
19:52 <+iant> generally a bad idea with gcc
19:52 <+iant> always run configure from a different empty directory
19:52 < quantumelixir> ok fine will give it a shot
19:53 <+iant> you should probably restart with fresh sources, it's really
hard to get the detritus of ./configure out of the source tree
19:53 < quantumelixir> svn status?
19:53 <+iant> hmmm, yeah, that should work, good point
19:53 < quantumelixir> it's a *huge* source tree that I had to download
19:53 <+iant> yep
19:54 < quantumelixir> did it pull in the elements for building the c, c++
compilers as well?
19:54 -!- femtoo [~femto@95-89-198-16-dynip.superkabel.de] has joined #go-nuts
19:54 <+iant> yes, they are all in the source tree
19:55 < Darxus> Has there been any work on making go self hosting?
19:55 < quantumelixir> yeah, that be much less painful
19:55 < quantumelixir> s/that/that'd/
19:57 -!- kashia_ [~Kashia@port-92-200-19-160.dynamic.qsc.de] has joined #go-nuts
19:59 -!- wobsite [~ian@68-112-244-225.dhcp.oxfr.ma.charter.com] has quit [Quit:
19:59 < quantumelixir> I'm still getting a "gcc/gengtype.c:978: undefined
reference to `lexer_line'"
20:00 -!- camnaes [~cm@c-69-255-143-16.hsd1.md.comcast.net] has joined #go-nuts
20:00 < quantumelixir> i.e.  after running an out of source build
20:00 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
20:01 -!- Kashia [~Kashia@port-92-200-30-31.dynamic.qsc.de] has quit [Ping
timeout: 272 seconds]
20:01 -!- femtooo [~femto@95-89-198-16-dynip.superkabel.de] has joined #go-nuts
20:02 < quantumelixir> iant: How do I know for sure if libfl.a provides
20:02 <+iant> quantumelixir: it shouldn't be coming from libfl.a, it should
be coming from the generated file gcc/gengtype-lex.c
20:02 <+iant> what does that file look like in your build directory?
20:03 < quantumelixir> just says #include "bconfig.h"
20:03 <+iant> that file should be generated by flex
20:04 <+iant> something has gone wrong with the way that it was geneated
20:04 <+iant> look for those commands in your make output
20:04 < quantumelixir> oh wait a minute, I haven't added flex/bin to my
path!  doh!
20:04 -!- femtoo [~femto@95-89-198-16-dynip.superkabel.de] has quit [Ping timeout:
240 seconds]
20:04 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Read
error: Connection reset by peer]
20:05 < wrtp> iant: are there any known issues with cgo callbacks (no
threads involved?)
20:05 < wrtp> if not, i've got a good test case
20:06 < wrtp> i'm trying to cut it down, but it's quite hard working out how
to build a dynamic library under mac os...
20:06 <+iant> wrtp: I don't know of any issues with cgo callbacks when new
threads are not created, no
20:07 < wrtp> i suspect it's to do with having a callback from a dynamic
library, because the code in question looks quite straightforward (both in the
library and outside it)
20:07 < wrtp> and a normal callback works ok
20:07 <+iant> sounds plausible
20:07 <+iant> I know very little about Mac OS shared libraries
20:07 < wrtp> i get throw: bad g in cgocallback
20:08 < wrtp> me neither.  it used to be simpler.
20:08 < Darxus> --- FAIL: net.TestDialGoogle
20:09 < quantumelixir> build still fails..  maybe another day
20:09 < Darxus> The specified IP does not appear to be listening on the
specified port (
20:09 < Darxus> $ telnet 80
20:09 < Darxus> telnet: connect to address Connection timed
20:10 < Darxus> So go is currently failing to build for anyone because it's
required to connect to an IP that is not currently listening?
20:11 <+iant> Darxus: it's fixed in the development sources, I think
20:12 < Darxus> iant: So if I omit the "-r release" from the hg clone, it
should work?
20:12 <+iant> yes
20:12 < skelterjohn> i think if it fails at that point, everything else has
been built and you can use it with no problem
20:12 < Darxus> iant: Thanks.
20:15 -!- tensorpudding [~user@] has joined #go-nuts
20:19 < Darxus> Woo, built.
20:20 < KBme> skelterjohn: i don't think so.  if networking tests fail it'll
leave you with an unfinished build
20:20 -!- ymasory [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has quit [Remote
host closed the connection]
20:20 < KBme> there is an envvar to disable the net tests
20:20 < skelterjohn> there is definitely one network based test that always
used to fail for me, but things still worked
20:21 < KBme> imho the tests shoudln't fail the build imo
20:21 < Darxus> Somebody should make it so
http://golang.org/doc/install.html has instructions that work :P (possibly
removing "-r release"?)
20:22 < KBme> no, somebody should fix the build
20:23 < Darxus> KBme: That would qualify as making it so that page has
instructions that work.
20:23 <+iant> we should probably just do a new release
20:23 -!- _nil [~aiden@c-24-147-65-44.hsd1.ma.comcast.net] has joined #go-nuts
20:23 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
20:23 < _nil> hey guys :)
20:24 < _nil> adg: around?
20:27 < skelterjohn> does parser.ParseFile walk comments?
20:27 < skelterjohn> i know i have comments in this source file but i don't
see *ast.Comment showing up
20:28 -!- Renich [~Renich@] has quit [Remote host closed the
20:29 <+iant> skelterjohn: you have to pass ParseComments in the mode
parameter to ParseFile or whatever you are calling
20:29 < skelterjohn> ah, thanks
20:30 -!- temoto [~temoto@2a02:6b0:16:0:21e:68ff:fe55:14b2] has joined #go-nuts
20:31 < temoto> quantumelixir, how's your gccgo build?
20:34 -!- dal33tdvr [~jrs311@mac-rm242-0205.wilbur.Lehigh.EDU] has quit [Quit:
20:35 -!- mhi^ [~mhi^@fob.spline.inf.fu-berlin.de] has left #go-nuts []
20:46 -!- eikenberry [~jae@ivanova.zhar.net] has quit [Ping timeout: 264 seconds]
20:46 -!- eikenberry [~jae@ivanova.zhar.net] has joined #go-nuts
20:47 -!- boscop [~boscop@f055249227.adsl.alicedsl.de] has quit [Ping timeout: 240
20:48 < plexdev> http://is.gd/TNDj6W by [Russ Cox] in go/doc/ -- spec:
remove non-blocking channel operators
20:49 < KBme> huh wat?
20:49 < KBme> spec: remove non-blocking channel operators
20:49 < KBme> what the hell?
20:50 < exch> wut
20:50 -!- xash [~xash@d126119.adsl.hansenet.de] has quit [Ping timeout: 250
20:50 -!- qjcg [~qjcg@] has joined #go-nuts
20:50 <+iant> the new idea is to use select for non-blocking operations
20:50 < skelterjohn> ohh
20:51 < skelterjohn> so now we can be threadsafe?
20:51 < skelterjohn> :)
20:51 <+iant> yeah, threadsafe checks of closed()
20:51 < skelterjohn> will it reuse the val, ok <- ch syntax, or something
20:52 <+iant> yeah, it will use that syntax, but "ok" will mean the channel
is not closed
20:52 < skelterjohn> right
20:52 < skelterjohn> that's what i'd expect
20:52 < skelterjohn> +1
20:53 < exch> closed() is going out then?
20:53 < skelterjohn> i feel like closed() is still a useful function
20:53 <+iant> I think it will still be there
20:54 < exch> it allows checking for closing without popping a value from
the channel
20:54 < skelterjohn> you might not want to read something off the channel
just to check if it's closed
20:54 -!- skejoe [~skejoe@] has joined #go-nuts
20:54 < skelterjohn> risky to do in a multithreaded context, but that's not
the only context in which you might want to do it
20:54 < Namegduf> I'm not sure if there's a case where it can be used to
mean anything
20:55 < Namegduf> Aside with other external rules limiting concurrency
20:55 < KBme> hmmm, i don't really get how the new way works yet
20:55 < Namegduf> Between you calling closed() and doing stuff it could have
become closed; it's still either closed or not.
20:56 < Namegduf> It doesn't tell you much, although a positive result might
be useful.
20:57 -!- niemeyer_ [~niemeyer@189-10-154-68.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
20:57 < skelterjohn> KBme: saying "val, ok <- ch" will return either a
value when when is available (with ok=true), or a zeroed val when the channel got
closed (with ok=false)
20:59 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has quit [Quit:
21:00 < skelterjohn> it's the same as "val <- ch; ok = closed(ch)" except
that this only works when there is only one possible reader of ch
21:00 -!- boscop [~boscop@f055249227.adsl.alicedsl.de] has joined #go-nuts
21:00 -!- niemeyer [~niemeyer@189-10-208-149.pltce701.dsl.brasiltelecom.net.br]
has quit [Ping timeout: 240 seconds]
21:01 -!- tensorpudding [~user@] has quit [Remote host closed the
21:01 -!- qjcg [~qjcg@] has quit [Read error: Connection reset by
21:03 -!- qjcg [~qjcg@] has joined #go-nuts
21:04 -!- femtooo [~femto@95-89-198-16-dynip.superkabel.de] has quit [Ping
timeout: 240 seconds]
21:08 < wrtp> i think the proposal is to remove closed()
21:08 -!- femtoo [~femto@95-89-198-16-dynip.superkabel.de] has joined #go-nuts
21:08 < wrtp> i couldn't think of anywhere that i've used it without a
21:09 < skelterjohn> certainly you can (and probably should) add extra
infrastructure if you want to check without reading
21:10 -!- franksalim_ [~frank@108-65-76-174.lightspeed.sntcca.sbcglobal.net] has
joined #go-nuts
21:10 < skelterjohn> well, what if you just want to use it as a queue?
21:10 < skelterjohn> i often use a buffered chan as a code mutex
21:10 < wrtp> ok, but do you ever close it?
21:10 < skelterjohn> actually, that has nothing to do with close()
21:10 < skelterjohn> sorry
21:11 < skelterjohn> does len(ch) give the number of things in the buffer?
21:12 < wrtp> i think so
21:12 < skelterjohn> i can picture a monitor checking if there is
communication between two goroutines by checking closed(ch), but there are better
ways to do that
21:12 < wrtp> although i've never used that
21:13 -!- franksalim [~frank@108-65-76-174.lightspeed.sntcca.sbcglobal.net] has
quit [Ping timeout: 240 seconds]
21:23 < skelterjohn> how does one code a string that has // in it?
21:23 < skelterjohn> "\/\/" doesn't compile
21:23 < aiju> uh hu?
21:23 < aiju> "//"?
21:23 < skelterjohn> becomes a comment
21:23 < KirkMcDonald> skelterjohn: Eh
21:23 < KirkMcDonald> It does not.
21:23 < skelterjohn> then my syntax colorer lies
21:23 < skelterjohn> :)
21:24 < KirkMcDonald> Which editor is doing this?
21:24 < skelterjohn> well, now that i changed it, it colors it correctly
21:24 < skelterjohn> so, i might be confused
21:24 < KirkMcDonald> heh
21:24 < skelterjohn> either way, everything works fine now
21:29 -!- franksalim__ [~frank@108-65-76-174.lightspeed.sntcca.sbcglobal.net] has
joined #go-nuts
21:30 -!- tensorpudding [~user@] has joined #go-nuts
21:30 -!- femtoo [~femto@95-89-198-16-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
21:31 -!- ExtraSpice [~XtraSpice@] has quit [Ping timeout: 240
21:32 -!- ymasory [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has joined
21:32 -!- franksalim_ [~frank@108-65-76-174.lightspeed.sntcca.sbcglobal.net] has
quit [Ping timeout: 240 seconds]
21:33 < gmilleramilar> is there an api call to get the path to the current
user's home directory?
21:33 -!- saschpe [~quassel@opensuse/member/saschpe] has quit [Remote host closed
the connection]
21:35 -!- qjcg [~qjcg@] has quit [Read error: Connection reset by
21:36 < Darxus> gmilleramilar: I would guess you should look for a way to
access environment variables, and then read $HOME.
21:36 < gmilleramilar> wont work on windows, right?
21:37 < gmilleramilar> (not that I'm personally too worried about that)
21:37 < Darxus> Don't know how that would work.
21:37 < TheMue> os.Getenv("HOME")
21:37 -!- Urtie [~urtie@90-227-159-22-no57.tbcn.telia.com] has joined #go-nuts
21:38 < gmilleramilar> yeah, on windows it appears to be HOMEPATH
21:38 -!- m4dh4tt3r [~Adium@70-36-245-216.dsl.static.sonic.net] has joined
21:39 < Darxus> Bastards.
21:39 -!- pharris [~Adium@rhgw.opentext.com] has quit [Quit: Leaving.]
21:40 < Urtie> I'm playing around with gomongo a bit, but got curious about
thread-safety.  Is it generally a good idea in Go to connect to a database, or
open a file or whatever, and pass the handle along to go-routines?  Are the
packages generally "go-routine-safe"?
21:40 < Namegduf> Go doesn't have goroutine-local storage.
21:40 < Namegduf> So yes; it'd be hard not to be.
21:41 < Namegduf> Things often aren't safe for concurrent access, but that's
a different issue.
21:41 -!- m4dh4tt3r1 [~Adium@70-36-245-216.dsl.static.sonic.net] has joined
21:41 -!- m4dh4tt3r [~Adium@70-36-245-216.dsl.static.sonic.net] has quit [Read
error: Connection reset by peer]
21:42 < aiju> how does handle syscalls in a single OS thread without locking
everything up?
21:42 -!- tensorpudding [~user@] has quit [Read error: Connection
reset by peer]
21:43 <+iant> aiju: are you asking how Go handles it?
21:43 < aiju> yeah
21:43 <+iant> basically when a goroutine enters a system call, it takes the
thread out of the list of runnable threads
21:44 <+iant> then the scheduler observes that the number of runnable
threads is too low, and it starts a new one
21:44 < aiju> sounds terribly expensive
21:44 <+iant> when the goroutine exits the system call, the scheduler
observers that the number of runnable threads is too high, and it suspends a
21:44 <+iant> no, it's cheap
21:44 <+iant> the threads don't go away or anything, they sit around waiting
to be useful
21:46 -!- Urtie [~urtie@90-227-159-22-no57.tbcn.telia.com] has quit [Ping timeout:
276 seconds]
21:48 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
21:50 -!- Urtie [~urtie@90-227-159-22-no57.tbcn.telia.com] has joined #go-nuts
21:53 -!- qjcg [~qjcg@] has joined #go-nuts
21:53 < kimelto> iant: sounds like GCD, but local to the app ;)
21:57 < Urtie> Namegduf: Ok, so another hypothetical then, if you are up for
it.  If I pass the db-handle to a number of go-routines, and the connection to the
db is lost, what would be a good GO'ish way of handling that?  I couldn't let all
the go-routines suddenly start trying to reconnect.  I thought about passing
information about it back to the main thread on a channel and let it handle it,
but I don't know how best let the other routines know to wa
21:57 < Urtie> it for it.  The sync package comes to mind, but Mutexes seem
like the ugly way out somehow.
21:58 < aiju> Urtie: don't pass the handle
21:58 < aiju> that's the Go way
21:58 < Namegduf> You can't have multiple using it at once anyway.
21:58 < Namegduf> If something can use it it can reconnect to it
21:58 < aiju> sync is evil as well
21:59 < Urtie> So I have to stick the db handling in its own routine?  I'm
not sure how I would instruct it to fire off queries and return the responses.
21:59 < aiju> yeah
21:59 -!- KptnKrill [KptnKrill@c-65-96-145-193.hsd1.ma.comcast.net] has joined
22:01 < Urtie> Neat.  That ought to teach me a few things in the process :)
22:01 < aiju> or maybe not interface{} but something more specific
22:02 < aiju> depends on the db
22:02 < aiju> i prefer using the in-kernel database
22:02 < aiju> called "filesystem"
22:05 < plexdev> http://is.gd/4kXt6s by [Evan Shaw] in 2 subdirs of
go/src/pkg/ -- bytes: Add Buffer.ReadBytes, Buffer.ReadString
22:05 < Urtie> aiju: Not an option for me in this case, since the go-program
will run on several machines and handle a fairly large db.  I think I understand
what types of channels I could use, but how would I pass new channels to the
db-routine as more worker-routines start?  Can I pass a Vector of slices to the
db-routine and add/remove channels as I go, or am I missing the proper way to do
22:06 < Urtie> sorry, that's a vector of channels, not slices
22:06 < aiju> hm last time i checked my filesystem could handle files of
several GB without trouble
22:06 < Urtie> I tend to prefer MongoDB over NFS and flat files any day :)
22:06 < Namegduf> Have a reply channel sent with the request, perhaps?
22:07 < aiju> Urtie: a channel of channels?
22:07 < Urtie> aiju: Oh, I didn't realize that was possible.  Cool.
22:08 -!- tensorpudding [~user@] has joined #go-nuts
22:08 < aiju> you can combine Go types in all possible ways
22:08 < aiju> channels of pointers to slice of structs with maps?  sure why
22:10 -!- im2ee [im2ee@gateway/shell/bshellz.net/x-drbzkwbpxtveekiq] has quit
[Quit: Lost terminal]
22:10 -!- TheMue [~TheMue@p5DDF67F0.dip.t-dialin.net] has quit [Quit: TheMue]
22:11 -!- skejoe [~skejoe@] has quit [Quit: Lost terminal]
22:12 -!- JusticeFries_
[~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net] has joined #go-nuts
22:15 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Ping timeout: 250 seconds]
22:17 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
22:17 -!- photron [~photron@port-92-201-62-229.dynamic.qsc.de] has quit [Ping
timeout: 264 seconds]
22:18 -!- lmoura [~lauromour@] has quit [Ping timeout: 240 seconds]
22:20 -!- wrtp [~rog@] has quit [Quit: wrtp]
22:21 <@adg> _nil: am now
22:21 < plexdev> http://is.gd/2S11YG by [Robert Griesemer] in
go/src/cmd/godoc/ -- godoc: tiny bug fix - use correct filename when comparing
files against the index whitelist
22:21 -!- lmoura [~lauromour@] has joined #go-nuts
22:25 -!- nettok_ [~quassel@] has joined #go-nuts
22:26 < gmilleramilar> I'm calling os.Mkdir and then checking if err == nil
|| err == os.EEXIST
22:26 < gmilleramilar> is that the right way to compare errors, because it
doesn't seem to be taking the right branch in my if stmt
22:26 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Remote host closed the connection]
22:26 -!- nettok [~quassel@] has quit [Ping timeout: 276 seconds]
22:26 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
22:26 < gmilleramilar> that is the else clause gets executed when the
directory exists.
22:29 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
22:35 -!- zozoR [~zozoR@56346ed3.rev.stofanet.dk] has quit [Quit: Morten.  Desu~]
22:36 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Remote host closed the connection]
22:36 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
22:39 -!- dju [dju@fsf/member/dju] has quit [Quit: Quitte]
22:40 <@adg> gmilleramilar: it should be
22:40 <@adg> gmilleramilar: put some print statements in to compare
22:41 < gmilleramilar> ok, thx.  still wrestling with file permissions.
will try in a minute
22:44 -!- artefon [~thiago@] has joined #go-nuts
22:45 -!- dju [dju@fsf/member/dju] has joined #go-nuts
22:45 -!- m4dh4tt3r1 [~Adium@70-36-245-216.dsl.static.sonic.net] has quit [Quit:
22:46 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
22:53 -!- imsplitbit [~imsplitbi@] has quit [Quit: Bye!]
22:53 -!- qjcg [~qjcg@] has left #go-nuts []
22:54 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
22:57 < gmilleramilar> adg: ok so os.EEXIST is an os.Errno and the return
value of Mkdir is an os.PathError
22:58 <@adg> :)
23:01 < skelterjohn> what i do, when this is an issue, is fmt.Printf("%v\n",
23:02 < gmilleramilar> yeah, but because they're all os.Errors (an interface
implementing String()), that was less than helpful.
23:02 < gmilleramilar> it was %T that saved the day.
23:03 < gmilleramilar> so what I have now though is ugly, type-assert it to
a *PathError, and check the Error field against os.EEXIST
23:03 < gmilleramilar> but maybe that's the right answer.
23:06 < uriel> good ridance to closed(), it caused way more confusion than
23:10 < uriel> adg: 17:03 < uriel> adg: silly question, but why not
allow comments in the Go blog?
23:11 -!- snearch [~snearch@f053000207.adsl.alicedsl.de] has quit [Quit:
23:12 <@adg> uriel: the various aggregator sites do a good job of providing
a space for comments
23:14 -!- idr0 [~idr@e179146032.adsl.alicedsl.de] has quit [Remote host closed the
23:18 < rm445> hah, at least *we* get to comment at you!  Seriously, I think
your recent tutorial content on the Go blog is great.
23:19 < rm445> The more content like that there is around, the greater the
chance people go from 'looking at Go' to actually feeling they can get to grips
with it and use it for whatever they want to do.
23:20 -!- franksalim_ [~frank@108-65-76-174.lightspeed.sntcca.sbcglobal.net] has
joined #go-nuts
23:23 -!- franksalim [~frank@108-65-76-174.lightspeed.sntcca.sbcglobal.net] has
quit [Ping timeout: 240 seconds]
23:24 < rm445> actually, adg, I had a question about your ODSC tech talk
video (the url-shortening service).  At the start, you introduce memory protection
with mutexes, and I was *sure* you were going to go ah-ha, there is a better way,
we shall share memory by communicating, with goroutines!
23:25 < rm445> I mean, your code was fine, but did you feel it was idiomatic
Go, or were there specific reasons you went with using mutexes?
23:25 -!- cafesofie [~cafesofie@dhcp-140-254-202-51.osuwireless.ohio-state.edu]
has joined #go-nuts
23:27 -!- Venom_X [~pjacobs@] has quit [Quit: Venom_X]
23:29 <@adg> i think it's fine to use mutexes for some things
23:29 <@adg> but i am about to rework that whole talk for FOSDEM next week
23:30 <@adg> and thanks for your kind words about the blogs, we work hard on
23:31 < rm445> :-) keep up the good work
23:38 -!- rinzai [~rinzai@host86-132-154-175.range86-132.btcentralplus.com] has
joined #go-nuts
23:39 < mpl> damn, I didn't know Go would be at fosdem.  I'd have planned to
go then :(
23:40 -!- camnaes [~cm@c-69-255-143-16.hsd1.md.comcast.net] has quit [Quit: ]
23:48 < Boney> adg: Have you read about STM.  It's a nice replacement for
mutexes in that it avoids deadlocks.
23:49 < Boney> I realize Go has channels and all that business, just
offereing another idea/perspective.
23:52 -!- dju [dju@fsf/member/dju] has quit [Quit: Quitte]
23:53 < temoto> Boney, have you read about MS Research abandoning STM
project?  :)
23:54 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has quit [Quit:
23:57 < Boney> temoto: nope.
23:57 -!- dju [dju@at.dmz.me] has joined #go-nuts
23:57 -!- dju [dju@at.dmz.me] has quit [Changing host]
23:57 -!- dju [dju@fsf/member/dju] has joined #go-nuts
23:58 < KBme> doesn't haskell also use stm?
23:59 < KBme> yep
23:59 < Boney> KBme: yes, Microsoft Research employes many of the GHC
23:59 < temoto> Boney, http://www.infoq.com/news/2010/05/STM-Dropped
23:59 < KBme> i know, yea
--- Log closed Fri Jan 28 00:00:05 2011