--- Log opened Mon Feb 21 00:00:29 2011
00:01 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has joined #go-nuts
00:02 -!- dju_ [~dju@fsf/member/dju] has quit [Ping timeout: 264 seconds]
00:03 < exch> zzing: Not sure.  I dont have any problems with the lib, or
use OSX ..
00:07 -!- Electro^ [electro@c-bef570d5.033-10-67626721.cust.bredbandsbolaget.se]
has quit [Ping timeout: 276 seconds]
00:07 < cbeck> Random, ungoogled thought: Has anyone tried building sparc
binaries with gccgo?
00:09 < ww> is there a way to get the keys of a map as a slice?
00:09 < str1ngs> zzing: you can try 386 but like I said when I built it on
linux it segfaulted
00:09 < ww> (other than iterating and building an array)
00:09 < cbeck> ww: Nothing built in, no
00:09 < zzing> str1ngs: Is there any way to determine why it segfaulted?
00:10 < str1ngs> zzing: let me try it again
00:10 < zzing> str1ngs: You can try fetching a new copy, the makefile uses
pkg-config now
00:11 < str1ngs> zzing: ah good
00:11 < str1ngs> zzing: if you need help with the test file let me know.
much easier for testing imo
00:11 < zzing> sorry I forgot to push, it is updated now
00:11 < zzing> str1ngs: a simple make will try to compile the test now as
you suggested
00:12 < str1ngs> ya I thought it was strange it would build and I dont even
have glfw installed
00:12 < zzing> str1ngs: It shouldn't have even gotten that far
00:14 < str1ngs> zzing: ya but pkg-config is much better imo
00:14 < zzing> certainly
00:14 < zzing> I didn't notice the pkg file before
00:15 < str1ngs> examples does not exist
00:15 < ww> cbeck: that's unfortunate given the information's there...
although maybe that's because i'm not thinking of the problem in an idiomatic
00:16 < str1ngs> zzing: should that be example not examples?
00:16 < zzing> str1ngs: right now maybe, but if I can get this to work it
will have more
00:17 < str1ngs> zzing: not sure how I should test but glfwtest segfaults
00:17 < zzing> str1ngs: Does triangles?
00:18 < str1ngs> ah guess I neeed opengl-go for that?
00:18 < zzing> str1ngs: yes
00:18 < str1ngs> rather go-opengl
00:18 < cbeck> ww: I assume (And I may be wrong) that maps are implemented
as either a hashtable or a btree, in either case the data isn't there in any sort
of linear format
00:18 < zzing> Go-OpenGL and Go-SDL
00:19 -!- Electro^ [electro@c-bef570d5.033-10-67626721.cust.bredbandsbolaget.se]
has joined #go-nuts
00:19 < zzing> Go-SDL is required by an example or two from Go-OpenGL
00:20 < zzing> again if I get glfw working, I will for Go-OpenGL to remedy
00:20 < ww> cbeck: right, i'm using them to avoid writing my own hashtable
(and i couldn't find a good library)
00:20 < ww> don't care about order, just want to be able to iterate...
00:20 < cbeck> for k := range mymap {}
00:21 < ww> cbeck well in this case, not quite:
00:21 < ww> edges map[uint64]map[uint64]bool // edges in the graph
00:21 < ww> implementing Neighbours() i want the keys in the second map
00:22 < str1ngs> zzing: example test file
00:22 < ww> the bool part is throwaway, a custom data structure wouldn't
have it
00:23 < ww> ok -- i misread...  i can just do k := range, and don't have to
do k,v := range?
00:23 < cbeck> Yep
00:23 < zzing> str1ngs: so I should put that as my testing file?
00:24 < ww> brilliant.  that does it then.  thanks
00:24 < cbeck> cool
00:24 < str1ngs> zzing: not exactly just convert your test go file to that
00:25 < str1ngs> zzing: as long as you have it as the same package as your
package it will work
00:25 < ww> of course the return type of Neighbours() will have to be
map[uint64]bool which is a bit weird though
00:25 < zzing> I want to have the tests outside of the package itself
00:25 < str1ngs> zzing: there is no need
00:26 < str1ngs> zzing: thats the whole point you dont need to install the
package to test it
00:26 < cbeck> It seems like a really simple list class there would do a
better job of it
00:26 < str1ngs> zzing: its alot saner in that when you make a function in
your package you just add it to the test file
00:27 < zzing> str1ngs: at this point I can't even link, so I won't worry
about that :p
00:27 < str1ngs> zzing: ok just installing sdl depends
00:28 < zzing> str1ngs: does this test thing automatically run?  I can't
find a reference in the makefile
00:28 < cbeck> Or hell, just a slice, and append neighbors as you need to
00:28 -!- tarrant [~tarrant@]
has quit [Quit: Leaving...]
00:29 < str1ngs> zzing: yes in a sense.  you just do make test
00:29 < zzing> How does make test know what to do?
00:30 < str1ngs> its all templated in the Make files
00:30 < zzing> ok
00:30 < str1ngs> do I need to have Go-Opengl installed?
00:31 < zzing> for triangles yes
00:31 < str1ngs> ok let me skip that
00:31 < str1ngs> I'm converting this to a test file
00:32 < zzing> ok, if you can get it to not crash, it would be lovely
00:33 -!- boscop [~boscop@g227128066.adsl.alicedsl.de] has quit [Ping timeout: 240
00:33 < ww> cbeck: the reason for using maps instead of a list was imagining
nodes with large outdegrees and wanting constant time lookups
00:34 < cbeck> fair
00:34 < ww> using append is cleaner than building an array by hand though
00:35 < str1ngs> zzing: https://gist.github.com/836473
00:35 < str1ngs> zzing: right now it doesnt do any testing I just converted
the glwtest you had
00:36 < zzing> It is testing enough right now :p
00:36 < str1ngs> zzing: put it in glfw and save it as glfw_test.go
00:36 < str1ngs> then you can just do make test
00:37 < str1ngs> also...  need to convert the none darwin stuff to
00:37 < str1ngs> in fact just use pkg-config and you probably dont need to
do darwin logic
00:39 < zzing> yes
00:39 < ww> actually is it cleaner?  it's cleaner looking...  but this is
way in the realm of premature optimisation i think
00:39 < zzing> This is the error I get right now:
00:40 < str1ngs> zzing: ya for me it segfaults on linux
00:40 < zzing> this is puzzling
00:40 < str1ngs> zzing: let me fork your project so I can push these test
changes and you can pull
00:41 < zzing> str1ngs: I was going to push the updates i just made
00:41 < str1ngs> zzing: ok push please
00:41 -!- Scorchin [~Scorchin@host109-156-10-102.range109-156.btcentralplus.com]
has quit [Quit: Scorchin]
00:42 < zzing> done
00:42 < str1ngs> thanks
00:42 < zzing> I will need you to tell me how to pull properly, I am not
that familiar with this part of git/github :p
00:43 < str1ngs> zzing: np
00:45 -!- youngsterxyf [~xyf@] has joined #go-nuts
00:45 -!- alkavan_ [~alkavan@] has joined #go-nuts
00:46 < str1ngs> zzing: really all you have to do is git pull url
00:46 < zzing> ok
00:46 < str1ngs> it good practice to do it on another branch but you dont
have to
00:47 < str1ngs> then merge the other branch into w/e branch you want
00:47 < zzing> Do I go to another directory and pull?
00:48 < str1ngs> any dir in the git tree will work.  I like to work in the
git root dir
00:48 -!- youngsterxyf [~xyf@] has left #go-nuts []
00:48 < str1ngs> ok so now I need to figure out why this segfaults on linux
00:50 < str1ngs> zzing: also another tip I like to run gofmt when I build or
add a format: to Makefile that does it
00:52 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has quit [Ping timeout: 272 seconds]
00:52 -!- thomas_b [~thomasb@cm-] has joined #go-nuts
00:53 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has joined #go-nuts
00:53 < exch> zzing: did you install glfw's shared lib as well as the static
lib?  I dont believe CGO allows you to statically link a C lib into your binary
00:54 < zzing> exch: I did
00:54 < exch> I just had some issues with linking because I ran 'make
x11-install' instead of 'make x11-dist-install' which omitted the shared lib
00:54 < exch> mm
00:54 < zzing> hmm, it appears that the current version doesn't have it, let
me check something...
00:55 < str1ngs> zzing: grr glfw user guide is pdf format
00:56 < exch> <GL/glfw.h> is all the user guide you'll need ;)
00:56 < str1ngs> zzing: can you make a quick test C fille that just uses
00:56 < zzing> exch: is this relevant?
00:56 < str1ngs> zzing: file*
00:57 < zzing> str1ngs: I can make one for the version easily enoug
00:57 < str1ngs> exch: I'm not a C programmer . well not a good one anyways
00:57 < str1ngs> zzing: ya that would work thanks
00:57 < str1ngs> zzing: I just need to test my glfw install
00:58 < exch> zzing: this is my current makefile http://pastie.org/1587692
00:58 < exch> If it's an OSX specific problem, that won't help you much
00:59 < str1ngs> exch: it may not be since it segfaults for me.  unless it
works for you?
00:59 < exch> it compiles without a problem, but you are right.  segfault as
well :s
00:59 < exch> Using Init()
00:59 < str1ngs> aye
01:00 < zzing> str1ngs: https://gist.github.com/abd98decf6bed0a6cb7d
01:00 < str1ngs> zzing: thanks
01:00 < zzing> gcc glfwver.c -lglfw -o glfwver and anything for opengl
01:00 < str1ngs> zzing: I'll just use pkg-config and add it to the test file
01:01 < zzing> sure
01:02 < exch> the C program works with $ gcc glfw.c `pkg-config --libs
libglfw` -o glfw
01:03 < zzing> exch: according to this:
you statically link to a C library by putting it in the cgo_ldflags, which is
pretty much what we know already
01:04 < skelterjohn> I have certainly got Go-OpenGL working with cgo, and it
has similar ldflags to what you've got, zzing
01:04 < str1ngs> zzing: ok so its nothing glfw related imo.  definately cgo
01:05 < zzing> skelterjohn: yep, I copied Go-SDL and Go-OpenGL pretty
extensively because of this problem
01:05 < skelterjohn> although interestingly...
01:05 < zzing> str1ngs: I think the best description of the problem is
something to do with those underscores that it seems to be dropping.
01:05 < zzing> something different?
01:05 < zzing> Anything that is different I would love to know :p
01:05 < skelterjohn> i tried to get Go-OpenGL to be built by gb (a tool I
made for automatic building, and I've added CGO support)
01:05 < skelterjohn> and when i use the makefile, it works
01:06 < skelterjohn> when i do the instructions by hand, it works
01:06 < zzing> skelterjohn: are you on the mac?
01:06 < skelterjohn> but when i run the linker step from within gb, it fails
due to unresolved symbol issues
01:06 < skelterjohn> yes
01:06 < skelterjohn> i'm on a mac
01:06 < skelterjohn> i copy that same link line, and run it from the same
place, and it works no problem
01:06 < skelterjohn> very frustrating
01:06 < zzing> skelterjohn: In my case, I can't get any of the opengl or sdl
tests to run
01:07 < skelterjohn> git experts...  what do i do to tell git to revert the
current directory to the state of the repository?
01:07 < zzing> What does gopack grc _test/glfw.a _gotest_.6 _cgo_defun.6
_cgo_import.6 glfw.cgo2.o _cgo_export.o do?
01:08 < skelterjohn> zzing: it puts all those .6 files and .o files together
in the .a file
01:08 < skelterjohn> i don't know what the grc part means, but that is
always the flag used for gopack as far as i can see
01:09 < zzing> That is for make test it does that command with link errors
01:10 < zzing> This is what I was thinking about posting to the mailing
list, does this sound reasonable, or are there additional details I should add?
01:11 < exch> I've just tried building another one of my CGO libs and it
works without problems (libvlc)
01:11 < exch> Same setup as the glfw thing
01:11 < exch> runs withuot issues as well
01:11 < skelterjohn> zzing: try doing the link instruction by hand
01:12 < zzing> skelterjohn: no better
01:12 -!- mjrosenb [~mjrosenb@STARGATE-ATLANTIS.RES.CMU.EDU] has joined #go-nuts
01:17 -!- saturnfive [~saturnfiv@] has joined #go-nuts
01:19 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping
timeout: 240 seconds]
01:20 < mjrosenb> i'm looking at the draw package.
01:20 < mjrosenb> there is a member function: EventChan() <-chan
01:20 < zzing> I have just posted the new message for the mailing list,
hopefully something from there
01:21 < mjrosenb> that means that EventChan returns a channel that when I
pull an element off of it, it will adhere to an interface that specifies nothing?
01:22 < exch> mjrosenb: the object it returns will be one of the Event types
defined in the draw package
01:22 < exch> you can see which one it is with a type switch: switch
evt.(type) { case *draw.ConfigEvent: ...  }
01:23 < mjrosenb> ahh.  thanks.
01:23 < skelterjohn> zzing: much of the go team uses macs, and when the week
starts they'll be back in their offices
01:23 < skelterjohn> your problem may draw some interest
01:24 < zzing> skelterjohn: that it may
01:24 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #go-nuts
01:24 < zzing> I suppose the week starts tomorrow, up here it is a holiday
01:24 < skelterjohn> unfortunately this evening i have a bunch of things
taking priority
01:24 < skelterjohn> where is "up here"?
01:25 < zzing> ontario
01:25 < skelterjohn> canada day, or something?
01:25 < mjrosenb> note: ontario is ambiguous.
01:25 < skelterjohn> i know you folk have all sorts of weird things going on
01:25 < skelterjohn> other than the canadian province, what place calls
itself ontario?
01:26 < mjrosenb>
01:27 < zzing> Ontario in California, Illinois, Indiana, Iowa, New York,
Ohio, Oregon, Pennsylvania, Virginia, and Wisconsin - did I miss any?
01:27 < mjrosenb> zzing: probably?
01:27 < zzing> :-)
01:28 < zzing> I just looked up
01:29 < zzing> Somebody replied to my posting, he says when he did this kind
of work, it compiles without problems but segfaults on linux.
01:29 < zzing> So there is definitely something funky here
01:29 < zzing> It probably means I cannot use google go for what I want
01:30 < exch> zzing: that was me
01:30 < zzing> exch: haha
01:30 < exch> I ran it through strace but there's a metric ton of output I
need to sift through
01:31 < exch> at first glance I can't find anything peculiar though
01:31 < skelterjohn> zzing: it just means there is a bug somewhere, either
in our understanding of how this is supposed to be put together or in one of the
tools provided
01:31 < skelterjohn> just have to find that bug
01:32 < zzing> Do you guys know of any languages that have some of the
features of go that I might be able to use as a stop gap?
01:32 < str1ngs> think there is place in califonia called Ontario
01:32 < exch> I am seeing a /lot/ of ENOENT responses when loading shared
libs.  Not sure if that is indicative of anything though
01:32 < str1ngs> zzing: well what do you need to do exactly ?
01:33 < zzing> str1ngs: I want to do some opengl experimentation that
involves threading and animation.  Nothing big, but I want a natively compiled
language that has some typesafety.
01:34 < exch> http://pastie.org/1587753 <- strace output
01:34 < str1ngs> oh noes it links to linux-gate.so.1 wtf ? :P
01:34 < str1ngs> zzing: C?
01:34 < zzing> str1ngs: I was hoping for some better built in data
01:34 < exch> Note how any reference to libglfw.so fails
01:35 < zzing> I don't care for C++ either :p
01:35 < zzing> No such file eh?
01:36 < exch> its looking in bizar places
01:37 < zzing> I actually like Haskell for these features, but it is a
little 'weird'
01:37 < zzing> I was considering vala :p
01:38 < skelterjohn> what is glfw for?
01:38 < skelterjohn> i can guess what the "gl" stands for
01:38 < skelterjohn> but what about fw
01:38 < zzing> "GLFW is a free, Open Source, multi-platform library for
creating OpenGL contexts and managing input, including keyboard, mouse, joystick
and time.  It is intended to be simple to integrate into existing applications and
does not lay claim to the main loop."
01:38 < zzing> i.e.  it is a modern glut
01:38 < skelterjohn> right
01:38 < skelterjohn> i was about to say something like that
01:39 < zzing> It is more focused than SDL
01:39 < skelterjohn> but what is "fw" for
01:39 < zzing> no clue
01:39 < skelterjohn> :)
01:39 < zzing> Hell SDL fails to even run on my mac - the examples dump core
01:40 < zzing> skelterjohn: lets call it 'openGL For the Win' for fun :p
01:40 < exch> why is it looking for the .so in $GOROOT/pkg/ ? O_o
01:40 < exch> or is that the stuf that cgo is supposed to create?
01:40 < exch> *stub
01:40 < zzing> Does cgo generate .a or .so on linux?
01:40 < exch> .so
01:41 < exch> for go packages .a
01:41 < exch> but for linked C libs it creates a stub .so
01:41 < exch> in this case it doesn't though
01:42 -!- tarrant [~tarrant@]
has joined #go-nuts
01:44 < exch> meh.  it doesnt generate the .so for my vlc bindings either.
That behaviour must have changed then
01:45 < exch> I am pretty friggin confused right now
01:45 < zzing> hmm Go is just above RPG :p
01:45 < zzing> on this:
01:45 < exch> it was 14 or 15 at some point
01:45 < exch> then down to 19
01:45 < exch> so it's improving again :p
01:46 < exch> or not
01:46 < exch> considering the down arrows
01:46 < exch> I am both shocked and horrified that java is #1
01:48 < zzing> There was a guy at my college that thought that RPG was the
future of internet development.  He was a professor who wrote a few RPG books and
we suspected was in the pay of IBM.
01:48 < exch> hehe maybe he just liked it :)
01:49 < zzing> I saw some of the code those poor losers had to write in his
01:50 < exch> o ive seen that before
01:50 < exch> it's ...  different
01:50 < zzing> ...
01:52 < exch> beautiful
01:52 * zzing stabs eyes with spork
01:52 < exch> hehe
01:53 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has left
#go-nuts []
01:56 < exch> im not totally averse to obscure languages, but that one takes
the cake
01:56 < zzing> exch: Well Go is somewhat of a novelty itself.
01:58 < exch> in some aspects it's a little strange, but for the most part
it's still very recognizable I think
01:59 < exch> https://gist.github.com/836568 something like this I like a
01:59 < str1ngs> zzing: whats strange is it doent segfault in gdb
01:59 < exch> that's a subset of postscript, which itself borrows a lot from
01:59 < zzing> heh
01:59 < str1ngs> zzing: gdb ./8.out
01:59 < zzing> look into factor :p
02:00 < exch> gdb gives me "warning: Loadable segment ".interp" outside of
ELF segments"
02:00 < str1ngs> what happens when you run
02:00 < zzing> str1ngs: I hope my post gets somebody's attention in the
castle :p
02:00 < zzing> It should be interesting
02:01 < str1ngs> Starting program: /home/strings/src/glfw-go/glfw/8.out GLFW
Version 2.7 0
02:01 < str1ngs> which is exactly what it should output
02:04 < exch> what's your platform?
02:04 < str1ngs> linux
02:04 < str1ngs> 386
02:04 < exch> hmm
02:04 < str1ngs> it will segfault if I run it ./8.out
02:04 < str1ngs> but not in gdb
02:06 < exch> it doesnt run in gdb.  Just shows this and sits there
02:06 < str1ngs> and when you type run?
02:06 < exch> hey, starting program ..  PASS ...  Program exited normally
02:07 < exch> strange
02:07 < str1ngs> yep
02:07 < str1ngs> doesnt segfault
02:07 < exch> indeed
02:07 < str1ngs> exch: what distro are you using?
02:08 < exch> arch linux (64b)
02:08 < str1ngs> ah same archlinux
02:08 < str1ngs> I'm going to make a ubuntu vm
02:08 < str1ngs> I get the feeling this is archlinux related
02:08 < str1ngs> which means zzing problem is mac related
02:09 < zzing> heh what isn't :p
02:16 < exch> "GLFW is designed to be as portable as possible, and the code
has been written with portability in mind.  That being said, the code is not yet
64-bit clean." This might explain some of the issues I am having
02:18 < zzing> exch: quite right
02:19 < skelterjohn> maybe that's part of the proble
02:20 < yebyen> skelterjohn: hey, thanks for go-gb
02:20 < skelterjohn> glad someone is using it
02:20 < skelterjohn> serves my egomaniacal tendencies
02:20 < skelterjohn> and the never-ending quest for programmer immortality
02:20 < yebyen> it is perfect for me
02:21 < skelterjohn> i'm blushing
02:21 < yebyen> i want to introduce people to go
02:21 < skelterjohn> not really
02:21 < skelterjohn> great
02:21 < skelterjohn> most of the people in my lab are pretty language-stodgy
02:21 < skelterjohn> and stick to java, python or matlab
02:21 < yebyen> and it's really helpful that this tool resolves folders into
packages or commands
02:22 < skelterjohn> i feel like this is an informercial
02:22 < mjrosenb> does go have anything like tagged unions?
02:22 < yebyen> i made a folder called toys
02:22 < skelterjohn> yebyen, how much would you be willing to pay for a
build tool like this?
02:22 < skelterjohn> mjrosenb: no, but people think about it
02:22 < yebyen> skelterjohn: now that i have one already?
02:22 < str1ngs> zzing: ah ha works in ubuntu
02:22 < zzing> That is what my friend was running
02:22 < str1ngs> exch: are you using nvidia?
02:22 * exch would be a very happy camper if Go got unions
02:22 < exch> str1ngs: yes
02:23 < skelterjohn> yebyen: you're supposed to say something like, 49.99
02:23 < skelterjohn> and then i say "you're in luck!  it's open source!"
02:23 < str1ngs> exch: ah I think its a libgl issue then
02:23 < yebyen> skelterjohn: haha oh :)
02:23 < str1ngs> exch: I bet if I use libgl it works
02:23 < yebyen> i'll remember that for the next tape
02:23 < skelterjohn> good
02:24 < yebyen> i would probably pay 50.25BTC or 10.30BTC
02:24 < yebyen> thats what i'm accustomed to paying for software these days
02:24 < skelterjohn> what's a BTC
02:24 < mjrosenb> yebyen: BTC?
02:24 < yebyen> bitcoin
02:24 < skelterjohn> what's a bitcoin
02:25 < yebyen> the cryptocurrency :D
02:25 < skelterjohn> what's a cryptocurrency
02:25 < yebyen> they make up these crypto blocks that show a transaction
02:25 < yebyen> to account for all of the money in the world
02:25 < str1ngs> exch: yep not segfault with libgl
02:25 < exch> mm interesting
02:25 < yebyen> and a fixed (really, a slowing rate, over a long time) rate
of inflation
02:25 < exch> How did yuo solve that?
02:25 < exch> *you
02:26 < str1ngs> removed nvidia and installed libgl
02:26 < exch> k
02:26 < str1ngs> nvidia provides its on libgl implimentation
02:26 < str1ngs> own*
02:26 < yebyen> and then they compete (all of the bitcoin network) to see
who can make the most from the inflation
02:26 < yebyen> based on cpu power
02:26 < yebyen> mhash/s
02:26 < str1ngs> zzing: ok so its definate mac only
02:26 < yebyen> and they trade them at mtgox.com
02:26 < str1ngs> zzing: I'll switch to mac now
02:26 < yebyen> i have almost 100
02:27 < zzing> str1ngs: nice to know it has been isolated a little more
02:27 < str1ngs> zzing: switch to mac?
02:27 < str1ngs> zzing: err linux lol
02:27 < zzing> So it was a linux library fault?
02:28 < str1ngs> zzing: nvidia
02:28 < skelterjohn> yebyen: I have no idea what you're talking about, but
it sounds great.
02:28 < yebyen> skelterjohn: bitcoin.org
02:28 < yebyen> skelterjohn: think of it this way, since it's open source,
you can actually fork the network
02:28 < yebyen> and start your own incompatible currency from the genesis
02:29 < skelterjohn> still no idea
02:29 < skelterjohn> but that's ok
02:29 < yebyen> where the first person to discover any money gets 50, and
then roughly every 10 minutes another 50 pops out
02:29 < yebyen> ...  somewhere
02:29 < yebyen> and it prevents double spending
02:29 < skelterjohn> i'll bet it does.
02:30 < yebyen> it would be much better to just make a website that says
"zomg you found 50!"
02:30 < yebyen> imho
02:30 < yebyen> but people really trade these
02:30 -!- napsy [~luka@] has quit [Quit: Lost terminal]
02:31 < exch> we get plenty of banners like that already
02:31 < yebyen> not another winrar :D
02:31 < exch> ^^
02:33 -!- cbeck1 [cbeck@gateway/shell/pdx.edu/x-fjsedsigtfewfkhu] has joined
02:33 -!- cbeck [cbeck@gateway/shell/pdx.edu/x-gpvocrtvmweeafrh] has quit [Read
error: Connection reset by peer]
02:34 < yebyen> i was going to use bitcoin in my craps game
02:34 < yebyen> but then i never actually made a craps game
02:36 < exch> speaking of games, I should continue work on my IRC poker game
:o been ages
02:43 < exch> I've been reading a few pages on that bitcoin site, but I
still have no clue what it is supposed to be for
02:43 < yebyen> it should be obvious :)
02:43 < exch> other than seemingly boundless exchange of data between
arbitrary peers
02:44 < yebyen> what if paypal actually stored the money on your computer
02:44 < yebyen> in your home directory
02:44 < exch> I would be very worried
02:44 < yebyen> that is bitcoin
02:44 < yebyen> you should protect your home directory :)
02:44 < yebyen> at least somewhere
02:44 < exch> If a single bank loses my cash, I know who to sue
02:44 < yebyen> i have an ssh remote that i consider pretty well protected
02:44 < exch> if a billion anynomous individuals have my cash, that is
02:45 < yebyen> but they don't have your cash unless you spent it :)
02:45 < exch> why then the sharing?
02:45 < yebyen> you have cryptographic keys, don't you trust crypto?
02:45 < yebyen> the sharing is of the transaction record
02:45 < yebyen> to prevent double spending
02:46 < exch> cryptographic keys are only as strong as the inverse
proportion of alcohol in my blood.  eg: subject to boundless social engineering
schemes :)
02:46 < yebyen> if you acquired 100 and spent 50, how much can you spend
now?  well, if you spent it offline and he hasn't published the transaction, and
neither have you, then probably 100...
02:47 < yebyen> so they share the transaction record, and there is a reward
for the nodes that do a good job at indexing the unknowns that are left around in
02:48 < yebyen> i am so glad to be almost rid of this allergy/cold
02:48 < yebyen> gobs of snot for days
02:48 < exch> eew
02:50 < yebyen> breathing with my nose again!
02:50 < yebyen> yay
02:58 < exch> righty.  ubuntu in VM compiles and runs the program without
any issues
03:10 < str1ngs> anyone have cgo cmd Makefile I can use as reference I can
only fine pkg ones
03:11 < skelterjohn> i think the idea is you make a cgo pkg and import it
03:12 < str1ngs> ok so there is no way to use the C package in a main?
03:12 < str1ngs> I was thinking thats what Makefile.ccmd was for
03:12 < skelterjohn> i don't know
03:12 < skelterjohn> did you try just adding a CGOFILES=...  var in the
03:12 < skelterjohn> if that doesn't work, then i'd guess it's not supposed
03:13 < str1ngs> I did yes
03:13 < yebyen> does anyone use go-dbi?
03:13 -!- nettok [~quassel@] has joined #go-nuts
03:14 < yebyen> or gosqlite
03:14 -!- JusticeFries [~JusticeFr@c-24-9-171-36.hsd1.co.comcast.net] has quit
[Quit: JusticeFries]
03:16 < exch> I've used gosqlite
03:18 < yebyen> did you use goinstall to get it?
03:19 < exch> nope
03:19 < yebyen> i noticed something odd when i did it, i had to build from
within the source directory or it didn't find the headers
03:19 < yebyen> actually it didn't resolve the library reference
03:19 < yebyen> using gb -g
03:19 < exch> goinstall didnt support CGO projects when I used it
03:19 < yebyen> that could be the problem
03:19 < exch> I also made some changes to the source, so I imported it's
source into my project
03:27 < yebyen> that's neat
03:27 < yebyen> i just use go-dbi
03:27 < yebyen> which is pretty simplistic
03:27 < yebyen> i guess dbi layers usually expose the sql code to you
03:28 < yebyen> i haven't got around to see if it has parameterizd queries
03:29 < yebyen> i guess go-dbi is pretty new!
03:29 < yebyen> 12/10
03:36 < yebyen> supposed to have support for prepared statements, i guess
it's reasonably complete
03:36 < yebyen> i guess parameterized queries are a no brainer then, since
03:36 < yebyen> i mean, Query(params ...interface{})
03:37 < tarrant> Anyway to send signals from go?
03:49 < mjrosenb> can i print arbitrary structures with printf() if they
have String defined (and if so, what specifier do I need to use?)
03:49 < yebyen> it's not %s?
03:50 < yebyen> i'm assuming you tried that...
03:50 < tarrant> mjrosenb: I believe it is %v
03:52 < mjrosenb> yebyen: don't know.  i still many lines of code away from
being able to test.
03:55 < tarrant> mjrosenb: Just tested its %v
03:55 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has quit [Ping timeout: 240 seconds]
03:56 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has joined #go-nuts
04:02 < mjrosenb> tarrant: awesome.
04:02 < tarrant> :w
04:03 < tarrant> I've mostly adjusted to not having focus follows mouse on a
mac but sometimes when I'm not paying attention it just catches me by surprise.
04:05 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has quit [Ping
timeout: 240 seconds]
04:06 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has joined #go-nuts
04:07 < mjrosenb> perhaps i was wrong to attempt to use interfaces here.
04:08 < mjrosenb> i have an interface for expressions, and a "member"
function derivative, which returns an expression
04:08 < mjrosenb> how can I ever implement this?
04:09 < plexdev> http://is.gd/ALOheL by [Nigel Tao] in go/ -- A+C: Mikael
Tillenius (individual CLA)
04:12 < mjrosenb> unless all of these things want to be *Expr
04:14 -!- tensai_cirno [~cirno@] has quit [Read error: Operation
timed out]
04:15 < exch> str1ngs: exchanging nvidias libgl with the standard one should
not be the primary fix tbh.  The C examples of libgl run fine on the nvidia
04:15 < exch> *C examples of glfw
04:19 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
04:20 -!- Arafangion [~arafangio@60-241-250-19.static.tpgi.com.au] has quit [Ping
timeout: 272 seconds]
04:21 -!- gits [~gits@] has joined #go-nuts
04:21 -!- Arafangion [~arafangio@60-241-250-19.static.tpgi.com.au] has joined
04:23 -!- nettok [~quassel@] has quit [Ping timeout: 250 seconds]
04:29 -!- gits [~gits@] has quit [Ping timeout: 240 seconds]
04:32 < mjrosenb> in effective go, it says that a constructor should return
an interface rather than the implementing type.  how exactly do you do this?
04:33 < mjrosenb> ok, never mind then
04:43 < yebyen> mjrosenb: never mind, or you still want to know?
04:43 < yebyen> i remember when my professor made us do that
04:45 < yebyen> the point is to get the interface together in the first
04:45 < yebyen> your type might have methods() and Methods() (private and
exported methods)
04:46 < yebyen> but the interface certainly will not have any private
04:46 < str1ngs> exch: what WM do you use?
04:47 < str1ngs> exch: nvidia has its own implimentation of libgl as far as
I know.  my WM question was not related to libgl btw
04:50 < yebyen> mjrosenb: i'm guessing you just kept reading and figured it
04:52 < yebyen> that chapter of effective go looks pretty good...
04:52 < str1ngs> tarrant: you can set focus to follow Terminal and X windows
04:52 < str1ngs> other then that its pita
04:53 < str1ngs> yebyen: its better reading then the tutorial I think
04:53 < yebyen> the tutorial is definitely a tutorial
04:53 < yebyen> i would not give effective go to a freshman computer
scientist unless i had already checked him for smarts and they were there
04:55 < mjrosenb> yebyen: nope, i kept typing random things into emacs until
6g stopped complaining.
04:55 < str1ngs> well I do think there is a certain amount of assumption
that you are coming from some other language to Go
04:56 < mjrosenb> yebyen: so i had some concepts (and code) left over from
earlier experiments, where it gave me an error message whenever the return type of
a function was different from the value being returned.
04:57 < mjrosenb> afaict, there isn't a whole lote that says when two types
can be different, and when they *need* to be the same.
04:57 < yebyen> the keywords i think you mean are type compatibility and
type identity
04:58 < yebyen> and there's a third one that is in between
05:02 < mjrosenb> probably.  i don't remember seeing either of those
05:02 < mjrosenb> actuall
05:02 < mjrosenb> no, i remember seeing "type identity"
05:08 < yebyen> well, if your type implements the interface that you
05:09 < yebyen> and the constructor is stated to return the interface type
05:10 < yebyen> you should be able to return instances of the type, even
though the type has a different name
05:10 < yebyen> i'm not sure if that's identity or compatibility, i think
that is the third one
05:10 < yebyen> different name and identity
05:11 < yebyen> and potentially incompatible as well?  i think so
05:13 < yebyen> is there a good go search engine?
05:14 < yebyen> or good go index
05:14 < yebyen> it's pretty impossible to search for the word "go" and some
other keywords :)
05:14 < yebyen> not like looking for erlang information
05:15 < tarrant> I tend to use golang as a search term.  It seems to mostly
05:20 < Xenith> Genius.  Because "google go" is useless.  :)
05:21 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has joined #go-nuts
05:21 < Archwyrm> There is also this: http://go-lang.cat-v.org/go-search
05:22 < yebyen> and we have a winner!
05:22 < Archwyrm> :)
05:24 < yebyen> it doesn't even mention my professor's course in University
05:25 < yebyen> :(
05:26 < yebyen> http://www.cs.rit.edu/~ats/go-2009-3/index.xml
05:27 < yebyen> it does have plenty of good links though
05:28 < zozoR> go search engine tells me that somebody called one of their
files for penis.go
05:28 < Archwyrm> yebyen: uriel maintains the site, so perhaps he will see
this and add it.
05:30 < zozoR> yebyen, your professor doesnt code idiomatic go
05:32 < yebyen> zozoR: what's wrong?
05:33 < yebyen> i think it's possible he didn't figure out stuff like
composite literals from day 1
05:33 < yebyen> and the notes were certainly done before 50% mark in the
05:35 < fzzbt> zozoR: why did you search for penis, lol
05:36 < str1ngs> yes why!
05:37 < zozoR> func (this *Monitor) something() {
05:38 < zozoR> you dont use this as an identifier in go : | you use one
05:38 < zozoR> because i need more penis go
05:38 < zozoR> :D
05:38 -!- tensai_cirno [~cirno@] has joined #go-nuts
05:38 < Archwyrm> zozoR: I'd say that is entirely up to personal preference.
05:39 < yebyen> if that's all
05:39 < zozoR> true that
05:40 < yebyen> i think he did a pretty good job
05:40 < yebyen> granted i took the class, instead of reading the notes
05:41 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has quit [Remote host closed the connection]
05:42 -!- fabled [~fabled@mail.fi.jw.org] has joined #go-nuts
05:43 -!- alkavan_ [~alkavan@] has quit [Quit: Leaving]
05:59 -!- viirya [~viirya@cml506-25.csie.ntu.edu.tw] has joined #go-nuts
06:16 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
06:21 -!- gits [~gits@] has joined #go-nuts
06:21 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has quit [Remote host closed
the connection]
06:22 -!- adu [~ajr@softbank220043138128.bbtec.net] has joined #go-nuts
06:22 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
06:26 -!- tarrant [~tarrant@]
has quit [Remote host closed the connection]
06:27 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
06:43 -!- cbeck1 [cbeck@gateway/shell/pdx.edu/x-fjsedsigtfewfkhu] has quit [Read
error: Operation timed out]
06:44 -!- gits [~gits@] has quit [Ping timeout: 240 seconds]
06:47 -!- ExtraSpice [XtraSpice@78-62-101-194.static.zebra.lt] has joined #go-nuts
06:50 -!- tensai_cirno [~cirno@] has quit [Ping timeout: 250 seconds]
07:00 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
07:21 -!- photron [~photron@port-92-201-229-114.dynamic.qsc.de] has joined
07:29 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
07:30 -!- chressie [~chressie@dreggn.in-ulm.de] has quit [Quit: WeeChat 0.3.4]
07:33 -!- chressie [~chressie@dreggn.in-ulm.de] has joined #go-nuts
07:33 -!- tvw [~tv@e176007195.adsl.alicedsl.de] has joined #go-nuts
07:54 -!- tvw [~tv@e176007195.adsl.alicedsl.de] has quit [Remote host closed the
07:56 -!- XenoPhoenix [~Xeno@cpc13-aztw24-2-0-cust23.aztw.cable.virginmedia.com]
has quit [Ping timeout: 276 seconds]
08:01 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
08:03 -!- skejoe [~skejoe@] has joined #go-nuts
08:08 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts
08:08 -!- XenoPhoenix [~Xeno@cpc13-aztw24-2-0-cust23.aztw.cable.virginmedia.com]
has joined #go-nuts
08:20 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has joined #go-nuts
08:23 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has quit
[Quit: Ex-Chat]
08:24 -!- photron [~photron@port-92-201-229-114.dynamic.qsc.de] has quit [Read
error: Operation timed out]
08:30 -!- cde [~cde@unaffiliated/cde] has left #go-nuts []
08:33 -!- tensorpudding [~user@] has quit [Remote host closed the
08:39 -!- foocraft [~dsc@] has joined #go-nuts
08:45 -!- cbeck1 [cbeck@gateway/shell/pdx.edu/x-beubtpwfhqgkrvhq] has joined
08:53 -!- tvw [~tv@e176007195.adsl.alicedsl.de] has joined #go-nuts
08:56 -!- Eko [~eko@c-24-5-127-87.hsd1.ca.comcast.net] has joined #go-nuts
09:00 -!- Stiletto [7f000001@] has quit [Ping timeout: 246 seconds]
09:02 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has quit [Ping timeout:
612 seconds]
09:02 -!- Stiletto [7f000001@] has joined #go-nuts
09:04 -!- skejoe [~skejoe@] has quit [Quit: Lost terminal]
09:14 -!- visof [~visof@] has joined #go-nuts
09:14 -!- visof [~visof@] has quit [Changing host]
09:14 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
09:23 -!- wrtp [~rog@] has joined #go-nuts
09:45 -!- cenuij [~cenuij@base/student/cenuij] has quit [Remote host closed the
09:46 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping
timeout: 276 seconds]
09:52 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #go-nuts
10:03 -!- leczb_ [~leczb@nat/google/x-aargvcbtefpauoxt] has quit [Remote host
closed the connection]
10:06 -!- leczb [~leczb@nat/google/x-bwsslrtpdmfvrkyv] has joined #go-nuts
10:10 -!- rlab [~Miranda@] has joined #go-nuts
10:26 -!- lmoura [~lauromour@] has joined #go-nuts
10:28 -!- napsy [~luka@] has joined #go-nuts
10:29 -!- saturnfive [~saturnfiv@] has quit [Read error: Connection
reset by peer]
10:31 -!- rlab [~Miranda@] has quit [Ping timeout: 276 seconds]
10:36 -!- shvntr [~shvntr@] has joined #go-nuts
10:44 -!- artefon [~thiago@] has joined #go-nuts
10:44 -!- rlab [~Miranda@] has joined #go-nuts
11:04 -!- wtfness [~dsc@] has joined #go-nuts
11:09 -!- andman [~andman@antiflash.org] has joined #go-nuts
11:11 -!- boscop [~boscop@g230105170.adsl.alicedsl.de] has joined #go-nuts
11:12 -!- XenoPhoenix [~Xeno@cpc13-aztw24-2-0-cust23.aztw.cable.virginmedia.com]
has quit [Ping timeout: 276 seconds]
11:15 -!- XenoPhoenix [~Xeno@cpc13-aztw24-2-0-cust23.aztw.cable.virginmedia.com]
has joined #go-nuts
11:23 -!- saturnfive [~saturnfiv@] has joined #go-nuts
11:30 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: Quit]
11:33 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has joined
11:42 -!- saturnfive [~saturnfiv@] has left #go-nuts []
11:43 -!- skejoe [~skejoe@] has joined #go-nuts
11:54 < exch> str1ngs: I use openbox
11:56 < str1ngs> exch: ah I use dwm.  but I started writing one in go
12:06 -!- ziyu_huang [~ziyuhuang@220-133-3-82.HINET-IP.hinet.net] has joined
12:08 -!- ziyu_huang [~ziyuhuang@220-133-3-82.HINET-IP.hinet.net] has quit [Client
12:08 -!- ziyu_huang [~ziyuhuang@220-133-3-82.HINET-IP.hinet.net] has joined
12:15 -!- perdix [~mkhl@sxemacs/devel/perdix] has joined #go-nuts
12:15 -!- vinisterx [~ryan@74-129-201-27.dhcp.insightbb.com] has joined #go-nuts
12:19 -!- ziyu_huang [~ziyuhuang@220-133-3-82.HINET-IP.hinet.net] has quit [Quit:
Colloquy for iPod touch - http://colloquy.mobi]
12:25 -!- deltaphc [delta@cpe-76-173-127-142.socal.res.rr.com] has joined #go-nuts
12:35 < wrtp> oh, that sinking feeling when you discover that the source to
a library you want to port is written in C++.
12:36 < KBme> heh
12:36 < KBme> that sucks
12:38 < wrtp> "where is that *!$#ing name defined?!"
12:39 < Arafangion> Oh, that's nothing.
12:39 < Arafangion> What's that sinking feeling when you discover that the
program you need to do some work in, has the GUI entirely written up in *code*, by
someone who has no freaking clue how the layout managers work?
12:39 < wrtp> i know that's just the start, but i rarely get beyond that bit
12:40 * wrtp has never used a "layout manager" :-)
12:40 < Arafangion> wrtp: Good, I hope that means you don't use one anyway,
then redefine how things should be placed on the screen for good measure.
12:41 < wrtp> in fact i probably have used one, if that what you'd call the
tk packing algorithm
12:41 < wrtp> s/that what/that's what/
12:41 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has quit [Ping
timeout: 246 seconds]
12:42 < Arafangion> wrtp: Essentially, the more I learn about how this
particular GUI works, the more I am flumboloxed at how the heck the program
managers to work at all!  (And no, it's not maintainable).
12:42 * Arafangion stops ranting.
12:43 < Arafangion> wrtp: Carry on.  :) You were saying that C++ syntax is
12:43 < Arafangion> wrtp: At least it already is gruesome.  :)
12:45 < wrtp> i just dislike the way that you can't tell what function is
being called without knowing the types of its arguments.  and that's an additional
level of stuff to get wrong.
12:45 < wrtp> i should probably load it up in some IDE or other
12:45 -!- davvid [~davvid@208-106-56-2.static.dsltransport.net] has quit [Ping
timeout: 240 seconds]
12:46 < Arafangion> That's not even unique to C++.  Even C# has the same,
and that's regarded as a decent language, as far as most modern languages are
12:46 < wrtp> yeah, i know, and java too
12:47 -!- niekie [quasselcor@CAcert/Assurer/niekie] has quit [Ping timeout: 240
12:47 < wrtp> also unqualified instance variables
12:47 * Arafangion /hates/ java.
12:47 < Arafangion> Unqualified?
12:48 < Arafangion> Sorry, what's an unqualified instance variable?
12:49 < wrtp> when you use an instance variable, say v, without using e.g.
12:49 < wrtp> so you can't know whether it's an instance variable or a
global variable
12:49 -!- niemeyer [~niemeyer@189-10-154-99.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
12:49 < Arafangion> Ahh, I get you.  Funny people say the opposite in
python...  I usually tend to use the unqualified form, but I *am* starting to
think that qualified forms are better, but seriously, those aren't the worst parts
of C++.
12:50 < Arafangion> C++'s namespaces are *nasty&
12:50 < Arafangion> *nasty*, that is.
12:50 * Arafangion wonders if he's mentioned that namespaces are nasty?
12:50 < wrtp> i don't know about C++ namespaces.  what's their worst aspect?
12:50 -!- Fish [~Fish@exo3753.pck.nerim.net] has quit [Quit: So Long, and Thanks
for All the Fish]
12:51 < Arafangion> wrtp: Well, if you bring a namespace into the global
space.  (ie, the 'using' statement), then EVERYTHING in that namespace can be
12:51 < Arafangion> By anything that you call that requires an implied
element from its namespace.
12:51 < wrtp> s/By/But/ ?
12:52 < Arafangion> ie, if you call something that's templated, and it uses
other templates that are normally in the global namespace...
12:52 < Arafangion> Your using statement just potentially overloaded those.
12:52 < Arafangion> So it may expand out to something different.
12:52 < wrtp> oh i see
12:52 < wrtp> i guess the only solution to that is never to use the global
12:54 < Arafangion> That's like saying "Never use new and delete".
12:54 < Arafangion> Although they should certainly be avoided.
12:54 < Arafangion> (::new and ::delete are global)
12:54 -!- Fish [~Fish@exo3753.pck.nerim.net] has joined #go-nuts
12:55 < jumzi> Global variables are the evil that spawned satan himself
12:55 < Arafangion> Ha, no, these aren't mere variables.
12:55 < Arafangion> These are *functions*.
12:55 < Arafangion> Types, even.
12:57 < wrtp> jumzi: i don't agree.  global variables are ok when they sit
in a limited namespace
12:58 -!- adu [~ajr@softbank220043138128.bbtec.net] has quit [Ping timeout: 250
12:58 < Arafangion> No, global variables are evil, they have no advantage
12:58 < Arafangion> Infact, the only time I might ever use a global is to
provide a path to the configuration file.
12:59 < Arafangion> (And even that's iffy)
12:59 < jumzi> Ah shee
12:59 * jumzi goes into serious mode to sort things out
12:59 -!- youngsterxyf [~xyf@] has joined #go-nuts
12:59 < wrtp> well you'd better get away from Go then...  it uses global
variables a lot!
12:59 < Arafangion> Actually, come to think of it, I do use more globals on
windows...  But that's because it's windows.
13:00 < jumzi> I have no problems with global variables, its abit crazy how
ppl shun them as they shun goto:s
13:00 < jumzi> But as with everything, a good measure is needed
13:00 < Arafangion> I don't /ban/ them, I just don't think they're as useful
as people often think they are.
13:00 < wrtp> oh, so you didn't mean what you said before about evil & satan
13:01 < Arafangion> wrtp: They are evil.  :) The alternatives are sometimes
13:01 < aiju> hate of global variables?
13:01 < aiju> hahahaha
13:02 < Arafangion> Singletones too.  They're the same thing!
13:02 < aiju> random hate of global variables is a great way to
overcomplicate programs
13:02 < wrtp> i liked limbo, where you had global variables, but because
everything was based around dynamic modules, you could always get more instances
if you wanted
13:02 < Arafangion> wrtp: That's not so bad.
13:02 < wrtp> so the global variables weren't really global, they just felt
that way
13:02 < Arafangion> Python's use of modules also made globals manageable.
13:02 -!- niekie [~niek@CAcert/Assurer/niekie] has joined #go-nuts
13:02 < Arafangion> But I dislike C#'s globals.
13:03 < wrtp> globals are useful for caching
13:03 < jumzi> Well every executable has it own namespace in C for example
13:03 < aiju> globals are useful for many things
13:03 < aiju> after all there is one huge global variable
13:03 < aiju> it's called "the universe"
13:03 < Arafangion> I'm not big enough for the universe, though.
13:03 < aiju> l
13:04 < Arafangion> I think for small programs, they often make sense.
13:04 < wrtp> aiju: the universe is shared state.  global variables are a
shared naming scheme.  the two are different.
13:04 < Arafangion> But for large programs, they get annoying.
13:04 < aiju> so this is about namespace pollution?
13:04 < Arafangion> When I usually see a global, I tend to prefer passing a
reference to the common state.
13:04 < jumzi> Arafangion: Large programs are annoying tbh
13:05 < wrtp> you can have shared state without a global naming scheme
13:05 < wrtp> aiju: absolutely
13:05 < aiju> hahaha exactly jumzi
13:05 < Arafangion> jumzi: Well, there's that.  :)
13:05 < aiju> Only *YOU* can prevent NAMESPACE POLLUTION.
13:05 < aiju> SEALS WILL DIE.
13:05 < aiju> Act now, before it's too late.
13:05 < jumzi> I collect the money
13:05 < Arafangion> Aaaaand G'night all.
13:07 < wrtp> in the go libraries, global variables are usually used for
caching, shared resource management, or constant data
13:08 < wrtp> sometimes also for convenience, e.g.  http.DefaultServeMux
13:08 < wrtp> all those seem like reasonable uses to me
13:10 < Arafangion> I must admit those are reasonable, indeed.
13:13 < skelterjohn> mornin
13:13 < skelterjohn> g
13:13 < aiju> it's annoying that Go lacks constant data
13:13 < aiju> for e.g.  lookup tables
13:15 * skelterjohn curses the snow
13:15 < skelterjohn> it was 60 degrees here two days ago, now it's snowing
13:17 < KBme> mmmmm snow
13:22 < wrtp> skelterjohn: where are you?
13:22 < skelterjohn> new jersey
13:27 < nixness> skelterjohn, a bit odd, but why does futurama and a bunch
of other shows mock new jersey?
13:27 < skelterjohn> because futurama is set in new york
13:27 < skelterjohn> and new yorkers hate new jersey
13:27 < nixness> "this is so cheap, and beautiful, what's the down side?"
"well...technically you're in new jersey" "that's it, we're not moving in"
13:27 -!- youngsterxyf [~xyf@] has left #go-nuts []
13:28 < KBme> south park also just had a show about new jerseyites
13:28 < KBme> pretty damned hilarious
13:28 < skelterjohn> :\
13:28 < jumzi> New jersey is pretty terrible
13:28 < skelterjohn> fyi the people on "jersey shore" are one and all not
from jersey
13:28 < skelterjohn> jumzi: gfy.
13:29 < KBme> heh
13:29 < uriel> in any case, most people at Bell Labs were...  canadians!
13:29 < nixness> skelterjohn, I was asking; I have nothing agains nj people
13:29 < nixness> uriel, hahaha okay :D
13:30 < skelterjohn> well, at least the people who worked at bell labs lived
in jersey at the time, for the most part
13:30 < nixness> uriel, I think Bell labs single-handedly started a lof of
the current hacker culture
13:31 < skelterjohn> stallman?  we have to get our unwashed/smelly/hairy
stereotype from somewhere
13:31 < nixness> yeah, he came in and put all that in the mix
13:31 < nixness> kinda like chemical X and the power puff girls
13:32 < skelterjohn> i'll take your word for it
13:32 < nixness> Go for it!
13:38 -!- deltaphc [delta@cpe-76-173-127-142.socal.res.rr.com] has quit []
13:38 < uriel> nixness: I doubt it, the Bell Labs culture was very different
from any current culture
13:39 < uriel> (except perhaps some would argue, what is left of the Plan 9
'community', but I should n't talk bout this, I'm too biased)
13:40 < uriel> perhaps Go is the only inheritor of any parts of the Bell
Labs culture...
13:44 -!- virtualsue [~chatzilla@nat/cisco/x-xpjklqkttqnacfpp] has joined #go-nuts
13:46 < Arafangion> I don't know where windows fits in, these days.
13:53 < KBme> what fits in windows no?
13:53 < KBme> aww what a horrible joke :D
13:53 < nixness> KBme, indeed :p
13:55 -!- skejoe [~skejoe@] has quit [Quit: Lost terminal]
13:57 -!- tvw [~tv@e176007195.adsl.alicedsl.de] has quit [Remote host closed the
13:58 < niemeyer> KBme: Nah..  it'd have been a terrible joke if you said..
"They fit in walls.", but we're glad you didn't
13:58 < aiju> hahahaha
13:58 < KBme> i almost did tho :D
14:02 -!- shvntr [~shvntr@] has quit [Ping timeout: 246 seconds]
14:03 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has joined #go-nuts
14:13 -!- adu [~ajr@softbank220043139062.bbtec.net] has joined #go-nuts
14:18 -!- adu [~ajr@softbank220043139062.bbtec.net] has quit [Ping timeout: 276
14:27 -!- imsplitbit [~imsplitbi@] has joined #go-nuts
14:28 -!- coldturnip [~COLDTURNI@118-166-71-243.dynamic.hinet.net] has joined
14:33 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
14:35 -!- visof [~visof@unaffiliated/visof] has quit [Quit: Leaving]
14:38 -!- rbraley [~rbraley@ip72-222-134-229.ph.ph.cox.net] has quit [Read error:
Connection reset by peer]
14:41 -!- femtoo [~femto@95-89-248-54-dynip.superkabel.de] has joined #go-nuts
14:47 -!- jeng [~jeng@] has joined #go-nuts
14:56 -!- artefon [~thiago@] has quit [Quit: bye]
14:57 -!- adu [~ajr@softbank220043139062.bbtec.net] has joined #go-nuts
15:00 -!- jyoshm [~jmissao@unaffiliated/sundial] has joined #go-nuts
15:04 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
15:08 -!- tvw [~tv@] has joined #go-nuts
15:10 -!- aho [~nya@fuld-590c6994.pool.mediaWays.net] has joined #go-nuts
15:12 -!- emjayess [~emjayess@pix1.i29.net] has joined #go-nuts
15:20 < ww> so...  a question about the map implementation.  from
15:20 < ww> gograph.BenchmarkAddEdge 500000 4041 ns/op
15:20 -!- jbooth1 [~jay@] has joined #go-nuts
15:20 < ww> gograph.BenchmarkHasEdge 5000000 522 ns/op
15:20 < ww> gograph.BenchmarkGetEdge 5000000 541 ns/op
15:20 < ww> gograph.BenchmarkDelEdge 100000 240132 ns/op
15:20 < ww> not only is the delete operation (sparse graph of 10^6 nodes)
quite slow
15:21 < ww> but it seems like removing elements from a map doesn't free
space, in fact it seems to grow...
15:22 < ww> is this expected?
15:22 < KBme> you probably should use the map type for this sort of thing
15:22 < KBme> shouldn't*
15:23 < ww> KBme: am beginning to think so...  that will mean writing a
custom hash table...  wanted to see how much mileage i could get out of maps first
15:23 < KBme> ok, sure
15:23 < KBme> how do you delete from the maps?
15:23 < KBme> er, remove an element
15:23 < ww> m[i] = nil, false
15:23 < KBme> hum yeah iirc that's how it's done
15:24 < KBme> ww: but yeah, usually people here will discourage the use of
maps in general i think
15:24 < zozoR> "Maps are extremely powerful, and are implemented in the
language because of that, but we encourage you not to use it : |"
15:24 < zozoR> xD
15:25 < KBme> yeah :)
15:25 < KBme> our maps are not very efficient so please don't use them
15:25 < Namegduf> I wouldn't
15:25 < KBme> tho we'll keep them in the language just to attract users
15:25 < Namegduf> They aren't too bad, really
15:26 < ww> interesting...  coming from a recently mostly python background
i was tempted to use them a lot as the moral equivalent of dict...
15:26 < Namegduf> I wrote my own data structure mostly because I required
iterating subsets
15:26 < Namegduf> Also because lockfree reads are a ridiculous performance
15:26 < KBme> maps are locked?
15:26 < KBme> waat?
15:26 < Namegduf> No, they aren't.
15:26 < Namegduf> You have to lock them yourself.
15:27 < Namegduf> They are not concurrency safe.
15:27 < KBme> yep
15:27 < Namegduf> Implementing my own data structure let me write it so it
was concurrency safe.
15:28 < Namegduf> Similar to the way Russ says strings and slices could be
made so in the discussion of races there.
15:28 < Namegduf> But if I didn't need either of those things I'd use a map.
15:28 < KBme> ah
15:28 < KBme> i see
15:29 < wrtp> ww: your source code link doesn't work for me
15:29 < KBme> Namegduf: russ says?
15:29 < Namegduf> http://research.swtch.com/2010/02/off-to-races.html
15:29 < niemeyer> ww: I have no idea about where that "don't use maps" is
coming from
15:29 < ww> wrtp: oops that should read https://bitbucket.org/ww/gograph/src
15:29 < KBme> ohh
15:29 < niemeyer> ww: Feel free to use maps, please :)
15:29 < KBme> Namegduf: interesting, i didn't see that
15:30 < ww> niemeyer: happily...  but need to understand why the delete
operation is so slow and why the memory footprint of the benchmark program seems
to grow while deleting entries!
15:31 < Namegduf> KBme: Technically I rely on implementation details
15:31 < Namegduf> Worth it, though
15:31 < KBme> ww: that should be normal until the GC kicks in
15:31 < wrtp> ww: how are you determining the memory footprint?
15:31 < niemeyer> ww: Uh..  that sounds pretty awkward/unfamiliar
15:31 < niemeyer> ww: Pointers please?
15:33 < ww> niemeyer: if you clone https://bitbucket.org/ww/gograph and run
the benchmarks
15:33 -!- virtualsue [~chatzilla@nat/cisco/x-xpjklqkttqnacfpp] has quit [Ping
timeout: 240 seconds]
15:33 < ww> wrtp: just with top
15:33 < ww> actually i'm not certain it's growing, but it is definitely not
shrinking as i would expect
15:33 < wrtp> looking at RSS or VM size?
15:33 < ww> RSS
15:33 < ww> (VM size is funny 19G!)
15:34 < wrtp> go maps in a lot of memory space that it never uses
15:34 < niemeyer> ww: A smaller reproducer would be nice
15:35 < niemeyer> ww: Uh..  ok..  "i'm not certain it's growing" starts to
feel more like FUD :-)
15:35 < KBme> heh
15:35 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
15:36 < wrtp> ww: your DelEdge benchmark isn't comparable with your other
15:36 < wrtp> it does 1e6 edge deletions per cycle, not 1
15:36 < ww> niemeyer: i'd be more easily able to be certain if for some
reason gotest -benchmarks didn't swallow log messages / printfs.  the beginning of
the benchmark goes and makes a big graph so it takes a little while, i stop the
timer, but have no way of knowing when the actual benchmarked code starts...
anyhow, i'll try to write a small program to reproduce
15:37 -!- rlab [~Miranda@] has quit [Ping timeout: 250 seconds]
15:37 < wrtp> ww: fmt.Printf will always work
15:37 < wrtp> (or log.Printf)
15:38 -!- rlab [~Miranda@] has joined #go-nuts
15:38 < wrtp> oops, didn't see that break in there
15:39 < niemeyer> ww: If you want to test a property of maps, just isolate
the bits you're testing.  I don't think maps grow when being removed, and Go is a
GCd language, so it will *not* free the memory immediately, and at the moment will
not give it back to the OS either.
15:39 < niemeyer> ww: These are pretty basic properties..  you can test them
in isolation with small snippets.
15:40 < niemeyer> ww: If you find actual bugs, I'll be happy to look at
15:42 < wrtp> ww: but it's still removing more than one node per iteration
15:42 < skelterjohn> checking to see if memory is freed by examining top
doesn't make sense, since (i think) at the moment, go's gc doesn't not send memory
back to the OS
15:43 < niemeyer> skelterjohn: Right
15:46 < ww> skelterjohn: hmmm...  that makes some sense then
15:46 < wrtp> skelterjohn: well ww, was looking at RSS...  which doesn't
make sense either
15:47 < wrtp> because it'll go down even the memory wasn't freed by the GC.
15:47 < ww> wrtp there are two breaks, pretty sure only one delete per
15:47 < wrtp> although maybe it won't
15:47 < wrtp> 'cos the GC will still be traversing the memory
15:47 < wrtp> ww: yes
15:47 < wrtp> i must be blind
15:48 < wrtp> ww: it may be that setting up a range statement is expensive
15:49 < wrtp> so then you'd be paying that price twice as well as the del
15:50 < ww> ok: https://gist.github.com/837246
15:50 < ww> it makes a big map, removes all the entries, then re-adds them
15:50 < ww> so the resident size doesn't appear to go down
15:51 < wrtp> ww: BTW you can always use 1e6 for 1000000 in Go
15:51 < wrtp> it reads better
15:51 < ww> but otoh re-adding them re-uses the same memory (i.e.  it
doesn't increase in the re-add step)
15:51 < ww> wrtp: thanks, good to know
15:51 < wrtp> ww: the RSS won't go down until the OS needs it for something
15:51 < wrtp> it depends on the page replacement policy of the OS
15:52 < niemeyer> wrtp: Why would RSS go down magically?
15:52 < Namegduf> It, er, would go down if Go were free()'ing memory
15:52 < wrtp> niemeyer: because resident set size will change when a process
is paged out
15:52 < niemeyer> wrtp: Yes, but why would it be paged out?
15:52 < wrtp> 'cos another process wants the memory
15:52 < niemeyer> wrtp: If you're sitting on top waiting for it to go out,
it won't happen
15:52 < niemeyer> wrtp: ^
15:53 < ww> *however*
15:53 < wrtp> why not?
15:53 < ww> if i make a new map before the re-add step, m =
15:53 < niemeyer> wrtp: Because the kernel doesn't page things out for
absolutely no reason :-)
15:53 < ww> it goes and starts allocating yet more memory
15:54 < ww> niemeyer: nah.  i' certain malloc() -> RSS bigger, free()
-> RSS smaller
15:54 < wrtp> niemeyer: depends whether all the RSS's fit in RAM...
15:54 < ww> in general...
15:54 < wrtp> ww: i doubt it
15:54 < niemeyer> ww: That's not entirely true, and there's no free() either
in this case
15:54 < Namegduf> Linux seems to do it.
15:54 < niemeyer> ww: The memory is mapped
15:54 < Namegduf> As does Windows.
15:55 < Namegduf> Processes will drop in RAM usage, even if the OS has gigs
more available.
15:55 < Namegduf> Both also use RAM for disk cache, so there are strong
benefits to doing so
15:55 < niemeyer> Namegduf: ECONTEXT
15:55 < niemeyer> Namegduf: The process is not giving memory back to the OS
15:55 < Namegduf> niemeyer: Because it isn't freeing it.
15:55 < Namegduf> The OS never gets told it's free.
15:56 < Namegduf> The discussion of the OS is not related
15:56 < Namegduf> Go does not release memory back to the OS
15:56 < niemeyer> Namegduf: Yes, I said that a while ago..  we're debating
about whether RSS would magically reduce or not
15:56 < Namegduf> And the answer is that it would on Linux and Windows at
least, because they do it for all other programs
15:56 < niemeyer> Namegduf: <niemeyer> ww: If you want to test a
property of maps, just isolate the bits you're testing.  I don't think maps grow
when being removed, and Go is a GCd language, so it will *not* free the memory
immediately, and at the moment will not give it back to the OS either.
15:56 < Namegduf> Whether it's guaranteed or not isn't particularly
15:57 < Namegduf> They *do*
15:57 < ww> what seems odd is that the first map in that gist is not getting
garbage collected and go is allocating more memory to the second map
15:57 < niemeyer> Namegduf: They do what?
15:57 < Namegduf> Reduce RSS when a process frees memory
15:57 < Namegduf> Regardless of the amount spare
15:57 < niemeyer> OMG
15:57 < niemeyer> Namegduf: Nevermind
15:58 < ww> we can agree that RSS increases when a program allocates memory,
15:58 < wrtp> ww: i'm not sure
15:58 < niemeyer> ww: Define "allocate memory" ;-)
15:58 < wrtp> ww: if i do malloc(10000000); i don't know whether rss will
increase if i don't write to any of that memory
15:59 < niemeyer> Right
15:59 < wrtp> it might just be zero-filled on demand
16:00 < ww> niemeyer: calling brk(2) with increasing memory locations, or
16:00 < skelterjohn> pardon me.  what is RSS?
16:01 < wrtp> skelterjohn: "resident set size" - the size of all a process's
pages that are currently resident in RAM
16:01 < wrtp> i.e.  process memory that's not paged out to disk
16:01 < skelterjohn> thanks
16:02 * wrtp can't believe how long it is taking to compile Qt
16:03 < ww> wrtp, niemeyer ok, so let's be pedantic.  absent memory
contention, RSS will increase when a process allocates memory and writes to it.
the "writes to it" may or may not be necessary depending on the vm implementation
in the OS
16:04 < wrtp> agreed
16:04 < niemeyer> ww: That to me would indicate that the mount of space
needed by the program is incrementing, so RSS would be increased
16:04 < ww> so my test program makes a big map -> allocates a bunch of
memory (~660Mb) and writes to it
16:04 < niemeyer> ww: Ok, lots of RSS
16:04 < ww> then it goes and deletes the entries in the map, go does not
unmap this memory, fine.
16:04 < niemeyer> ww: That's correct too
16:05 < ww> then we make a new map, and and put a bunch of stuff in it
16:05 < wrtp> ww: try calling runtime.GC() before making the new map
16:05 < ww> wrtp: aha.  let's try that
16:05 < skelterjohn> how often does the gc get triggered normally?
16:05 < niemeyer> ww: RIght, wrtp anticipated your next point
16:05 < Namegduf> Not sure.
16:05 < wrtp> skelterjohn: it gets called on every syscall, but only
sometimes does it actually do a full collection
16:06 < niemeyer> ww: You don't strictly need it in normal cases, but if
you're freeing and immediately making use of more memory, the GC may have had not
collected the old stuff yet
16:06 < skelterjohn> and runtime.GC() triggers a full collection?
16:06 < Namegduf> It's also called on allocation.
16:06 < wrtp> skelterjohn: yes
16:06 < wrtp> (that's the point of the call)
16:06 < wrtp> yeah, i'm sure it's called elsewhere too
16:06 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Remote host closed the connection]
16:06 -!- tensai_cirno [~cirno@] has joined #go-nuts
16:06 < niemeyer> Namegduf: In some cases..  not on every allocation
16:07 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
16:07 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has joined #go-nuts
16:08 < ww> runtime.GC() after the creation of the seocnd map but before
populating it does not appear to free memory and populating the second map
increases the RSS yet more
16:09 < ww> incidentally, resident size is not only the amount of the
program in RAM, at least on OSX, i just saw it go up to 3+Gb and the host has only
2Gb of RAM so it must include swap
16:09 < niemeyer> ww: You may have reference leaks and/or cyclic relations
16:10 < wrtp> ww: what happens if you assign nil to the first map before
calling runtime.GC() ?
16:10 < niemeyer> ww: Oh, ok..  that gives an entire new perspective to what
"resident" means :-)
16:10 < wrtp> yeah, that's odd
16:10 < Namegduf> Yeah, it is.
16:10 < Namegduf> I thought it was just the resident part, too.
16:10 < Namegduf> Are you sure you're reading it right?
16:11 < wrtp> the mac os man page for ps says that the column gives "real
16:11 < Namegduf> (Sorry, but, had to ask)
16:12 < wrtp> if it's not real memory, and it's not vm size, then what could
it be?  memory that has been used?
16:12 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
16:13 < ww> wrtp: so doing m = nil; runtime.GC() doesn't improve
16:15 < ww> Namegduf: yes, when i saw that, i must have been looking at the
VPRVT column
16:15 -!- artefon [~thiagon@] has joined #go-nuts
16:15 < ww> which makes more sense
16:17 -!- erus_ [50b135f2@gateway/web/freenode/ip.] has joined
16:18 < wrtp> ww: when my Qt compile has finished (probably some time
tomorrow) i'll be able to run your tests...
16:22 < ww> wrtp: heh.  ok...  current version of the test:
16:23 < ww> tries runtime.GC() and runtime.Gosched()in case the GC just
signals another goroutine to start collecting rubbish...
16:24 < ww> going to try re-writing this test using some goroutines
actually...  maybe the GC only actually happens when a routine ends...
16:24 < wrtp> ww: one more thing that just might make a difference if
there's some register leak: do the allocation in different function.
16:24 < wrtp> no, GC() forces a GC right then
16:24 < wrtp> calling runtime.GoSched won't make a difference, i think
16:25 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.]
16:27 -!- femtoo [~femto@95-89-248-54-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
16:28 < erus_> if i want every combination of two cards in a deck
16:28 < erus_> do i have todo a bubble sort without the sort?
16:28 < erus_> sort of thing
16:28 < erus_> *no pun intended*
16:31 < niemeyer> ww: There's a reference somewhere in the stack..  try this
version: http://paste.ubuntu.com/570123/
16:32 < niemeyer> Sorry, it should say f2(m) at the end
16:33 < ww> niemeyer: aha!
16:33 < wrtp> register leak...
16:33 < wrtp> the compiler needs to be more careful!
16:40 -!- Venom_X [~pjacobs@] has joined #go-nuts
16:41 < wrtp> ww: you can get results without the long sleeps if you just
print runtime.MemStats.HeapAlloc
16:43 < wrtp> the problem is in range
16:44 < wrtp> here's an example: https://gist.github.com/837326
16:44 < wrtp> this allocates double the memory necessary
16:45 < wrtp> if you take out the first range statement, it uses only the
necessary memory
16:45 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has joined #go-nuts
16:45 < wrtp> it'd be worth raising as an issue
16:46 < ww> wrtp: http://code.google.com/p/go/issues/detail?id=1541
16:47 -!- saschpe [~quassel@opensuse/member/saschpe] has joined #go-nuts
16:50 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
16:51 < wrtp> FWIW, this is rarely an issue in real code
16:51 < ww> wrtp: was just going to come to that
16:52 < ww> where it's an issue seems to be with running benchmarks.
16:52 < ww> somehow or other running several benchmarks in sequence there is
some reference being kept around
16:52 < niemeyer> wrtp: This isn't specific to range..  it will happen with
pretty much any function call
16:52 < ww> and memory isn't freed
16:53 < niemeyer> Things will be saved in the stack, and won't be reset when
the function returns
16:53 < wrtp> niemeyer: that wasn't what i was seeing
16:54 < wrtp> the function return *did* seem to be cleaning up its stack
16:54 < niemeyer> wrtp: It's trivial to test..  just replace the range with
a normal for loop
16:55 < ww> afk a while, food etc
16:55 < wrtp> niemeyer: but a normal for loop doesn't reference the map
16:55 < niemeyer> wrtp: Exactly :)
16:56 -!- erus_ [50b135f2@gateway/web/freenode/ip.] has quit [Ping
timeout: 272 seconds]
16:56 < wrtp> ok
16:57 < wrtp> well, replacing the range loop with a for loop makes it work
16:57 < wrtp> even if the map is referenced inside the loop
17:01 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
17:02 < niemeyer> wrtp: Leaks for me equally well..  and not at all
surprising..  there's nothing resetting the stack.
17:03 < wrtp> niemeyer: so if you don't have the range statement, then your
version leaks?
17:03 < wrtp> 'cos mine doesn't
17:03 < niemeyer> wrtp: Yep, continues to leak "fine"..  ;)
17:03 < aiju> Java programs always leak memory all over the floor
17:03 < fzzbt> niemeyer: you use syntax hack "var _ = Suite(&S{})" in your
gocheck example to call Suite as if it were inside func init.  is that considered
idiomatic go?  looks so silly to me to have a variable declaration that declares
no variables at all.
17:04 < Namegduf> I don't know why he doesn''t just use func init
17:04 < niemeyer> fzzbt: Hi Juhani, how are you?
17:04 -!- pjm0616 [~user@] has quit [Ping timeout: 240 seconds]
17:04 < wrtp> what do you mean be func init?
17:04 < wrtp> s/be/by/
17:05 -!- rutkowski [~adrian@078088215128.walbrzych.vectranet.pl] has joined
17:05 < wrtp> ww: BTW my benchmark seems to indicate that delete is about
40% faster than add
17:05 < fzzbt> wrtp: i mean the func init that gets called on import
17:05 < niemeyer> fzzbt: All the problems and ugly details you find in that
code are my fault rather than "idiomatic foo"..  please feel free to tweak it to a
version you prefer.
17:06 < wrtp> ww: here's the benchmark: https://gist.github.com/837349
17:07 < wrtp> yeah, i'd use an init function rather than _ = ...
17:07 < wrtp> although...
17:07 < wrtp> i
17:07 < wrtp> t
17:07 < wrtp>
17:07 < wrtp> 
17:07 < wrtp> ??  !!
17:07 < wrtp> wtf
17:08 < wrtp> anyway
17:08 < wrtp> it has a subtly different meaning
17:08 < wrtp> the var _ = ...  form gets evaluated before any init functions
17:08 < fzzbt> niemeyer: i was just stumped first by that one line when i
read your example.  i like your gocheck very much, btw.  very handy.
17:09 < niemeyer> fzzbt: Thanks, I'm glad you're finding it useful
17:09 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
17:09 < niemeyer> fzzbt: In some cases the suite is actually useful..  so
the variable may be seen with a name too
17:10 < niemeyer> fzzbt: In other cases where it's not useful, it's just a
shorthand and familiar way to call the function in one line, rather than defining
an init() just for that
17:10 < niemeyer> fzzbt: Either way, a trivial case..  feel free to stick to
your preference
17:11 < wrtp> niemeyer: as far as i can see, the GC knows exactly how big a
goroutine's stack is, so function calls should not leak memory
17:11 < wrtp> even if the function calls don't clean the memory up on return
17:11 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has joined #go-nuts
17:14 -!- JusticeFries_
[~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net] has joined #go-nuts
17:17 -!- imsplitbit [~imsplitbi@] has quit [Ping timeout: 276 seconds]
17:17 -!- imsplitbit [~imsplitbi@] has joined #go-nuts
17:17 -!- pjm0616 [~user@sigfpe-1-pt.tunnel.tserv15.lax1.ipv6.he.net] has joined
17:18 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Ping timeout: 240 seconds]
17:19 < skelterjohn> weird...  go-nuts isn't showing my reply to a message,
but it *does* show a reply to my reply...
17:20 < skelterjohn> can anyone else see my reply to the "import own
package" thread?
17:20 < adu> skelterjohn: are you talking about 30 mins ago?
17:20 < skelterjohn> no, 5
17:20 < skelterjohn> did i reply 30 min ago?
17:20 < adu> i dunno
17:20 < skelterjohn> ok...
17:20 < wrtp> niemeyer: but what's odd is that it *looks* like the memory
leaks, but the memory allocation doesn't double at the end, which it does if the
range statement is still there
17:21 < adu> I don't see any messages in the past 11 mins before "weird..
17:21 < skelterjohn> i'm sorry
17:21 < skelterjohn> i meant on the mailing list
17:21 < skelterjohn> :)
17:21 < adu> oh
17:21 < skelterjohn> my fault
17:21 < adu> I'm not on the mailing list
17:21 < skelterjohn> the google-group
17:21 < aiju> wow
17:21 < adu> my email gets 2000 messages a day
17:22 < aiju> compiling a simple Go program takes 2s here
17:22 -!- saschpe [~quassel@opensuse/member/saschpe] has quit [Remote host closed
the connection]
17:22 < skelterjohn> aiju: where is 'here'?
17:22 < adu> aiju: is that a lot?
17:22 < Namegduf> Yes.
17:22 < Namegduf> XD
17:22 < aiju> and only if i include fmt o.O
17:22 < Namegduf> fmt is big
17:22 < aiju> god, i dislike fmt
17:22 < Namegduf> It's unicode table things
17:22 < aiju> i want that print/println stay
17:23 < Namegduf> Builtins are evil
17:23 -!- DerHorst [~Horst@e176106252.adsl.alicedsl.de] has joined #go-nuts
17:23 < aiju> that's why operations on complex numbers are builtin <.<
17:23 < adu> Namegduf: I think builtin functions are evil, but I like the
possibility of builtin methods
17:23 < aiju> Go already has many (too many?) builtins
17:24 < adu> MyFuncyPointer.len()
17:24 < aiju> eww builtin methods
17:24 < aiju> i don't see any necessity for them
17:24 < adu> anyways just a thought
17:24 < aiju> except "aawwww it looks cuuutee"
17:24 < Namegduf> With interfaces, I can see some benefit
17:25 < Namegduf> But I don't like them much for some reason.
17:25 < taruti> aiju: btw are you sure it is compiling that takes 2s and not
17:25 < aiju> taruti: it is linking, actually
17:25 < aiju> sorry for convulting this
17:25 < adu> Namegduf: I can think of a reason: x.len() looks bad, len(x)
looks pretty :)
17:26 < Namegduf> adu: I agree strongly when it comes to literals.
17:26 < Namegduf> "foo".blah() <- Ew ew ew
17:26 < skelterjohn> 2.plus(3)
17:26 < aiju> it's something you write papers about
17:27 < aiju> "in $thislanguage EVERYTHING IS AN OBJECT [but it actually
17:27 < adu> also, if you're going to add first-class types to the language,
then the method receiver is the place to do it, because it causes the least amount
of headaches later on, since types are limited to the first parameter of
functionized methods (much like builtin new/make)
17:29 -!- saschpe [~quassel@opensuse/member/saschpe] has joined #go-nuts
17:30 < aiju> []int is an invalid map key type?  aww :P
17:30 -!- sauerbraten [~sauerbrat@p508CFF66.dip.t-dialin.net] has joined #go-nuts
17:31 -!- femtoo [~femto@95-89-248-54-dynip.superkabel.de] has joined #go-nuts
17:31 < adu> anyways
17:31 < adu> night
17:31 -!- adu [~ajr@softbank220043139062.bbtec.net] has quit [Quit: adu]
17:34 < niemeyer> wrtp: I'm not sure I get what you mean by "it knows
*exactly* how big the stack is"
17:35 < niemeyer> wrtp: Obviously, if there was space reserved in the stack
for a prior function in the stack, it can't collect it or jump over it
17:36 < wrtp> i don't know what you mean by "space reserved in the stack for
a prior function"
17:36 < wrtp> everything above a certain place in the stack is live, by
17:38 < wrtp> i think map might be keeping a cache of allocated objects or
17:39 < niemeyer> wrtp: Yep, precisely
17:39 < niemeyer> wrtp: I mean, precisely that everything is live..
17:39 < niemeyer> wrtp: I don't think there's anything to do with cache of
allocated objects
17:40 < aiju> http://p.remotehost.co/pastes/2011-02-21T13:42:08.raw haha i
really like this cod
17:40 < aiju> +e
17:41 < wrtp> niemeyer: not everything...  everything up until the current
function's frame, but not further.
17:42 < wrtp> s/not fur/no fur/
17:42 -!- jeng [~jeng@] has quit [Read error: Connection reset by peer]
17:42 < niemeyer> wrtp: Yes, if you call GC, the function which called GC
naturally is not the top one in the frame
17:42 -!- jeng [~jeng@] has joined #go-nuts
17:45 < wrtp> sorry, maybe we're talking at cross purposes here.  i thought
you were saying that calling a function which allocates something could leak an
object from the function's stack frame
17:48 < niemeyer> wrtp: No, it won't leak..  it must just still be
referencing to something which was used
17:48 < wrtp> yeah, that's what i thought
17:48 < wrtp> BTW, if you run this: https://gist.github.com/837415
17:48 < wrtp> what does it print for you?
17:48 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has quit [Ping
timeout: 246 seconds]
17:50 < wrtp> niemeyer: because it was that code (or very similar) that you
were saying was leaking before
17:50 < wrtp> it doesn't leak for me
17:51 < wrtp> whereas this code: https://gist.github.com/837419
17:51 < wrtp> does leak
17:53 -!- rlab_ [~Miranda@] has joined #go-nuts
17:54 -!- rlab [~Miranda@] has quit [Ping timeout: 246 seconds]
17:54 < niemeyer> wrtp: Let me check
17:56 < niemeyer> wrtp: 2011/02/21 14:58:19 before GC 39367576
17:56 < niemeyer> 2011/02/21 14:58:19 after GC 3587920
17:57 < wrtp> well that's collected most of the garbage
17:58 < wrtp> 90% of it
17:58 < wrtp> i get the same result
17:59 < niemeyer> wrtp: Yeah..  you've managed to tweak the assembly in a
way that doesn't leak.  :-)
17:59 < wrtp> niemeyer: whereas if i add the range statement, it doesn't
collecct anything
17:59 -!- tvw [~tv@] has quit [Remote host closed the connection]
17:59 < wrtp> niemeyer: no, i think you were just misreading the numbers
before :-)
17:59 < wrtp> (i know i was - i missed the extra digit)
18:00 < niemeyer> wrtp: Ah, I see..  yeah, I can accept blame if that makes
you happier
18:00 * wrtp is very happy anyway
18:00 < wrtp> naturally
18:01 < wrtp> so i think that means we can lay the blame fairly and squarely
on the range statement...
18:01 < niemeyer> wrtp: Cool, let me find the actual problem while you're
happy.  :-)
18:02 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
18:04 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has quit [Remote host closed the connection]
18:05 < wrtp> niemeyer: i'm guessing that the hash_iter struct isn't cleaned
up correctly
18:05 -!- JusticeFries [~JusticeFr@173-8-247-218-Colorado.hfc.comcastbusiness.net]
has joined #go-nuts
18:07 < nsf> wrtp: indeed
18:07 < ww> do i read that you've narrowed down to a bug in range?
18:07 < nsf> gocode doesn't eat memory as it was before
18:07 < nsf> 30 megs memory consumption and it is stable
18:08 < wrtp> ww: it seems so
18:08 < nsf> perviously it was eating like up to 400 megs easily
18:08 < nsf> that's a very good thing indeed
18:08 < jnwhiteh> hrm..  i wonder if this would help my http issue =)
18:08 < ww> related question, what happens if you change a map inside a loop
iterating over it?
18:08 < Namegduf> I believe it either is iterated over or it isn't.
18:09 < Namegduf> But it is safe.
18:09 < wrtp> ww: it's defined in the spec
18:09 < niemeyer> ww: No, it's not a bug in range, but wrtp thinks so
18:09 < wrtp> niemeyer: don't you think so?
18:09 < aiju> ww: i remember bad things to happen in terms of items being
18:09 < niemeyer> wrtp: I thought it was clear that I'm sure it's not
18:10 < wrtp> i think that it's because there's no iterclose statement to
clear up the hash_iter struct
18:10 < wrtp> niemeyer: so how do explain the behaviour that you see when
adding or removing the range statement?
18:11 < wrtp> it's interesting to see that the compiler doesn't re-use
hash_iter structs either
18:11 < niemeyer> wrtp: You've manipulated the generated assembly code
completely..  I'm surprised you're so easily convinced you've found the bug just
because of that.
18:11 -!- rutkowski [~adrian@078088215128.walbrzych.vectranet.pl] has quit [Quit:
WeeChat 0.3.3-dev]
18:11 < wrtp> i saw exactly the same problem with the original code
18:12 < wrtp> niemeyer: where do you think the leak comes from then?
18:12 < niemeyer> wrtp: I'll tell you in a moment
18:13 < nsf> I mean seriously
18:13 < nsf> Go's GC isn't that bad now :)
18:13 < KBme> there is a new GC?
18:13 < nsf> gocode doesn't eat memory anymore
18:13 < nsf> KBme: sort of
18:13 < KBme> nsf: oh!  nice!
18:13 < nsf> it's still the same mark & sweep thing, but optimized
18:13 < aiju> the old GC had a comment like that
18:14 < KBme> heh
18:14 < Namegduf> They took it out.
18:14 < Namegduf> Now it is!
18:14 < Namegduf> It's awesome.
18:14 < bartbes> or they just don't tell you about it anymore
18:14 < bartbes> :P
18:14 < nsf> but now Go eats virtual address space
18:14 < nsf> like a dinosaur
18:14 < aiju> hahaha
18:15 < skelterjohn> fun mental image
18:15 < skelterjohn> nsf: can gocode do something like refactoring from the
command line?
18:15 < skelterjohn> like change the name of a variable everywhere
18:15 < Namegduf> Dinosaurs are known to eat virtual address space?
18:15 < aiju> yeah
18:16 < nsf> skelterjohn: previously it was possible
18:16 < skelterjohn> Namegduf: virtual dinosaurs
18:16 < nsf> I've removed this part of the gocode
18:16 < Namegduf> Man, my CS degree isn't teaching me any of this stuff
18:16 < skelterjohn> nsf: have you put it somewhere else, at least?  i think
such a tool would be pretty useful
18:16 < ww> address space is cheap and plentiful...  who would ever need
more than 64 bits?  :P
18:16 < nsf> and I think now it won't even work if you'll try to find that
version in git
18:16 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has joined #go-nuts
18:16 < skelterjohn> ah
18:16 < nsf> skelterjohn: it was messy
18:16 < nsf> and buggy
18:16 < aiju> ww: we don't have 64 bits of address space
18:16 < skelterjohn> i understand
18:16 < nsf> and I have no time maintaining it :)
18:16 < aiju> address space on amd64 is only 48 bits
18:16 < aiju> 256 TB ought to be enough for everyone
18:17 < ww> i wonder what happens if you alloc/dealloc until we wrap 256TB
18:18 < aiju> address space isn't contigious
18:18 < aiju> i'd expect problems to happen as soon as you cross 128 TB
18:18 < wrtp> gotta go
18:19 < KBme> oh, that will be sufficient for all of mankind's needs!
18:19 < skelterjohn> why wouldn't address space on 64bit be 64 bits?
18:19 < aiju> skelterjohn: because it is not?
18:19 < aiju> look it up in the architecture datasheets
18:19 < skelterjohn> good reason
18:19 < skelterjohn> i mean, i believe you
18:19 < KBme> ☺
18:19 < skelterjohn> just wondering why that would be
18:19 < aiju> "who the fuck needs more than 48 bits?"
18:19 < KBme> it's too much
18:19 < skelterjohn> a pointer can hold the address of 64bits of addresses
18:20 < aiju> skelterjohn: it simplifies virtual memory management
18:20 < aiju> we already have four levels of page tables which are really
hell to manage
18:20 < skelterjohn> or maybe, they had instructions that needed at most
16bits of other stuff, *and* the address
18:20 < nsf> "The architecture permits extending this to 52 bits in the
future" (c) wiki
18:20 < nsf> we're good
18:20 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has joined #go-nuts
18:21 < aiju> nsf: i think that's physical address range
18:21 < nsf> well, yes
18:21 < aiju> it's probably possible to extend to full 64 bit later on
18:22 < ww> addressing != using...  i could realistically imagine a process
that churns through a few petabytes of data over its long lifetime...
18:22 < ww> imagine reimplementing erlang in go (!!!) process...  never...
18:25 < aiju> transgressing the 128 TB border is probably already a good OS
stress test :D
18:29 < KBme> man, i can't have moar than 256Tb ram on PC?
18:29 < aiju> KBme: no, even less
18:30 < aiju> idk about the current physical limit
18:32 < aiju> oh current CPUs indeed support 256 TB
18:32 < nsf> 1TB is a lot
18:32 < aiju> but no motherboard does :P
18:32 < nsf> my all HDD space is 320gigs :)
18:32 * nsf needs to buy a new hdd
18:33 < aiju> my HDD space is 60 GB
18:33 < aiju> at least, in this machine
18:34 -!- thomas_b [~thomasb@cm-] has quit [Ping
timeout: 250 seconds]
18:34 < aiju> i have one machine with 256 MB RAM and 30 GB disk space here
18:36 < niemeyer> ww: So, yeah, your value is in the stack and you're just
assuming too much about the implementation.
18:36 < aiju> you shouldn't worry about stack/heap in Go
18:36 < niemeyer> wrtp: ^
18:36 < aiju> the compiler places stuff where it's appropriate
18:36 -!- tvw [~tv@e176003213.adsl.alicedsl.de] has joined #go-nuts
18:36 < niemeyer> ww: Here is your m = nil:
18:37 < niemeyer> MOVQ $0,AX
18:37 < aiju> i think it's entirely "illegal" to use absolute addresses on
the stack
18:37 < niemeyer> Which is a perfectly fine thing to do in this context
18:37 < niemeyer> aiju: No idea about what you mean by that
18:38 < ww> so the moral is, write small functions to give GC maximum
opportunity to do its job
18:38 < ww> which is good practice anyways
18:38 < aiju> niemeyer: Go never ever allows you take the address of
anything on the stack
18:38 < aiju> if you try it gets moved to the heap
18:39 < skelterjohn> the ability to minimize allocations is a good skill to
18:40 < niemeyer> aiju: Sorry, I have no idea about why you're telling me
18:40 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has quit [Ping
timeout: 264 seconds]
18:43 -!- Project-2501 [~Marvin@] has joined #go-nuts
18:44 < ww> icket
18:44 < ww> s/^/will be interesting to see rsc@'s take on the t/
18:44 < aiju> haha
18:45 < niemeyer> LOL
18:45 < skelterjohn> quite a typo
18:45 < niemeyer> d
18:45 < aiju> s
18:45 < niemeyer> s/d/Indeed/
18:46 < aiju> s/^/happen/
18:46 -!- DerHorst [~Horst@e176106252.adsl.alicedsl.de] has quit [Remote host
closed the connection]
18:48 < aiju> 1,$d should be usable as well :P
18:54 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
18:55 -!- femtoo [~femto@95-89-248-54-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
18:57 < niemeyer> ww: Wanna see something cool?
18:57 < aiju> watch out, he's going to rape you
18:57 < niemeyer> LOL
18:58 < niemeyer> No..  my interest is computers, obviously..
18:58 < niemeyer> ;)
18:58 < taruti> this is not #cat-v...
18:58 < ww> as long as it's not a clever goatse redirect...
19:00 < niemeyer> ww: Try this out: http://pastebin.ubuntu.com/570196/
19:00 < niemeyer> ww: Should still leak
19:00 -!- sauerbraten [~sauerbrat@p508CFF66.dip.t-dialin.net] has quit [Quit:
19:00 -!- sauerbraten [~sauerbrat@p508CFF66.dip.t-dialin.net] has joined #go-nuts
19:01 -!- itrekkie [~itrekkie@] has joined #go-nuts
19:02 < ww> niemeyer ok, will have to wait a little bit.  my son's using the
computer to watch toy story and i'm reduced to putty on the phone atm...
19:03 < niemeyer> ROTFL
19:03 < aiju> hahahaahhahahaha
19:03 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-157-130.clienti.tiscali.it]
has joined #go-nuts
19:04 < ww> actually lynx works with that
19:04 < ww> that makes sense because m is still on main's stack
19:05 < ww> if you refactored it in the reverse way, first alloc in a
function the second inline probably wouldn't leak
19:05 -!- itrekkie [~itrekkie@] has quit [Client Quit]
19:06 -!- itrekkie [~itrekkie@] has joined #go-nuts
19:06 -!- itrekkie [~itrekkie@] has quit [Client Quit]
19:06 -!- Project-2501 [~Marvin@] has quit [Ping timeout: 246 seconds]
19:07 -!- itrekkie [~itrekkie@] has joined #go-nuts
19:10 < ww> not sure go not releasing memory back to the os is a good thing
19:10 < ww> i mean some times you want a burst of extra and give it back...
19:11 < skelterjohn> sometimes you take the easier solution to a less
important problem so you can focus on the tougher solutions to more significant
19:11 < ww> like a one host sql/web thingy.  i wouldn't want the sql
database squatting its worst case complex query memory usage
19:12 < KirkMcDonald> Go should define a standard set of interfaces for DB
19:13 < ww> and i have that use case very much in mind...  this graph stuff
is groundwork for a triplestore
19:14 < ww> so sparql queries and bursty back-chaining are evetually on
19:15 -!- gits [~gits@] has joined #go-nuts
19:19 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has quit [Ping
timeout: 246 seconds]
19:25 -!- freetz [~fritz@secure-atrc-dip23.nat.okstate.edu] has joined #go-nuts
19:28 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
19:32 -!- freetz [~fritz@secure-atrc-dip23.nat.okstate.edu] has quit [Ping
timeout: 246 seconds]
19:37 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has joined #go-nuts
19:46 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has quit [Ping timeout: 240 seconds]
19:47 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has joined #go-nuts
19:47 < skelterjohn> i wrote a piece of experimentation software 4 years
ago, and i've used it heavily since.  i can't find the source anywhere...
19:48 < skelterjohn> :\
19:48 -!- sauerbraten [~sauerbrat@p508CFF66.dip.t-dialin.net] has quit [Remote
host closed the connection]
19:52 -!- sauerbraten [~sauerbrat@p508CFF66.dip.t-dialin.net] has joined #go-nuts
19:59 -!- itrekkie [~itrekkie@] has quit [Quit: itrekkie]
20:01 -!- artefon [~thiagon@] has quit [Quit: Leaving]
20:01 < exch> time for a rewrite then
20:02 < Namegduf> It's always time for a rewrite!
20:03 < aiju> when in doubt, rewrite it
20:04 < skelterjohn> found it on another machine
20:05 < skelterjohn> very oddly written C++ code
20:05 < Namegduf> Sounsd like time for a rewrite
20:05 < Namegduf> In Go!
20:05 < skelterjohn> considering
20:05 < aiju> all C++ code is oddly written
20:05 < skelterjohn> it's not C++'s fault in this case
20:06 < KirkMcDonald> Can we blame C++ anyway?
20:06 < aiju> don't ever blame the programmer for something you can blame
C++ for
20:06 < skelterjohn> perhaps we can share responsibility
20:07 < Namegduf> That sounds like poor management of responsibility
20:07 < aiju> don't communicate via shared responsibility
20:07 < Namegduf> Without some kind of reference counting setup
20:07 < aiju> share responsibility by communication
20:08 < aiju> Namegduf: but what about circular responsibility?
20:08 < kimelto> Go guyz like this kind of saying, don't they!?
20:08 < Namegduf> aiju: Maybe you could use a responsibility collector
20:08 < Namegduf> kimelto: It's my hammer.
20:10 -!- freetz [~fritz@secure-atrc-dip23.nat.okstate.edu] has joined #go-nuts
20:11 < jumzi> hmm wasn't it the programmer who choice C++?  Ergo it's the
programmers fault
20:11 < jumzi> s/choice/choosed/
20:11 < aiju> it's the society's fault!
20:11 < skelterjohn> go was unavailable at the time
20:11 < Namegduf> It's whoever invented OO's fault
20:11 < skelterjohn> s/choosed/chose/
20:11 < aiju> skelterjohn: gee, that's no excuse
20:11 < Namegduf> Let's go back in time and stop them
20:11 < aiju> get a time machine
20:12 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has quit
[Quit: reboot time]
20:12 < jumzi> thank you skelterjohn, irc is improving my grammar day by
day, sentence by sentence
20:12 < skelterjohn> i figure if you care enough to correct yourself, you
care enough to be correct :)
20:13 < jumzi> :)
20:16 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has quit [Ping
timeout: 240 seconds]
20:16 -!- itrekkie [~itrekkie@] has joined #go-nuts
20:18 -!- jrslepak [~jrslepak@adsl-70-227-108-38.dsl.applwi.ameritech.net] has
joined #go-nuts
20:19 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has joined
20:20 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has quit [Remote host
closed the connection]
20:21 -!- jeng [~jeng@] has quit [Read error: Connection reset by peer]
20:22 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has quit [Remote host closed the connection]
20:22 -!- skejoe [~skejoe@] has joined #go-nuts
20:28 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
20:34 -!- ExtraSpice [XtraSpice@78-62-101-194.static.zebra.lt] has quit [Read
error: Connection reset by peer]
20:34 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts
20:40 -!- Stiletto [7f000001@] has quit [Ping timeout: 250 seconds]
20:44 -!- Stiletto [7f000001@] has joined #go-nuts
20:45 -!- saschpe [~quassel@opensuse/member/saschpe] has quit [Remote host closed
the connection]
20:50 < skelterjohn> a nanosecond is 1e-9 seconds, right?  so to get
milliseconds i'd multiply nanoseconds by 1e6?
20:54 -!- jrslepak [~jrslepak@adsl-70-227-108-38.dsl.applwi.ameritech.net] has
quit [Quit: jrslepak]
20:55 -!- thomas_b [~thomasb@cm-] has joined #go-nuts
20:55 < exch> ya
20:58 -!- rlab [~Miranda@] has joined #go-nuts
20:58 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts
21:00 -!- rlab_ [~Miranda@] has quit [Ping timeout: 260 seconds]
21:05 -!- Eko [~eko@c-24-5-127-87.hsd1.ca.comcast.net] has quit [Ping timeout: 260
21:05 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has joined
21:12 -!- Eko [~eko@c-67-188-2-56.hsd1.ca.comcast.net] has joined #go-nuts
21:17 -!- n___ [~n____@5ad54238.bb.sky.com] has joined #go-nuts
21:18 -!- emjayess [~emjayess@pix1.i29.net] has quit [Ping timeout: 240 seconds]
21:18 -!- sauerbraten [~sauerbrat@p508CFF66.dip.t-dialin.net] has quit [Remote
host closed the connection]
21:21 -!- tensorpudding [~user@] has joined #go-nuts
21:24 -!- TheMue [~TheMue@p5DDF5184.dip.t-dialin.net] has joined #go-nuts
21:27 < zozoR> this channel is for bashing c++ and discussing the epicness
of go :D
21:27 < skelterjohn> we also put down java, D and haskell
21:28 -!- itrekkie [~itrekkie@] has quit [Quit: itrekkie]
21:28 < str1ngs> bash is safe though
21:29 -!- perdix [~mkhl@sxemacs/devel/perdix] has quit [Remote host closed the
21:31 < skelterjohn> can't bash bash.  it bashes your bash right bash.
21:31 < zozoR> can we bash perl too?  :o
21:31 < str1ngs> echo yes
21:31 < str1ngs> perl is open season
21:31 < aiju> bash is pain
21:31 < skelterjohn> you don't even need to bash perl
21:31 < Namegduf> I feel PHP and Ruby deserve mention
21:31 < skelterjohn> it bashes itself
21:32 < zozoR> yay :D
21:32 < skelterjohn> best ignore it altogether
21:32 < zozoR> cat /dev/urandom > perlscript.pl :D
21:32 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Quit:
21:36 -!- maattd [~maattd@esc31-1-78-245-92-71.fbx.proxad.net] has joined #go-nuts
21:37 -!- maattd [~maattd@esc31-1-78-245-92-71.fbx.proxad.net] has quit [Remote
host closed the connection]
21:37 -!- maattd [~maattd@esc31-1-78-245-92-71.fbx.proxad.net] has joined #go-nuts
21:37 -!- TheMue [~TheMue@p5DDF5184.dip.t-dialin.net] has quit [Quit: TheMue]
21:43 -!- pothos_ [~pothos@111-240-171-188.dynamic.hinet.net] has joined #go-nuts
21:43 -!- freetz [~fritz@secure-atrc-dip23.nat.okstate.edu] has quit [Ping
timeout: 250 seconds]
21:44 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has quit [Remote host closed
the connection]
21:44 -!- pothos [~pothos@111-240-170-46.dynamic.hinet.net] has quit [Ping
timeout: 255 seconds]
21:45 < exch> hehe
21:45 < exch> I wouldnt be surprised if that even semi-works
21:48 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has joined #go-nuts
21:48 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has quit [Remote
host closed the connection]
21:48 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has joined #go-nuts
21:59 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-172-86.clienti.tiscali.it] has
joined #go-nuts
22:02 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-157-130.clienti.tiscali.it]
has quit [Ping timeout: 250 seconds]
22:06 -!- wrtp [~rog@] has quit [Quit: wrtp]
22:13 -!- suiside [tajnyman@unaffiliated/suiside] has quit [Ping timeout: 240
22:26 -!- suiside [~suiside@unaffiliated/suiside] has joined #go-nuts
22:28 < ww> hmmm...  typechecking woes...  can't figure out how to make this
function that takes a factory function as an argument:
22:29 < ww> accept things that return things that impleent Graph without a
wrapper function like:
22:30 -!- suiside [~suiside@unaffiliated/suiside] has quit [Ping timeout: 240
22:31 < skelterjohn> try naming the return values
22:31 < skelterjohn> or put them in parens
22:31 < skelterjohn> func() (*Graph)
22:32 -!- suiside [tajnyman@unaffiliated/suiside] has joined #go-nuts
22:35 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
22:35 < ww> skelterjohn: doesn't seem to help, if i pass NewDiGraph instead
of the wrapper i still get: trigraph_test.go:12: cannot use NewDiGraph (type
func() *DiGraph) as type func() *Graph in function argument
22:35 < skelterjohn> oh
22:36 < skelterjohn> well of course not
22:36 < skelterjohn> clearly a different type :)
22:36 < str1ngs> DiGraph != Graph
22:36 < ww> by playing with interface{} i can force it to compile but i
still get a similar error about conversion at runtime
22:36 < skelterjohn> like str1ngs said
22:37 < ww> str1ngs: right, DiGraph implements the Graph interface
22:37 < skelterjohn> then you don't want to return *Graph
22:37 < skelterjohn> you want to return Graph
22:38 < skelterjohn> and then assert it to *DiGraph
22:39 < ww> similar problem, changing NewTriGraph's argument signature,
trigraph_test.go:12: cannot use NewDiGraph (type func() *DiGraph) as type func()
Graph in function argument
22:39 < skelterjohn> func() *DiGraph is not func() Graph :)
22:39 < skelterjohn> have NewDiGraph return Graph
22:40 < ww> skelterjohn: if i do that, then ...  what about all the
22:40 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Remote host closed the connection]
22:40 < skelterjohn> what about it?
22:41 < skelterjohn> all you have to do is change the return type for
22:41 < skelterjohn> its code block doesn't need to change
22:41 < skelterjohn> if your return type is Graph, and you "return
&aDiGraph", that will work fine, as long as *DiGraph implements Graph
22:41 < skelterjohn> and from context I'm assuming it does
22:42 < ww> aha...  they still bind rightly
22:42 * ww slowly starts to get it
22:43 < skelterjohn> go is not object oriented - there is no polymorphism
22:43 < skelterjohn> so a lot of the old tricks don't work
22:43 < skelterjohn> but that doesn't mean you can do things efficiently and
22:43 < rl> I'm a bit confused by makefiles: Is the idea that you only have
one package per directory?
22:43 < skelterjohn> rl: not required with the makefiles, but it's a good
22:43 < skelterjohn> you can specify a subset of all the .go files available
22:44 < skelterjohn> oh, but it will use _go_.6 as an intermediate for both
packages, and that might cause problems
22:44 < ww> rl: your life will be easier if you do
22:44 < skelterjohn> is the issue that you want it to be easy to import one
of your packages from the other?
22:45 -!- cco3 [~conley@c-69-181-140-72.hsd1.ca.comcast.net] has joined #go-nuts
22:45 < rl> sure sounds like it.  i was thinking it was a waste when most of
my packages are tiny
22:45 < rl> i'm writing a smallish program that has a couple of individual
22:45 < str1ngs> if there that small maybe roll them into a util package
22:46 < rl> no, one directory with a small package in it is a much lesser
evil than a generic "util" package :)
22:46 < rl> (imnsho)
22:46 < str1ngs> or not use package at all just use go files within the main
22:46 -!- ath [ath@omega.lambda.fi] has quit [Remote host closed the connection]
22:46 < rl> yeah that's another option i considered, i just like the idea of
making packages.  it seems cleaner
22:47 < rl> but I guess that leaves me with making subdirectories for the
22:47 < skelterjohn> you can also use one of the available auto-builders to
make it so you don't have to deal with all the makefile business
22:47 < str1ngs> sure..  if you are going to reuset it
22:47 < str1ngs> reuse if you are not reusing it then your just making it
complicated for no reason :P
22:47 < rl> not going to reuse it but I think it improves code quality if
it's separated cleanly so a package has obvious internals and externals
22:47 < rl> if it's a good logical division of the program
22:48 < rl> so i wouldn't say it's for no reason
22:48 < skelterjohn> some people like to organize their code
22:48 < skelterjohn> nothing wrong with that
22:48 < ww> what about goinstall and multiple packages (and dependencies!)?
22:48 < rl> some people like to be able to understand their code ;)
22:48 < skelterjohn> ww: what *about* goinstall?
22:48 < str1ngs> no it does not seperate go files makes more sense imo
22:48 < rl> i'd like to understand how to do Makefiles properly in go, but
what's the auto-builder?
22:48 < skelterjohn> you just have to name your targets and imports
22:48 -!- ath [ath@omega.lambda.fi] has joined #go-nuts
22:49 < skelterjohn> rl: well, the one i made is at go-gb.googlecode.com
22:49 < skelterjohn> it's not the only one
22:49 < skelterjohn> but...it's my favorite?
22:49 < rl> sounds like a very unbiased opinion!
22:49 < ww> if there is a package with one top level makefile
thatunderstands things like "all", "clean" "install" and builds packages in
subdirectories, all of them will get installed?
22:49 < skelterjohn> rl: it will also generate makefiles for you, if you
22:49 < ww> (suspects yes)
22:49 < skelterjohn> ww: goinstall doesn't use the makefiles you provide
22:49 < skelterjohn> it makes its own
22:50 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Ping timeout: 240 seconds]
22:51 < ww> so it reads the .go files and guesses what is a package and what
is a program?  and recurses through subdirectories?
22:51 -!- imsplitbit [~imsplitbi@] has quit [Quit: Bye!]
22:51 < skelterjohn> the package's target is where you got it from
22:51 < ww> or will it only work with one-package-per-hg/git/whatever/ repo
22:51 < skelterjohn> so if you > goinstall github.com/me/project
22:51 < rl> skelterjohn: I guess the makefiles it generates aren't based on
22:51 < str1ngs> rl: I'm not being biased.  just think that a bunch of small
packages that are not going to be reused could be seperted into go files
22:51 < skelterjohn> the package is "github.com/me/project"
22:51 < skelterjohn> rl: they are
22:51 < skelterjohn> rl: they're just like you would write if you did it by
22:52 < skelterjohn> except you don't have to do it by hand
22:52 < rl> ok, so does it mean you still have one package per subdir?
22:52 < skelterjohn> str1ngs: his "bias" comment was referring to me
22:52 < skelterjohn> rl: gb enforces the idea of one package per directory
22:52 < ww> skelterjohn: right, i've done that with bitbucket.org/ww/fnv and
bitbucket.org/ww/gograph and it works well...  i'm just wondering about larger
things with more than one package in
22:52 < str1ngs> skelterjohn: ah well we all know you are biased :P
22:52 < skelterjohn> that's how it gets away with being configuration-free
22:52 < rl> ok, well if that's the idiomatic way that's the way I'll do it
22:52 < skelterjohn> ww: if you have a nested package, you need to import it
by its long name
22:53 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
22:54 < rl> str1ngs: I like being able to think of e.g.  one part of my
program as the "message parser", which functions as a well-defined package with
exported members, internals, and separate testing.  it just seems a lot cleaner.
22:54 < rl> just to be clear when i'm talking about small-ish it's still a
few hundred lines of code
22:55 < str1ngs> rl: you can do the same thing with structs and types in the
main package.
22:55 < skelterjohn> i don't think you should argue for flattening of code
22:55 < ww> neat.  goinstall seems to understand dependenceis, e.g.
goinstall .../gograph also builds and installs fnv
22:56 < skelterjohn> fnv is a sub-package in gograph?
22:56 < skelterjohn> but, yeah - goinstall will goinstall anything it needs
to to make it build
22:56 < ww> no, it's actually a parallel one
22:56 < skelterjohn> right
22:56 < rl> str1ngs: sure, I'm not arguing about feasibility of coding, it's
what makes conceptually sense
22:57 < rl> it's probably up to personal opinion though
22:57 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
22:57 < str1ngs> rl: this is based on its not going to be reused and there
22:57 < rl> and as I'm sure you can tell mine isn't going to change anytime
soon, as well as yours probably isn't, so we're both better served by not arguing
about it much more
22:58 < str1ngs> rl: I really dont care, just responding to your
problem/question :P
22:58 < rl> I know, thanks, it's good to get differing opinions
22:59 < str1ngs> rl: just giving you options is all
22:59 < rl> It might just be my use of the word "small": 100 lines of code
seems small for a separate subdirectory but a bit big to dump in the main package
22:59 < str1ngs> well thats why I mentioned the util package
23:00 < ww> rl: i think you really have three choices:
23:00 < rl> ww: it's ok, i made my choice :p subdirectories ftw!
23:00 < ww> 1.  separate packages in one directory (writing your own
makefiles, do you really want to do that?)
23:00 < ww> :P
23:00 < ww> 2.  separate directories
23:00 < ww> 3.  catchall package
23:01 < ww> and not sure how well goinstall would handle 1.
23:01 < skelterjohn> hmm
23:01 < rl> yeah, #1 sounds like a can of worms
23:01 < str1ngs> ya
23:01 < skelterjohn> i don't think it would handle it well at all
23:01 < str1ngs> lets just make it 2 choices :P
23:01 < rl> anyway, when I start writing some tests
23:01 < Namegduf> If you're having separate packages, separate directories
seems like the least of the complaints.
23:01 < rl> I'm sure I'll appreciate having one dir per package
23:01 < Namegduf> You need more imports, more of a bunch of stuff.
23:01 < Namegduf> Yeah.
23:02 -!- rlab [~Miranda@] has quit [Read error: Operation timed out]
23:02 < rl> more imports?  that doesn't seem like a lot of overhead
23:02 -!- rlab [~Miranda@] has joined #go-nuts
23:02 -!- rlab [~Miranda@] has quit [Client Quit]
23:02 < Namegduf> In every using module.
23:02 < Namegduf> It complicates the design some, is all.
23:02 < rl> I think it simplifies the design at cost of a few extra lines of
23:02 < skelterjohn> talk about beating an issue to death :)
23:03 < rl> But perhaps I misunderstood your grievance with the split
packages :p
23:03 < Namegduf> More elements in a design -> More complex design.
23:03 < rl> But I have the same amount of code
23:03 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
23:03 < rl> the code is just partitioned better
23:03 < rl> doesn't that simplify it?
23:03 < Namegduf> Overpartitioning is bad too.
23:04 < rl> Of course, you can do too much of anything
23:04 < Namegduf> I would say you are doing that.
23:04 < rl> Ok :)
23:04 < rl> I'm not going to argue on that point though, but thanks for your
23:04 < Namegduf> Yeah, it's just an opinion.
23:04 < Namegduf> I have a lot of one file packages, but that's because I
prefer selection of modules to build in over an additional configuration file.
23:04 < Namegduf> It isn't so nice, though.
23:05 < skelterjohn> this reminds me of one of those fark threads labeled
"last comment wins"
23:05 < Namegduf> Haha.
23:05 < str1ngs> I win
23:05 < Namegduf> No you don't!
23:05 < Namegduf> :P
23:05 < skelterjohn> :< oops
23:05 < str1ngs> hehe
23:05 < rl> skelterjohn: Yeah I think that question got a lot more attention
than it deserved
23:05 < Namegduf> Bikeshedding, we're all prone to it sometimes.
23:11 -!- amacleod [~amacleod@pool-96-252-93-11.bstnma.fios.verizon.net] has
joined #go-nuts
23:14 -!- TheSeeker2 [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has
joined #go-nuts
23:15 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-172-86.clienti.tiscali.it] has
quit [Quit: E se abbasso questa leva che succ...]
23:15 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn]
23:16 -!- TheSeeker [~n@99-153-250-110.lightspeed.irvnca.sbcglobal.net] has quit
[Ping timeout: 240 seconds]
23:16 -!- rl [~rleland@84-74-142-37.dclient.hispeed.ch] has quit [Ping timeout:
276 seconds]
23:18 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Read error: Operation timed
23:24 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
23:25 -!- rl [~rleland@84-74-142-37.dclient.hispeed.ch] has joined #go-nuts
23:30 -!- Eko [~eko@c-67-188-2-56.hsd1.ca.comcast.net] has quit [Quit: This
computer has gone to sleep]
23:31 -!- Eko [~eko@c-24-5-127-87.hsd1.ca.comcast.net] has joined #go-nuts
23:31 -!- Eko [~eko@c-24-5-127-87.hsd1.ca.comcast.net] has quit [Client Quit]
23:33 -!- tvw [~tv@e176003213.adsl.alicedsl.de] has quit [Remote host closed the
23:33 -!- itrekkie [~itrekkie@ip72-211-129-122.tc.ph.cox.net] has quit [Quit:
23:43 -!- skejoe [~skejoe@] has quit [Quit: Lost terminal]
23:43 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.4]
23:44 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Remote
host closed the connection]
23:49 -!- niemeyer [~niemeyer@189-10-154-99.pltce701.dsl.brasiltelecom.net.br] has
quit [Ping timeout: 240 seconds]
23:50 -!- itrekkie [~itrekkie@] has joined #go-nuts
23:52 -!- gmilleramilar [~gmiller@] has quit [Ping timeout: 250
23:54 -!- ako [~nya@fuld-4d00d016.pool.mediaWays.net] has joined #go-nuts
23:56 -!- aho [~nya@fuld-590c6994.pool.mediaWays.net] has quit [Ping timeout: 240
23:59 -!- Scorchin [~Scorchin@host86-145-19-209.range86-145.btcentralplus.com] has
joined #go-nuts
--- Log closed Tue Feb 22 00:00:29 2011