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

--- Log opened Mon Mar 28 00:00:50 2011
00:06 < dforsyth> i am really confused
00:06 < dforsyth> the name is set by the string passed to stat
00:06 < dforsyth> yet i have a blank string
00:10 < enferex> So, if I am correct, go does not allow inter-module
dependancies.  For instance, I cannot have package A import package B while also
having package B import package A. I didnt not see this specified explicitly in
the language spec, but I might have missed something.
00:11 -!- jhawk28 [~jhawk28@12.40.157.66] has joined #go-nuts
00:19 < dforsyth> woowwww, its because the path i passed it had a trailing
'/'
00:20 < dforsyth> fileInfoFromStat is busted
00:31 < dforsyth> well i guess its not really stat...
00:31 < dforsyth> man that is weird
00:49 -!- nettok_ [~quassel@200.119.171.131] has joined #go-nuts
00:50 -!- nettok [~quassel@200.119.151.202] has quit [Ping timeout: 246 seconds]
00:57 -!- bjtitus [~bjtitus@154-199.nagel-n.du.edu] has joined #go-nuts
00:59 -!- dwilliamii [~w@72.214.103.209] has joined #go-nuts
01:04 -!- mikespook [~mikespook@219.137.49.30] has joined #go-nuts
01:10 < str1ngs> enferex: as far as I know.  the compiler would resolve that
to a + b . and continue on its way
01:11 < enferex> str1ngs: My case failed but...  but it was just a test to
see if intermodule dependancy was allowed
01:13 < str1ngs> I can see circular dependency being a problem though.
01:13 < enferex> of course
01:13 < str1ngs> but often not always avoidable
01:13 < crazy2be> interesting that the runtime doesn't pick up on infinite
recursion, or provide a warning
01:14 < crazy2be> my system died for like 30 minutes because i had a
function call itself infinately
01:14 < crazy2be> then it ran out of ram
01:14 -!- saturnfive [~saturnfiv@210.74.155.131] has joined #go-nuts
01:15 < jessta_> crazy2be: solving the halting problem is kind of difficult
01:16 < enferex> jessta_: I did that last week, as well as proving p==np
01:17 < crazy2be> enferex: Why didn't i hear about it?  :P
01:17 -!- itrekkie [~itrekkie@ip72-201-208-165.ph.ph.cox.net] has joined #go-nuts
01:18 < str1ngs> enferex: I just built and install a that needs b and b that
nees a
01:18 < str1ngs> needs*
01:18 < str1ngs> enferex: are the packages in the same project?
01:19 < enferex> and a needs b
01:19 < enferex> a full up circle in the module dependancy graph
01:19 < str1ngs> right but are they in the same package?
01:19 < str1ngs> or project even
01:20 < enferex> yes
01:20 < str1ngs> ok that might be the problem
01:20 < str1ngs> you need to build and install one.  then build and install
the other.
01:21 < str1ngs> but there is a catch
01:21 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has quit [Excess
Flood]
01:21 < enferex> exactly
01:21 < str1ngs> you need to have had one installed already I guess
01:21 < enferex> I was just making sure, since i did not see
circular-dependancy mentioned in the spec
01:22 < str1ngs> its rare I guess, and I'm not sure how you would bootsrap a
more complicated case
01:22 < enferex> It only complicates intermodule analysis
01:22 < enferex> Which is something I do plan on taking my research towards
01:23 < str1ngs> and versions iirc because doesnt it strep the dependant
module statically into the package?
01:23 < str1ngs> store*
01:24 < enferex> yes, well I think thats a function of what compiler and
linker are being used
01:24 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has joined #go-nuts
01:24 < str1ngs> so thats kinda how they handle it in away.  but its a good
question.  and how do you bootstrap a process like that
01:25 < str1ngs> and what module do you use when you different versions of
the modules in a and b
01:32 -!- watr_ [~rom@66.183.100.58] has joined #go-nuts
01:36 < steven> i have to admit,
01:36 < steven> i really dont like the way Go uses errors instead of
exceptions
01:37 < steven> its tedious to handle an error after 90% of the function
calls in a function, especially when the error handler is the same each time, but
it takes 3 lines of code each time to invoke that shared-error-handler
01:45 < jessta_> steven: handling errors properly is always a tedious thing
01:46 < jessta_> exceptions don't make it less so
01:46 < jessta_> they just make it easier to not handle errors
01:48 -!- ajstarks [~ajstarks@pool-98-109-198-180.nwrknj.fios.verizon.net] has
joined #go-nuts
01:55 -!- shvntr [~shvntr@116.26.129.61] has joined #go-nuts
01:57 < steven> jessta_: they make it easier to push them up a level.
02:06 -!- jhawk28 [~jhawk28@12.40.157.66] has quit [Quit: Linkinus -
http://linkinus.com]
02:10 -!- ajstarks [~ajstarks@pool-98-109-198-180.nwrknj.fios.verizon.net] has
quit [Quit: ajstarks]
02:11 -!- pphalen [~pphalen@66.92.11.149] has joined #go-nuts
02:28 -!- napsy [~luka@88.200.96.18] has quit [Read error: Operation timed out]
02:47 < jessta_> steven: if you're actually doing it properly it's not much
easier
02:47 < jessta_> because you have have catch and re-throw anyway
02:49 < jessta_> unless you are certain that no two functions being called
will throw the same exception
02:49 < steven> good point, maybe.
02:50 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has quit [Quit:
Leaving.]
02:51 < jessta_> and then you have to be sure that your assumptions about
this won't ever change
02:54 < Rennex> i think exceptions and errors are different.  Errors aren't
that exceptional so you have to handle them gracefully, but having to write
"otherwise let's give up" boilerplate for every function call is tedious
02:58 -!- mjrosenb [~mjrosenb@STARGATE-ATLANTIS.RES.CMU.EDU] has quit [Quit:
leaving]
02:59 < skelterjohn> i haven't missed exceptions since the beginning, and
that was only because i was used to them
03:00 < skelterjohn> i've never found myself saying "now only if exceptions
were present I could make this code much more ...  appealing to people who demand
exceptions be present?"
03:05 < skelterjohn> enferex, str1ngs: you cannot have a package dependency
cycle
03:05 < skelterjohn> it's not allowed
03:07 < skelterjohn> unless you mean for a package manager, rather than go
linking
03:29 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has quit [Excess
Flood]
03:33 < str1ngs> skelterjohn: we were talking about go packages
03:35 -!- Cobi [~Cobi@2002:1828:88fb:0:aede:48ff:febe:ef03] has joined #go-nuts
03:43 < crazy2be> is there some function to copy the files from one
directory into another?
03:44 < str1ngs> crazy2be: as far as I know, no you would have to walk the
tree mkdir's and use io.Copy to copy the files
03:46 < crazy2be> blah i would rather run a shell script to do it for me
03:46 < str1ngs> crazy2be: its not as hard as you would think.
03:55 -!- itrekkie [~itrekkie@ip72-201-208-165.ph.ph.cox.net] has quit [Quit:
itrekkie]
04:02 -!- zozoR [~Morten@56344e3e.rev.stofanet.dk] has joined #go-nuts
04:09 -!- edsrzf [~chickench@122-61-221-144.jetstream.xtra.co.nz] has joined
#go-nuts
04:12 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 246 seconds]
04:34 < steven> i really suck at tdd/bdd
04:34 < steven> and designing internal APIs when all i have in mind is the
external API (ie, the cmdline API)
04:36 < steven> which is sad because these are fundamental parts of my job
04:39 < jessta_> start with external APIs and work inwards
04:42 -!- tensorpudding [~user@99.148.205.193] has quit [Remote host closed the
connection]
04:43 -!- pphalen [~pphalen@66.92.11.149] has left #go-nuts []
04:46 < enferex> skelterjohn: thank you, you confirmed my tests.  I am going
to focus some of my research into cross module optimization and such.
04:47 < crazy2be> night all
04:49 -!- nettok [~quassel@200.119.171.131] has joined #go-nuts
04:49 -!- nettok_ [~quassel@200.119.171.131] has quit [Ping timeout: 248 seconds]
04:50 -!- tensorpudding [~user@99.148.205.193] has joined #go-nuts
04:52 -!- chin_up [~chatzilla@115.200.56.189] has joined #go-nuts
04:54 -!- chin_up [~chatzilla@115.200.56.189] has quit [Quit: ChatZilla 0.9.86.1
[Firefox 4.0/20110318052756]]
04:55 -!- ako [~nya@fuld-590c7c07.pool.mediaWays.net] has joined #go-nuts
04:57 -!- littlebobby [~bob@unaffiliated/littlebobby] has quit [Quit: Ex-Chat]
04:58 -!- aho [~nya@fuld-590c7951.pool.mediaWays.net] has quit [Ping timeout: 240
seconds]
04:59 -!- crazy2be [~crazy2be@d209-89-248-73.abhsia.telus.net] has quit [Ping
timeout: 248 seconds]
05:00 -!- shell [~code.in.t@112.90.241.12] has joined #go-nuts
05:00 < shell> hello
05:01 < shell> is anyone there?
05:01 < edsrzf> Hi
05:02 < shell> hi
05:02 < edsrzf> People are usually idle on this channel, but if you have
questions or something you want to talk about, go ahead, and someone will probably
join in.
05:02 < shell> ok
05:02 -!- shvntr [~shvntr@116.26.129.61] has quit [Quit: leaving]
05:03 < shell> i would like to know whether the golang project has
participated in the GSoC
05:03 < edsrzf> I don't believe it's participating this year, no.
05:04 < edsrzf> There was someone who worked on a gccgo project last year
for GSoC.
05:04 < dforsyth> they are not
05:04 < shell> thanks
05:06 < steven> jessta_: good idea
05:06 < steven> thanks
05:06 < steven> <3
05:14 -!- zozoR [~Morten@56344e3e.rev.stofanet.dk] has quit [Remote host closed
the connection]
05:16 -!- monokrome [~monokrome@174.129.14.230] has left #go-nuts []
05:17 -!- ExtraSpice [XtraSpice@88.118.35.153] has joined #go-nuts
05:21 -!- itrekkie [~itrekkie@ip72-201-208-165.ph.ph.cox.net] has joined #go-nuts
05:22 -!- tav [~tav@92.7.141.101] has quit [Quit: tav]
05:30 -!- virtualsue [~chatzilla@nat/cisco/x-yxyyqkuvafsbwtld] has joined #go-nuts
05:33 -!- shell [~code.in.t@112.90.241.12] has quit []
05:43 -!- itrekkie [~itrekkie@ip72-201-208-165.ph.ph.cox.net] has quit [Quit:
itrekkie]
05:46 -!- tensorpudding [~user@99.148.205.193] has quit [Remote host closed the
connection]
05:46 -!- prip [~foo@host62-124-dynamic.35-79-r.retail.telecomitalia.it] has quit
[Ping timeout: 246 seconds]
05:46 -!- nettok [~quassel@200.119.171.131] has quit [Ping timeout: 260 seconds]
05:51 -!- watr_ [~rom@66.183.100.58] has quit [Quit: Leaving]
05:58 -!- prip [~foo@host62-124-dynamic.35-79-r.retail.telecomitalia.it] has
joined #go-nuts
06:01 -!- virtualsue [~chatzilla@nat/cisco/x-yxyyqkuvafsbwtld] has quit [Ping
timeout: 240 seconds]
06:03 -!- tylergillies [~quassel@unaffiliated/tylergillies] has quit [Quit: No
Ping reply in 180 seconds.]
06:03 -!- tylergillies [~quassel@204-232-205-180.static.cloud-ips.com] has joined
#go-nuts
06:03 -!- tylergillies [~quassel@204-232-205-180.static.cloud-ips.com] has quit
[Changing host]
06:03 -!- tylergillies [~quassel@unaffiliated/tylergillies] has joined #go-nuts
06:03 -!- nsfx [~nsfx@pool-96-225-70-167.nwrknj.fios.verizon.net] has quit [Ping
timeout: 255 seconds]
06:03 -!- rl [~rbl@84-74-142-37.dclient.hispeed.ch] has quit [Ping timeout: 255
seconds]
06:05 -!- nsfx [~nsfx@pool-96-225-70-167.nwrknj.fios.verizon.net] has joined
#go-nuts
06:05 -!- rl [~rbl@84-74-142-37.dclient.hispeed.ch] has joined #go-nuts
06:08 < str1ngs> ww: hmm I just fired up my mac and via started building
stuff no problem
06:08 -!- virtualsue
[~chatzilla@cpc3-haye15-0-0-cust450.haye.cable.virginmedia.com] has joined
#go-nuts
06:16 -!- sacho [~sacho@90.154.220.91] has joined #go-nuts
06:19 -!- Project_2501 [~Marvin@82.84.78.194] has joined #go-nuts
06:19 -!- mthreat [~chris@cpe-70-124-73-10.austin.res.rr.com] has joined #go-nuts
06:26 -!- Xenith [~xenith@xenith.org] has quit [Ping timeout: 264 seconds]
06:28 -!- wrtp [~rog@92.17.50.183] has joined #go-nuts
06:38 -!- Xenith [~xenith@xenith.org] has joined #go-nuts
06:40 -!- tvw [~tv@e176000012.adsl.alicedsl.de] has joined #go-nuts
06:42 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
06:48 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
06:53 -!- virtualsue
[~chatzilla@cpc3-haye15-0-0-cust450.haye.cable.virginmedia.com] has quit [Ping
timeout: 246 seconds]
06:54 -!- tvw [~tv@e176000012.adsl.alicedsl.de] has quit [Remote host closed the
connection]
06:58 -!- bjtitus [~bjtitus@154-199.nagel-n.du.edu] has quit [Quit: Leaving...]
06:59 -!- dfc [~dfc@eth59-167-133-99.static.internode.on.net] has quit [Ping
timeout: 276 seconds]
07:00 -!- virtualsue [~chatzilla@nat/cisco/x-mdxslrwirtutzvmh] has joined #go-nuts
07:11 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
07:15 -!- ildorn [~ildorn@dslb-088-067-155-060.pools.arcor-ip.net] has joined
#go-nuts
07:15 -!- ildorn [~ildorn@dslb-088-067-155-060.pools.arcor-ip.net] has quit
[Client Quit]
07:22 -!- shvntr [~shvntr@116.26.129.61] has joined #go-nuts
07:31 -!- shvntr [~shvntr@116.26.129.61] has quit [Quit: leaving]
07:47 -!- ako [~nya@fuld-590c7c07.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
07:54 -!- chin_up [~chatzilla@115.200.62.144] has joined #go-nuts
07:59 -!- virtualsue [~chatzilla@nat/cisco/x-mdxslrwirtutzvmh] has quit [Ping
timeout: 240 seconds]
08:05 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
08:20 -!- rtharper [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
08:28 -!- shvntr [~shvntr@116.26.129.61] has joined #go-nuts
08:30 -!- rlab_ [~Miranda@91.200.158.34] has joined #go-nuts
08:32 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 248 seconds]
08:41 -!- virtualsue [~chatzilla@nat/cisco/x-ctfqbrcozyjoqvod] has joined #go-nuts
08:41 -!- chin_up [~chatzilla@115.200.62.144] has left #go-nuts []
08:41 -!- Project-2501 [~Marvin@82.84.74.45] has joined #go-nuts
08:42 -!- virtualsue [~chatzilla@nat/cisco/x-ctfqbrcozyjoqvod] has quit [Client
Quit]
08:43 -!- edsrzf [~chickench@122-61-221-144.jetstream.xtra.co.nz] has quit [Remote
host closed the connection]
08:44 -!- Project_2501 [~Marvin@82.84.78.194] has quit [Ping timeout: 246 seconds]
08:47 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
08:56 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
08:57 -!- shvntr [~shvntr@116.26.129.61] has quit [Quit: leaving]
08:59 < taruti> What is the status of the GOOS=plan9 patches (mainly for
os/syscall/runtime) ?
09:07 -!- st-5426 [~st-5426@a89-154-147-132.cpe.netcabo.pt] has quit [Quit:
Quiting...]
09:10 -!- Project-2501 [~Marvin@82.84.74.45] has quit [Quit: E se abbasso questa
leva che succ...]
09:25 -!- rtharper [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed
the connection]
09:29 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
09:31 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
09:32 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
joined #go-nuts
09:32 < xyproto> I've become more curious about plan9 after learning about
Go. Does it have the same philosophy as Go?
09:33 -!- rtharper [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
09:46 -!- leczb [~leczb@nat/google/x-rxhdmokrnwolvolc] has quit [Ping timeout: 248
seconds]
09:47 -!- mikespook [~mikespook@219.137.49.30] has quit [Quit: Leaving.]
09:49 -!- leczb [~leczb@nat/google/x-zxvrobfkpaynjrdj] has joined #go-nuts
09:52 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
09:56 -!- littlebobby [~bob@unaffiliated/littlebobby] has joined #go-nuts
09:57 * nsf loves C++
09:57 < nsf> void *p; bool x = !p; // ok
09:57 < nsf> implicit conversions >_<
10:06 < wrtp> that's fine in C too ...
10:07 < wrtp> apart from no bool of course
10:07 < nsf> there is a bool in C99 O_o
10:07 < nsf> _Bool
10:07 < nsf> lol
10:08 * wrtp shakes his head.
10:08 < wrtp> xyproto: the philosophy is similar - a focus on minimalism,
pragmatism and appropriate abstractions.
10:17 -!- rlab_ [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
10:22 -!- saturnfive [~saturnfiv@210.74.155.131] has quit [Read error: Connection
reset by peer]
10:23 < nsf> var f = float32(1<<s) // illegal: 1 has type float32,
cannot shift
10:23 < nsf> hm...
10:23 < nsf> another interesting thing in Go
10:23 < nsf> and a complete wtf to me
10:25 < nsf> why 1 has type float32?
10:25 < nsf> :\
10:25 < nsf> it looks like (1<<s) gets converted to float32
10:26 < nsf> interesting kind of approach for a type system
10:26 -!- tsung [~jon@112.104.53.151] has quit [Quit: leaving]
10:27 < nsf> enclosing expression affect the type of an inner expression
10:27 -!- tsung [~jon@112.104.53.151] has joined #go-nuts
10:27 < nsf> effects*
10:27 < nsf> affects*
10:30 -!- rmt [~rmt@2a02:790:1:6:1:c:caf0:2] has quit [Ping timeout: 260 seconds]
10:30 < jessta_> nsf: that's a good thing
10:30 < nsf> jessta_: I don't understand it
10:31 < nsf> var s uint = 5
10:31 -!- rtharper [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed
the connection]
10:31 < nsf> var a = float32(1 << s) // fails
10:31 < nsf> var b = float32(1 << 5) // ok
10:31 < nsf> wtf
10:32 < nsf> suddenly constant expressions and non-constant expressions have
different evaluation order or something?
10:32 < Namegduf> 1 << 5 is an expression made out of constants
10:33 < Namegduf> 1 << s isn't, and in order to do it, 1 must be
assigned a type
10:33 < nsf> ok
10:33 < nsf> 1 << s has type int
10:33 < nsf> as _spec_ says
10:33 < Namegduf> I think you're having issues with how 1 is getting the
type
10:33 < nsf> 1 is int
10:33 < nsf> but it gets type float32
10:33 < Namegduf> No, isn't.
10:33 < nsf> for some reason
10:33 < Namegduf> 1 is untyped.
10:33 < Namegduf> It's a constant.
10:33 < nsf> (1 << s) has type int
10:34 < nsf> var i = 1<<s // 1 has type int
10:34 < nsf> spec says that
10:34 < nsf> not me
10:34 < Namegduf> I'm dubious of that, because int is also the default type
for var i = 1
10:34 < Namegduf> So it seems possible that (1 << s) is just going for
the default type for 1
10:34 < nsf> but not in this expr:
10:34 < Namegduf> And something about casting it to float32 is overriding
that.
10:35 < nsf> var a = float32(1 << s)
10:35 < nsf> I don't understand the reason for that behaviour
10:35 < Namegduf> The fix is probably to explicitly give 1 a type
10:35 < nsf> var a = float32(1) << s
10:35 < Namegduf> But why that behaviour is happening is a good question
anyway.
10:35 < nsf> it's ok for that to fail
10:35 < nsf> but what's wrong with float32(1 << s)
10:36 < Namegduf> I would have expected 1 in 1 << s to become an int
because it was being used in a non-constant expression without being assigned to
anything giving it an explicit type.
10:36 < Namegduf> But apparantly that isn't how it works.
10:36 < nsf> yeah
10:37 < Namegduf> Test it with int(1) in place of 1, if it works post a WTF
on the mailing list and see if anyone knows what's going on?
10:38 < jessta_> nsf: 1 doesn't have a type, the expression 1<<s can't
be of float32
10:38 < nsf> s is a var
10:38 < nsf> 1 << s is a binary expression
10:38 < jessta_> yeah
10:38 < nsf> spec says
10:38 < nsf> that binary expression where one operand is untyped
10:38 < nsf> and other is not
10:38 < nsf> takes type of typed operand
10:38 < nsf> exception is
10:38 < nsf> shift operations
10:39 < nsf> shift operation always takes the type of a left operand
10:39 < nsf> the same way if it were left alone
10:39 < nsf> hm..
10:39 < nsf> ok
10:39 < nsf> so
10:39 < Namegduf> That sounds complicated for 1
10:39 < nsf> 1 << s is untyped int
10:39 < Namegduf> Assuming that actually works
10:39 < nsf> but anyway
10:39 < nsf> even if 1 << s is untyped int
10:39 < Namegduf> Taking the type of something untyped sounds messy.
10:39 < nsf> it can be converted to float32
10:40 < jessta_> var a float32 = 1<<s
10:40 < Namegduf> I wonder about x := float32(2*2.5)
10:40 < jessta_> is the same issue
10:40 < nsf> jessta_: exactly
10:41 < Namegduf> Or, hmm, rather, x := float32(10/y)
10:41 < nsf> maybe I don't understand something or this thing is broken
10:41 < jessta_> because 1 is untyped, a type must be chossen for the
expression.
10:41 < Namegduf> Where y is an integer.
10:41 < Namegduf> I'm wondering if the subparts of an arithmetic expression
which is partially untyped
10:41 < jessta_> in this case the expression is choosen to be float32
because that's where it's going to be stored
10:42 < nsf> jessta_: ah, yes
10:42 < Namegduf> Can be derived from the final type
10:42 < jessta_> nsf: it avoids the issues of unexpected overflows
10:42 < nsf> jessta_: it's just an ugly special case for shifts
10:42 < Namegduf> Yeah.
10:42 < nsf> I think I should change that
10:42 < jessta_> eg.  var i int64 = a+b
10:43 < Namegduf> 1 is untyped, 1 << s stays untyped, float32(1
<< s) assigns 1 << s and thus the 1 a type of float32
10:43 < jessta_> where a and b are large int32 which added would overflow
int32
10:43 < nsf> or not
10:43 < Namegduf> Yeah.
10:43 < Namegduf> Think about int64(1 << s)
10:43 < nsf> how about 1 in (1 << x) taking the largest possible int?
10:44 < Namegduf> if 1 became an int
10:44 < nsf> Namegduf: yeah
10:44 < nsf> but how about the largest possible int?
10:44 < Namegduf> nsf: Sounds like appropriate behaviour iff being cast to a
float
10:44 < Namegduf> Maybe.
10:44 < Namegduf> Really I just think this is a cast where you need to be
explicit.
10:44 < nsf> case*
10:45 < nsf> yeah
10:45 < Namegduf> Yeah.
10:45 < Namegduf> The compiler error could be improved, though.
10:45 < nsf> maybe disallowing untyped consts for left side?
10:45 < nsf> int(1) << 5 // ok
10:45 < nsf> 1 << 5 // fail
10:45 < Namegduf> Well, int64(1 << x) is perfectly useful
10:46 < nsf> int64(1) << x
10:46 < Namegduf> That's what that does.
10:46 < nsf> yeah
10:46 < nsf> but to me it's untrivial
10:46 < Namegduf> As jessta pointed out, taking the type used to do the
operation from the thing it's being stored in is done elsewhere
10:46 < nsf> I should keep a "default type for left shift operand" in type
checker
10:47 < Namegduf> Go just doesn't do the math blind to what it's being
assigned into
10:47 < nsf> well, I guess it's the way to do it
10:47 < nsf> even if it's not trivial
10:47 < nsf> it's the cost of having untyped number literals
10:48 < nsf> in C 1 is int, 1L is long
10:48 < nsf> etc.
10:48 < nsf> :D
10:48 < nsf> 1ULL
10:48 < nsf> :)
10:48 < Namegduf> I don't think it's that bad.
10:48 < Namegduf> Go's still doing The Right Thing in all cases where it
will do something
10:49 < nsf> ok, I'll try to implement that
10:49 < Namegduf> var i int64 = a+b does a+b at int64 precision, etc.
10:49 < nsf> at least now I understand why it happens
10:49 < nsf> Namegduf: is it?
10:49 < nsf> even if a and b int32?
10:50 < Namegduf> That was jessta's example.
10:50 < nsf> hm..
10:50 < nsf> interesting
10:50 < jessta_> nsf: if you don't speciy a type it will be at int32
10:50 < nsf> so, it's kind of: uint64_t i = (uint64_t)a + (uint64_t)b;
10:51 < nsf> rather than:
10:51 < nsf> uint64_t i = (uint64_t)(a + b);
10:51 < Namegduf> Neither, really
10:51 < jessta_> yeah
10:51 < Namegduf> More like a uint64 version of a + function
10:51 < Namegduf> Which you can't represent in psuedo C
10:53 < nsf> uhm
10:53 < nsf> test.go:11: cannot use a + b (type int32) as type int64 in
assignment
10:53 < Namegduf> Ah, yeah.
10:53 < nsf> jessta_ fail
10:53 < nsf> :)
10:53 < Namegduf> You'd have to explicitly convert.
10:53 < jessta_> yeah,true
10:54 < nsf> and var c = int64(a + b)
10:54 < nsf> gives an overflowed result
10:54 < Namegduf> Maybe that kind of logic is only used when dealing with an
untyped thing?
10:54 < nsf> yeah
10:54 < Namegduf> Like 100000 + b
10:54 < nsf> no
10:54 < nsf> in that case the type of 100000 is typeof(b)
10:54 < jessta_> ok, I guess I should go read the spec again
10:54 < nsf> Namegduf: it's a special case for shifts only
10:55 < Namegduf> Okay.
10:55 < nsf> because shift op should always take a type of the left side
10:55 < nsf> and the situation is possible
10:55 < nsf> when left side is const and right isn't
10:55 < Namegduf> And they're the only op which must take a type of a given
side?
10:55 < nsf> and you can't perform untyped op at runtime
10:55 < nsf> therefore you have to choose
10:55 < nsf> the question is what
10:55 < nsf> Namegduf: yeah
10:56 < nsf> "Except for shift operations, if one operand is an untyped
constant and the other operand is not, the constant is converted to the type of
the other operand."
10:56 < Namegduf> Weird.
10:56 < nsf> no
10:57 < nsf> there is no magic in fact, and thank god (or Go team) for that
:D
10:57 < Namegduf> Maybe banning untyped left hand side of a shift op would
be useful, then, although it seems to do the right thing when being assigned to an
integer type.
10:57 < nsf> in shift op case you just have to choose something
10:57 < nsf> Namegduf: uhm..  maybe, but maybe the Go does the right choice
10:58 -!- st-9828 [~st-9828@a89-154-147-132.cpe.netcabo.pt] has joined #go-nuts
10:58 < Namegduf> Yeah.
10:58 < nsf> otherwise there would be a lot of ugliness
10:58 -!- st-9828 [~st-9828@a89-154-147-132.cpe.netcabo.pt] has quit [Client Quit]
10:58 < nsf> like bit clear: x &^= int(1) << x;
10:58 < nsf> or something
10:58 < nsf> oops
10:59 < nsf> x &^= int(1) << y;
10:59 < nsf> and you need to know the type of x
10:59 < nsf> otherwise it would case a type check failure
10:59 < nsf> x &^= 1 << y;
10:59 < nsf> here type of 1 is derived from x
10:59 < nsf> which looks like a valid thing to do
11:00 < nsf> it's a bit complex yeah, but now I think it's the right way to
do it :D
11:00 < nsf> that or adding typed constants
11:00 < nsf> 1I 1I32 1U32 or whatever :D
11:01 < nsf> which is ugly too and you still need to know type of x
11:01 * nsf sighs
11:01 < nsf> problem solved
11:01 < nsf> another black spot in Go
11:02 < Namegduf> At least it *is* that smart.
11:02 < nsf> it's a pragmatic solution and smart, yeah
11:02 < wrtp> nsf: i'm pretty sure it's a compiler bug
11:02 < Namegduf> Rather than "I'm an untyped thing and my type is required,
I'm now an int", it makes the type of 1 << s inferred in turn
11:02 < nsf> wrtp: I don't think so
11:03 < Namegduf> And then infers its type from whatever that becomes.
11:03 < wrtp> "If the left operand of a non-constant shift operation is an
untyped constant, the type of constant is what it would be if the shift operation
were replaced by the left operand alone."
11:03 < nsf> yes
11:03 < wrtp> and float32(1) is fine
11:03 < nsf> but the problem is
11:03 < nsf> !
11:03 < nsf> you have an expression:
11:03 < nsf> 1 << s
11:03 < Namegduf> float32(1) << s is not fine
11:03 < nsf> where s is a var
11:03 < wrtp> so float32(1<<x) should be fine too
11:04 < nsf> wait
11:04 < nsf> s is a var
11:04 < nsf> you can't say (1 << s) has type untyped int
11:04 < wrtp> Namegduf: that wasn't the original expression
11:04 < wrtp> nsf: why not?
11:04 < nsf> because you can't generate code for that
11:04 < wrtp> you don't need to generate code for that
11:04 < nsf> you need to
11:04 < Namegduf> wrtp: No, but it's the result.
11:04 < wrtp> ah
11:04 < nsf> you need to evaluate it somehow at runtime
11:04 < nsf> what precision would you use?
11:04 < Namegduf> If the type of the constant is the type the constant would
have if the shift operation was removed
11:05 < Namegduf> Then float32(1 << x) says that 1 gets the type
float32
11:05 < nsf> some may say
11:05 < nsf> ok, I will use default int
11:05 < nsf> then: var i int64 = 1 << 40
11:05 < nsf> fails
11:05 < nsf> or whatever, when s == 40
11:06 < wrtp> oh yeah, and it even has your example explicitly listed in the
spec
11:06 < nsf> var s = 40; var i int64 = 1 << s
11:06 < nsf> yeah
11:06 < nsf> because you have to choose a valid precision here and the type
of the end type is valid
11:06 < nsf> end result I mean
11:07 < nsf> anyways, it's a hack yeah, but it's very smart :)
11:07 -!- saturnfive [~saturnfiv@219.144.204.206] has joined #go-nuts
11:07 < wrtp> it's a good thing to know.
11:07 < nsf> yeah
11:08 < wrtp> i can totally see why it works that way.  there's not really
any other way it could work.
11:08 < nsf> exactly
11:09 -!- st-10005 [~st-10005@a89-154-147-132.cpe.netcabo.pt] has joined #go-nuts
11:10 -!- st-10005 [~st-10005@a89-154-147-132.cpe.netcabo.pt] has quit [Client
Quit]
11:10 < nsf> but it's a bit hard to implement though :)
11:10 < nsf> something like:
11:10 < nsf> var a int64;
11:10 < nsf> var s uint8 = 5
11:10 < nsf> var c = a + (1 << s)
11:11 < nsf> 1 takes int64 type
11:11 < nsf> if I understand it correctly :)
11:11 < Namegduf> Hmm.
11:12 < Namegduf> float32((1 << s) + 5)
11:12 < nsf> hm..  :)
11:12 -!- rtharper [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
11:12 < Namegduf> If tha works too, that's an impressive amount of type
inference for the 1
11:13 < nsf> yeah
11:13 < nsf> but it's easy for type cast expression
11:13 < nsf> because you see it, you set the default type for shift op
11:13 < Namegduf> The only issue I can see is that it could use a better
compiler error.
11:13 < nsf> but when you have:
11:13 < Namegduf> Complaining of a type mismatch where the type is inferred
11:13 < nsf> (1 << s) + a
11:14 < nsf> you need to know ahead of time
11:14 < nsf> before entering (1 << s)
11:14 < nsf> that default shift type can be a typeof(a) here
11:14 < nsf> so you can't even type check (1<<s) before a
11:14 < nsf> or it must be done in a separate pass
11:15 < Namegduf> Untyped + typed will just give the untyped the type of the
typed
11:15 < Namegduf> The interesting thing with (1 << s) +
<constant> is that you get untyped + untyped
11:15 < Namegduf> Done at runtime
11:16 < nsf> I don't think it's interesting
11:16 < nsf> 1 << s is typed
11:16 < nsf> it just chooses the default type for shift op
11:16 < nsf> which is int by default
11:16 < Namegduf> Nope.
11:16 < nsf> yes
11:16 < nsf> unless it's overridden
11:16 < Namegduf> That wouldn't work for being assigned to int64
11:16 < nsf> by upper type somewhere
11:17 < nsf> var i int64 = (1 << s) + 5
11:17 < nsf> here default type for shift op is int64
11:17 < nsf> it's known ahead of time before entering type check for init
expr
11:17 < nsf> but
11:17 < nsf> var i = (1 << s) + a
11:18 < nsf> here when you want to type check the + binary expr
11:18 < nsf> you need to know that LHS can borrow the type of RHS
11:18 < nsf> the question is, what to check first?
11:18 < nsf> LHS or RHS
11:18 < nsf> LHS can borrow the type of RHS or RHS can borrow the type of
LHS
11:18 < nsf> :\
11:19 < nsf> so..  a separate pass
11:19 < nsf> must be done
11:19 < nsf> which is kind of weird
11:20 -!- st-10104 [~st-10104@a89-154-147-132.cpe.netcabo.pt] has joined #go-nuts
11:20 < nsf> I'm trying to figure out whether it is possible to do that in a
single pass
11:21 < nsf> I guess not
11:21 < nsf> even harder:
11:21 < nsf> var a int64;
11:22 < nsf> var s uint8 = 5
11:22 < nsf> var c = ((1 << s) + 5) + a
11:22 < nsf> 1 has type int64
11:22 < nsf> because 'a' has type int64
11:22 < nsf> and as a result 'c' has type int64
11:22 < nsf> :D
11:23 < nsf> a little bit untrivial
11:23 < Namegduf> Can Go do it?
11:23 -!- tensai_cirno [~cirno@80.250.216.102] has joined #go-nuts
11:24 < nsf> http://pastie.org/1725954
11:24 < nsf> yeah
11:24 < nsf> prints:
11:24 < nsf> 37 int64
11:24 < nsf> and I'm sure 1 has type int64
11:25 < nsf> but we can check that, one moment
11:25 < nsf> 1099511627781 int64
11:25 < nsf> (after changing s to 40)
11:25 < nsf> doesn't look like an overflowed value to me
11:26 < nsf> so, the answer is yes
11:27 < nsf> and well
11:27 < nsf> changing type of 'a'
11:27 < nsf> to float32
11:27 < nsf> will say
11:27 < nsf> test.go:10: invalid operation: 1 << s (shift of type
float32)
11:27 < nsf> so 1 is derived from 'a'
11:27 < nsf> in this example
11:27 < nsf> type of 1
11:27 < nsf> I mean
11:28 < Namegduf> Fancy.
11:29 < nsf> interesting, yeah
11:30 < nsf> but frankly I'm confused
11:30 < nsf> I need to implement that :D
11:30 < nsf> somehow
11:33 -!- st-10104 [~st-10104@a89-154-147-132.cpe.netcabo.pt] has quit [Quit:
Quiting...]
11:34 < wrtp> nsf: 1) work out overall type of expression (may be untyped).
2) if untyped, it becomes int or float64 depending on const type 3) propagate type
downwards to subexpressions as necessary
11:35 < wrtp> (although i haven't looked at the actual implementation)
11:35 < nsf> well, I have to use two passes like that yeah
11:35 < nsf> most likely
11:35 < nsf> for example:
11:35 < nsf> typeoflhs = typecheck(lhs);
11:35 < nsf> typeofrhs = typecheck(rhs);
11:36 < nsf> if (typeoflhs != 0 && typeofrhs == 0) retypecheck(rhs,
typeoflhs);
11:36 < nsf> and vice versa
11:36 < nsf> retypecheck will only fix shift op cases
11:36 < nsf> and everything that depends on them
11:37 < nsf> well, it's not exactly like that
11:37 < nsf> '== 0' should be replace with '== const type'
11:37 < nsf> because by default
11:37 < nsf> 1 << s will result in a const int type
11:37 < nsf> if it's not a const int type then shift op got resolved down
below somewhere anyway
11:38 < nsf> looks ugly and confusing though
11:38 < nsf> no, I think retypecheck should redo typecheck completely
11:38 < nsf> because type errors may happen
11:39 < wrtp> i don't think you want to do the retypecheck for every node
11:39 < nsf> due to new type of 1 << s
11:39 < wrtp> just once after the first pass
11:39 < nsf> for example:
11:39 < wrtp> otherwise the alg is n^2
11:39 < nsf> uhm, no
11:39 < nsf> or yes
11:39 < nsf> I don't know, I should think about that
11:40 < nsf> retypecheck should happen only when there is a case of
converting an abstract int type to a concrete int type
11:41 < nsf> and it will do nothing, unless the type of shift op got changed
11:41 < nsf> but still looks complicated to me
11:42 < nsf> let's see how iant solves that
11:42 -!- foocraft [~dsc@78.101.135.18] has joined #go-nuts
11:46 < wrtp> gc solves it by doing the defaulting in the code gen stage,
AFAICS
11:49 < nsf> gofrontend does two passes as far as I can see
11:50 < nsf> in first it uses abstract types
11:50 < nsf> in second it transforms them to a concrete type
11:50 < nsf> and that's the place where special context for shift ops is
used
11:51 < nsf> also for shift op there is another special context "thing"
11:51 < nsf> right-handed side uses uint by default
11:51 < nsf> for abstract ints
11:51 -!- artefon [~thiago@dhcp37.usuarios.dcc.ufmg.br] has joined #go-nuts
11:52 < nsf> a valid approach I think
11:52 < nsf> I should do the same
11:54 < nsf> wrtp: well it can be done in the code gen stage as well
11:54 < nsf> but it's more context to carry
11:57 < nsf> actually there are other cases when it must be used
11:57 < nsf> (e.g.  context-dependent type inference)
11:57 < nsf> function calls for example
11:57 < nsf> func x(i uint8);
11:57 < nsf> x(5)
11:57 < nsf> 5 has type uint8
11:57 < nsf> basically it's the same thing as shift ops
11:57 < nsf> x(1 << s)
11:57 < nsf> 1 has type uint8
11:58 < nsf> :)
11:58 < xyproto> I see that gcc 4.6 will add support for float128.  Will Go
also support float128?
11:58 < xyproto> (in the future)
11:58 < nsf> xyproto: Go can add it at any moment :) why not?
11:59 < nsf> I'm wondering when we will have float1024
11:59 < nsf> not enough precision, always, lol
12:05 -!- boscop [~boscop@f055112013.adsl.alicedsl.de] has joined #go-nuts
12:05 < nsf> does anyone have a working gccgo?
12:05 < nsf> I'm wondering
12:06 < nsf> will that: var x uint8 = 5; var f = float32(1 << x);
12:06 < nsf> pass the -fsyntax-only
12:06 < nsf> because gccgo starts to assign real types to const types after
type check phase
12:10 -!- jgonzalez [~jgonzalez@173-14-137-134-NewEngland.hfc.comcastbusiness.net]
has joined #go-nuts
12:12 * nsf brb in few hours
12:12 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.4]
12:26 -!- tensai_cirno [~cirno@80.250.216.102] has quit [Remote host closed the
connection]
12:34 -!- zozoR [~Morten@56344e3e.rev.stofanet.dk] has joined #go-nuts
12:37 -!- chin_up [~chatzilla@115.200.1.143] has joined #go-nuts
12:38 < xyproto> nsf: :)
12:38 -!- xyproto [~alexander@77.40.159.131] has quit [Quit: WeeChat 0.3.4]
12:41 -!- foocraft [~dsc@78.101.135.18] has quit [Remote host closed the
connection]
12:52 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
13:01 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
quit [Ping timeout: 240 seconds]
13:02 -!- shvntr [~shvntr@116.26.129.61] has joined #go-nuts
13:05 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
joined #go-nuts
13:07 -!- rtharper_ [~tomh@client-7-200.eduroam.oxuni.org.uk] has joined #go-nuts
13:07 -!- rtharper [~tomh@unaffiliated/sioraiocht] has quit [Read error: Operation
timed out]
13:11 -!- jbooth1 [~jay@209.249.216.2] has joined #go-nuts
13:14 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has joined #go-nuts
13:22 -!- pharris [~Adium@rhgw.opentext.com] has joined #go-nuts
13:31 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
13:39 -!- xyproto [~alexander@77.40.159.131] has joined #go-nuts
13:39 -!- RobertLJ [~Robert@c-69-249-154-13.hsd1.nj.comcast.net] has joined
#go-nuts
13:39 -!- RobertLJ [~Robert@c-69-249-154-13.hsd1.nj.comcast.net] has left #go-nuts
[]
13:42 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
joined #go-nuts
13:47 -!- Venom_X [~pjacobs@75.92.43.21] has joined #go-nuts
13:50 -!- emjayess [~emjayess@pix1.i29.net] has joined #go-nuts
13:52 -!- ildorn [~ildorn@dslb-088-067-155-060.pools.arcor-ip.net] has joined
#go-nuts
13:55 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
13:55 -!- DerHorst [~Horst@e176109140.adsl.alicedsl.de] has joined #go-nuts
14:08 -!- fhs [~fhs@pool-74-101-66-112.nycmny.east.verizon.net] has quit [Ping
timeout: 240 seconds]
14:19 < nsf> uhm, guys, what do you think about taking an address of an
r-value?
14:19 < nsf> &(1+3)
14:19 < nsf> does it make sense?
14:20 < nsf> I think compiler can create a temporary on the stack for that
14:20 -!- skelterjohn [~jasmuth@c-68-46-33-145.hsd1.nj.comcast.net] has quit [Read
error: Connection reset by peer]
14:21 < nsf> on the other hand, such cases are rarely useful
14:24 < nsf> "The operand must be addressable, that is, either a variable,
pointer indirection, or slice indexing operation; or a field selector of an
addressable struct operand; or an array indexing operation of an addressable
array.  As an exception to the addressability requirement, x may also be a
composite literal."
14:24 < nsf> interesting
14:26 < nsf> I mean is there a big difference between composite literal and
arbitrary expression?
14:27 -!- skelterjohn [~jasmuth@c-68-46-33-145.hsd1.nj.comcast.net] has joined
#go-nuts
14:28 < wrtp> nsf: this has been discussed quite a bit on the list
14:28 -!- sacho [~sacho@90.154.220.91] has quit [Quit: Ex-Chat]
14:28 -!- sacho [~sacho@90.154.220.91] has joined #go-nuts
14:28 < nsf> wrtp: and what's the result?  :)
14:28 < nsf> any points worth looking into?
14:29 < wrtp> i seem to remember coming up with quite a few awkward edge
cases, but i can't remember them now
14:29 < nsf> &int{1} it's not possible to do in Go
14:29 < nsf> but I bet some people want that
14:29 < nsf> for some weird reason :)
14:30 < wrtp> FWIW russ recently said that if they were re-doing things,
they might have used (*T){...} rather than &T{...}
14:30 < wrtp> then it's not so confusing
14:30 < nsf> it is confusing to me :)
14:30 < wrtp> looks ok to me (apart from the extra brackets) - it's like a
cast of a struct initialiser
14:31 < wrtp> so quite natural
14:31 < wrtp> no special case needed for &
14:31 < nsf> yeah, with exception that struct initializer doesn't exist in
Go
14:31 -!- ildorn [~ildorn@dslb-088-067-155-060.pools.arcor-ip.net] has quit [Quit:
Leaving.]
14:31 -!- bjtitus [~bjtitus@154-199.nagel-n.du.edu] has joined #go-nuts
14:31 < nsf> for example in my language I'm planning to add it
14:31 < nsf> var x []int = {1, 2, 3}
14:31 < nsf> will be valid
14:31 < nsf> because compound literal looks a bit ugly in my syntax
14:32 < nsf> var x = <[]int>{1, 2, 3}
14:32 -!- Project_2501 [~Marvin@82.84.89.115] has joined #go-nuts
14:32 < nsf> but it has a good analogy with type cast operator
14:32 < wrtp> where *did* those angle brackets come from?
14:32 < nsf> I have a type cast op
14:32 < nsf> <type>expr
14:33 < nsf> a := <float>b
14:33 < wrtp> what's the advantage of that over float(b) ?
14:33 < nsf> less ambigous for simple parsers
14:33 < nsf> float(b) can be confused with function call
14:33 < nsf> and problems with int too
14:33 < nsf> oops
14:33 < nsf> with pointers I mean
14:33 < wrtp> there are quite a few other places where types can be used in
the same place as an expression
14:33 < nsf> *int(x)
14:34 < nsf> can't do that
14:34 < nsf> (*int)(x)
14:34 < nsf> vs.
14:34 < nsf> <*int>x
14:34 < nsf> wrtp: not in my lang
14:34 < nsf> also another ambiguity
14:34 < nsf> with compound literal:
14:34 < nsf> type X [1]int
14:35 < wrtp> can you do var x func(int, int) ?
14:35 < nsf> if X { 1 }[0] == 1 { }
14:35 < nsf> wrtp: sure, why not
14:35 < nsf> but fields in func decl are not expressions
14:35 < nsf> func(*int, *int) is valid of course
14:35 < nsf> as well as:
14:36 < nsf> func(a, b *int)
14:36 -!- foocraft [~dsc@SMSADLER.WV.QATAR.CMU.EDU] has joined #go-nuts
14:36 < nsf> that's the most complex part of my syntax :)
14:36 < wrtp> how do you do make and new?
14:36 < nsf> in future I think it would be possible with templates
14:36 < nsf> for now, there are no new and make
14:36 < nsf> no built-in types
14:37 < nsf> memory allocation using C's malloc
14:37 -!- shvntr [~shvntr@116.26.129.61] has quit [Ping timeout: 250 seconds]
14:37 < nsf> will look ugly though
14:37 < wrtp> another question that occurred to me: are you going to do
bounds checking on arrays?
14:37 < nsf> no
14:37 < skelterjohn> what would X { 1 } [0] mean?
14:38 < wrtp> ok - i will never use that language!
14:38 < nsf> wrtp: sure
14:38 < wrtp> skelterjohn: the first element of the array with type X
14:38 < nsf> skelterjohn: X is an array type
14:38 < wrtp> skelterjohn: e.g.  type X []int; foo := X{1}[0]
14:38 < nsf> X{1} is an array declaration
14:38 < nsf> X{1}[0] is the first element
14:39 < nsf> but for LALR(1) parser it's confusing
14:39 < nsf> because X is a valid expression
14:39 < nsf> and 1 is a valid statement
14:39 < nsf> if X { 1 }
14:39 < nsf> looks like a valid if statement
14:39 < nsf> with angle brackets syntax there is no such problem
14:40 < wrtp> nsf: i honestly think you're making a mistake by not having
bounds checking.  it's the main source of hard-to-find errors in C and C++
14:40 < nsf> wrtp: I don't think so
14:40 < nsf> have you ever tried using valgrind?
14:41 < nsf> wrtp: and I'm not trying to make a better Go
14:41 < nsf> or other Go
14:41 < nsf> it's a different language, targets low level C programming
14:41 < nsf> C-like*
14:41 -!- waqas [~waqas@jaim.at] has joined #go-nuts
14:42 < wrtp> you can be low level and still have bounds checking
14:42 < nsf> I don't think so
14:42 < nsf> because in my language indexing will be also valid for pointers
14:42 < nsf> e.g.
14:42 < nsf> var a *int;
14:42 < nsf> a[5];
14:42 < nsf> as in C
14:43 < nsf> and there are no "slice" type
14:43 < nsf> arrays can be bounds checked though
14:43 < waqas> i.e., C with Go syntax?
14:43 < nsf> yes
14:44 -!- skelterjohn_ [~jasmuth@50.14.27.213] has joined #go-nuts
14:44 < wrtp> nsf: i think that's a mistake.
14:44 < waqas> nsf: By the way, were you the one behind the go llvm project?
14:44 < nsf> think what you think is right :)
14:44 < nsf> waqas: I wouldn't call it a "project"
14:44 < nsf> waqas: I've spent two days writing bindings, yeah
14:45 < nsf> but bindings are in an abondoned state
14:45 < waqas> Why?
14:45 < nsf> abandoned*
14:45 < nsf> uhm, I don't use them
14:45 < nsf> no one uses them
14:45 < nsf> they may work though
14:45 < nsf> I don't know
14:46 < waqas> I need to compile a language down no native code.  The
easiest would be compiling down to C, but I was wondering how using llvm would
compare.
14:46 < nsf> pretty close
14:47 < waqas> s/no/to/
14:47 -!- skelterjohn [~jasmuth@c-68-46-33-145.hsd1.nj.comcast.net] has quit [Ping
timeout: 246 seconds]
14:47 -!- Venom_X [~pjacobs@75.92.43.21] has quit [Ping timeout: 240 seconds]
14:47 < waqas> Hmm, has anyone tried compiling Go down to C? That could be
an interesting project :)
14:48 < nsf> there will be problems with garbage collection I think
14:48 < nsf> or no, I don't know
14:48 < waqas> That would be the only issue I think
14:48 < nsf> I mean LLVM can provide stack information needed for precise
scanning
14:49 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
14:49 < nsf> how would you do that with C code, I don't know
14:49 < jbooth1> maybe just call free() on the spot whenever an object is
dereferenced to count 0?
14:49 < waqas> And you can mostly get around it, since a proper GC is only
required if you have reference cycles, so a lot of code could actually work fine
:/
14:49 < nsf> yeah
14:49 < jbooth1> would cause unpredictable timing but it might work
14:49 < waqas> jbooth1: It leaks with reference cycles.
14:49 < jbooth1> ah right
14:50 < waqas> That by the way was my intention for the MyLanguage.
Allocation aware compiler, mostly optimizing the GC away.
14:51 < wrtp> waqas: you still have to do reference counting
14:51 < wrtp> waqas: and get it right
14:51 < wrtp> inferno did that
14:52 < waqas> wrtp: Yep
14:52 < wrtp> hybrid ref count / mark-sweep
14:52 < wrtp> if you want to be multi-core, it's hard
14:52 < waqas> Stack based or static allocation when you reasonably can, ref
count for all the rest which can't cycle, real GC for what's left.
14:53 < wrtp> waqas: you need some type annotation for what types can't be
cyclic
14:54 < wrtp> waqas: and that become problematic because any closure can be
cyclic
14:55 < waqas> wrtp: You can infer that to quite an extent.  What I intend
to do is provide compile reports of all cycle possibilities, etc, hopefully in a
sane enough manner than the code writer can add annotations if they feel like it.
14:55 < waqas> It's an experiment though.  I'm not certain how well it would
work out.
14:56 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has
quit [Quit: Quitte]
14:56 -!- pphalen [~pphalen@66.92.11.149] has joined #go-nuts
14:57 < wrtp> waqas: it's quite hard.  for instance, a standard idiom for
appending to a linked list is to append to the end, but without extremely
sophisticated analysis, how are you going to tell that that end pointer assignment
isn't a cycle
14:58 < wrtp> actually, the inferno runtime actually ignored the cyclic
annotations
14:58 < wrtp> i
14:58 -!- skelterjohn_ [~jasmuth@c-68-46-33-145.hsd1.nj.comcast.net] has joined
#go-nuts
14:58 < wrtp> it ref counted everything.
14:58 < wrtp> and then GC'd the rest for cycles
14:58 < wrtp> it worked pretty well actually
15:01 < waqas> I think a GC is reasonable (I bet nsf wouldn't like that!).
Eliminating all cycles would be pretty hard to do (though I'll note many closures
can be inspected and inlined, etc).
15:01 < nsf> I agree
15:01 < waqas> With not finding it reasonable?
15:02 < nsf> that GC is a reasonable choice for some environments
15:02 < nsf> it's just not my case
15:02 -!- skelterjohn [~jasmuth@50.14.27.213] has quit [Ping timeout: 276 seconds]
15:02 -!- skelterjohn [~jasmuth@c-68-46-33-145.hsd1.nj.comcast.net] has quit
[Client Quit]
15:02 < nsf> http://news.cnet.com/8301-30685_3-20047787-264.html
15:02 < nsf> haha, James Gosling joins google
15:02 -!- awidegreen [~quassel@c-66c9e555.08-2-73746f39.cust.bredbandsbolaget.se]
has joined #go-nuts
15:03 < waqas> One sample application I want to write in MyLanguage though
was a bootloader.  It would be interesting to do that in a mostly memory managed
language.
15:03 < wrtp> the code that's hard is stuff like: type L struct {next *L};
var hd *L; n := new(L); n.next = hd; hd = next
15:03 < waqas> Indeed
15:03 < wrtp> s/hd = next/hd = n
15:04 -!- saturnfive [~saturnfiv@219.144.204.206] has left #go-nuts []
15:04 < nsf> I think google has acquired too many programming language
creators
15:06 < waqas> I think any experienced group of developers would have "too
many programming language creators"
15:06 < waqas> Maybe 'experienced' is not the right word
15:06 < aiju> LISPers are proud of creating languages for every time they
take a shit
15:08 < exch> The hunt for the perfect language never stops really.
Specially since the 'perfect language' is highly domain specific
15:08 < nsf> exactly
15:08 < nsf> there will be always more than one
15:08 < nsf> but one best for its niche
15:08 < nsf> currently the problem is that even niches aren't exactly
defined
15:08 < aiju> there are no well defined niches
15:09 < aiju> problem sets are always slightly overlapping
15:09 -!- chin_up_ [~chatzilla@115.200.21.14] has joined #go-nuts
15:10 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 276 seconds]
15:10 < nsf> my life mission is to kill C++
15:10 < nsf> :D
15:10 < waqas> I bet it'll outlast you :)
15:10 < aiju> nsf: so why the fuck do you use it all the time?
15:11 -!- foocraft [~dsc@SMSADLER.WV.QATAR.CMU.EDU] has quit [Remote host closed
the connection]
15:12 < nsf> aiju: because there are no good alternatives
15:12 < nsf> I'm making one :)
15:12 -!- chin_up [~chatzilla@115.200.1.143] has quit [Ping timeout: 260 seconds]
15:12 < aiju> C
15:12 < nsf> I hope the compiler will be rewritten in the language it
compiles
15:12 < nsf> evetually
15:12 < nsf> eventuall*
15:12 < nsf> fuck
15:12 < nsf> eventually* :)
15:13 < aiju> is there any other language except C which is bootstrapped?
:\
15:13 < aiju> oh well, there are C++ compilers in C++ …
15:13 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
15:13 < nsf> yeah
15:13 < aiju> but still
15:13 < nsf> there are many compilers that can compile themselves
15:13 < nsf> Vala for example
15:13 < nsf> is written in Vala :)
15:13 < aiju> almost all languages implementation are written in either C or
C++
15:14 < aiju> in practice??
15:14 < nsf> but yeah
15:14 < aiju> -?
15:14 < nsf> all major languages usually are written in C or C++
15:14 < waqas> The Java compiler is in Java, and Java probably falls under
'major languages' :)
15:16 < nsf> I didn't know that
15:16 < nsf> then yeah
15:16 < nsf> C/C++/Java
15:16 < waqas> I thought it was a well known fact.
15:16 < waqas> And I have a vague recollection of the C# one being in C#
15:16 < nsf> not for my area of knowledge
15:16 < nsf> I know nothing about Java
15:16 < nsf> and C#
15:16 < nsf> :)
15:17 < waqas> http://en.wikipedia.org/wiki/Self-hosting#Examples
15:17 < aiju> waqas: isn't the JVM in C?
15:17 < waqas> aiju: The JVM is.  The compiler isn't.
15:17 < aiju> so yeah, it's unusable without a JVM
15:17 < aiju> i said "language implementation", not compiler
15:18 < waqas> aiju: There are implementations of Java-all-the-way-down
(including OS)
15:18 < aiju> waqas: i'm talking about practical implementations of
practical languages used in practice
15:18 < aiju> you *can* self-host almost *any* language
15:18 < waqas> Well yeah, those are mostly in C. I specifically said
'compiler', and nothing else.  :)
15:19 < aiju> w/e
15:19 < nsf> funny fact: crysis 2 runs smoother than magicka or minecraft on
my machine
15:19 < aiju> nsf: hahahahahhahahaha
15:20 < exch> Running smoother than minecraft is not exactly hard to do :p
15:21 < exch> Notch is grat with concepts, but his implementation skills
could use some work
15:21 < exch> *great
15:22 < nsf> and I'm not implying anything, just a funny fact :)
15:22 < Rennex> something wrong with magicka then...  it was choppy for me
when fullscreen but not when windowed, but a patch fixed that long ago
15:22 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
15:23 < nsf> sure there is something wrong with something
15:23 < nsf> or someone
15:24 -!- sacho [~sacho@90.154.220.91] has quit [Ping timeout: 260 seconds]
15:24 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.]
15:26 -!- sacho [~sacho@87-126-43-104.btc-net.bg] has joined #go-nuts
15:29 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 240 seconds]
15:29 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
15:31 -!- shell [~code.in.t@112.90.241.12] has joined #go-nuts
15:35 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
15:35 -!- mattn_jp [~mattn@112-68-51-4f1.hyg1.eonet.ne.jp] has joined #go-nuts
15:40 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
15:41 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Client Quit]
15:41 -!- chin_up [~chatzilla@115.200.63.27] has joined #go-nuts
15:44 -!- chin_up_ [~chatzilla@115.200.21.14] has quit [Ping timeout: 240 seconds]
15:46 -!- chin_up [~chatzilla@115.200.63.27] has quit [Quit: ChatZilla 0.9.86.1
[Firefox 4.0/20110318052756]]
15:48 -!- chin_up [~chatzilla@115.200.61.148] has joined #go-nuts
15:49 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
quit [Quit: leaving]
15:49 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping
timeout: 246 seconds]
15:50 -!- iant [~iant@216.239.45.130] has joined #go-nuts
15:50 -!- mode/#go-nuts [+v iant] by ChanServ
15:52 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
15:57 -!- arun_ [~arun@pool-108-18-145-233.washdc.fios.verizon.net] has joined
#go-nuts
15:57 -!- arun_ [~arun@pool-108-18-145-233.washdc.fios.verizon.net] has quit
[Changing host]
15:57 -!- arun_ [~arun@unaffiliated/sindian] has joined #go-nuts
16:01 -!- shell [~code.in.t@112.90.241.12] has quit [Ping timeout: 248 seconds]
16:05 -!- tav [~tav@92.7.141.101] has joined #go-nuts
16:06 < steven> go is great, but it doesnt compare to ruby in speed of
prototyping
16:10 -!- aho [~nya@fuld-590c720a.pool.mediaWays.net] has joined #go-nuts
16:19 < jnwhiteh> seems not terribly useful to compare a statically typed
language with a dynamic one in that regard =)
16:20 -!- rtharper_ [~tomh@client-7-200.eduroam.oxuni.org.uk] has quit [Remote
host closed the connection]
16:20 -!- waqas [~waqas@jaim.at] has left #go-nuts []
16:26 -!- willdye [~willdye@fern.dsndata.com] has quit [Quit: Leaving.]
16:27 < Namegduf> Well, it's not a bad thing to do
16:27 < Namegduf> You just can't expect the results to be awesome.
16:27 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
16:28 < Namegduf> How "not awesome" they are is useful to examine
16:28 -!- chin_up [~chatzilla@115.200.61.148] has quit [Quit: ChatZilla 0.9.86.1
[Firefox 4.0/20110318052756]]
16:29 < Namegduf> Safety has a price, as does simplicity for boosted
maintainability, and I think one reason Go is a lot more "fun" is that it makes
time to write stuff a lot *closer* to "dynamic" languages.
16:29 < nsf> Go feels like it's much easier to write in, and it's not
because of GC to me
16:30 < nsf> other things like lack of ';', lack of '()' in if/for/switch
16:30 < nsf> default 'break' behaviour for case clauses in switch statements
16:30 < nsf> etc.
16:30 < nsf> type inference here too
16:30 < Namegduf> Packages.
16:30 < nsf> and ':=' especially
16:30 < nsf> packages has other kind of properies I guess
16:30 < Namegduf> := is great.
16:31 < dforsyth> := is awesome
16:31 < nsf> it's much easier to organize Go code than C code
16:31 < Namegduf> Well in comparison to C header files...
16:31 < nsf> because declaration shouldn't be before use
16:31 < Namegduf> I think not having separate declarations and definitions
helps, too.
16:31 < nsf> and that, yes
16:31 < dforsyth> lame as it sounds i just have a lot of fun writing go, and
that tends to speed me up
16:31 < nsf> yeah, it feels very nice
16:41 < wrtp> personally i found that prototyping with dynamic languages, i
spent the time that i would have spent adding type information on debugging stuff
that would never have got past the compiler in a static language.
16:41 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
16:41 < Namegduf> That's a fair point, too.
16:42 < Namegduf> Prototyping you won't have unit tests, and so the
compiler's static analysis will be greatly helpful in any debugging that occurs
while still prototyping.
16:43 < jnwhiteh> for a quick and dirty hackjob prototype, Go's going to
take a bit longer than a quick and dirty dynamic language =)
16:43 < Namegduf> Depends how big the thing you're prototyping is
16:43 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Client
Quit]
16:43 < Namegduf> In essence: Yes, but only if the prototype is small enough
to be actually quick and actually not involve any debugging.
16:44 < jnwhiteh> I just think you get more from the Go version :P
16:45 < Namegduf> Of course, then you need to look at time spent learning
the language in both languages, and time spent reminding yourself of features'
rules you've forgotten for the "complex corners" of things...
16:46 < jnwhiteh> I find Go code incredibly readable, it makes me happy =)
16:46 < Namegduf> I'm not saying I think Go loses, but I think there's ways
it is more pleasant.
16:46 < Namegduf> Er, Go wins.
16:47 < Namegduf> Complex dynamic languages basically have "make making
something that basically works easy" as their goal and it shows.
16:48 -!- artefon [~thiago@dhcp37.usuarios.dcc.ufmg.br] has quit [Ping timeout:
248 seconds]
16:49 < steven> in terms of speed of prototyping, Ruby > Go > C
16:50 < steven> in terms of maintainability, Go > both
16:50 < skelterjohn> i like python for fast prototyping
16:51 < skelterjohn> though i find i write go code quickly as well
16:52 -!- blackmagik [~blackmagi@unaffiliated/blackmagik] has joined #go-nuts
16:53 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:a44a:7396:a120:7cf2] has joined
#go-nuts
16:53 < Namegduf> I'm a Bad Person apparantly because I like to convert my
prototypes into real code if they're close enough
16:53 < Namegduf> Go is very good for that.
16:55 -!- DerHorst [~Horst@e176109140.adsl.alicedsl.de] has quit [Remote host
closed the connection]
16:56 -!- wrtp [~rog@92.17.50.183] has quit [Quit: wrtp]
16:57 < steven> skelterjohn: ew
16:57 < steven> Namegduf: yeah i agree
16:57 < steven> ;)
16:58 < skelterjohn> don't come here, as a ruby dev, and say "ew" to python
16:58 < skelterjohn> you'll only get laughed at (more)
16:59 < steven> ive used both extensively
16:59 < skelterjohn> doesn't matter
16:59 < skelterjohn> just warning you
16:59 < steven> they both have their pros and cons.  ruby just has a lot
more pros
16:59 < steven> :D
17:00 < kimelto> haha!
17:00 < steven> one thing that is both great about and sucks about Ruby, is
its openness
17:00 < steven> which is what drove me to Go actually
17:00 -!- artefon [~thiago@dhcp37.usuarios.dcc.ufmg.br] has joined #go-nuts
17:02 < jnwhiteh> its also nice that you're objective and open to other
people's opinions O.o
17:03 < steven> heh
17:03 < steven> im just playing around
17:03 < steven> sorry guys :/
17:03 < steven> :(
17:04 < skelterjohn> hmm.  the only opinion that was trod upon that i can
see is steven's, by me
17:04 < skelterjohn> oh, and mine, by steven
17:04 < skelterjohn> so it evens out
17:04 < Namegduf> If it helps I can point out that Ruby has always looked
absolutely horrible to me
17:05 < Namegduf> Like someone who didn't speak English tried to write a
language to look like it
17:05 < skelterjohn> that's how i feel as well
17:05 < skelterjohn> for better or for worse, the first thing i look for in
a language is the aesthetic quality
17:05 < Namegduf> Also the object model of the language is utterly screwed
in order to do that
17:05 < Namegduf> From Rails, 20.minutes.ago
17:05 < jnwhiteh> godoc -http :6060 -path . is my hero.
17:05 < Namegduf> Those are not sensible member names
17:06 < skelterjohn> i like things to be neat, clean, consistent and concise
17:06 < skelterjohn> jnwhiteh: i have had no luck with -path...  but you did
"-path ." where i tried "-path=."...
17:06 < skelterjohn> but also i've done "-http=:6060" and that works fine
17:06 < jnwhiteh> i never use -opt=foo
17:06 < jnwhiteh> always use the other style
17:06 < Namegduf> A screwed object model in an OO using language makes it
hurt my head because I try to read and understand the structure of things from
code.
17:06 < jnwhiteh> dunno why =)
17:07 < Namegduf> But apparantly that's not a problem for many people.
17:07 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
17:07 < steven> Namegduf: return unless 'hi'.include?  'hello'
17:08 < Namegduf> Oh god, you can pass parameters to .blah?
17:08 < skelterjohn> jnwhiteh: "-path ." doesn't seem to do it either
17:08 -!- keithcascio [~keithcasc@nat/google/x-jkuxqfspmxyzpezn] has joined
#go-nuts
17:08 < steven> why did Go choose such an unconventional cmdline options
syntax?
17:08 < Namegduf> I've had good luck with explicit paths.
17:09 < Namegduf> Plan 9 heritage.
17:09 < steven> -f or --foo= are conventional, but -foo and -foo= are not
17:09 < steven> gr.
17:09 < jnwhiteh> skelterjohn: works for me
17:09 < jnwhiteh> godoc -http :6060 -path .
17:09 < jnwhiteh> shows my package
17:09 < skelterjohn> jnwhiteh: are you sure your package isn't also
installed?
17:09 < dforsyth> steven: i think someone rolled a getopts pkg
17:09 < steven> someone ought to write a more conventional unix-like opt
parsing system for Go
17:09 < steven> nice.
17:09 < jnwhiteh> yes
17:09 < Namegduf> -f or --foo= are the GNU standard
17:09 < Namegduf> Which I prefer, myself, but hey.
17:09 < steven> they seem to be used by freebsd a lot too
17:09 -!- saschpe_ [~quassel@opensuse/member/saschpe] has joined #go-nuts
17:10 < jnwhiteh> skelterjohn: only difference being the -path .
http://images.gammatester.com/pics/9059ae0038b0ea91d2961d50a009fa63.png and
http://images.gammatester.com/pics/6997b0f47ee0bdf66958d18458480324.png
17:10 < jnwhiteh> the change is obvious =)
17:12 < skelterjohn> omg - i didn't realize it put it up there
17:12 < jnwhiteh> its also in the 'packages' list
17:12 < skelterjohn> i was looking for it next to the othe rpackages
17:12 < jnwhiteh> its there too
17:12 < jnwhiteh> or maybe I lied.
17:12 < jnwhiteh> its not =)
17:12 < jnwhiteh> its just at the top
17:13 < skelterjohn> well, thanks for pointing it out :)
17:13 < jnwhiteh> it adds any extra paths up ther
17:13 < jnwhiteh> just put another bit of path in =)
17:14 < skelterjohn> godoc seems to use a lot of memory
17:14 < jnwhiteh> psh, 50 megs is nothing :P
17:14 < skelterjohn> quitting the server reduces my over memory use by 50%
17:14 < skelterjohn> no - i wouldn't complain about 50mb
17:14 < jnwhiteh> oh, that's all I have
17:15 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
17:15 < skelterjohn> perhaps something else was going on
17:16 < skelterjohn> and now godoc is pegging one of my processors...
17:16 < skelterjohn> rescanning source?
17:16 < jnwhiteh> weird
17:17 < skelterjohn> mem just shot up to 320mb
17:17 < skelterjohn> steadily rising
17:17 < steven> whoa.
17:17 < steven> why is godoc so bloaty memorywiae?
17:17 < steven> WISE
17:18 < skelterjohn> stopped pegging the proc, mem use stopped rising at
500mb
17:18 < skelterjohn> i imagine it's a bug, steven
17:18 < steven> a bug in godoc, http, or net?
17:18 < skelterjohn> i imagine godoc
17:18 < steven> i hope
17:18 -!- itrekkie [~itrekkie@ip72-201-208-165.ph.ph.cox.net] has joined #go-nuts
17:18 < skelterjohn> since i wasn't interacting with it via the web page
when this happened
17:18 < steven> i hope not http
17:18 < steven> or net
17:18 < skelterjohn> http is a very simple package
17:18 < skelterjohn> godoc is a very complex program
17:18 -!- dfr|mac [~dfr|work@nat/google/x-rjtibaamolocrpnd] has joined #go-nuts
17:18 < skelterjohn> that does lots of stuff
17:19 < steven> ah.
17:19 < steven> <3
17:19 < skelterjohn> oh the issue is probably that go doesn't release
acquired memory
17:19 < skelterjohn> it will just use the already acquired memory before
asking for more
17:20 < skelterjohn> it self-reports at having 500mb before GC, 150mb after
17:20 < skelterjohn> but the 500mb doesn't get sent back to the os
17:20 < Namegduf> It's annoying.
17:20 < Namegduf> That said I'm sure my godoc isn't that bad.
17:20 < skelterjohn> i'm trying again, this time with no browser interaction
17:21 < skelterjohn> to see if this is easy to reproduce
17:21 < Namegduf> 124MB for my one which has been running for ages.
17:21 < Namegduf> (Possibly a good month now?)
17:21 < skelterjohn> maybe something to do with -path .
17:21 < Namegduf> I'm using -path
17:22 < skelterjohn> my source must be more burly than yours
17:22 < Namegduf> Could be.
17:23 < Namegduf> That much of a difference in RAM usage from the source
difference would suck, though
17:23 < Namegduf> I think godoc is poorly optimised, myself
17:23 < skelterjohn> no - it's not associated with -path
17:23 < skelterjohn> same thing happens without setting -path
17:23 < Namegduf> 32bit or 64bit?
17:23 < skelterjohn> 64
17:23 < Namegduf> Same, so no help there.
17:24 < skelterjohn> alright - just "godoc -http :6060", never once
requested a page, it's pegging the proc after 60 or so seconds of running
17:24 < jnwhiteh> yeah that's not normal
17:24 < skelterjohn> so, probably rescanning the source
17:24 < jnwhiteh> rescanning the source shouldn't take that long, its
incredibly quick
17:24 < skelterjohn> i don't know what it's doing
17:24 < skelterjohn> i just know it's godoc that's doing it
17:25 < skelterjohn> up to 490mb when it was done pegging
17:25 < steven> wait, i thought that Go releases its memory back to the
system
17:25 < steven> that was one of the things i liked about it.  what the crap.
17:26 < Namegduf> Jeeze.
17:26 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
17:30 -!- TheMue [~TheMue@p5DDF58EC.dip.t-dialin.net] has joined #go-nuts
17:30 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Client
Quit]
17:30 < skelterjohn> steven: I don't think so
17:31 < steven> right, it doesnt give it back to OS.
17:31 < steven> sigh.
17:31 < steven> wish it did.
17:31 < skelterjohn> that's something i imagine we'll see in the future.
17:31 < skelterjohn> in the meantime, it doesn't change the big-Oh of memory
usage
17:32 < skelterjohn> i think that, at some point, we'll be able to specify a
custom memory manager
17:32 < skelterjohn> the GC will be the default, which will be nice for most
things
17:32 < skelterjohn> but if you really want to get down to business, you'll
be able to specify your own
17:33 < skelterjohn> and have to remember to pair every call to make/new
with a free
17:33 < nsf> iant: are you here?  I've found a typo in gofrontend :)
17:33 < nsf> iant: go/expressions.cc:3817
17:33 < nsf> gcc_assert(ocount <= ocount);
17:33 < nsf> makes no sense, it's always true
17:34 < skelterjohn> unless ocount is NaN :)
17:34 < nsf> it's size_t
17:34 < skelterjohn> fine
17:34 < skelterjohn> :)
17:34 < skelterjohn> you win, this time
17:35 < nsf> in NaN case one would use ==
17:35 < nsf> anyway
17:35 < nsf> that function has ecount as well
17:35 < nsf> probably it should be in that expression
17:37 < skelterjohn> ok, anyone want to verify that this is just me?  I run
"godoc -http :6060", and make no requests to it - just leave it alone.  after 70
seconds it starts pegging the proc for 1.5 minutes, at the end of which it has
allocated 500mb of ram, though all but 150mb of it is GC'd
17:38 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
17:38 < skelterjohn> reliably 70 seconds, too
17:39 < nsf> skelterjohn: let's see
17:39 * nsf has started godoc
17:39 < skelterjohn> (and i did update to tip before trying this)
17:39 < nsf> I didn't
17:39 < nsf> using tip makes no sense
17:39 < nsf> well, unless you're the go developer
17:39 < skelterjohn> it does if i want to submit an issue
17:40 < nsf> yeah
17:40 < nsf> but here it starts eating memory
17:40 < nsf> 70 megs
17:40 < nsf> and growing
17:40 < skelterjohn> processor pegged?
17:40 < nsf> well it does something yeah
17:40 < nsf> 180 megs
17:41 < nsf> CPU usage 100%, 300 megs
17:41 < nsf> only one core though
17:41 < nsf> 487 megs :)
17:41 < Namegduf> Sounds like something wrong in current godoc.
17:41 < nsf> and looks like it's done
17:41 < skelterjohn> yep - gonna file an issue
17:42 < Namegduf> Mine's been running for weeks and it's "only" at 124MB,
and I thought that was bad.
17:42 <+iant> nsf: thanks
17:43 < nsf> iant: np :)
17:43 <+iant> should be ocount <= count, I guess
17:43 < nsf> maybe, I don't know, the code looks complex to me, have you
tried to do the same without import/export?
17:44 < skelterjohn> nsf: what platform are you on, so i can include it in
the bug report?
17:44 < nsf> skelterjohn: linux, x86, 3b4e9c85b643 weekly/weekly.2011-03-15
17:44 <+iant> nsf: I must have had some reason to write it that way....
17:44 <+iant> I hope
17:44 < nsf> iant: :D
17:45 < nsf> I'm planning to do it that way: if ^'s operand has fixed size,
simply copy the value (because I know it fits that size) and manually do
complement for N bits, where N is the amount of bits for this type
17:46 < nsf> I hope it makes sense
17:46 < nsf> mpz has functions for doing complement for single bit
17:46 < nsf> s/mpz/gmplib/
17:47 < nsf> on the other hand
17:47 < nsf> maybe it won't work
17:47 < nsf> for negative numbers especially
17:48 < nsf> ugh, let's see
17:49 -!- bjtitus [~bjtitus@154-199.nagel-n.du.edu] has quit [Ping timeout: 250
seconds]
17:50 -!- m4dh4tt3r [~Adium@219.sub-75-208-12.myvzw.com] has joined #go-nuts
17:52 < nsf> I'm not sure how -1 is represented in gmplib, because both:
0b11111111 and 0b11111111111111111 are -1 for signed numbers
17:53 < skelterjohn> can you do 0b with go?
17:53 < nsf> no
17:53 < skelterjohn> that would be neat
17:53 < nsf> it's easy to implement
17:54 < nsf> I think I'll add it
17:54 < nsf> in future
17:54 < nsf> hm, I guess gmplib doesn't use two's complement system for
internal representation obviously
17:55 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
17:55 < nsf> interesting, because bit fiddling must behave like it does
17:56 -!- tvw [~tv@212.79.9.150] has quit [Remote host closed the connection]
17:56 < nsf> yeah, it uses sign-magnitude
17:57 < nsf> as doc says, hahaha, I should read docs more carefully
17:59 < nsf> hm, then I can convert the sign, making an amount of 1s <
inf
17:59 < nsf> and using the same technique
17:59 < nsf> or not
17:59 < nsf> :|
18:00 -!- sum69 [iqxwzb@69.41.179.203] has joined #go-nuts
18:00 -!- kingfishr [~kingfishr@c-98-207-87-183.hsd1.ca.comcast.net] has joined
#go-nuts
18:00 < sum69> hello
18:00 < nsf> hi
18:01 < sum69> anyone wanna private chat?
18:02 < Rennex> cyber?
18:02 < cbeck> ...
18:03 < sum69> ya
18:03 < cbeck> I'll make a nonblocking read from your channel..  or
something
18:03 < skelterjohn> you may have misinterpreted the name of this channel
18:03 -!- sum69 [iqxwzb@69.41.179.203] has quit [Client Quit]
18:03 < nsf> lol
18:04 < Rennex> hehe
18:05 < cbeck> I'd expect that in #latex...
18:05 < cbeck> Confused people showing up there is an hourly thing
18:07 < skelterjohn> haha
18:07 -!- boscop_ [~boscop@g227015087.adsl.alicedsl.de] has joined #go-nuts
18:10 -!- boscop [~boscop@f055112013.adsl.alicedsl.de] has quit [Ping timeout: 246
seconds]
18:10 < steven> git is awesome
18:10 * steven <3 git
18:10 -!- artefon [~thiago@dhcp37.usuarios.dcc.ufmg.br] has quit [Ping timeout:
240 seconds]
18:20 -!- kamaji [~kamaji@cpc2-aztw22-2-0-cust775.aztw.cable.virginmedia.com] has
joined #go-nuts
18:21 < aiju> i remember #latex to be a particularly unpleasant channel
18:21 < aiju> nicely put, a bunch of assholes
18:22 -!- rtharper [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
18:27 < nsf> hm, for bitwise complements there is also a nice property:
18:28 < nsf> (especially when dealing with fixed sizes)
18:28 < nsf> ^x == -x - 1
18:28 < nsf> for signed
18:28 < nsf> ^x == typeof(x).max - x
18:28 < nsf> for unsigned
18:28 < nsf> maybe it makes sense to use that instead
18:29 < aiju> you mean -x - 1 instead of ^x?
18:29 < nsf> yeah
18:29 < aiju> wtf?
18:29 -!- rlab_ [~Miranda@91.200.158.34] has joined #go-nuts
18:29 < aiju> you can also use *2 instead of <<1, it's not a good
idea, either
18:29 < nsf> for constants eval with fixed sizes
18:29 < nsf> aiju: gmplib is the problem :)
18:29 < nsf> it doesn't know about fixed sizes
18:30 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 252 seconds]
18:30 < nsf> and ^0xFF is -256
18:30 < nsf> which is corrent, but size is wrong
18:30 < nsf> 9 bits now
18:30 < aiju> don't use that, then ;P
18:30 < nsf> it's too late
18:31 < zozoR> are your language becomming more weird than c++?  :P
18:31 < nsf> zozoR: no
18:31 < nsf> nothing changed
18:31 < nsf> since I was talking about it last time
18:31 < nsf> just implementation details
18:31 < zozoR> ^^
18:31 < aiju> becoming more weird than c++ is QUITE an achievement
18:31 < zozoR> true
18:32 < nsf> anyways, you see, it becomes easy with that kind of formulas
18:32 < nsf> for uint8 max is 0xFF
18:32 < nsf> ~0xFF == 0xFF - 0xFF
18:32 < nsf> correct?  yes
18:33 < nsf> for int8 it's correct as well
18:33 -!- artefon [~thiago@187.58.198.167] has joined #go-nuts
18:33 < nsf> 0xFF == -1
18:33 < nsf> -(-1) - 1
18:33 < nsf> == 0
18:34 < nsf> ^0xFF == 0
18:34 < nsf> correct again :)
18:34 < nsf> I should use that I guess
18:34 < nsf> that way bitwise complement never overflows the size of the
type
18:36 < nsf> it's interesting
18:36 < nsf> because as far as I understand
18:36 < nsf> Go spec says nothing about bitwise complement regarding untyped
constants
18:36 < nsf> it says
18:36 < nsf> "^x bitwise complement is m ^ x with m = "all bits set to 1"
for unsigned x"
18:36 < nsf> bit for consts
18:37 < nsf> "all bits" means infinite amount of bits :)
18:37 -!- thiago__ [~thiago@189.59.180.46.dynamic.adsl.gvt.net.br] has joined
#go-nuts
18:37 < nsf> and ~0 yields infinity
18:37 < nsf> inifite amount of bits
18:38 < nsf> of 1 bits*
18:38 < nsf> hm..
18:38 < nsf> or I don't understand something
18:39 < nsf> ok, consts are just numbers
18:39 < nsf> but there are no bits in just numbers
18:39 < nsf> bitwise complement doesn't work
18:39 -!- artefon [~thiago@187.58.198.167] has quit [Ping timeout: 240 seconds]
18:39 < aiju> ^x is defined as -x-1 for untyped constants
18:39 < aiju> ^0 is -1
18:39 < nsf> is it?
18:40 < aiju> yes
18:40 < nsf> and where spec says that?
18:40 < nsf> I've missed that then
18:41 < nsf> "The mask used by the unary bitwise complement operator ^
matches the rule for non-constants: the mask is all 1s for unsigned constants and
-1 for signed and untyped constants."
18:41 < nsf> it says that
18:41 < nsf> but by saying that it also assumes the internal representation
of constant numbers
18:42 < nsf> because all 1s is ok for signed int with two's complement
system
18:42 < nsf> it's -1
18:42 < nsf> what if the other system is used
18:42 -!- tensai_cirno [~cirno@77.232.15.216] has joined #go-nuts
18:42 < nsf> all 1s means something close to inifinity
18:42 < nsf> infinity*
18:43 -!- thiago__ [~thiago@189.59.180.46.dynamic.adsl.gvt.net.br] has quit [Ping
timeout: 250 seconds]
18:43 < aiju> sort of implicit in the definition of two's complement
18:43 < aiju> w/e this is how the compiler works
18:44 < nsf> well, by default all constant integers are signed
18:44 < nsf> so, there are no problem
18:44 < nsf> because "all 1s for unsigned constants"
18:44 < nsf> makes no sense
18:44 < nsf> there is no such type
18:44 < aiju> yes it does
18:44 < nsf> as "unsigend const"
18:44 < aiju> const x uint64 = 24
18:45 < nsf> oh
18:45 < nsf> I mean unsigned untyped const
18:45 < nsf> :)
18:45 < aiju> there is no such things
18:45 < nsf> ah yes
18:45 < aiju> -s
18:45 < nsf> sorry, my bad
18:45 < nsf> spec says that :)
18:45 < nsf> "the mask is all 1s for unsigned constants and -1 for signed
and untyped constants"
18:45 < nsf> untyped constants has -1 as mask
18:45 < nsf> always
18:45 < nsf> have*
18:45 < nsf> then it makes sense
18:48 -!- rutkowski [~adrian@178235051224.walbrzych.vectranet.pl] has joined
#go-nuts
18:49 < aiju> what still bugs me
18:49 < aiju> russ at some point claimed that the go compiler did TCO
18:49 < nsf> iant: so, what do you think about that: mpz_com for signed and
mpz_sub(result, type.max, operand) for unsigned as a simple implementation of
bitwise complement that doesn't overflow type sizes?
18:49 < aiju> which i can't reproduce at all
18:49 < aiju> func foo() { foo() }
18:49 < aiju> gets compiled to
18:49 < aiju> CALL ,foo+0(SB)
18:49 <+iant> aiju: I think I accidentally claimed that, but I was wrong
18:50 <+iant> nsf: I think that should work fine when you have a type
18:50 < aiju> iant: oic
18:50 <+iant> nsf: probably better than what I am doing
18:50 < nsf> iant: I see, thanks :) I'll try that
18:51 < aiju> uriel claimed russ claimed that
18:51 < skelterjohn> nsf: it seems that to have godoc not eat 1/2 a gig of
memory, you need to say -maxresults=0 on the command line
18:51 < aiju> btw gcc doesn't even do TCO in many cases
18:51 <+iant> aiju: well, could be, I don't know
18:51 < nsf> skelterjohn: I see
18:51 <+iant> aiju: do you mean gcc or gccgo?  gcc does it when possible at
-O2
18:51 < skelterjohn> it's indexing all the source so it can do fast
searching
18:51 < aiju> gcc
18:51 <+iant> the cases where it can't are fairly esoteric in practice
18:51 < aiju> yeah, well, *when possible*
18:52 < aiju> you mean calling a function with a different number of
arguments?
18:52 <+iant> that should usually work these days
18:52 <+iant> as far as I know
18:53 < aiju> i have tried it
18:53 <+iant> which version of gcc?
18:54 < aiju> oh works with 4.5.2 nvm
18:54 <+iant> gcc marches ever on
18:54 * skelterjohn wishes there were a nice go refactoring tool
18:54 <+iant> gofmt does simple refactoring
18:54 < aiju> TCO is still a bad thing to rely on
18:55 <+iant> yes
18:55 < nsf> skelterjohn: write one
18:55 < skelterjohn> i'm talking about moving files around and such
18:55 < nsf> it's not that hard
18:55 -!- thiago__ [~thiago@187.58.198.230] has joined #go-nuts
18:55 < aiju> maybe try mv?
18:55 < aiju> what are you even talking about?
18:55 < skelterjohn> nsf: i'm done writing go tools - if i started, the go
team would just write one of their own
18:56 < nsf> hehe
18:57 < aiju> TCO fucks up stack traces nicely
18:57 < jnwhiteh> that it does =)
18:58 < skelterjohn> nsf: it may sound funny when i say it like that, but
it's less amusing once the months of hard work have already happened
18:59 < nsf> skelterjohn: but I haven't seen any refactoring tools so far
18:59 < nsf> Robert Griesemer slowly builds his typechecker
18:59 < nsf> and that's it
19:00 < skelterjohn> i still see no reason to waste my time
19:00 < nsf> I once had gocode being able to rename identifiers
19:00 < aiju> what happened to s//?  ;P
19:00 < nsf> but eventually there were some problems found
19:00 < nsf> and well, I removed that part completely
19:00 < nsf> it requires more testing and maintainance
19:00 < nsf> that I can provide
19:00 < nsf> for gocode
19:01 < nsf> well, anyway, it's the only valid path for now
19:01 < nsf> want a refactoring tool - make one
19:02 < nsf> maybe you will be able even sell it after few years
19:02 < nsf> :)
19:02 < nsf> I wouldn't define that as wasting time
19:02 < nsf> but whatever
19:03 < nsf> at least it gives you knowledge about language semantics and a
process of semantic analyzers creation
19:03 -!- rtharper [~tomh@unaffiliated/sioraiocht] has left #go-nuts []
19:03 < aiju> there is no wasted time in programming
19:04 < nsf> yeah, the most time wasted is on irc
19:04 < nsf> :D
19:04 < nsf> ;-)
19:06 < aiju> gs doesn't read from pipes, what the fuck
19:06 -!- huin [~huin@91.85.185.181] has joined #go-nuts
19:08 < steven> ghostscript?
19:08 < aiju> yeah
19:08 < steven> ha.
19:09 < steven> <3
19:09 -!- m4dh4tt3r [~Adium@219.sub-75-208-12.myvzw.com] has quit [Ping timeout:
260 seconds]
19:09 < skelterjohn> god dammit - now i feel compelled to write a
refactoring tool
19:09 < skelterjohn> :\
19:10 < nsf> skelterjohn: :D
19:10 < skelterjohn> thanks a lot, nsf
19:10 < nsf> np
19:10 < aiju> and i feel like creating and implementing a vector language
which doesn't suck without limits
19:10 < nsf> but if you're in doubt
19:10 < nsf> don't do it
19:10 < huin> cool, let me know when it's done, skelterjohn :)
19:10 < skelterjohn> when gofmt adds the same functionality, i'm coming for
you
19:13 < steven> hehehe:
19:13 < steven> $ touch echo hello world
19:13 < steven> $ *
19:13 < steven> hello world
19:13 < aiju> the unix shell is cool without limit
19:13 < aiju> +s
19:13 < steven> +s?
19:13 < aiju> limits
19:13 < aiju> i corrected my sentence
19:13 < steven> o
19:14 < steven> i totally just rebased in git successfully for the first
time earlier today <3
19:14 < steven> life is good.
19:14 < skelterjohn> what does rebased mean
19:14 < aiju> fuck up
19:15 < Namegduf> It means having commits inserted into the history at a
certain point and all later patches redone on top of those.
19:15 < steven> actually,
19:16 < steven> i changed 4 commits into one, and changed their commit date
to like 6 hours earlier
19:16 < Namegduf> It's used for patch queues
19:16 < steven> :D
19:16 < steven> ie, i rewrote history.
19:17 < jesusaurus> git's awesome like that
19:17 < aiju> you changed history?
19:17 < aiju> i thought that capability was limited to communist dictators
19:17 < Namegduf> Normally you need a time machine for that, but no, just
git.
19:18 < steven> aiju: nah, also secular elitists.
19:18 < steven> ie, your college professors.
19:18 < steven> like the one who taught me in school that all religions are
inherently man-made creations.
19:18 < Namegduf> All fear the terrifying LIBERAL ELITE
19:18 < steven> that guys a dick for teaching young, impressionable students
that.
19:19 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has joined
#go-nuts
19:19 < Namegduf> I thought you said college students?
19:19 < skelterjohn> steven: to be fair, no one person can think any more
than 1 religion is inherently man-made, i'd think
19:19 < skelterjohn> err, said that wrong
19:19 < Namegduf> *isn't
19:19 < steven> good point skelterjohn
19:19 < skelterjohn> right
19:19 < aiju> wtf
19:20 < aiju> a value i push down a channel doesn't appear on the other end
19:20 < Namegduf> The American predisposal to treat adults at university as
their wittle children never fails to astound.
19:20 < steven> its not the man-made part im against, i guess..  its the
*all* part.
19:20 < aiju> there are animal-made religions?
19:20 < steven> probably.
19:20 < steven> cows sacrificying humans, ec
19:20 < steven> :D
19:20 < steven> *etc
19:21 < aiju> wtf
19:21 < aiju> why is this value disappearing in the channel
19:21 < Namegduf> Inefficiency
19:22 < aiju> wtf
19:22 < aiju> somehow this non-buffered channels buffers shit
19:23 -!- tylergillies [~quassel@unaffiliated/tylergillies] has quit [Quit: No
Ping reply in 180 seconds.]
19:23 -!- tjgillies [~quassel@204-232-205-180.static.cloud-ips.com] has joined
#go-nuts
19:24 < aiju> i can use channels like UNIX pipes, right?
19:24 < steven> kinda
19:24 < aiju> i.e.  write some shit, close() and the other reads it
19:24 < aiju> without anything being lost or anything
19:24 < Namegduf> Yes.
19:25 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has joined #go-nuts
19:25 < steven> so do you guys have jobs or what?
19:25 < aiju> high school
19:25 < skelterjohn> <- grad student
19:25 < steven> lucky you's
19:25 * steven is at work and cant do any Go atm :(
19:25 < aiju> i can't do any Go in school either
19:26 < skelterjohn> i can do whatever i want, whenever i want
19:26 < steven> skelterjohn: until you run out of money ;)
19:26 < steven> and have to repay your loan :D
19:26 < skelterjohn> i get a stipend for doing whatever i feel like
19:26 < skelterjohn> i owe no money
19:27 < steven> can i have it?
19:27 < skelterjohn> if someone asks you to pay your way through a CS PhD,
pick another program
19:27 < skelterjohn> no.
19:27 < steven> are you christian?
19:27 < skelterjohn> no
19:27 < steven> shit.
19:27 < steven> can you turn into one for a few mins?
19:27 < skelterjohn> unlikely
19:27 < steven> shit.
19:28 < steven> there goes my plan
19:28 < nsf> uhm, guys I have a super code snippet for you
19:28 < jesusaurus> super??
19:28 < skelterjohn> if your plan was to bring religion into a channel about
a programming language and make everyone feel awkward, you succeeded
19:28 < nsf> http://pastie.org/1727747
19:28 < nsf> what's wrong with that code?
19:29 < aiju> the results i'm getting make it look like channels have a
buffer of length 1
19:29 < nsf> it compiles though
19:29 < aiju> blargh
19:29 < aiju> can't you put up a disclaimer
19:29 < aiju> i just ate
19:29 < aiju> nsf: "default" is mispelled?
19:29 < skelterjohn> nice
19:29 < nsf> aiju: it's easy to spot when it doesn't highlighted
19:29 < nsf> let me show you a screenshot
19:30 < skelterjohn> why would it compile with deafult?
19:30 < aiju> skelterjohn: it's a label
19:30 < nsf> skelterjohn: it thinks it's a label
19:30 < aiju> you can do all kind of shit in C switch() statements
19:30 < aiju> look at Duff's device
19:30 < nsf> I'm afraid you can do this one in Go as well
19:30 < skelterjohn> unused labels get an error
19:30 < skelterjohn> as of recently
19:30 < aiju> assert is the spawn of evil
19:30 < nsf> it will be simply a labeled statement inside case clause
19:30 < nsf> http://ompldr.org/vODBjbQ/2011-03-29-013413_1440x866_scrot.png
19:30 < nsf> ok
19:31 < skelterjohn> scrot rofl
19:31 < nsf> my vim actually highlights labels and 'default' with the same
color
19:31 < jesusaurus> scrot++
19:31 < nsf> and as you can see
19:31 < nsf> I copy & paste a lot
19:31 < aiju> nsf: that's what syntax highlighting does to you ;P
19:31 < nsf> :)
19:31 < aiju> nsf: and you use assert
19:31 < nsf> because deafult is everywhere
19:31 < nsf> aiju: yes
19:32 < aiju> assert(!"fuck") <-- just plain wtf
19:32 -!- brett [~brett@rdnzl.net] has left #go-nuts []
19:32 < nsf> believe it or not, I don't care what you think about my code,
because I don't care what _I_ think about it :)
19:32 < aiju> hahahahaha
19:33 < nsf> I just need it up and running
19:33 < aiju> is there a go pastebin which allows you to run code or
something?
19:34 < aiju> http://pastie.org/1727778
19:34 < aiju> looks like i got something wrong
19:35 < aiju> gives me 1 2
19:35 < skelterjohn> hmm, when making a command line refactoring tool, what
would be a good way to tell it to rename a variable within a function, where that
name can mean different variables, depending on scoping?
19:35 < skelterjohn> might just not give that functionality
19:35 < nsf> skelterjohn: I haven't found solution other than position in
the source code
19:35 < nsf> offset or line:column
19:35 < skelterjohn> since it's easy to do that by hand without worrying
about side-effects
19:35 < nsf> which is unusable without a GUI tool
19:36 < skelterjohn> while renaming a type field can have side effects
19:36 < nsf> there are few places where renaming can cause problems
19:36 < nsf> renaming a package name is a problem
19:37 < aiju> is my problem a bug?
19:37 < nsf> because you also need to fix an import statement
19:37 -!- Project-2501 [~Marvin@82.84.81.192] has joined #go-nuts
19:37 < aiju> the spec says "after calling close *and after any previously
sent values have been received*"
19:37 < nsf> aiju: no
19:37 < nsf> wait
19:37 < nsf> I'll fix it for you
19:37 < skelterjohn> nsf: refactoring tool has multiple ways to do it for
rnaming packages...  can change the location of the source, or can force the name
for imports in other spots
19:38 < nsf> aiju: http://pastie.org/1727806
19:38 < nsf> skelterjohn: yeah
19:39 < nsf> but you need to handle all those cases
19:39 < aiju> nsf: what the fuck?  really?
19:39 < nsf> I didn't
19:39 < aiju> oh wait
19:39 < nsf> aiju: yes
19:39 < aiju> it's main terminating, right?
19:39 < aiju> blargh
19:39 < nsf> when main.main goroutine exists
19:39 < nsf> it kills everything
19:39 < nsf> exits*
19:39 < nsf> you have to do an explicit sync
19:39 < nsf> for that
19:40 < aiju> crap
19:40 < nsf> e.g.  block at the end of main, until all other goroutines are
finished
19:40 -!- Project_2501 [~Marvin@82.84.89.115] has quit [Ping timeout: 260 seconds]
19:41 < aiju> is there a function for this?
19:41 < nsf> no :)
19:41 < Namegduf> Channels
19:41 < aiju> this *SUCKS*
19:41 < Namegduf> It's better than the alternative
19:42 < Namegduf> Which requires you shut down "service" goroutines
19:42 < Namegduf> Which requires dependency resolution between them
19:42 < nsf> you can also drop a feature request, so that scheduler must
provide a number of active goroutines
19:42 < nsf> it makes sense to me
19:42 < nsf> and call os.Sched() or something
19:42 < nsf> until it's > 1
19:43 < nsf> hm..
19:43 < skelterjohn> nsf:
https://github.com/skelterjohn/gorf/blob/master/README
19:43 < nsf> it's not in os
19:43 < aiju> runtime
19:43 < nsf> ah, yes
19:43 < aiju> are semaphores exposed to normal code?
19:43 < skelterjohn> i can't think of anything beyond that that would be
useful (as in, stuff that isn't easy to do on your own)
19:43 < nsf> skelterjohn: I have no opinion on that
19:44 < nsf> my mind is busy with my own language
19:44 < nsf> implementation
19:44 < Namegduf> I just have my main goroutine receive a "okay to
terminate" from everything
19:44 < aiju> is nil a valid channel value?
19:45 < Namegduf> And terminate when they're okay to terminate.
19:45 < Namegduf> Yes.
19:45 < nsf> aiju: yeah
19:45 < nsf> Namegduf: the problem with that approach
19:45 < nsf> you have to know the amount of goroutines
19:53 -!- Dr_Who [~tgall@206.9.88.154] has joined #go-nuts
19:53 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
19:55 -!- zimsim [~simon@87.72.77.195] has joined #go-nuts
19:55 -!- tgall_foo [~tgall@206.9.88.154] has quit [Ping timeout: 260 seconds]
20:03 -!- mattn_jp [~mattn@112-68-51-4f1.hyg1.eonet.ne.jp] has quit [Quit:
Ex-Chat]
20:04 -!- Dr_Who [~tgall@206.9.88.154] has quit [Ping timeout: 240 seconds]
20:09 < aiju> haha
20:09 < aiju> i have an algorithm which is O(n^5) or something
20:09 < nsf> lol
20:09 < nsf> worst algorithm ever?
20:09 < aiju> nah
20:09 < aiju> there are O(n!) algorithms ;P
20:09 < aiju> or O(n^n)
20:09 < nsf> ah, worst ever is O(n^n)
20:09 < nsf> he
20:10 < aiju> run time for n = 10 is 0.243 s
20:10 < nsf> nice
20:10 < nsf> :D
20:11 < aiju> oh wait
20:11 < aiju> n^5 is a *gigantic* underestimation
20:11 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
20:11 < aiju> it's n^2 2^(n^3) or something
20:11 < aiju> i killed it after 1min 16s
20:12 < nsf> :)
20:12 -!- wrtp [~rog@92.17.50.183] has joined #go-nuts
20:12 < jesusaurus> ewww
20:14 -!- artefon [~thiago@187.58.198.230] has joined #go-nuts
20:15 -!- thiago__ [~thiago@187.58.198.230] has quit [Read error: Connection reset
by peer]
20:16 -!- saschpe_ [~quassel@opensuse/member/saschpe] has quit [Remote host closed
the connection]
20:17 -!- crazy2be [~crazy2be@d209-89-248-73.abhsia.telus.net] has joined #go-nuts
20:17 < aiju> for n = 13 my program is still faster than the conversion to
png
20:18 -!- ildorn [~ildorn@dslb-088-067-155-060.pools.arcor-ip.net] has joined
#go-nuts
20:18 -!- ildorn [~ildorn@dslb-088-067-155-060.pools.arcor-ip.net] has quit
[Client Quit]
20:18 -!- rlab_ [~Miranda@91.200.158.34] has quit [Ping timeout: 252 seconds]
20:19 < aiju> http://aiju.phicode.de/up/circ/test.html
20:19 < aiju> watch the beautiful result
20:19 -!- imsplitbit [~imsplitbi@64.39.4.132] has joined #go-nuts
20:20 < aiju> (is my eye or convert fucking up the filled arcs?)
20:21 < aiju> thanks to channel my program has space complexity not nearly
as insane as time complexity
20:21 < aiju> O(Σ(d|n) φ(n/d) 2^d) :D
20:22 < Namegduf> Oh no, squiggles.  :(
20:27 -!- rutkowski [~adrian@178235051224.walbrzych.vectranet.pl] has quit [Quit:
WeeChat 0.3.3-dev]
20:29 -!- huin [~huin@91.85.185.181] has quit [Quit: bedtime]
20:29 < crazy2be> aiju: What is that?
20:30 < aiju> can't you tell?  ;P
20:30 < Namegduf> The second squiggle looks vaguely satanic.
20:30 * nsf knew this one once
20:30 < nsf> can't remember though
20:31 < nsf> phi?
20:31 -!- ni| [~nil@users.vu.union.edu] has joined #go-nuts
20:31 < aiju> yeah
20:31 < nsf> yay!
20:31 < nsf> :D
20:31 * Namegduf is given stuff using it occasionally but never been told what it
means.
20:31 < nsf> well, it looks like russian 'f'
20:31 -!- TheMue [~TheMue@p5DDF58EC.dip.t-dialin.net] has quit [Quit: TheMue]
20:31 < nsf> which is: ф
20:31 < aiju> they are related
20:32 < aiju> both cyrillic and roman letters derived from greek ones
20:32 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
20:32 < nsf> yeah, I guess
20:32 -!- zozoR [~Morten@56344e3e.rev.stofanet.dk] has quit [Remote host closed
the connection]
20:33 < nsf> have no idea what phi means though :)
20:33 < Namegduf> As typical for mathematics, any of a dozen things
20:33 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:a44a:7396:a120:7cf2] has quit
[Quit: Leaving.]
20:33 < aiju> well it's usually just a variable
20:33 < Namegduf> And that's just covering mainstream usage
20:33 < aiju> for an angle or a function or crap
20:33 < aiju> in that case it means the euler phi function
20:34 < aiju> φ(n) is the number of coprime numbers between 1 and n
20:37 < skelterjohn> i don't remember learning about the euler phi function
in high school
20:40 -!- HottestGuyEver [~rooms@2.51.180.216] has joined #go-nuts
20:41 -!- pharris [~Adium@rhgw.opentext.com] has quit [Quit: Leaving.]
20:46 -!- zerosanity [~josh@8.20.178.82] has joined #go-nuts
20:47 -!- zerosanity [~josh@8.20.178.82] has quit [Remote host closed the
connection]
20:52 < HottestGuyEver> Welcome girls on private
20:52 < nsf> :D
20:53 < nsf> we need to rename the channel to gtfo
20:53 < nsf> :D
20:53 < Namegduf> HottestGuyEver: You may be looking for #latex
20:55 -!- imsplitbit [~imsplitbi@64.39.4.132] has quit [Quit: Bye!]
20:55 < dfr|work> nsf, sometimes it means the wave function ;)
20:55 < dfr|work> or was that psi
20:55 < dfr|work> i think it was psi, actually
20:55 < nsf> http://en.wikipedia.org/wiki/Phi
20:56 < Namegduf> That has a wonderful list.
20:56 < nsf> it has a lot of meanings as I can see
20:56 < nsf> :)
20:56 < aiju> dfr|work: phi means the wave function in momentum space
20:56 < Namegduf> Mathematics is like a programming language crossed with a
natural language
20:56 < aiju> Namegduf: mathematics is fine compared with physics
20:56 < Namegduf> Symbols and syntax and their meaning are made up at whim
20:56 < aiju> mathematicians are at least consistent
20:56 < Namegduf> No, they aren't.
20:57 * steven <3 git
20:57 -!- ajdecon [~ajdecon@li207-111.members.linode.com] has quit [Ping timeout:
255 seconds]
20:57 < dforsyth> steven: you said that earlier
20:57 < steven> writing my own cheesy git implementation is awesome
20:57 < steven> dforsyth: and ill say it again!
20:57 < steven> :D
20:57 < dforsyth> what will your implementation be able to do?
20:57 < steven> a small fraction of what git can do
20:58 < steven> ;)
20:59 < dfr|work> steven, output its help message?  ;)
20:59 -!- blackmagik [~blackmagi@unaffiliated/blackmagik] has quit [Read error:
Connection reset by peer]
20:59 < dforsyth> cool
20:59 < dforsyth> i want to see the libgit implementation someone was
writing too
21:04 -!- Project-2501 [~Marvin@82.84.81.192] has quit [Read error: Connection
reset by peer]
21:04 -!- Project-2501 [~Marvin@82.84.81.192] has joined #go-nuts
21:07 -!- Project-2501 [~Marvin@82.84.81.192] has quit [Client Quit]
21:07 < steven> dfr|work: ha, no
21:07 < steven> dfr|work == dforsyth?
21:09 < dforsyth> no
21:09 -!- Dr_Who [~tgall@206.9.88.154] has joined #go-nuts
21:13 < dfr|work> steven, no, I'm special
21:13 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn]
21:19 -!- Dr_Who [~tgall@206.9.88.154] has quit [Ping timeout: 252 seconds]
21:25 -!- HottestGuyEver [~rooms@2.51.180.216] has quit [Quit: Rooms • iPhone IRC
Client • http://www.roomsapp.mobi]
21:26 < nsf> SmartestGuyEver
21:27 < steven> ok
21:27 < steven> um, nsf?
21:27 < nsf> steven: nevermind :)
21:28 -!- m4dh4tt3r
[~Adium@75.144.24.109-BusName-walnutcreek.ca.hfc.comcastbusiness.net] has quit
[Quit: Leaving.]
21:28 < nsf> uhm
21:28 < nsf> never mind
21:28 < nsf> *
21:28 < nsf> :)
21:28 < nsf> I thought it's a single word
21:30 < steven> me too
21:31 < steven> forever i thought that
21:31 < steven> lately ive been noticing it show up as typos
21:31 < steven> which is weird.
21:31 -!- Dr_Who [~tgall@206.9.88.154] has joined #go-nuts
21:31 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
21:33 < steven> whats a good design of creating a singleton in Go?
21:34 -!- ExtraSpice [XtraSpice@88.118.35.153] has quit [Read error: Connection
reset by peer]
21:34 < nsf> singleton is a bad term
21:34 < steven> like, i have this bunch of common functionality, that shares
data, but i only ever want one instance of it to be used
21:34 < nsf> aiju: :)
21:34 < nsf> aiju will tell you :)
21:34 < taruti> steven: just write a module with variables?
21:34 < steven> i guess it kinda makes sense to just write them as functions
in their own package and let them operate on private data
21:34 < aiju> rants about singletons are almost TOO easy
21:34 < steven> so the package itself would then be a sort of singleton in a
sense.
21:35 < steven> and with init(), initialization of that data becomes pretty
easy
21:35 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Connection reset by
peer]
21:35 -!- foocraft [~dsc@78.101.135.18] has joined #go-nuts
21:35 < steven> its like an initializer for my singleton :D
21:35 < aiju> drilling holes into your skull to drive out evil spirits is a
better idea than singletons
21:35 < crazy2be> why
21:36 < steven> aww crap.
21:36 < nsf> I think singleton is a name of an idea that shouldn't exist
21:36 < aiju> singletons are just a fancy (read: really annoying) way to do
...  global variables
21:36 < nsf> name shouldn't exists I mean
21:36 < nsf> not an idea
21:37 < steven> that only works if i want one 'singleton' per package.
theres no way to "namespace" multiple related functions in a single package
21:37 < nsf> idea is simple:
21:37 < nsf> var x;
21:37 < steven> the closest i can get is to package multiple related
packages together.
21:37 < aiju> steven: what kind of fornication are you doing with your
global variables?
21:37 < nsf> func main() { init_x(); use_x(); shutdown_x(); }
21:37 < steven> aiju: im trying to represent the concepts like git index and
git object-store in my internal API
21:38 < crazy2be> there is nothing wrong with singletons where they belong
to be used
21:38 < steven> those are both single-instances in the sense that they each
have several functions that act on a single shared bit of data
21:38 < crazy2be> e.g.  the log package
21:38 < crazy2be> is a thing of beutiful design
21:39 < steven> thats not really a singleton.  rather its a single instance
of a type.
21:40 < steven> a singleton is where you cannot create new instances, which
Go inherently does not have with its normal type system
21:40 < crazy2be> oooooh
21:40 < crazy2be> well that's a stupid idea normally
21:40 < crazy2be> why would you want that?
21:40 < steven> well think about the git index.  within a single repository,
there is only one index, right?
21:40 < nsf> aiju: hehe, I can't even comment that
21:40 < steven> and everything in the repository can generally access it so
its global, right?
21:40 < crazy2be> within a single repository, yes
21:41 < steven> and within a single repository, there is a single
object-store located at .git/objects
21:41 < taruti> steven: an app might want to handle multiple repositories
21:41 < steven> which is also global
21:41 < aiju> crazy2be: by some weird logic, global variables are bad and
singletons good
21:41 < steven> good point
21:41 < nsf> steven: here is the solution: forget about singletons, what
would you do?
21:41 -!- artefon [~thiago@187.58.198.230] has quit [Read error: Connection reset
by peer]
21:41 -!- thiago__ [~thiago@187.58.198.230] has joined #go-nuts
21:41 < steven> so i guess a better question is: whats the proper dependency
flow for git object-stores and git indexes?
21:42 < steven> my head hurts
21:42 < taruti> take a sheet of paper and draw them out?
21:42 < crazy2be> yeah paper helps
21:42 < crazy2be> or a whiteboard
21:42 -!- wrtp [~rog@92.17.50.183] has quit [Quit: wrtp]
21:42 < steven> i have 3 objects, Git, GitIndex, and GitStore.  the first
one owns a single instance of the second two.
21:43 < steven> i jsut feel bad because im making my Git object global so
that the store can access the index and vice versa
21:43 < steven> i guess i could give the store a pionter to my index, and
vice versa.  but still feels unclean.
21:43 < dforsyth> why not just set a pointer to the parent obj in the index?
21:43 < crazy2be> aiju: I don't beleive global variables are always bad,
just use them in the right places
21:43 < aiju> crazy2be: i don't do either
21:43 < aiju> crazy2be: it's just the Java kind of logic
21:44 < steven> dforsyth: im not sure if thats better or worse or neutral
21:44 < crazy2be> aiju: You have to have something absolute
21:44 < crazy2be> packages are global variables
21:44 < crazy2be> so are functions in those packages
21:44 < steven> i especially dont like the idea of seeing this code inside
GitIndex: val := idx.Git.Store[key]
21:44 < steven> that seems kinda dirty, to reach in too far
21:45 < crazy2be> aiju: Or am i missing something?
21:45 < aiju> crazy2be: the main problem with global variables is state
21:46 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
21:46 < aiju> singletons are by no means better, though
21:46 -!- awidegreen [~quassel@c-66c9e555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Remote host closed the connection]
21:52 < nsf> if someone will teach me how to make people unlearn OOP, I
don't know
21:52 < nsf> I will marry that person
21:53 < nsf> :D
21:53 < aiju> rm OOP/*
21:54 < nsf> aiju: it's called: "I wish brain was POSIX compatible"
21:55 < aiju> i really don't
21:55 < nsf> haha
21:55 < aiju> i don't want pthreads in my brain
21:56 < nsf> then you can't rm OOP/*
21:56 < aiju> del OOP/*.*
21:56 < crazy2be> no, you mean DELETE C:/OOP/*
21:57 < crazy2be> DELETE C:\OOP\*
21:58 < aiju> // EXEC DELETE,DSN='OOP'
22:01 -!- vpit3833 [~user@203.111.33.203] has joined #go-nuts
22:02 -!- pphalen [~pphalen@66.92.11.149] has left #go-nuts []
22:03 -!- thiago__ [~thiago@187.58.198.230] has quit [Ping timeout: 240 seconds]
22:03 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 240 seconds]
22:05 -!- emjayess [~emjayess@pix1.i29.net] has quit [Quit: Leaving]
22:08 -!- zimsim [~simon@87.72.77.195] has quit [Remote host closed the
connection]
22:14 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Read error:
Connection reset by peer]
22:29 -!- dfr|mac [~dfr|work@nat/google/x-rjtibaamolocrpnd] has quit [Remote host
closed the connection]
22:31 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
22:53 < steven> nsf: learn Lisp
22:53 < steven> :D
22:53 < nsf> no thanks
22:53 * steven actually wrote an implementation of OOP using Lisp, hehe
22:53 < steven> http://degutis.org/entries/2010/12/6/oop-in-lisp-part-3
23:02 -!- l00t [~i-i3id3r_@189.105.32.98] has quit [Remote host closed the
connection]
23:04 < crazy2be> how can you do multi-line strings?
23:05 < KirkMcDonald> crazy2be: You just do.
23:05 < KirkMcDonald> String literals may contain newlines.
23:05 < nsf> KirkMcDonald: I think not
23:06 < nsf> only raw string literals can
23:06 < nsf> ``
23:06 < KirkMcDonald> Ahh, you're right.
23:06 < KirkMcDonald> Even so.
23:06 < nsf> test.go:5: newline in string
23:06 < nsf> yes
23:06 < nsf> good night, sweet dreams :)
23:06 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.4]
23:26 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
23:34 < exch> interesting
https://groups.google.com/forum/#!topic/golang-nuts/h_Yd71Kis-s
23:35 < exch> I might just boot up windows in vbox to see how all this works
23:35 -!- m4dh4tt3r [~Adium@195.sub-75-208-227.myvzw.com] has joined #go-nuts
23:36 < exch> You can't go wrong when your company has unicorns in the name
23:40 -!- dfc [~dfc@eth59-167-133-99.static.internode.on.net] has joined #go-nuts
23:45 -!- jgonzalez [~jgonzalez@173-14-137-134-NewEngland.hfc.comcastbusiness.net]
has quit [Ping timeout: 246 seconds]
23:46 <@adg> it does sound very cool
23:47 <@adg> i tried it out a few months ago, and it was impressively
complete
23:51 < str1ngs> I need a better name for this struct.  it handles both
bzip2 and gzip tarballs.  I was going to call it Tar but that doesnt seem right to
me.  maybe Archive?
23:51 < str1ngs> ie Archive.Untar
23:52 < exch> 'zip' covers them both
23:52 < str1ngs> Zip.Decompress
23:52 < str1ngs> that might work
23:53 < str1ngs> good idea thanks exch
--- Log closed Tue Mar 29 00:00:50 2011