--- Log opened Thu Dec 30 00:00:01 2010
00:01 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-165-48.clienti.tiscali.it] has
joined #go-nuts
00:03 -!- go-irc-ch [~go-irc-ch@2001:470:1f13:3b4:20a:e4ff:fe49:b68c] has joined
#go-nuts
00:04 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-162-156.clienti.tiscali.it] has
quit [Ping timeout: 250 seconds]
00:06 -!- LeNsTR [~lenstr@79.165.23.176] has joined #go-nuts
00:06 -!- LeNsTR [~lenstr@79.165.23.176] has quit [Changing host]
00:06 -!- LeNsTR [~lenstr@unaffiliated/lenstr] has joined #go-nuts
00:11 -!- tensorpudding [~user@99.56.169.128] has joined #go-nuts
00:12 -!- sauerbraten [~sauerbrat@p508CFE24.dip.t-dialin.net] has quit [Remote
host closed the connection]
00:12 -!- Scorchin [~Scorchin@host86-173-188-202.range86-173.btcentralplus.com]
has quit [Quit: Scorchin]
00:12 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 260 seconds]
00:30 -!- l00t [~i-i3id3r_@189.105.5.123] has joined #go-nuts
00:32 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts
01:01 -!- daharon [~daharon@173-11-102-86-SFBA.hfc.comcastbusiness.net] has quit
[Quit: Leaving]
01:02 -!- cafesofie [~cafesofie@ool-4a5978f2.dyn.optonline.net] has joined
#go-nuts
01:04 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X]
01:06 -!- photron_ [~photron@port-92-201-196-89.dynamic.qsc.de] has quit [Read
error: Operation timed out]
01:09 -!- tgall_foo [~tgall@linaro/tgall-foo] has quit [Quit: Leaving]
01:11 -!- niemeyer__ [~niemeyer@189.30.51.90] has quit [Ping timeout: 240 seconds]
01:26 -!- xash [~xash@d162187.adsl.hansenet.de] has quit [Ping timeout: 265
seconds]
01:29 -!- sav [~lsd@jagat.xored.org] has left #go-nuts []
01:31 -!- binarypie [~binarypie@c-24-6-151-185.hsd1.ca.comcast.net] has quit
[Remote host closed the connection]
01:34 -!- shvntr [~shvntr@116.26.128.19] has joined #go-nuts
01:35 -!- SoniaKeys [Alliebloom@c-24-91-112-191.hsd1.ma.comcast.net] has joined
#go-nuts
01:43 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-165-48.clienti.tiscali.it] has
quit [Quit: E se abbasso questa leva che succ...]
02:03 -!- binarypie [~binarypie@c-24-130-113-34.hsd1.ca.comcast.net] has joined
#go-nuts
02:11 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
02:12 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
02:14 -!- binarypie [~binarypie@c-24-130-113-34.hsd1.ca.comcast.net] has quit
[Remote host closed the connection]
02:14 -!- keithcascio [~keithcasc@nat/google/x-unrvnlaspqtjbsch] has quit [Quit:
Leaving]
02:22 -!- niemeyer__ [~niemeyer@189.30.51.90] has joined #go-nuts
02:25 -!- SmoothPorcupine [~smooth@207.224.112.146] has joined #go-nuts
02:26 < SmoothPorcupine> Good news everyone!
02:27 < SmoothPorcupine> Go has mauch of the same functionality I would have
put in my langauge if I thought plain text was a valid solution.
02:28 < SmoothPorcupine> much*
02:31 < Namegduf> Plain text?
02:32 < SmoothPorcupine> Go is written in plain text, is it not?
02:32 < Namegduf> In UTF-8.
02:32 < nsf> SmoothPorcupine: of course plain text sucks, do you have a
better idea?
02:33 < nsf> XML?  lol
02:33 < SmoothPorcupine> Whatever.  Plain UTF-8 string.
02:33 < Namegduf> As opposed to fancy UTF-8 string?
02:33 < SmoothPorcupine> XML is written in plain text, is it not?
02:33 < kanru> we need 2D or even 3D presentation!
02:33 < Namegduf> What IS your definition of plain text?
02:34 < SmoothPorcupine> Anything that is designed to be "humanly readable."
02:35 -!- shvntr [~shvntr@116.26.128.19] has quit [Quit: leaving]
02:36 < TheSeeker> As opposed to ...  perl?
02:36 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Remote
host closed the connection]
02:37 < SmoothPorcupine> Well kinda.  Hence the quotation marks.
02:40 < SoniaKeys> bar codes
02:42 < SoniaKeys> paper tape
02:43 < SmoothPorcupine> Yeah those are thing nobody would genuinely argue
ought to be manipulated with a text editor.
02:45 < uriel> we need 3D programming languages
02:45 < uriel> SmoothPorcupine: wtf are you smoking?
02:46 < SmoothPorcupine> Well, if you want to stretch the definition of
"smoking" really far, licorice root.
02:48 < Namegduf> So how do you think people should program?
02:48 < Namegduf> Since "writing code" obviously isn't the approach you're
thinking of.
02:48 < Eko> Namegduf: so, interesting side-effect of the channel
coroutines, I joined 10,000 users onto a single channel and the entire rest of the
server kept responding smoothly except for any user who joined that channel
02:48 < SmoothPorcupine> By hitting keys, probably.
02:49 < Namegduf> Eko: Yeah, that should happen.
02:49 < Eko> Namegduf: but I was away for a half hour or so, and now it has
processed all the joins and I can cycle in ~2sec
02:49 < Eko> so, on the whole, not too bad.
02:49 < SmoothPorcupine> I guess some part of programming are more easily
done with the mouse.
02:50 < SmoothPorcupine> parts*
02:50 < Namegduf> SmoothPorcupine: If you take input in text form and
convert it to generate your "source files" you've invented a bytecode format, not
a non-human-readable language.
02:51 < Eko> Namegduf: what's a reasonable upper limit for channel sizes for
stress testing?  2000?
02:51 < SmoothPorcupine> Yes...?
02:52 < Eko> that's 1,001,000 JOIN commands if my math is right
02:52 < Namegduf> 2000 seems reasonable.
02:52 < SmoothPorcupine> There's more to the keybaord than text, though.
02:52 < Namegduf> For a single channel.
02:52 < Eko> of course.
02:52 < SmoothPorcupine> keyboard*
02:52 < Eko> SmoothPorcupine: I've read your entire conversation and I still
have no idea what you're saying.
02:53 -!- boscop_ [~boscop@g225220058.adsl.alicedsl.de] has joined #go-nuts
02:53 < SmoothPorcupine> I'm just saying, Go is great, for a text format
language.
02:53 -!- niemeyer__ [~niemeyer@189.30.51.90] has quit [Ping timeout: 240 seconds]
02:54 < SmoothPorcupine> (Thoguh I guess I didn't specify I consider my
design decisions great.)
02:54 < SmoothPorcupine> (Though*)
02:54 < Namegduf> Everything else working well while it happens is a nice
consequence of Go.
02:54 < Eko> SmoothPorcupine: most of us agree that it's pretty great; I'm
curious what your alternative is that might be better, as you haven't stated it
that I saw.
02:54 < Namegduf> The two second cycle time is high but nice.
02:55 -!- boscop [~boscop@g226245247.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
02:55 < Eko> Namegduf: well, the cycle was instant, but it was another
second or two before XChat filled out the user list fully
02:55 < Eko> I can't say whether that was the server or xchat or happening
to get caught in a GC run.
02:55 -!- shvntr [~shvntr@116.26.128.19] has joined #go-nuts
02:55 < Namegduf> Eko: Likely the server.
02:56 < Namegduf> The half hour join time makes it just demonstrated as a
non-functioning case anyway, though.
02:56 < Eko> oh, it might actually have been the WHO request
02:56 < Namegduf> I mean, for the original joins.
02:56 < SmoothPorcupine> I'm not quite sure what I've imagined is better
yet.
02:56 < Namegduf> Yeah, that's what would do it.
02:56 < Eko> damn xchat and its constant WHO requesting, lol
02:57 < SmoothPorcupine> I haven't formally made that design decision, at it
were.
02:57 < SmoothPorcupine> as*
02:57 < Eko> but you think that there is some better way to program than via
text.
02:57 < SmoothPorcupine> More efficient, at least/
02:57 < SmoothPorcupine> .*
02:58 < Eko> While I don't disagree that there may be some better way, I'm
somewhat curious what it is about text that you find inefficient.
02:58 < SmoothPorcupine> Parsing, for one.
02:59 < Eko> SmoothPorcupine: parsing is a more or less solved problem.
Even languages like go have some irregularities, but it's not like they aren't
understood, and ways to get around them are more or less generaly known.
03:00 < Eko> and if you want a complely unambiguous language (I think),
there are always languages like lisp.
03:00 < SmoothPorcupine> Compressing complex structures into a linear series
is a form of adding complexity, the way I see it.
03:01 < Eko> unfortunately, memory is still linear in nature, so it's a
natural representation for the computer as well.
03:01 < SmoothPorcupine> No ambiguity isn't really a problem.  The brain is
good at context.
03:01 < SmoothPorcupine> XML is natural?
03:01 < Namegduf> XML is not a good example of anything.
03:01 < Namegduf> So I don't see the relevance.
03:01 < SmoothPorcupine> XML is the natural way for a computer to express a
tree?*
03:02 < Eko> no, it isn't, and I wasn't talking about it; I was talking
about 1D representations of "2D" arrays
03:02 < Eko> and, of course, n-dimensional arrays.
03:02 < SmoothPorcupine> Also, memory isn't plain text.
03:03 < Namegduf> No, but it can be represented as such.
03:03 < Eko> so, are you envisioning some sort of virtual programming
language with 3D objects and nonlinear control paths or something?
03:03 < Namegduf> Assembly has a one-to-one correspondance with
instructions.
03:03 < Namegduf> In the same sequential layout the instructions are.
03:04 < Eko> (and is a much better programming language than machine code)
03:04 < SmoothPorcupine> No, but now that you mention it, I don't see any
reason you couldn't render a program that way.
03:05 < Namegduf> I'm not sure you can claim it not a natural way of writing
and representing machine code.
03:05 < Eko> SmoothPorcupine: I think such a language would gain the creator
significant notoriety; however, the programming environment would probably have to
be something like a projector and a Kinect (which, now that it is available for
consumers, makes these things more feasible)
03:06 < SoniaKeys> ASL, sign language, is a good example of a language that
isn't a linear string of glyphs.  Spoken language, for that matter, communicates
much more than written language.
03:06 < Eko> ASL actually IS a linear string of glyphs.
03:06 < SmoothPorcupine> For the way our minds interact with a computer, I
suppose ASM isn't a terribly unnatural way to "write" a program.
03:06 < Eko> they just happen to require 3D spatial representations.
03:07 < Namegduf> Programs are a linear string of instructions.
03:07 < Eko> SmoothPorcupine: actually, it is a terrible way to "write" a
program given how our minds interact with a computer becuase are brains are wholly
nonlinear and solve the simplest problems first and assemble them into a final
solution in parallel
03:08 < SmoothPorcupine> Eko, ehhh...  I think I still prefer just hitting
buttons that correspond to actions in the computer.
03:08 < Eko> SmoothPorcupine: the problem with that is, of course, having
enough buttons.
03:08 < Eko> that would work for assembly instructions, but then how do you
represent addresses?
03:08 < Namegduf> You can do that anyway, you just need vim.
03:09 < Namegduf> :P
03:09 < Eko> and when you get into a language like Go, do you have a wall
full of class names and run around poking at them?
03:09 < Namegduf> And some creative modifications, I guess.
03:10 < SmoothPorcupine> Eko, one button could be used to swap the current
button:action set for another.
03:10 < Eko> and suddenly you find yourself typing out the whole name of the
class, or at least a unique prefix
03:10 < SmoothPorcupine> Or, if you can manage it, simply pressing the
button down, or releasing it, could have the same effect.
03:12 < SmoothPorcupine> As long as you don't have too many names in your
immediate namespace, it shouldn't take more than a couple buttons to identify a
name.
03:12 < Eko> with a countably infinite set of classes, the only effective
representation for them with a finite number of symbols would be to give them all
unique names and to get to one you would have to indicate the symbols in order
until you narrow it down to the one you want.
03:12 < Eko> so, now to identify a namespace you have the same problem
03:12 < Namegduf> A couple of buttons changing per namespace...
03:13 < Eko> so far, this is degenrating right back into typing your program
out with a really good context-sensitive code completion
03:13 < Namegduf> Which don't correspond to a human-comprehensible name...
03:13 < SmoothPorcupine> "really good" sounds good.
03:14 < jessta_> ah, the old visual programming language debate
03:14 < SmoothPorcupine> If it weren't familiar, nobody would use it.  ;D
03:15 < Eko> jessta_: I have always believed that visual programming
languages could be far superior to text based ones.  I just haven't seen one yet.
03:15 < jessta_> yeah, nobody has
03:15 < Namegduf> XD
03:15 < SmoothPorcupine> Then why does it appear to have a name?
03:15 < Eko> Who knows what those crazy japanese CS researchers are doing; I
wouldn't put it past them.
03:15 < jessta_> they sound really good in theory, but nobody has managed to
make one that isn't horrible to use
03:16 < Eko> kindof like communism.  >:-)
03:16 < Eko> brilliant in theory, never worked in practice yet.
03:16 < jessta_> communism sounds silly in thoery
03:16 < jessta_> *theory
03:16 -!- bgentry [~bgentry@75.85.173.206] has quit [Quit: bgentry]
03:16 < Eko> meh.
03:17 < jessta_> communism is based on the obvisouly silly idea that people
can actually be equal while not being exactly the same
03:17 < SoniaKeys> i draw flow charts once in a while
03:18 < SmoothPorcupine> Oh wow no.
http://en.wikipedia.org/wiki/File:Ktechlab_FlowCode.png Is this what you imagine
when you think of a VPL?
03:19 < Eko> SmoothPorcupine: not really, though that's an example of what I
would call "bad"
03:19 < jessta_> A good visual programming language has to be able to
represent the same things that a textual one does, in the same amount of space.
03:20 < jessta_> but since representing abstract ideas visually is difficult
you end up just having to name everything anyway
03:20 < jessta_> sticking blocks with words on them together isn't all that
much different from just typing them
03:21 < Eko> and it's much more difficult to document and collaborate on.
03:21 < jessta_> see adobe flash's visual actionscript editor as an example
03:22 < SmoothPorcupine> Oh damn.  I think thinking about using icons, but
it really needs to be test to be successful, and if you really wanted you could
use Unicode symb--Oh wait glyphs are jsut images.
03:22 < SmoothPorcupine> just*
03:22 < SmoothPorcupine> text*
03:22 < SoniaKeys> python's indent sensitivity could be considered a start.
it represents a mapping between program structure and a 2D visual presentation.
03:23 < Eko> http://appinventor.googlelabs.com/about/index.html
03:23 < Eko> that's about as close to a successful graphical programming
system as I've seen
03:24 < Eko> and that's just UI stuff, basically.
03:24 < jessta_> http://scratch.mit.edu/
03:25 < Eko> interesting, haven't seen that.  Looks like a similar concept.
03:25 < jessta_> appinventor is based on the ideas from scratch
03:26 < SmoothPorcupine> I don't really see that as better than the one I
linked.
03:27 < Eko> SmoothPorcupine: I didn't say better, I said successful
03:27 < Eko> you just have to look at the apps written in Scratch and
AppInventor versus those written in text to see the superiority.
03:27 < SmoothPorcupine> It's not successful unless "real" programmers use
it.
03:27 < SmoothPorcupine> In my book.
03:28 < Eko> SmoothPorcupine: defining who a "real" programmer is is hard.
03:28 < SmoothPorcupine> Hence the quotation marks.
03:29 < SmoothPorcupine> I like how Formatting is the first section of
Effective Go. :P
03:29 < Eko> lol.
03:29 < Eko> and how gofmt is one of the bundled commands
03:30 < jessta_> gofmt is my favourite thing about go
03:30 < jessta_> I miss it in every other language I use
03:30 < SoniaKeys> In fact, Go's semicolon insertion makes it a 2D language.
The newline character affects both language structure and 2D visual presentation.
It doesn't go as far as Python, but it's the same direction.
03:31 < SmoothPorcupine> In a sufficiently properly designed VPL, formatting
is merely rendering preference.
03:32 < jessta_> yeah, one of the many things that make it seem like a great
idea
03:33 < SmoothPorcupine> "I may be able to render in idiomatic Go."
03:34 < Eko> SmoothPorcupine: that also makes it impractical, as it makes it
almost impossible for another user to interpret your visual program if their brain
works differently than yours
03:34 < jessta_> http://www.subtextual.org/subtext2.html <-- and this guy
has been trying to do it for a while
03:35 < SmoothPorcupine> Eko, no, I mean, your rendering preference has no
bearing on the code.
03:35 < SmoothPorcupine> As in, any code you read is rendered the way you
want.
03:35 < Eko> SmoothPorcupine: so, in addition to programming, you also have
to find some way to represent how you want the editor to render to your liking?
03:36 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Ping timeout: 276
seconds]
03:38 < SmoothPorcupine> If trying out other "themes" people have made
counts as finding, then yes.
03:45 < SmoothPorcupine> jessta_, that guys is trying to do a lot more than
simply programming.
03:48 < SmoothPorcupine> guy*
03:48 < jessta_> more?
03:53 < SmoothPorcupine> Yeah.  He's changing the way you think about making
the program.
03:58 < uriel> SmoothPorcupine: stop trolling
03:59 < SmoothPorcupine> I was /trying/ to give the good news that Go has my
blessing.
04:10 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 260
seconds]
04:12 -!- SoniaKeys [Alliebloom@c-24-91-112-191.hsd1.ma.comcast.net] has quit []
04:13 < Eko> SmoothPorcupine: whether that was your intent or not, in text
saying something like "...  if I thought plain text was a valid solution" implies
that you don't, but that you are condescending to dribble a little praise to those
who do.
04:14 < SmoothPorcupine> Oh yes.  I am a strong advocate of, "Put up or shut
up."
04:15 < Eko> jessta_: that's a neat presentation, thanks for the link.
*bookmarks*
04:19 < jessta_> Eko: yeah, it's neat, but if you look at the code his main
problem is that he's intentionally doing it in a complicated way
04:21 < Eko> jessta_: lol, yeah.  But it's a neat way to look at the
organization of code.
04:23 < jessta_>
http://blog.jessta.id.au/2007/12/subtext-is-research-project-in-creating.html
04:24 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
04:29 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
04:30 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
04:31 -!- crazy2be [~justin@d75-152-162-237.abhsia.telus.net] has joined #go-nuts
04:31 < crazy2be> is there some way to continue a specific loop?
04:31 < crazy2be> if you have a for loop inside a for loop
04:31 < fuzzybyte> goto?
04:32 < crazy2be> i thought that resulted in getting attacked by raptors
04:32 < SmoothPorcupine> Not between teh hours of 10PM and 5AM.
04:32 < SmoothPorcupine> the*
04:33 < crazy2be> hmm i thought i remembered being able to label your loops
or something
04:33 < jessta_> crazy2be: you can break to a label,
http://golang.org/doc/go_spec.html#Break_statements
04:34 < fuzzybyte> oh, cool
04:35 < jessta_> crazy2be: goto is a fine statement, don't be afraid to use
it when you need to
04:35 < crazy2be> it just frightens me from memories of TI-BASIC
04:36 < SmoothPorcupine> "need"?
04:36 < crazy2be> which became quickly unmanageable with a larger program
04:36 < jessta_> yeah, don't use it has the basis for all your program
control
04:36 < jessta_> *as
04:38 < jessta_> it often makes flow cleaner by avoiding deeper nesting
04:38 < crazy2be> oh yeah you can label for loops
04:38 < crazy2be> it doesn't describe how to do it in the for loop section
for some reason
04:39 -!- boscop [~boscop@g225220058.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
04:42 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts
04:43 < crazy2be> which is, essentially, a goto i suppose
04:44 < jessta_> everything is a goto
04:45 < crazy2be> well yes and no
04:45 < jessta_> somethings are just a bit more restricted
04:45 < crazy2be> everything has to be distilled to goto statements for the
computer to understand
04:45 < crazy2be> but like a funciton call is not the same as a goto
statement
04:45 < crazy2be> because it returns afterward
04:46 < jessta_> return is a goto
04:46 < crazy2be> it is comprised of two gotos i suppose
04:46 < crazy2be> but the label, or memory adress, is specified by the
calling function
04:46 < crazy2be> so it's a variable goto
04:48 < crazy2be> from a program design and flow point of view, it's quite
different
04:48 < crazy2be> from a raw function point of view, it's similar
04:48 < crazy2be> forgive the use of "function" as two different meanings in
one conversation
04:59 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Quit:
Leaving.]
05:03 < fuzzybyte> "functions" should really be called subroutines or some
other non-math term with distinct meaning.
05:06 < crazy2be> well they were in QBASIC if i'm not mistaken
05:06 < jessta_> fuzzybyte: why a non-math term?
05:08 < jessta_> programming and math are different industries
05:09 < fuzzybyte> jessta_: uh, sorry i wrote wrongly.  just any term that
doesn't get mixed with actual mathematical functions would be fine.  it just bugs
me that "functions" can also have side effects so they're not really
(mathemathical) functions at all.
05:10 -!- bgentry [~bgentry@75.85.173.206] has joined #go-nuts
05:10 < SmoothPorcupine> ffffuuuunctions?
05:14 -!- ios_ [~ios@180.191.43.108] has joined #go-nuts
05:15 < bgentry> is there any kind of a fixed point / decimal type available
in any of the standard Go libs?
05:17 < Eko> is a number ever a strict prefix of a lesser number?  e.g.  11
is a strict prefix of 110
05:18 < Eko> with no zero-padding.
05:18 < Eko> I don't think so, but I will be introducing an insidious bug if
it can be.
05:18 < jessta_> fuzzybyte: yeah, they are programming functions
05:21 < fuzzybyte> jessta_: then what would you call side-effectless
function?
05:21 < Namegduf> "pure functions"
05:21 < fuzzybyte> riight
05:27 < |Craig|> Eko: -11 and -1
05:27 < jessta_> fuzzybyte: yeah, that's what I'd call them
05:28 < Eko> |Craig|: Aha!  Good catch.  *adds nonnegative assertion*
05:28 < |Craig|> closer to 0 no, closer to -infinity yes
05:28 < jessta_> fuzzybyte: you can't use 'function' because nobody will
realise it's side-effectless
05:29 < jessta_> like I never use the pharse "next thursday" because it's
ambiguous
05:29 < jessta_> it probably shouldn't be, but it is.
05:32 < SmoothPorcupine> Has anyone identified a case where mutexes are
neccesary?
05:32 -!- tgall_foo [~tgall@206.9.88.154] has joined #go-nuts
05:33 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has joined
#go-nuts
05:33 < Eko> jessta_: I love the way the Japanese speak about days relative
to now.  Their weeks are Monday to Sunday, and they say "This week's Thursday" or
"Last week's thursday" whether or not today is wednesday or friday.
05:34 < Tv> Eko: that just sounds like typical non-english usage to me..
05:34 * Tv <-- Finnish
05:35 < Eko> Tv: it's probably not limited to Japanese, no, that just
happens to be the only non-english I know and I was pointing out it's unambiguity.
05:35 < Eko> the english language is terribly ambiguous.
05:35 -!- crazy2be [~justin@d75-152-162-237.abhsia.telus.net] has quit [Remote
host closed the connection]
05:42 < |Craig|> Eko: its like biannual or bimonthly.  Most english temporal
terms are ambiguous....
05:45 < |Craig|> SmoothPorcupine: depends on what you mean by necessary.  By
some definitions, even multiplication is unnecessary
05:52 -!- tgall_foo [~tgall@206.9.88.154] has quit [Changing host]
05:52 -!- tgall_foo [~tgall@linaro/tgall-foo] has joined #go-nuts
05:52 < cbeck1> func foo() {i := 0; go func(){i++}(); go func(){i--}();
println(i)}
05:53 < cbeck1> I'm not sure how you could ever communicate between
processes barring something like hardware level channels
05:53 < cbeck1> Which I'd love to see
05:57 < SmoothPorcupine> The one where multiplication is unnecessary.
05:58 < SmoothPorcupine> But if you say it depends, then in that case there
is no use case.
05:59 < SmoothPorcupine> cbeck, was that in response to me?
06:02 < cbeck> Yes, sorry
06:02 < SmoothPorcupine> That doesn't use mutexes?
06:03 < cbeck> It doesn't, it needs them.
06:04 < SmoothPorcupine> How?
06:04 < cbeck> What will that code print?
06:04 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout: 240
seconds]
06:05 < SmoothPorcupine> Some integer.
06:06 < cbeck> Precisely T_T
06:07 < SmoothPorcupine> Why not just use rand?
06:10 < cbeck> Gee, good point.  Predictability is for suckers.
06:11 < jessta_> cbeck: your case isn't predictable anyway
06:11 < cbeck> jessta_: I know
06:12 < cbeck> That was the point
06:16 < |Craig|> SmoothPorcupine: I believe its possible to make a mutexes
without using a mutex, so you don't need them
06:17 < |Craig|> I think the bakery algorithm is an example of a solution to
the issue for a general n process system
06:18 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
06:19 < cbeck> If I remember right, that requires the ability to disable hw
interrupts, which userland code should never have
06:19 < cbeck> Though I may be wrong
06:21 < |Craig|> I think the bakery algorithm is tolerant enough to be use
on networked sets of computers accounting for occasional hardware failure, so it
should be interrupt tolerant.  I don't really understand it though
06:22 < |Craig|> my understanding is that its key is that what is returned
from a read of a value while it is being changed does not have to be anything in
particular
06:24 < |Craig|> I think what I said there is slightly wrong, but close
06:25 < |Craig|> first paragraph in this section explains it better:
http://en.wikipedia.org/wiki/Lamport's_bakery_algorithm#Discussion
06:26 < cbeck> Yeah, reading that now
06:26 < |Craig|> Its impressively cool, but I haven't gotten around to
understanding it
06:32 -!- nettok [~quassel@200.119.160.95] has quit [Ping timeout: 265 seconds]
06:52 -!- noktoborus_ [debian-tor@gateway/tor-sasl/noktoborus] has joined #go-nuts
06:52 -!- noktoborus [debian-tor@gateway/tor-sasl/noktoborus] has quit [Ping
timeout: 240 seconds]
06:54 -!- illya77 [~illya77@151-64-133-95.pool.ukrtel.net] has joined #go-nuts
06:58 -!- ios_ [~ios@180.191.43.108] has quit [Quit: Leaving]
07:00 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts
07:11 -!- cafesofie [~cafesofie@ool-4a5978f2.dyn.optonline.net] has quit [Remote
host closed the connection]
07:21 < SmoothPorcupine> |Craig|, using a mutex algorithm is using a mutex.
07:22 < |Craig|> SmoothPorcupine: you you are asking if its possible to
write single threaded programs?  Because the answer is yes
07:23 < |Craig|> regardless of what you do though, if the problem
conceptually involves sync, some sort of sync will get used
07:26 < SmoothPorcupine> No, I'm asking if anyone can give me a clear
example of using a "mutex" so stall or alter the execution of a goroutine.
07:26 < SmoothPorcupine> to stall*
07:27 < vsmatck> For what purpose?  I can only think of rediculous examples
which leads me to believe I don't understand your question.
07:29 < vsmatck> Like you could lock a mutex, and start a go routine that
also tries to lock that mutex and it'd stall.
07:29 < SmoothPorcupine> Any purpose, where a purpose is a purpose aside
from being for the purpose of purpose.
07:29 < cbeck> I prefer porpoises, myself
07:29 < cbeck> As long as they're asynchronous
07:30 < anticw> SmoothPorcupine: .Lock on a locked mutex will block until it
07:30 < anticw> is release
07:30 * anticw stupid ' key
07:31 < SmoothPorcupine> Yes, but why would you ever do that?
07:32 < anticw> huh?
07:32 < vsmatck> SmoothPorcupine: I don't understand what you're after.
*goes afk*
07:32 < anticw> SmoothPorcupine: to avoid concurrent access to something
07:33 < SmoothPorcupine> Ah, let's put it that way: What is a valid use case
of concurrent access?
07:33 < Namegduf> Reusing a function which uses a mutex to control access
from another function also using said mutex.
07:33 < anticw> a complex data structure that is shared across many
threads/goroutines
07:33 < Namegduf> Is the common cause.
07:33 < anticw> if you want to update it, you need some way to hold others
out whilst you are doing that
07:33 < Namegduf> You can solve it by pulling the bulk of the second into
another function and calling it from both.
07:34 < cbeck> If you're actually interested, and not just trolling, then
simple producer-consumer problems are a good place to start
07:34 < SmoothPorcupine> Those cases could be refactored to use channels and
goroutines.
07:34 < cbeck> ..
07:34 < cbeck> channels rely on mutexs under the covers
07:36 < SmoothPorcupine> Not /necessarily/.
07:37 < cbeck> A mutex is just a construct which allows binary mutual
exclusion
07:37 < cbeck> are you referring specifically to a sync.Mutex?
07:38 < anticw> SmoothPorcupine: ok, here is a case where i use a mutex ...
to increment a counter in a map
07:38 < anticw> SmoothPorcupine: when i did the code initially i knew it was
racy and say 'screw it' and assumed i would never easily hit the race that would
cause things to break, but as it happens it blew up in seconds
07:40 < |Craig|> SmoothPorcupine: using channels is using a mutex algorithm
thus using a mutex by your logic
07:40 < SmoothPorcupine> No, more like I'm asking, "Why does sync.Mutex
exist?"
07:40 < |Craig|> SmoothPorcupine: the same reason multiply exists, because
its handy and can help performance sometimes
07:40 < cbeck> Because a simple binary mutex is both more efficient and more
natural in many places
07:41 < SmoothPorcupine> anticw, from what context are two goroutines doing
that?
07:41 < cbeck> When controlling access to a map, you can either set up a
goroutine with multiple channels for reads and writes, or just wrap a mutex around
every access
07:42 < SmoothPorcupine> |Craig|, it's possible to implement channels
without and underlying mutex.
07:42 < cbeck> The latter is both faster and less complicated to write
07:42 < cbeck> If you like race conditions.
07:42 < anticw> SmoothPorcupine: the code walks a directory path and sned
path elements to workers ...  they read files and checksum the blocks in them in
parallel
07:42 < |Craig|> SmoothPorcupine: yes, and its possible to implement a mutex
without an underlying mutex
07:43 < anticw> SmoothPorcupine: doing a lot of IO in parallel helps overal
performance because the IO subsystem (the IO scheduler/elevator in this case) can
reorder IOs more optimally when it has more to work with
07:43 < SmoothPorcupine> an*
07:43 < anticw> cbeck: spinlocks would be faster still in most cases, but i
fear people would screw them up and cause deadlocks
07:44 < anticw> cbeck: also, mutexes done right are pretty fast when not
contended (ie.  futexes)
07:44 < cbeck> anticw: I don't agree in Go's case
07:44 < cbeck> spinlocks in a goroutine mean that the runtime doesn't
context switch immediatly
07:45 -!- tvw [~tv@e176006186.adsl.alicedsl.de] has joined #go-nuts
07:45 < anticw> cbeck: it's debatable as to whether spinlocks really win out
...  in this specific case you would ping-pong the cache lines about badly no
matter what
07:45 < cbeck> Probably true
07:46 < cbeck> I've run into issues in the past where (possibly due to
issues with the early scheduler) spinlocks in my code would essentially cause it
to hang, as other goroutines would starve
07:46 < SmoothPorcupine> |Craig|, no, I mean without any mutex-like
algorithm at all.
07:47 < SmoothPorcupine> Basically you have one processor and it can only
run one instruction at a time.
07:47 < SmoothPorcupine> Threads are virtual in that sense.
07:47 < cbeck> You can still have race conditions in that case
07:48 < cbeck> anywho, despite People Being Wrong on the Internet, it's past
my bedtime.  G'night
07:49 < anticw> cbeck: mutex lock + unlock is 108 cycles hot-cache
07:49 < anticw> spinlocks wouldn't help much there at all
07:50 < anticw> 69 cycles for a lock when not contended
07:50 < anticw> (i just measured it now, so i might have goofed)
07:50 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 246
seconds]
07:51 < anticw> in fact, the cpu probably never hit full speed, but the
rdtsc counter on this cpu runs at a constant speed ...  so it's likely a bit
faster
07:52 < anticw> no, 69 for a lock is pretty consistent ...  i guess the cpu
ramps up pretty quick
07:53 < SmoothPorcupine> anticw, why do the workers need to modify the map
counter?
07:53 < anticw> SmoothPorcupine: in this case i count the distribution on
unique datablock across a large dataset
07:54 < anticw> does that answer your question?  perhaps i didnt understand
properly?
07:55 < SmoothPorcupine> I don't see how that indicates the workers update
the counter.
07:56 < SmoothPorcupine> the workers need to be the ones*
07:56 < SmoothPorcupine> ones that*
07:57 < anticw> ckLock.Lock() |
07:58 < anticw> cklist[key]++ |
07:58 < anticw> ckLock.Unlock() |
07:58 < anticw> totalblocks++ |
07:58 < anticw> that happens inside a worker
07:58 < anticw> cklist is a map with string as a key
07:58 < anticw> cklist[key]++ isn't atomic
07:59 < anticw> if you do 2+ of them in parallel you can corrupt things and
it will crash
07:59 < anticw> because updates/changes to maps can cause things to shuffle
about
08:00 < SmoothPorcupine> Why not `cklcntch <- key;totalblocks++`?
08:01 < Namegduf> Two reasons come to mind:
08:02 < Namegduf> 1) Performance- it's slower and some places that matters
enough to care about.
08:02 < Namegduf> 2) GC- if a goroutine is actively waiting on a channel
while holding a reference to the structure it will never be destroyed.
08:02 < anticw> SmoothPorcupine: performance
08:02 < Namegduf> You can't just let it be forgotten about by the rest of
the program.
08:02 < anticw> SmoothPorcupine: there are 100s of workers and billions of
blocks
08:03 < anticw> i didnt calc the IO rate but it's fairly high
08:03 < Eko> Namegduf: so, assuming zero network latency and enough file
descriptors, my ircd took no more than 2 minutes to register 10k clients on
1:5:5:5 channels with 1000:100:10:1 users each (that's with emulating each client
in software and waiting for each join to process before sending the next one)
08:03 < Namegduf> Two minutes is kinda ouch
08:04 < Eko> Namegduf: not really
08:04 < Namegduf> Yeah, really.
08:04 < Namegduf> Freenode is 50k users.
08:04 < SmoothPorcupine> anticw, can I get a benchmark of the difference?
08:04 < Namegduf> If your server was in use there it'd take ten minutes to
link.
08:04 < anticw> SmoothPorcupine: i dont have one, i just wrote code and
shared numbers on Mutex lock times though
08:05 < Eko> Namegduf: those are *remote* users, which using TS6 would
require far fewer JOIN commands, and it wouldn't have to send all of the JOIN
replies to all of the other clients
08:05 < Namegduf> (Assuming O(n), which is kind of best you can hope for)
08:05 < anticw> SmoothPorcupine: also, why add a channel ...  it would make
the code harder to read and more complex
08:05 < Namegduf> Eko: Benchmarks say that most of the time is spent in
joins?
08:05 < Namegduf> If so, it's not too bad.
08:06 < Eko> Namegduf: I can't bench on my os x box, but the majority of the
time is spent in sending the JOIN replies to the other users when it joins
08:06 < Namegduf> You can't run 6prof?
08:06 < SmoothPorcupine> Because you don't have mutexes available.  ;D
08:06 < Eko> nope
08:06 < Namegduf> Pity.
08:06 < anticw> SmoothPorcupine: is this a real problem or academic?
08:07 < Namegduf> Mine does 20k "remote" users in 12-14 seconds, with 50% of
that time spent in the client stuff's sending of join messages
08:07 < Namegduf> Each in 20 channels, 5 of which each hit 1000 in size.
08:07 < SmoothPorcupine> I'm asking for a use case where mutexes are
necessary.  Which do you think it is?
08:07 < Namegduf> (Well.  They should AVERAGE 1000.  They actually average a
bit under because of duplicate joins)
08:08 < anticw> SmoothPorcupine: read hennessy and patterson :-)
08:08 < Eko> mine calculates out exact channel sizes
08:08 < SmoothPorcupine> Is that a use case?
08:08 < anticw> no
08:08 < anticw> is this a real question?
08:08 < Namegduf> I'm planning on making multiple joins happen at once in
core, and then refactoring the remote user simulation thing to use them.
08:08 < Eko> so I can join #tier0-chan0-group0 and see exactly 1k users
(plus me)
08:09 < anticw> SmoothPorcupine: you have mutexes, pretty much everything
does ...
08:09 < Eko> I thought about how best to do that and couldn't come up with a
good way...
08:09 < Namegduf> My clients are designed to be somewhat unpredictable on
the grounds that randomness is closer to real performance than sequentialness
08:09 < SmoothPorcupine> How can, "Give me a reason to use mutexes,"
anything but "acedemic"?
08:09 < |Craig|> SmoothPorcupine: academic answer: languages can be turing
complete without mutexes.  Practical answer: they can make code shofter, easier to
read and run faster
08:09 < anticw> SmoothPorcupine: i gave you more than one
08:09 < anticw> they are fast
08:09 < anticw> it makes the code cleaner
08:09 < Eko> Namegduf: I went with sequential joins on the grounds that
that's the worst-case for mine
08:09 < SmoothPorcupine> be*
08:10 < Namegduf> Well, random would be similar, I'd think, if you got
channels to the same size.
08:10 < Namegduf> It'd just gradually slow down as it goes along as more and
more the channels it randomly picks are bigger.
08:10 * Eko wonders if there's a shuffle anywhere in the go standard library
08:10 < Namegduf> I just use rand and fmt.Sprintf
08:11 < anticw> SmoothPorcupine: you realise channel operations internally
use mutexes ...  so they at best case can only be as fast and in reality will be
much slower?
08:11 < SmoothPorcupine> The question is theoretical, performance and code
structure are irrelevant.
08:12 < Namegduf> The two minute benchmark is interesting, though, because
I'd say that's the upper limit of what's reasonable in using the software
08:12 < anticw> "performance and code structure are irrelevant" ...  dude
08:12 < Namegduf> Which suggests scalability to 20k users, hypothetically,
which is nice.
08:12 < anticw> wtf
08:12 < anticw> oh, and i can say that
08:12 < anticw> because i'm hiring so i get to be picky like that
08:12 < SmoothPorcupine> It's possible to make a Go implementation not use
mutexes for channels.
08:13 < anticw> SmoothPorcupine: it's possible to make a cpu with only two
instructions on one register
08:13 < Namegduf> Mutexes and channels sync are just higher level
representations of lower level synchronisation primitives
08:13 < Eko> Namegduf: rand.Perm(n) - how convenient :D
08:13 < Eko> I can use that to index it without shuffling.
08:13 < |Craig|> its possible to write a rendering system in grep too
08:13 < anticw> Eko: neat, i saw your query and thought ...  nope, not there
...  didn't know about that one
08:14 < Eko> anticw: yeah, neither did I
08:14 < Eko> rand.* has lots of interesting tidbits
08:14 < Namegduf> While you could probably switch one for the other in a
number of cases, they're both similar things at the end of the day aside those
code structure and implementation details.
08:14 < SmoothPorcupine> It's possible to have a theoretical discussion
without being accused of trolling as well.
08:14 < SmoothPorcupine> But of course, in practice...
08:14 -!- ios_ [~ios@180.191.91.156] has joined #go-nuts
08:14 < anticw> you asked why to use it, i answered
08:14 < Namegduf> You're not having a discussion, you're asking questions
then rejecting answers.
08:14 < anticw> what more can i say?
08:14 < Namegduf> :P
08:14 < anticw> dude, im an old balding fat guy with kids, i'm not supposed
to be tolerant
08:15 < Eko> rofl.
08:15 < Namegduf> Eko: I got my time down from 30 seconds using 6prof to
notice slow things, though, so I highly recommend it.
08:15 < Eko> Namegduf: I have the gopprof script, not sure what it does.
08:16 < SmoothPorcupine> I'm not rejecting answer, I'm explaining why they
aren't answers to my question.
08:16 < SmoothPorcupine> answers*
08:16 < anticw> SmoothPorcupine: http://dilbert.com/1995-06-24/
08:16 < Eko> but it wants a profile and I don't know what that is...
08:16 < Namegduf> You can't just use the regular 6prof?
08:16 < Namegduf> You know that 6prof covers architectures other than amd64,
right?
08:16 < Namegduf> gopprof looks like something...  fancier.
08:17 < Eko> Namegduf: there is no 6prof executable anywhere
08:17 < anticw> SmoothPorcupine: yes in theory you can avoid mutexes ...  i
dont see why you would
08:17 < Eko> er, it just didn't get installed to gobin
08:17 < Eko> weird
08:18 < Namegduf> 6prof -t somelimit <binary>
08:19 < Namegduf> It normally likes to run until the binary terminates,
which is kind of useless for a daemon thing unless you have a way to shut it down
cleanly.
08:19 < Eko> do I need to compile it specially?  6prof can't attach to it
08:19 < Namegduf> Don't need to on Linux.
08:19 < Eko> "ctlproc attached: addpid: mach: failure"
08:23 < vegai> that reminds me of my college years
08:23 < vegai> oh, it's "mach" not "math" nevermind
08:24 -!- mxxm [~osiris@aixd3.rhrk.uni-kl.de] has joined #go-nuts
08:25 < Eko> lol.
08:25 -!- mxxm [~osiris@aixd3.rhrk.uni-kl.de] has left #go-nuts []
08:26 -!- mxxm [~osiris@aixd3.rhrk.uni-kl.de] has joined #go-nuts
08:26 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
08:27 -!- mxxm [~osiris@aixd3.rhrk.uni-kl.de] has left #go-nuts []
08:27 < Eko> Namegduf: apparently I had to run it as root...
08:28 < anticw> Eko: yeah, i think apple changed something there in 10.5 or
10.6
08:28 < anticw> Eko: certain debug interfaces worked w/o being root
previously
08:28 < Eko> interesting.
08:28 < anticw> i could be lying, i dont use any of the mcapples in this
place, other than to complain about them
08:29 < Eko> lol.
08:29 < Eko> wheee, I love it when I get a panic with 20k coroutines....
08:30 < Eko> oh come on
08:30 < Eko> mach error semaphore_wait: 16777252
08:30 < Eko> throw: mach error
08:30 < Eko> can I blame 6prof or is that my fault?
08:31 -!- sacho [~sacho@90.154.208.35] has quit [Ping timeout: 240 seconds]
08:31 < anticw> blame jobs
08:32 < Eko> lol, now that I work for google, I think I'm required to have a
love/hate with apple.  We love their hardware but hate that they're competing with
us.
08:33 < anticw> a few people i know their traded in their mcapples for
thinkpads ...  almost eveywhere else the reverse seems to be true
08:35 < Eko> yeah, in the 4.5 years I spent in college at a tech school Macs
went from being that thing that only liberal arts kids had to something almost
everyone had or wanted
08:35 < Eko> when I visited our rival school (liberal arts *spits*), I think
I saw maybe 5 non-apple laptops in the whole place.
08:35 < anticw> Eko: you're in 94043?
08:36 < Eko> anticw: will be in 94087 or so most likely
08:36 < taruti> Anyone want to quickly review a http-digest authentication
implementation in Go before announcing on the ML?
08:36 < Eko> if you mean living.
08:37 < anticw> Eko: there is an office there?
08:37 < Eko> oh, I thought you meant living.  no, I'll be at the plex.
08:37 < anticw> oh, i meant working
08:37 < anticw> yeah, so the entire area is crawling with macs ...  i think
up here in the city it might be worse
08:38 < Eko> lol
08:38 < anticw> you go to a coffee shop at random in the city and it's 90%+
macs ...  which clearly is well above market share
08:38 < Eko> I love Linux with all my heart, but when I need a computer
that's stable and doesn't hassle me about anything, I use my mac.
08:39 < Eko> and when you're talking about laptops, it's no question because
the hardware on apple beats the crap out of everyone else in terms of being well
matched and durably constructed.
08:39 < vegai> I use my mac to run a linux in vmware
08:39 < vegai> because sucky company policies prohibit macs :-\
08:39 < Eko> vegai: why not on another partition?
08:39 < vegai> uhh s/mac/linux/
08:39 < anticw> Eko: actually, i would dispute that wrt to hw
08:39 < anticw> @ work everyone has macbooks ...  it's the standard
08:40 < anticw> except me, i have a lenovo thinkpad ...  think i really
wasn't sure about
08:40 < anticw> my older thinkpads were awesome, but lenovo kinda screwed
them up
08:40 < anticw> but, to be fair, this machine (t510) is great even compared
to the macs
08:40 < anticw> just ugly
08:41 < anticw> physical construction is great, screen is great (1920x1080
and very crisp), audio is decent (for a laptop), wifi is fantastic
08:41 < Eko> anticw: the thing about lenovo, dell, hp, pretty much
everything but the toughbook, is that every few years they do a real refresh and
match it all up.  Then they swap out parts without upgrading the rest just for
marketing, and they start using offbrand parts or boards that make them more
difficult to service, and it's a lot harder to get the good stuff.
08:41 < anticw> Eko: when it breaks ill just get a new one
08:42 < Eko> but you're rolling a die...  you may be in the market when
they're in the middle of their piecewise upgrades, and you'll end up with ram that
doesn't match your mobo that can't handle your processor that looks at your video
card and wonders where it's going in such a hurry
08:43 < anticw> for a laptop?  it's one thing
08:43 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
08:43 < anticw> it works or you replace it
08:43 < anticw> there are few variables
08:43 < Eko> we'll have to agree to disagree on that ;-)
08:43 < Eko> I use my laptops until they cease to function.
08:43 < Eko> or they're stolen, but that's not at issue here >_<
08:43 < anticw> same here
08:44 < anticw> i have two partly working t43p
08:44 < Eko> but I take them in to be serviced when a single piece fails
08:44 < anticw> best laptops ever made ...  but partly working got old so i
got this
08:44 < Eko> and Apple has always fixed it in-store for me really fast or
given me a new one.
08:44 < anticw> Eko: you have a job now, it's not worth your time to screw
about
08:44 -!- ios_ [~ios@180.191.91.156] has quit [Quit: Leaving]
08:44 < anticw> Eko: plus, if you manager aproves you can go ask the Santa
Claus machine for a laptop of your choice @ google
08:45 < Eko> when I had to get my HP serviced, it was 6 weeks until HP even
had the box with a half-bad screen and then they sent it back "unable to
reproduce"
08:45 < anticw> when you buy a laptop, buy a service plan
08:45 < anticw> ideally one where they come fix it
08:45 < Eko> I always did and always do, but only Apple follows through in
my experience.
08:46 < anticw> dell always were fine IME
08:46 < anticw> IBM only called them once and they were great
08:46 -!- SmoothPorcupine [~smooth@207.224.112.146] has left #go-nuts ["Too much
reading."]
08:46 < Eko> dell could be serviced in-store, but see above for why I refuse
to play russian roulette with dells.
08:46 < anticw> in fact ...  dell used to come to my office at what is now
the googleplex to fix the damned inspiron that always broke
08:47 < Eko> but that's a business customer.
08:47 < Eko> if I tallied up all of the computer problems for all of my
students in a given year, MAYBE one would be a mac, and the other 20 or 30 would
be dell or HP, with a handful of acer or inspiron or ibm thrown in for flavor
08:48 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
08:48 < Eko> the most I usually get from mac users is a request for a
two-day extension becuse they're restoring from their backup on their replacement
laptop that apple handed them.
08:49 < anticw> ok ...  so this is lame ...  when i was an undergrad ...
one of our assignments was to submit something electronically
08:49 < anticw> oh the novelty
08:49 < Eko> lol
08:50 < Eko> I wrote a grading program that my TAs use to simplify
everything and it automatically submits grades when they're done along with tons
of feedback and the actual compile and execution output of the programs.
08:51 < Eko> so none of the "but it compile on my computer!" crap because
they can see /exactly/ what they did wrong.
08:51 < anticw> we just had to pile rocks up to reflect turing machine state
08:51 < Eko> (I'm a douchebag and strictly enforce the
zero-if-it-doesn't-compile rule)
08:51 < Eko> rofl.
08:52 < Eko> though I hear murmurings that sometimes my TAs are more lenient
than I tell them to be, but that's part of the point of them paying me to be the
bad guy.
08:53 < anticw> Eko: there is a sunnyvale shuttle ?
08:55 < Eko> anticw: hopefully.
08:55 < Eko> if not, it's still a shorter drive than I had in houston to
work even if the traffic is bad.
08:56 < Eko> I'm still a little unclear about where some of the stops are
that are on my shuttle schedule.
08:56 < anticw> oh wow, they go out as far as concord now
08:56 < Eko> anticw: do you have a map or anything?  All I have is a giant
spreadsheet with times and intersections.
08:58 < anticw> i dont think there is a public on, only one internally on
the employee web-site ...  probably HR can send you what you need
09:01 < anticw> you can always bike
09:02 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
09:02 < Eko> yeah, I asked my HR contact for one, but it wasn't until after
the holiday started.
09:09 -!- foocraft [~dsc@78.100.216.131] has joined #go-nuts
09:16 -!- ios_ [~ios@180.191.91.156] has joined #go-nuts
09:20 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts
09:21 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
09:25 -!- Project_2501 [~Marvin@82.84.85.195] has joined #go-nuts
09:30 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Max SendQ exceeded]
09:30 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
09:31 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts
09:31 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
09:33 -!- zozoR [~zozoR@56346ed3.rev.stofanet.dk] has joined #go-nuts
09:36 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
09:37 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has quit
[Remote host closed the connection]
09:59 -!- devrim1 [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts
09:59 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Read error:
Connection reset by peer]
10:04 -!- tvw [~tv@e176006186.adsl.alicedsl.de] has quit [Remote host closed the
connection]
10:06 -!- photron_ [~photron@port-92-201-141-253.dynamic.qsc.de] has joined
#go-nuts
10:09 -!- sauerbraten [~sauerbrat@p508CFD18.dip.t-dialin.net] has joined #go-nuts
10:09 -!- Scorchin [~Scorchin@host109-152-121-250.range109-152.btcentralplus.com]
has joined #go-nuts
10:12 -!- tensai_cirno [~cirno@77.232.15.216] has joined #go-nuts
10:12 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
10:23 -!- bgentry [~bgentry@75.85.173.206] has quit [Quit: bgentry]
11:03 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 240
seconds]
11:27 -!- makkalot [~makkalot@85.101.153.10] has joined #go-nuts
11:29 < makkalot> hi, go's interfaces and implementation is kind of
different and very clever, but isnt it hard to handle big projects with model like
that, how can i know which class implements which interface ?
11:29 -!- exch [~exch@h78233.upc-h.chello.nl] has quit [Ping timeout: 250 seconds]
11:31 < uriel> makkalot: go has no classes, stop thinking like you are
programming in java
11:32 < makkalot> uriel: well but it has the object oriented model doesnt it
?
11:32 < aiju> no
11:32 < aiju> Go is not object oriented
11:33 < kimelto> hmm.
11:33 < aiju> of course you can wave your hands a lot and come to the
conclusion that somehow Go is somewhat object oriented
11:33 < fuzzybyte> but rob pike said it is in a youtube video..
11:34 < fuzzybyte> maybe he had different idea of OOP
11:34 < aiju> because nowadays people are too stubborn to accept anything
which doesn't call itself "object oriented"
11:35 < kimelto> "Object oriented, not Type oriented", they like to say.
11:37 < vegai> the term OOP is not very concrete
11:37 < vegai> means different things to different people
11:37 < makkalot> well let me ask it in a different way, what is the
advantage of a model like that, "if x has the methods of y ,x implements y" ,what
happens if i add new method to interface, wouldnt it be difficult to search all of
its objects that implement it and add the same method ?
11:38 < aiju> makkalot: you don't add methods to interfaces
11:38 < aiju> most interfaces have only one or two methods
11:39 < makkalot> aiju: so i create new interface ?
11:40 < kimelto> makkalot: usually you do it the other way: see that there
are common functions, then create an interface for this functions.
11:40 < kimelto> and not create the abstract functions then implement them
11:41 < fuzzybyte> does there exist yet any database software written in
pure go?
11:41 < aiju> json
11:41 < aiju> :P
11:42 < makkalot> kimelto: hmm interesting
11:42 < fuzzybyte> i mean, a whole database, not just a binding or something
like that..
11:42 < fuzzybyte> :)
11:42 < fuzzybyte> json is good
11:42 < aiju> all operating systems have builtin databases
11:42 < kimelto> SQL?  key-value?
11:42 < fuzzybyte> haha
11:42 < aiju> they are called "filesystems"
11:42 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Operation timed out]
11:42 < fuzzybyte> kimelto: anything
11:42 < kimelto> you can create your own key-value datasotre with maps and
gob, eh!  :p
11:43 < fuzzybyte> i want to create something like mongodb in go, but maybe
that is too hard for me
11:44 < aiju> judging Oracle, every grade schooler should be able to create
something better
11:44 < fuzzybyte> maybe just pure json flatfile db is okay
11:47 < vegai> just be sure your db will be webscale
11:47 -!- deso_ [~deso@x0561a.wh30.tu-dresden.de] has joined #go-nuts
11:49 < makkalot> as i know go is a systems programming language, does it
support all posix functions we can call from C ?
11:49 < fuzzybyte> nah, it's just for learning purposes.  i don't want to
think about scaling or something awfully silly like that
11:50 < napsy> makkalot: I doubt it, but you can always call C function from
Go
11:50 < uriel> 11:37 < vegai> the term OOP is not very concrete
11:50 < uriel> the term OOP is completely useless
11:50 -!- wrtp [~rog@88.210.132.85] has joined #go-nuts
11:51 < uriel> the only meaningful deffinition this days is 'a language with
inheritance', Go has no inheritance, Rob was explicitly refering to the original
and now completely forgoten meaning of OO
11:51 -!- sauerbraten [~sauerbrat@p508CFD18.dip.t-dialin.net] has quit [Remote
host closed the connection]
11:51 < uriel> in any case, Go certainly has no classes, and if you think of
your Go code as you think of your java code, you will end with a mess
11:52 * taruti thinks go has very clean and sound inheritance from a certain pov
11:52 < uriel> 11:38 < aiju> makkalot: you don't add methods to
interfaces
11:52 < uriel> aiju: not quite right answer
11:52 < uriel> makkalot: you do *not* have to search for all types that
implement an interface, that is the whole poing of Go interfaces
11:52 < uriel> they are *implicit*
11:53 < uriel> 11:41 < fuzzybyte> does there exist yet any database
software written in pure go?
11:53 < uriel> what is 'database software'?
11:54 < uriel> anyway, see: http://go-lang.cat-v.org/pure-go-libs
11:54 < taruti> Anyone want to quickly review a http-digest authentication
implementation in Go before announcing on the ML?
11:56 < makkalot> does Go has some capabilites of meta programming like ruby
or python ?
11:57 < taruti> makkalot: yes, see the reflect package
11:59 < makkalot> the documentation is really cool, everything on one page
12:03 -!- wrtp_ [~rog@88.210.132.85] has joined #go-nuts
12:03 -!- wrtp [~rog@88.210.132.85] has quit [Ping timeout: 260 seconds]
12:06 -!- skejoe [~skejoe@188.114.142.162] has quit [Quit: Lost terminal]
12:07 -!- tensai_cirno [~cirno@77.232.15.216] has quit [Quit: Leaving]
12:12 -!- tensai_cirno [~cirno@77.232.15.216] has joined #go-nuts
12:17 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
12:20 -!- makkalot [~makkalot@85.101.153.10] has quit [Quit: Konversation
terminated!]
12:21 -!- makkalot [~makkalot@85.101.153.10] has joined #go-nuts
12:22 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 272 seconds]
12:24 -!- adu [~ajr@pool-173-66-253-179.washdc.fios.verizon.net] has joined
#go-nuts
12:27 -!- xash [~xash@d065036.adsl.hansenet.de] has joined #go-nuts
12:27 -!- DerHorst [~Horst@e176098003.adsl.alicedsl.de] has joined #go-nuts
12:43 -!- ssb [~ssb@213.167.39.150] has quit [Read error: Operation timed out]
12:44 -!- ssb [~ssb@213.167.39.150] has joined #go-nuts
12:48 -!- cafesofie [~cafesofie@ool-4a5978f2.dyn.optonline.net] has joined
#go-nuts
12:50 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
12:57 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
12:58 -!- tensai_cirno [~cirno@77.232.15.216] has quit [Quit: Leaving]
12:59 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
13:03 -!- makkalot [~makkalot@85.101.153.10] has quit [Quit: Konversation
terminated!]
13:04 -!- makkalot [~makkalot@85.101.153.10] has joined #go-nuts
13:05 < makkalot> what is the maximum number goroutines can be created ,and
how can i change that number ?
13:06 < temoto> makkalot, i doubt there's artificial limit.  You'll exhaust
memory sooner.
13:08 < vegai> I would dare to guess that the 32bit implementation has a
limit of 4 294 967 296
13:08 < vegai> but who knows, perhaps not
13:08 < vegai> s/who/rob/
13:09 -!- tensorpudding [~user@99.56.169.128] has quit [Remote host closed the
connection]
13:10 < temoto> That'd require ~16T of RAM.
13:11 < vegai> :)
13:12 < vegai> so I cannot simulate the world population so that every human
is a goroutine
13:13 < vegai> darn.
13:13 < aiju> you're limited by the stack amount
13:15 -!- go-irc-ch [~go-irc-ch@2001:470:1f13:3b4:20a:e4ff:fe49:b68c] has quit
[Read error: Operation timed out]
13:15 < vegai> then again, might be reasonable to do a dwarf fortress clone
so that every living thing would be a goroutine
13:16 < temoto> vegai, my simulation benchmark shows that, unfortunately, 4
threads processing all creatures in some random order is far more efficient than N
threads one for each creature.
13:18 < temoto> But i had ticking world.  Maybe continous simulation would
be different.
13:19 < vegai> yeah, no surprise there
13:19 -!- go-irc-ch [~go-irc-ch@2001:470:1f13:3b4:20a:e4ff:fe49:b68c] has joined
#go-nuts
13:20 < vegai> how many creatures did you have there?
13:21 < vegai> and what do you mean by "ticking world"?
13:21 < skelterjohn> every creature acts once before every creature acts
once again
13:22 < vegai> ah
13:22 < temoto> i tested with 100 and 1001 creatures.
13:24 -!- deso_ [~deso@x0561a.wh30.tu-dresden.de] has quit [Remote host closed the
connection]
13:33 -!- boscop [~boscop@g225220058.adsl.alicedsl.de] has joined #go-nuts
13:59 -!- sav [~lsd@jagat.xored.org] has joined #go-nuts
14:00 -!- Project-2501 [~Marvin@82.84.74.148] has joined #go-nuts
14:04 -!- Project_2501 [~Marvin@82.84.85.195] has quit [Ping timeout: 260 seconds]
14:09 -!- sav [~lsd@jagat.xored.org] has left #go-nuts []
14:10 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
14:15 -!- coldturnip1 [~COLDTURNI@118-166-68-186.dynamic.hinet.net] has quit [Read
error: Connection reset by peer]
14:15 -!- Project-2501 [~Marvin@82.84.74.148] has quit [Quit: E se abbasso questa
leva che succ...]
14:16 -!- coldturnip [~COLDTURNI@118-166-80-142.dynamic.hinet.net] has joined
#go-nuts
14:22 -!- niemeyer__ [~niemeyer@189.30.51.90] has joined #go-nuts
14:33 -!- ios_ [~ios@180.191.91.156] has quit [Ping timeout: 240 seconds]
14:35 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
14:38 -!- femtoo [~femto@95-89-197-139-dynip.superkabel.de] has joined #go-nuts
14:40 -!- adu [~ajr@pool-173-66-253-179.washdc.fios.verizon.net] has quit [Quit:
adu]
14:46 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
14:53 -!- makkalot [~makkalot@85.101.153.10] has quit [Read error: Connection
reset by peer]
14:54 -!- sav [~lsd@jagat.xored.org] has joined #go-nuts
15:05 -!- ismtrn [~andreas@85.218.134.71] has joined #go-nuts
15:06 -!- niemeyer__ [~niemeyer@189.30.51.90] has quit [Ping timeout: 240 seconds]
15:07 < ismtrn> Can methods access the private/not exported fields for the
struct they are defined on?
15:08 < ismtrn> I get this error when i try, but i'm not completely sure
why: "implicit assignment of unexported field 'x' of vector.Vector2 in method
receiver"
15:10 < taruti> ismtrn: you are trying to assign a structure while
structures with private fields cannot be assigned
15:10 < taruti> ismtrn: use a pointer instead
15:14 -!- emjayess [~emjayess@pix1.i29.net] has joined #go-nuts
15:16 -!- niemeyer__ [~niemeyer@189.30.51.90] has joined #go-nuts
15:16 < ismtrn> thanks
15:30 -!- kanru [~kanru@118-160-173-16.dynamic.hinet.net] has joined #go-nuts
15:35 -!- shvntr [~shvntr@116.26.128.19] has quit [Ping timeout: 250 seconds]
15:49 -!- xash [~xash@d065036.adsl.hansenet.de] has quit [Ping timeout: 250
seconds]
16:00 -!- ios_ [~ios@180.191.45.208] has joined #go-nuts
16:03 -!- sacho [~sacho@79-100-50-211.btc-net.bg] has joined #go-nuts
16:10 -!- sav [~lsd@jagat.xored.org] has left #go-nuts []
16:12 -!- sav [~lsd@jagat.xored.org] has joined #go-nuts
16:19 -!- sav [~lsd@jagat.xored.org] has left #go-nuts []
16:19 -!- sav [~lsd@jagat.xored.org] has joined #go-nuts
16:24 -!- ios_ [~ios@180.191.45.208] has quit [Quit: Leaving]
16:28 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
16:44 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
16:50 -!- sacho [~sacho@79-100-50-211.btc-net.bg] has quit [Ping timeout: 240
seconds]
16:51 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has quit [Quit:
DarthShrine]
16:53 -!- nettok [~quassel@200.119.161.79] has joined #go-nuts
17:03 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
17:11 -!- Project_2501 [~Marvin@82.84.80.24] has joined #go-nuts
17:11 -!- tvw [~tv@e176006186.adsl.alicedsl.de] has joined #go-nuts
17:16 -!- daharon [~daharon@173-11-102-86-SFBA.hfc.comcastbusiness.net] has joined
#go-nuts
17:18 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has joined #go-nuts
17:23 -!- snearch [~snearch@f053007157.adsl.alicedsl.de] has joined #go-nuts
17:23 -!- xash [~xash@d065036.adsl.hansenet.de] has joined #go-nuts
17:23 -!- daxt [~daxt@112.135.72.71] has joined #go-nuts
17:24 < daxt> hey gonuts
17:24 -!- tensai_cirno [~cirno@79.104.4.224] has joined #go-nuts
17:24 < daxt> what are the active go projects currently ?
17:26 -!- daxt [~daxt@112.135.72.71] has quit [Remote host closed the connection]
17:26 -!- daxt [~daxt@112.135.72.71] has joined #go-nuts
17:27 < anticw> daxt: the dashboard lists some
17:28 < anticw> uriel maintains a list as well on http://go-lang.cat-v.org/
17:28 < anticw> temoto: for 6g/8g a goroutine needs <4K in theory
17:28 -!- emjayess [~emjayess@pix1.i29.net] has quit [Quit: Leaving]
17:32 < daxt> ty anticw
17:33 < vegai> anticw: I sure hope so
17:33 < vegai> gccgo does worse?
17:34 < vegai> do people really use gccgo?
17:34 * taruti has used it
17:35 < anticw> gccgo is great
17:35 < anticw> gccgo has one thread per goroutine (at present, might
change) ...  so the footprint is larger
17:35 -!- niemeyer__ [~niemeyer@189.30.51.90] has quit [Ping timeout: 240 seconds]
17:35 < anticw> still, for a few 1000 on a modern machine so long as most
are sleeping it won't hurt
17:35 < daxt> anticw , i want to join a go project , can u show me the way ?
17:35 < anticw> vegai: gccgo does more optimization and produces much faster
code in some cases
17:36 < anticw> daxt: find something you like on github, clone it and hack
away on it might be easiest
17:36 < anticw> it depends what you want to do
17:37 < daxt> i want to do general purpose coding
17:37 < daxt> GUI app
17:38 < anticw> well ....  it would help to be more specific, find something
you like that's reasonable ...  UI support is very weak right now
17:39 < daxt> paltalk alternative :D
17:39 < daxt> it's scope is huge
17:40 < daxt> but will definitely prove Go's potential
17:41 < vegai> anticw: I guess.  6g seems to compete rather well against gcc
already, though
17:41 < vegai>
http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=go&lang2=gcc
17:41 < vegai> except for those two tests
17:47 -!- daxt_ [~daxt@112.135.87.48] has joined #go-nuts
17:50 -!- daxt [~daxt@112.135.72.71] has quit [Ping timeout: 240 seconds]
17:50 -!- daxt [~daxt@112.135.88.169] has joined #go-nuts
17:53 -!- daxt_ [~daxt@112.135.87.48] has quit [Ping timeout: 255 seconds]
17:54 < anticw> vegai: those benchmarks are retarded
17:55 -!- daxt [~daxt@112.135.88.169] has quit [Ping timeout: 240 seconds]
17:57 < vegai> anticw: no they're not.
17:58 -!- nettok [~quassel@200.119.161.79] has quit [Read error: Connection reset
by peer]
17:58 < kimelto> the go regex package is a joke :)
17:59 < anticw> that's been discussed to death on the list, especially wrt
to those benchmarks
17:59 < vegai> kimelto: no it's not :P
18:00 < vegai> anticw: "some people take these benchmarks too seriously" !=
"these benchmarks are worthless"
18:01 < anticw> exaggeration for effect
18:05 < jessta_> kimelto: just not optimised, like the rest of the language
18:13 < aiju> kimelto: what's wrong with it?
18:13 < aiju> most benchmarks are worthless
18:15 < aiju> http://swtch.com/~rsc/regexp/regexp1.html regexes are bad in
general
18:15 < kimelto> aiju: according to this benchmark it is the worst regex
implementation ever :p
18:15 < kimelto> note the "according to" ;)
18:15 < kimelto> v8 regex implementation is better :-)
18:16 < aiju> oh wow i wouldn't really trust that benchmark
18:16 < aiju> language benchmarks are the worst anyway
18:17 < aiju> some benchmarks "prove" that C is faster than PHP
18:17 < aiju> ehm
18:17 < aiju> *PHP is faster than C
18:18 < kimelto> I'd like to see those :p
18:18 < aiju> some benchmarks i did had PHP as the worst language
18:18 < aiju> even worse than CLISP
18:21 -!- xuwen [~xuwen@pool-138-88-67-134.res.east.verizon.net] has joined
#go-nuts
18:32 -!- kanru [~kanru@118-160-173-16.dynamic.hinet.net] has quit [Ping timeout:
276 seconds]
18:47 < vegai> the shootout is also a benchmark of the community
18:48 < vegai> for instance, the Haskell community has done some pretty
amazing/awful things to do well in there
18:49 < aiju> "haskell is a DSL specific to the .edu domain" *cough*
19:00 -!- cafesofie [~cafesofie@ool-4a5978f2.dyn.optonline.net] has quit [Remote
host closed the connection]
19:00 -!- tensai_cirno [~cirno@79.104.4.224] has quit [Read error: Connection
reset by peer]
19:01 -!- niemeyer__ [~niemeyer@189.30.51.90] has joined #go-nuts
19:30 -!- tylergillies [~quassel@unaffiliated/tylergillies] has joined #go-nuts
19:30 < tylergillies> anyone have an example url for getting the body text
out of http.Get("http://www.google.com")?
19:41 -!- DerHorst [~Horst@e176098003.adsl.alicedsl.de] has quit [Remote host
closed the connection]
19:47 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
19:48 < ismtrn> How do I deal with two source files (from the same package)
who needs exported types from each other to compile?  Do I have to copy the
contents from one over to the other?
19:48 < aiju> ismtrn: pass them both to the compiler
19:48 < aiju> 8g foo.go bar.go
19:49 < ismtrn> oh..  that makes sense lol.  Haven't thought about that,
thanks :)
19:49 < aiju> yeah, i had the same problem
19:54 -!- Project_2501 [~Marvin@82.84.80.24] has quit [Ping timeout: 265 seconds]
20:00 < Eko> so, does anyone know why a reverse lookup of 127.0.0.1 in
in-addr.arpa.  works but not a lookup of ::1 in ip6.arpa.?
20:01 -!- femtooo [~femto@95-89-197-139-dynip.superkabel.de] has joined #go-nuts
20:05 -!- femtoo [~femto@95-89-197-139-dynip.superkabel.de] has quit [Ping
timeout: 255 seconds]
20:05 -!- sacho [~sacho@79-100-50-211.btc-net.bg] has joined #go-nuts
20:08 -!- bgentry [~bgentry@75.85.173.206] has joined #go-nuts
20:10 < aiju> is there a preferred way to read binary data?
20:14 < aiju> oh encoding.binary
20:20 -!- niekie [~niek@CAcert/Assurer/niekie] has quit [Read error: Operation
timed out]
20:21 -!- KBme [~KBme@9angled-2-pt.tunnel.tserv5.lon1.ipv6.he.net] has quit [Read
error: Operation timed out]
20:22 -!- cbeck [cbeck@gateway/shell/pdx.edu/x-ubdstoaobwnnzmdo] has quit [Read
error: Operation timed out]
20:22 -!- go-irc-ch [~go-irc-ch@2001:470:1f13:3b4:20a:e4ff:fe49:b68c] has quit
[Ping timeout: 240 seconds]
20:22 -!- cbeck [cbeck@gateway/shell/pdx.edu/x-qragvborwdpjnzxm] has joined
#go-nuts
20:23 -!- Xenith [~xenith@2001:470:1:9:8002::1] has quit [Ping timeout: 260
seconds]
20:24 -!- adg [~nf@adak.wh3rd.net] has quit [Ping timeout: 260 seconds]
20:24 -!- niekie [quasselcor@CAcert/Assurer/niekie] has joined #go-nuts
20:25 -!- adg [~nf@adak.wh3rd.net] has joined #go-nuts
20:25 -!- mode/#go-nuts [+o adg] by ChanServ
20:30 < ismtrn> Is there any way to convert a pointer to an interface to a
pointer to a type implementing that interface?
20:30 -!- Xenith [~xenith@2001:470:1:9:8002::1] has joined #go-nuts
20:31 < ismtrn> The actual type "behind" the interface is of the type I want
to convert to
20:32 -!- BlaSux [7f000001@69.195.144.4] has quit [Read error: Operation timed
out]
20:35 -!- BlaSux [7f000001@69.195.144.4] has joined #go-nuts
20:35 -!- illya77 [~illya77@151-64-133-95.pool.ukrtel.net] has quit [Read error:
Connection reset by peer]
20:37 < Eko> ismtrn: are you sure you shouldn't be using an interface value
(where the pointer to the type implements the interface)?
20:38 < Eko> e.g.  a net.Conn which is implemented by a *net.TCPConn
20:39 < Eko> in which case you can do t,ok := c.(net.*TCPConn) to assert
that it is the type you expect
20:39 < Eko> er, *net.TCPconn
20:40 -!- niemeyer__ [~niemeyer@189.30.51.90] has quit [Ping timeout: 240 seconds]
20:42 -!- KBme [~KBme@9angled-2-pt.tunnel.tserv5.lon1.ipv6.he.net] has joined
#go-nuts
20:42 -!- go-irc-ch [~go-irc-ch@2001:470:1f13:3b4:20a:e4ff:fe49:b68c] has joined
#go-nuts
20:47 < TheSeeker> ah, I never understood wtf 'socket :=
conn.(*net.UDPConn)' was doing (I had just borrowed it from other known-to-be
functioning udp connection code)
20:48 < TheSeeker> so if I changed it to 'conn, ok := ...' I could check
that ok == true for extra super-duper paranoia?
20:50 < Eko> TheSeeker: yep; if you don't do that, it panics if the
assertion is false
20:50 < Eko> does anyone know how I can add a file to a change list?  or do
I need to delete it and make a new one?
20:53 < hokapoka> I'm using a channel to pass some type to another
goroutine, I was thinking I need to create a FIFO to stack the types until they
can be processed.
20:54 < hokapoka> But I've just rememembered that I can buffer the channel,
is there a way to grow the buffer if nessasary?
20:54 < Eko> nevermind, got it.
20:55 < Eko> hokapoka: not that I know of
20:55 < Eko> hokapoka: but the channel write will block if the buffer is
full, allowing time for the consumer to deal with some of it
20:55 < hokapoka> As in the channels buffer.  My initial intention was to
read from an unbuffered channel and use a regular slice and grow that as I need.
20:56 < hokapoka> Eko: yeah, that is somthing that can't happen.
20:57 < Eko> hokapoka: why not?
20:58 < hokapoka> I guess I could use a big ol' buffer on the channel, but I
figure that's not going tobe very efficient, and it'll be better to manage it
dynamically.
20:58 < Eko> don't forget that the go scheduler isn't preemptive, and your
coroutines aren't actually running in parallel
20:59 < Eko> (unless you set them to be with GOMAXPROCS, but at the moment
that is worse for highly communication-driven programs)
21:00 < ismtrn> Eko: I'm not sure i understand what you are saying.  I have
a struct that hold pointers to objects that implement an interface.  I want to
take one of those interface pointers and convert it to a pointer to its original
type.  I think it referred to as "back casting" in C/++
21:00 -!- rlab [~Miranda@132-83-95-178.pool.ukrtel.net] has joined #go-nuts
21:01 < hokapoka> Eko: because the goroutine what's filling the channel
needs to continue, and the routine that's reading from the channel is making http
requests that might timeout.
21:01 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has joined
#go-nuts
21:01 -!- femtoo [~femto@95-89-197-139-dynip.superkabel.de] has joined #go-nuts
21:03 < Eko> ismtrn: I don't think I've ever had a pointer to an interface.
There is no point.  A pointer to an object can implement that interface just fine.
21:04 < Eko> ismtrn: take this: type Reader interface { Read([]byte)
(int,os.Error) }.  You only ever need a variable of a Reader, never a *Reader.
21:05 -!- femtooo [~femto@95-89-197-139-dynip.superkabel.de] has quit [Ping
timeout: 265 seconds]
21:05 < ismtrn> So if i have interface 'I' and type '*T' that implements it,
i can do this: var object I = new(T)
21:05 < Eko> The reason is that a type like: type CanRead struct {...}; func
(cr *CanRead) Read(b []byte) (n int, err os.Error) {...}; implements that
interface
21:05 < Eko> yes, ismtrn.
21:06 < ismtrn> Thank you
21:09 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 272
seconds]
21:24 -!- BlaSux [7f000001@69.195.144.4] has quit [Remote host closed the
connection]
21:24 < tylergillies> im trying to loop over a channel until its drained:
for chan1{ fmt.Println("foo") }
21:25 -!- BlaSux [7f000001@69.195.144.4] has joined #go-nuts
21:25 < aiju> ha awesome
21:25 < aiju> i wrote a parser for the UNIX V6 file system
21:25 < aiju> my file structure implements Read
21:25 < aiju> now i can use all tools of the Go library on it
21:28 < uriel> vegai: more like a benchmark of how much the community cares
about those benchmarks
21:30 < uriel> tylergillies: you need to range
21:30 -!- Scorchin [~Scorchin@host109-152-121-250.range109-152.btcentralplus.com]
has quit [Quit: Scorchin]
21:30 < tylergillies> uriel: just figured out if i do for {} it will exit
when channel is drained
21:30 < uriel> for _ := range chan1 { }
21:31 < tylergillies> uriel: thnx
21:33 < tylergillies> uriel: chan.go:23: no new variables on left side of :=
21:33 -!- l00t [~i-i3id3r_@189.105.5.123] has quit [Ping timeout: 260 seconds]
21:33 < uriel> tylergillies: that is what _ is for
21:34 < aiju> or just don't use :=
21:34 < uriel> ah, good point, hehe
21:34 < tylergillies> uriel: i have "_" in my code: for _:= range ch{
21:34 < aiju> tylergillies: =
21:34 < aiju> not :=
21:34 < tylergillies> ok thnx
21:34 < uriel> ah!  dumb me :)
21:34 -!- l00t [~i-i3id3r_@189.105.4.231] has joined #go-nuts
21:36 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
21:36 < |Craig|> tylergillies: that loops until a channel is closed, not
until there is no more data, if empty, it will block
21:39 -!- karshan [~karshan@117.254.219.190] has joined #go-nuts
21:43 -!- rlab [~Miranda@132-83-95-178.pool.ukrtel.net] has quit [Quit: Miranda
IM! Smaller, Faster, Easier.  http://miranda-im.org]
21:43 < bgentry> is there any kind of a fixed point / decimal type available
in any of the standard Go libs?
21:46 < Eko> bgentry: http://golang.org/pkg/big/ ?
21:47 < Eko> unless you mean int/int32/int64, in which case no it's not in
the libraries it's in the language...
21:47 < Namegduf> No, there isn't.
21:48 < Namegduf> I dn't think big has fixed point.
21:49 < bgentry> hm
21:49 < Namegduf> big has arbitrary precision, though.
21:49 < bgentry> doing some MP4 parsing, got values to handle that are i.e.
"16.16" format
21:50 * Eko has only ever used fixed point in a microprocessor without floating
point.
21:50 < bgentry> 16 bits before and after decimal
21:50 < Namegduf> Fixed number of binary bits?
21:50 < Namegduf> Why not just use a float?
21:51 < Namegduf> It'll actually work safely in that context.
21:51 < Eko> bgentry: you might be able to use Big.SetBytes to get two Bigs
and then compose those together into a Rat or something
21:52 < bgentry> Namegduf: float is safe for that?
21:52 < bgentry> hadn't thought it through I guess
21:52 < Namegduf> Float has a specified size
21:52 < Namegduf> float64 or bigger has said size be bigger than that
21:53 < Eko> Namegduf: I don't think float will work, because float stores
them in mantissa/exponent notation, no?
21:53 < Namegduf> Eko: With an exponent of 0 it's equivalent.
21:54 < Eko> interesting.
21:54 < Eko> so why not just use an int32?
21:54 < Namegduf> Well, no
21:54 -!- ampleyfly [ampleyfly@gateway/shell/blinkenshell.org/x-imnrzrewpoxbmyyk]
has quit [Remote host closed the connection]
21:54 < Namegduf> An exponent of 2, I think.
21:54 < Namegduf> No again, an exponent of 16.  That's it.
21:54 < Namegduf> Moving 16 bits "above 0".
21:55 < Eko> but if he needs to get it back to 16.16, he can't
21:55 < bgentry> which I do of course =)
21:55 < Namegduf> If he needs to round/truncate, he has to do it himself
21:55 < Eko> so can't he just use an int32?
21:55 < Namegduf> "he can't" is inaccurate
21:55 -!- snearch [~snearch@f053007157.adsl.alicedsl.de] has quit [Quit:
Verlassend]
21:56 < Eko> true; the data format does not translate back into 16.16
without some prying.
21:57 < bgentry> I guess I could just make my own types for this usage..
have 8.8 and 16.16 types that let me get whatever forms I need but ultimately
convert easily back to their original representation
21:57 < Namegduf> int32 could work if you can parse into it easily enough.
21:57 < Namegduf> You'd just treat it as the number in question multiplied
up by 2^16
21:58 < Eko> yep.
21:58 < bgentry> Namegduf: yeah, I mean the data I'm reading is straight
binary already, it's not coming in as a string or anything
21:58 < Namegduf> I think you could do everything but multiplication
naturally.
21:58 < Eko> and encoding/binary can do it
21:58 < Namegduf> Multiplication would be tricky.
21:58 < Eko> yeah.
21:59 < Eko> you'd have to multiply by x/(2^16)
21:59 < Eko> which isn't fun with integer math.
22:00 < karshan> whats the go way of writing structures to a file ?
22:00 < Namegduf> You'd also presumably want to include the fractional part.
22:00 < Eko> karshan: encoding/binary, gob, or json
22:01 < karshan> thanks
22:01 < Eko> or some custom way
22:01 < karshan> i was wondering if there was an equivalent of the c
fwrite(&struct var....)
22:01 < Eko> karshan: there is also a go implementation of Google's Protocol
Buffers, which would make the format readable by any language.
22:02 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has quit
[Ping timeout: 240 seconds]
22:03 < Eko> karshan: you probably want gob then
22:04 < Eko> it doesn't write the bits to the file as they are in memory,
but that's not particularly go-like anyway.
22:05 < karshan> yeah ...  the structures dont have a fixed size in memory
do they ?
22:05 < karshan> i couldnt figure it out with unsafe.Sizeof but thats what
im guessing..
22:05 < Eko> read up on gob :P
22:05 < karshan> yeah :P
22:05 < Eko> it flattens the structure and writes it out along with
self-describing information so that it can be reconstituted later.
22:06 < karshan> yeah makes sense thats what ill do..  thanks
22:06 < Eko> if your data is textual in nature, you might also use json,
which would make it editable if you were sufficiently motivated.
22:07 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
22:18 -!- Davidian1024 [~Davidian1@cpe-173-88-174-84.neo.res.rr.com] has quit
[Ping timeout: 276 seconds]
22:19 -!- Davidian1024 [~Davidian1@cpe-173-88-174-84.neo.res.rr.com] has joined
#go-nuts
22:28 -!- karshan [~karshan@117.254.219.190] has quit [Ping timeout: 255 seconds]
22:31 -!- Davidian1024 [~Davidian1@cpe-173-88-174-84.neo.res.rr.com] has quit
[Ping timeout: 276 seconds]
22:32 -!- Davidian1024 [~Davidian1@cpe-173-88-174-84.neo.res.rr.com] has joined
#go-nuts
22:36 -!- Davidian1024 [~Davidian1@cpe-173-88-174-84.neo.res.rr.com] has quit
[Ping timeout: 250 seconds]
22:37 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Read error: Connection
reset by peer]
22:39 < tylergillies> anyone got an example of how i can create an interface
and then assign a variable to it?
22:39 < aiju> you don't assign variables to interfaces?
22:39 < aiju> -?
22:42 < tylergillies> tring to use json.Unmarshal it takes v as an argument
which is an interface
22:48 -!- Davidian1024 [~Davidian1@cpe-173-88-174-84.neo.res.rr.com] has joined
#go-nuts
22:49 -!- sacho [~sacho@79-100-50-211.btc-net.bg] has quit [Ping timeout: 240
seconds]
22:51 < Xenith> Any variable that has the proper methods will match the
interface.
22:52 < Xenith> I should probably say 'any type' instead of 'any variable'
22:53 < aiju> json.Unmarshal(buf[:], &v)
22:54 -!- emjayess [~emjayess@24-116-86-22.cpe.cableone.net] has joined #go-nuts
22:55 -!- ismtrn [~andreas@85.218.134.71] has quit [Quit: Leaving]
22:55 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
22:56 < tylergillies> so i need to create a variable with a type that
implements the interface, then use that variable in the Unmarshal method?
22:56 < Xenith> Yep.
22:57 < tylergillies> its weirde how go uses methods to store the value of a
variable instead of just returning a value
22:57 < tylergillies> weird*
22:57 < aiju> tylergillies: what do you mean?
22:58 < aiju> should it rather return the struct?
22:58 < tylergillies> nmarshal parses the JSON-encoded data and stores the
result in the value pointed to by v.
22:58 < aiju> you've never programmed C, don't you?
22:58 < tylergillies> why doesn't it just return the result?
22:58 < tylergillies> i haven't done a lot of c
22:59 < aiju> it wouldn't be possible to construct a struct at runtime
22:59 < tylergillies> ok
23:00 < Namegduf> At least, not one that matched an already defined type
23:00 < aiju> C is all like that, but for different reasons
23:01 < aiju> returning values by parameters is actually common in many
languages
23:02 -!- sacho [~sacho@79-100-51-54.btc-net.bg] has joined #go-nuts
23:02 -!- femtoo [~femto@95-89-197-139-dynip.superkabel.de] has quit [Ping
timeout: 240 seconds]
23:02 < tylergillies> oh
23:02 < tylergillies> its an interesting paradigm
23:03 < aiju> e.g.  in Prolog it's the only way to return values
23:03 < aiju> (but Prolog parameters work entirely different)
23:04 -!- devrim1 [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Quit:
Leaving.]
23:05 < tylergillies> how do i get to to be byte[] type?
json.Unmarshal(byte("{\"name\":\"tyler\"}"),stor)
23:06 < aiju> maybe [:]?
23:06 < aiju> "string"[:]
23:06 < uriel> tylergillies: I think that should work
23:07 < tylergillies> where does that go?
23:08 < tylergillies> uriel: chan.go:43: cannot convert
"{\"name\":\"tyler\"}" to type uint8
23:10 < tylergillies> oh i need to make it []byte
23:11 < tylergillies> part of the reason im learning go is to be more
familiar with typed data
23:11 < tylergillies> ive been spoiled with duck typing
23:11 < aiju> Go has a great type system
23:11 < aiju> i've been programming Javascript now, having almost no type
checking at all is really annoying
23:16 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has joined
#go-nuts
23:21 -!- Davidian1024 [~Davidian1@cpe-173-88-174-84.neo.res.rr.com] has quit
[Ping timeout: 264 seconds]
23:23 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 255 seconds]
23:26 < tylergillies> ok so i got a byte[] object in "foo", stor is a
struct: "var stor struct{}", when i call "json.Unmarshal(foo,stor)", stor
evaluates to {}, but string(foo) is == "{"Url":"sadsadasda","Body":""}"
23:29 < tylergillies> think i fixed it
23:30 < tylergillies> had to make stor the same type as the marshalled
object
23:31 < tylergillies> "stor :=&Foo{}"
23:36 < aiju> tylergillies: you need to define the appropriate fields in the
struct
23:37 < aiju> struct{ Url, Body string}
23:37 < tylergillies> aiju: right.  thats the part i figured out
23:37 < aiju> and you call Unmarshal with a pointer to it
23:40 -!- lmoura_ [~lauromour@187.59.115.154] has quit [Quit: Leaving]
23:48 -!- Scorchin [~Scorchin@host109-152-121-250.range109-152.btcentralplus.com]
has joined #go-nuts
23:49 < tylergillies> https://gist.github.com/760498 is causing a panic when
i try to write to io.writer
23:50 < tylergillies> panic: runtime error: invalid memory address or nil
pointer dereference
23:51 < Namegduf> You're writing to a nil writer.
23:51 < Namegduf> io.Writer is an interface, matched by anything you can
write to.
23:51 < Namegduf> You just defined a nil one pointing at nothing.
23:54 -!- nettok [~quassel@200.119.168.48] has joined #go-nuts
23:55 < tylergillies> how do i see what types implement what interface?
23:59 < Namegduf> You can't, don't generally need to.
--- Log closed Fri Dec 31 00:00:01 2010