--- Log opened Sat Nov 20 00:00:17 2010 00:05 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit: Verlassend] 00:09 -!- kanru [~kanru@118-160-169-118.dynamic.hinet.net] has joined #go-nuts 00:11 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Quit: Leaving.] 00:11 -!- cco31 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has joined #go-nuts 00:14 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has quit [Quit: KVIrc Insomnia 4.0.2, revision: 4740, sources date: 20100627, built on: 2010-10-19 12:51:39 UTC http://www.kvirc.net/] 00:15 -!- krutcha [~krutcha@remote.icron.com] has quit [Quit: Leaving] 00:16 -!- cco31 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Ping timeout: 276 seconds] 00:25 -!- zozoR [~zozoR@5634798d.rev.stofanet.dk] has quit [Quit: Morten. Desu~] 00:28 -!- iant [~iant@nat/google/x-npcilkzwsiuwszdo] has quit [Quit: Leaving.] 00:34 -!- drc_ [~drc@dh165049.res.uvic.ca] has joined #go-nuts 00:41 < drc_> Does anyone know of a gcov like tool for statement coverage of a go program? 00:41 -!- iant [~iant@nat/google/x-vpuoaruixyrdmstl] has joined #go-nuts 00:42 -!- mode/#go-nuts [+v iant] by ChanServ 00:43 -!- artefon [~thiago@189.59.163.114] has quit [Quit: bye] 00:47 -!- iant [~iant@nat/google/x-vpuoaruixyrdmstl] has quit [Ping timeout: 245 seconds] 00:59 -!- drc_ [~drc@dh165049.res.uvic.ca] has left #go-nuts [] 01:05 -!- Tv [~tv@gige.bur.digisynd.com] has quit [Ping timeout: 245 seconds] 01:09 -!- sauerbraten_ [~sauerbrat@p508CEEF3.dip.t-dialin.net] has quit [Remote host closed the connection] 01:28 -!- adu [~ajr@pool-173-66-11-168.washdc.fios.verizon.net] has joined #go-nuts 01:30 -!- kanru [~kanru@118-160-169-118.dynamic.hinet.net] has quit [Read error: Operation timed out] 01:31 -!- iant [~iant@67.218.104.238] has joined #go-nuts 01:31 -!- mode/#go-nuts [+v iant] by ChanServ 01:39 -!- devrim [~Adium@160.79.7.234] has quit [Quit: Leaving.] 01:46 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts 02:08 -!- niemeyer [~niemeyer@189-10-175-46.pltce701.dsl.brasiltelecom.net.br] has quit [Remote host closed the connection] 02:15 -!- gummibaerchen [~timm@archlinux/trusteduser/gummibaerchen] has quit [Ping timeout: 240 seconds] 02:24 -!- bjarneh [~bjarneh@232.80-203-20.nextgentel.com] has joined #go-nuts 02:25 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Ping timeout: 240 seconds] 02:28 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts 02:34 < |Craig|> whats the preferred method for converting from numeric types to bytes? In my specific case I need to do uint32s. I can compute each byte manually, but that seems inefficient as what I want already exists in memory. 02:40 -!- SoniaKeys [~soniakeys@c-76-118-178-209.hsd1.ma.comcast.net] has joined #go-nuts 02:49 -!- ymasory [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has joined #go-nuts 02:54 -!- tensorpudding [~user@99.148.202.191] has quit [Remote host closed the connection] 03:07 -!- jochang [~identd@58-114-203-35.cable.dynamic.giga.net.tw] has joined #go-nuts 03:09 -!- Ccod [~peter@c-76-18-5-93.hsd1.fl.comcast.net] has joined #go-nuts 03:10 < skelterjohn> |Craig|: you can use unsafe 03:10 -!- matti___ [~mumboww@c-98-207-108-218.hsd1.ca.comcast.net] has quit [Ping timeout: 250 seconds] 03:11 < skelterjohn> i think it goes like (*[64]byte)(unsafe.Pointer(my64BitType)) 03:11 < skelterjohn> err 03:12 < skelterjohn> [8]byte 03:12 < skelterjohn> not 64 03:12 < |Craig|> skelterjohn: I figured it might require that. Most languages I use have buffers with write methods for different types, I guess I could make one 03:13 < Ccod> Im on the last leg of installation, having a problem getting my $PATH to work. (need that compiler command) 03:13 < Ccod> hello by the way 03:13 < skelterjohn> hi Ccod 03:13 -!- iant [~iant@67.218.104.238] has quit [Quit: Leaving.] 03:14 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 245 seconds] 03:14 < Ccod> is it cool to ask this kind of thing here?? 03:14 < skelterjohn> you haven't asked anything :) 03:14 -!- tensorpudding [~user@99.148.202.191] has joined #go-nuts 03:14 < Ccod> oh, well What is my PATH suppose to look like 03:15 < Ccod> its in .bash_profile right? 03:15 < skelterjohn> what happens when you >ls $GOBIN 03:15 < skelterjohn> i put paths in .bashrc, but maybe i'm a weirdo 03:15 -!- noktoborus [~noxless@gateway/tor-sasl/noktoborus] has joined #go-nuts 03:16 < Ccod> nothing useful I think 03:16 < Ccod> just shows me the same ls list 03:17 < skelterjohn> so, GOBIN is not defined 03:17 < skelterjohn> is GOROOT defined? 03:17 -!- tensorpudding [~user@99.148.202.191] has quit [Remote host closed the connection] 03:17 -!- matti___ [~mumboww@c-98-207-108-218.hsd1.ca.comcast.net] has joined #go-nuts 03:18 < Ccod> ">" is suppose to hold a bit of significance right? unless i take it away I get nothing 03:18 < Ccod> in both cases 03:18 < skelterjohn> i just used that to indicate you should type something on the command line 03:18 < Ccod> but GOROOT is not likely defined 03:18 < Ccod> right 03:18 < skelterjohn> to get a go installation working you need to define a few environmental variables 03:19 < skelterjohn> GOROOT and GOBIN 03:19 < skelterjohn> GOROOT should be wherever you downloaded the go directory to 03:19 < skelterjohn> GOBIN can be $GOROOT/bin, for now 03:20 < |Craig|> Ccod: All I have for go is the go/bin on my path 03:20 < Ccod> hmm 03:20 < Ccod> one sec 03:20 < |Craig|> I think the binaries can figure out the rest unles you want to move files from the default locations 03:21 < |Craig|> my $GOROOT is not set 03:21 < skelterjohn> weird 03:21 < Ccod> hmm 03:21 < Ccod> well then 03:21 < skelterjohn> didn't know you could get along without setting goroot 03:21 < skelterjohn> i guess the go binaries will look at .. if nothing is set 03:21 < Ccod> how does your path statement look... cause I probably have it wrong then 03:22 < skelterjohn> export PATH=$PATH:$GOROOT/bin 03:22 < skelterjohn> that statement is in my .bashrc 03:22 < |Craig|> PATH=$PATH:/Developer/go/bin in my /bash_progile 03:22 < Ccod> in $HOME directory right? 03:22 < skelterjohn> what do you mean "in $HOME directory" 03:23 < Ccod> where you created the .bashrc file 03:23 < skelterjohn> oh yes 03:23 < skelterjohn> that is in my home directory 03:23 < Ccod> right 03:23 < skelterjohn> that only makes sense if you are running bash 03:23 < Ccod> just making sure 03:23 < skelterjohn> > echo $SHELL 03:23 < skelterjohn> to find out 03:23 < |Craig|> Ccod: What os are you on btw? (Mac here) 03:23 < Ccod> same 03:28 < Ccod> k.. just to be sure. To compile you type 6g thing.go in the command line right? its not in the file or some other method. 03:28 < skelterjohn> yes 03:28 < Ccod> well.. im going to go make a bashrc and see if that does something 03:29 < skelterjohn> did you echo $SHELL ? 03:29 < |Craig|> then 6l thing.6 ; ./6.out 03:29 < Ccod> yeah, says bin/bash 03:29 < |Craig|> you mean /bin/bash ? 03:30 < skelterjohn> then making a .bashrc will do what you need 03:30 < Ccod> yes that 03:30 < Ccod> k 03:30 < skelterjohn> though i'm certain it already exists 03:30 < Ccod> probably 03:30 < |Craig|> skelterjohn: at least on mac .bash_profile works 03:30 < |Craig|> what these 2 files do on mac is slightly different than linux I believe 03:30 < |Craig|> (I think both would work) 03:31 < skelterjohn> oh - on my mac i have no .bashrc it's true 03:31 < skelterjohn> i use .profile 03:31 < |Craig|> I've never used /bashrc 03:31 < skelterjohn> on linux it works 03:32 < Ccod> well, made the file and put PATH=$PATH/me/go/bin and no dice 03:33 < skelterjohn> you have to open a new terminal now 03:33 < skelterjohn> loading those files only happens when the term opens 03:33 < skelterjohn> or if you > source .bashrc 03:33 < Ccod> oh 03:33 < skelterjohn> but like |Craig| implied, .bashrc might be wrong for mac 03:33 < skelterjohn> if that still doesn't work, try .profile 03:33 < skelterjohn> that definitely works for me on my mac 03:35 < Ccod> just checking to rules on adding to paths that are already there. Just going to a new line is fine here right? 03:35 < |Craig|> CcoD did you export PATH? 03:35 < skelterjohn> you mean for editing your .profile? 03:35 < skelterjohn> just add a line at the bottom 03:35 < Ccod> yeah, opened it and see something there 03:35 < skelterjohn> and yeah, you need to export it 03:35 < Ccod> k 03:35 < skelterjohn> export PATH=$PATH:whereYourGoStuffIs 03:36 < Ccod> k 03:39 -!- tensorpudding [~user@99.148.202.191] has joined #go-nuts 03:41 < Ccod> what to do now... 03:41 < skelterjohn> what happens when you > 6g 03:41 < Ccod> bash 6g: command not found 03:41 < skelterjohn> > echo $PATH 03:42 < Ccod> its there in the end... among a sea of other stuff 03:43 < Ccod> the* 03:43 < skelterjohn> what's in the directory? 03:43 < Ccod> :peter/go/bin 03:44 < skelterjohn> that isn't the directory 03:44 < skelterjohn> it should be /Users/peter/go/bin 03:44 < skelterjohn> or something like taht 03:44 < skelterjohn> it's a global path 03:44 < Ccod> ah 03:44 < Ccod> I'll try that 03:46 < skelterjohn> if you cd into the bin directory and do > pwd 03:46 < skelterjohn> it will tell you exactly the right directory for $PATH 03:46 < skelterjohn> pwd = print working directory 03:46 -!- aho [~nya@fuld-4d00d1f9.pool.mediaWays.net] has quit [Quit: EXEC_over.METHOD_SUBLIMATION] 03:46 < Ccod> k 03:49 -!- jochang [~identd@58-114-203-35.cable.dynamic.giga.net.tw] has quit [Quit: Bye!] 03:50 < Ccod> yeah, still not happening even after checking with pwd 03:51 < Ccod> that 6g thing is not workin 03:53 < skelterjohn> what did it print when you said pwd 03:54 < |Craig|> Ccod: for a test, you can just use the full path to 6g 03:55 < |Craig|> Ccod: you did remember to relaunch your terminal after editing your .bash_profile right? 03:55 < Ccod> yea, I echoed $PATH just to make sure it was there 03:56 < Ccod> so in the directory of the .go file stick the path and 6g in front? 03:57 < Ccod> is that what you mean by the test? 03:57 < skelterjohn> Ccod, tell me what it prints when you go to the go bin directory and do > cwd 03:58 < skelterjohn> we don't have to do any half-measures here 03:59 -!- jochang [~identd@223.136.72.209] has joined #go-nuts 03:59 < |Craig|> Ccod: you can run 6g using the full path to it (and thus not relying on $PATH) try it 03:59 < Ccod> cwd: command not found. is that a shorthand? 03:59 < skelterjohn> ! 03:59 < |Craig|> pwd 03:59 < skelterjohn> oops 03:59 < skelterjohn> pwd 03:59 < skelterjohn> sorry 03:59 < Ccod> lol 03:59 < Ccod> yeah 03:59 < Ccod> I did that one already 03:59 < |Craig|> its cwd on windows isn't it? 04:00 < skelterjohn> and what did it print 04:00 < Ccod> Users/peter/go/bin 04:00 < skelterjohn> beginning with a slash? 04:00 < Ccod> yes 04:00 < |Craig|> the slash is important 04:00 < skelterjohn> and /Users/peter/go/bin is on the end of > echo $PATH 04:01 < skelterjohn> hmm. is there anything in this directory? 04:01 < skelterjohn> :) 04:01 < skelterjohn> have you built go? 04:01 < Ccod> yes it is all there 04:01 < Ccod> one sec 04:01 < Ccod> gonna try something 04:01 < |Craig|> /Users/peter/go/bin/6g should run it 04:02 < Ccod> got it 04:02 < Ccod> ! 04:02 < skelterjohn> what did you try? 04:02 < Ccod> it was that / you pointed out 04:03 < skelterjohn> ah 04:03 < skelterjohn> yeah, it matters 04:03 < Ccod> in front of Users 04:03 < Ccod> yeah... now it says non-declaration statement outside function body :P... which means I know it at least tried 04:04 -!- krutcha [~krutcha@S010600045a27676a.vs.shawcable.net] has joined #go-nuts 04:04 < skelterjohn> now it's just a compile error 04:04 < skelterjohn> that kind of thing is much easier to deal with 04:04 < Ccod> yep 04:04 < Ccod> well i certainly learned a few lessons over that last couple hours or so 04:04 < Ccod> thanks alot 04:05 < Ccod> I think I will be better prepared next time I need to se up an enviorment :P 04:05 < skelterjohn> it's a learned skill 04:05 < Ccod> set* 04:05 < skelterjohn> and no problem at all 04:06 < Ccod> now I can finally start playing with this thing :P... so what have you guys been doing with it? 04:07 < skelterjohn> i write experimentation software using go 04:07 < skelterjohn> i'm a phd student doing machine learning stuff 04:07 < |Craig|> I've been writing a MMOG server 04:08 < Ccod> 0.0 awesome 04:08 < Ccod> didnt think there was an emoticon for that one 04:08 < skelterjohn> the lack of a nice debugger and go-oriented IDE is a bit annoying 04:08 < skelterjohn> but overall i still write code faster because it's go code that i'm writing 04:09 < skelterjohn> it's very concise - you get to the interesting bits right away 04:09 < skelterjohn> and don't spend hours designing inheritance trees 04:09 < skelterjohn> to pick an example completely at random 04:09 < |Craig|> I can't say I develop go code faster than python, writing go code is faster than writing cython code that will run as fast to use with python 04:09 < Ccod> I can't wait 04:10 < skelterjohn> oh - python is also very fast to write 04:10 < skelterjohn> but i find that python loses readability over time 04:10 < skelterjohn> the language that takes longer to write for me is java or C++ 04:11 < |Craig|> when I have better tools for go, I think ill pass my python coding speed for it 04:11 < skelterjohn> both involve large amounts of boilerplating 04:12 < Ccod> what do you use for writing? TextMate? 04:12 < |Craig|> I use TextWrangler 04:12 < |Craig|> I tried Goclipse, but its clearly not ready for use 04:12 < Ccod> I have been forcing myself to use vim lately since I got the syntax highlighter to work there. 04:12 < skelterjohn> i use xcode on my mac 04:13 < skelterjohn> and emacs on linux 04:13 < Ccod> ah 04:13 < |Craig|> aparently there is a pretty sweet vim plugin for autocompleation with go, but I'm not a vim guy 04:13 < Ccod> oh 04:13 < Ccod> I need to go find it then 04:13 < skelterjohn> if you're interested in that, nsf (in this chatroom) is the guy who wrote it 04:13 < skelterjohn> and he might be happy to help you set it up 04:13 < skelterjohn> but he is a notorious curmudgeon, so it varies 04:13 < |Craig|> video: http://nsf.110mb.com/gocode-demo.swf 04:14 < Ccod> not familiar with curmudgeon 04:14 < Ccod> ?? 04:14 < skelterjohn> google ;) 04:14 < |Craig|> Ccod: put you mouse over the word and hit command control d 04:15 < skelterjohn> uh - what is that suppose to do, craig? 04:15 < skelterjohn> perhaps you have a different irc client 04:15 < |Craig|> pops up a defination 04:15 < Ccod> haha nice 04:15 < skelterjohn> doesn't do anything for me 04:15 < |Craig|> its a mac thing, not in the client 04:15 < skelterjohn> oh - i thought it was just ctrl-d 04:15 < skelterjohn> neat! 04:15 < |Craig|> Ccod: another mac feature, in text edit, the esc key is auto compelate 04:16 < Ccod> heh 04:16 < |Craig|> I was amazed when I discovered that 04:16 < |Craig|> no good for coding though 04:16 < skelterjohn> hah that'd be neat 04:17 < skelterjohn> if it brought up the declaration of whatever you mouse-over 04:17 < Ccod> hmm, the autocomplete thing is for compiled variable names right? 04:17 < skelterjohn> mac's intrinsic autocompletion picks out other things you've typed recently that begin the same 04:17 < Ccod> ah 04:17 < skelterjohn> nothing to do with the structure of your code 04:17 < Ccod> hmm... sounds like it could get annoying 04:18 < skelterjohn> it is annoying, for code 04:18 < Ccod> getting the wrong word 04:18 < |Craig|> Ive never used it 04:18 < skelterjohn> one of the things i don't like about xcode 04:18 < Ccod> I see 04:18 < skelterjohn> it pops up wrong autocomplete bubbles all the time 04:18 < Ccod> the vim thing is the same thing? 04:18 < skelterjohn> and god forbid i try to do a newline then 04:18 < skelterjohn> instead of giving me a new one, it inserts this wrong word 04:18 < skelterjohn> the vim thing analyzes the go source 04:18 < Ccod> ah 04:18 < |Craig|> that vim thing is based on gocode and knows all about the types and such 04:18 < skelterjohn> and also knows about the libraries 04:19 < Ccod> sounds far more useful 04:19 < Ccod> :P 04:19 < |Craig|> yes 04:20 -!- trophi [~phi@pool-71-178-14-3.washdc.fios.verizon.net] has quit [Ping timeout: 245 seconds] 04:27 < Ccod> how long have you been using go? 04:27 < Ccod> since your making an MMOG server I guess you are quite comfortable 04:29 < skelterjohn> i started taking a look at it when i saw the slashdot article last november 04:32 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds] 04:33 < skelterjohn> gnight 04:33 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn] 04:45 -!- jochang [~identd@223.136.72.209] has quit [Ping timeout: 264 seconds] 04:45 -!- Stiletto [7f000001@69.195.144.4] has quit [Ping timeout: 276 seconds] 04:49 < |Craig|> Ccod: This is my second project in go. I made a simple fractal generator to learn go 04:49 < |Craig|> I have a bit of a history in writing partially finished mmo servers 04:49 -!- jochang [~identd@58-114-203-35.cable.dynamic.giga.net.tw] has joined #go-nuts 04:51 < |Craig|> I do a lot of stuff with Panda3D and python. Its a great game engine, and has been used for commercial mmogs, but networking in it is poorly documented, and is not the high performance stuff that Disney wrote for their mmo server. I decided to make a decent server for it in go because it looked fun 04:51 < Ccod> well thats better than me though... I hardly have any experience with that kind of stuff 04:53 < |Craig|> go just looked so fun, and a server looked like the best thing to write with it, and the only servers I know anything about are game servers, so thats what I'm writing 04:53 < Ccod> I can't decide what kind of project to start on :P 04:54 < Ccod> well I have no idea how someone goes about doing something like that... definitely interested though 04:55 < Ccod> wonder where to look more into that sort of thing, my club has been doing XNA stuff lately 04:57 < |Craig|> well, you can look at my source: https://github.com/Craig-Macomber/Grains--Vegetarian-Zombie-Rising (I started it this week, its not like I've gotten very far) 05:04 < Ccod> nice 05:04 < Ccod> will do 05:10 -!- jochang [~identd@58-114-203-35.cable.dynamic.giga.net.tw] has quit [Ping timeout: 240 seconds] 05:12 -!- BlaSux [7f000001@69.195.144.4] has joined #go-nuts 05:21 -!- noktoborus [~noxless@gateway/tor-sasl/noktoborus] has quit [Remote host closed the connection] 05:22 < |Craig|> ha, I forgot to commit my most significant go file, fixed 05:25 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: I ♥ Unicode] 05:25 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts 05:27 -!- noktoborus [~noxless@gateway/tor-sasl/noktoborus] has joined #go-nuts 05:28 < Ccod> got it 05:28 < Ccod> :P 05:28 -!- kanru [~kanru@61-228-153-104.dynamic.hinet.net] has joined #go-nuts 05:29 < |Craig|> I just DOS attacked my server. 10000 connections was a tad overkill, though the server was fine (as expected), but there was no way my python client running on the same machine could deal with it 05:30 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.nj.comcast.net] has joined #go-nuts 05:30 < Ccod> sounds like we have a winner :P 05:31 < |Craig|> it even fails with 20, though with the server spamming at max throughput, I guess thats expected 05:31 -!- noktoborus [~noxless@gateway/tor-sasl/noktoborus] has quit [Remote host closed the connection] 05:31 < |Craig|> go can write to tcp faster than poorly optimized python can read it, not to mention that the server compresses it once and the clients each do it seperatly 05:32 -!- noktoborus [~noxless@gateway/tor-sasl/noktoborus] has joined #go-nuts 05:32 < Ccod> I'm even more impressed with go from that 00 05:33 < |Craig|> I think the client died befor it connected more than 100 or so 05:33 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Ping timeout: 255 seconds] 05:34 < |Craig|> I was spamming over 1000 compressed messages a second. at 100 connections, that would have been running 100000 decompressions in python per second, and it just failed to keep up 05:34 < Ccod> so your going to pull your python code for go? 05:35 < |Craig|> nah, in real use case terms, that would have been 10000 user's computers, they would have been able to keep up 05:36 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.nj.comcast.net] has quit [Quit: skelterjohn] 05:36 < |Craig|> rather than just my laptop with the server already eating all the cpu 05:36 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.pa.comcast.net] has joined #go-nuts 05:36 < Ccod> ah 05:36 < Ccod> I see 05:37 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.pa.comcast.net] has quit [Client Quit] 05:37 < |Craig|> Im impressed that with things slowed down a bit python (using twisted) can track 200 pretty high traffic connections ok 05:38 < |Craig|> and through all this abuse, my little go server that I wrote today didn't crash or lock up once 05:39 < Ccod> very impressive 05:39 -!- matti___ [~mumboww@c-98-207-108-218.hsd1.ca.comcast.net] has quit [Ping timeout: 276 seconds] 05:39 -!- jochang [~identd@58-114-203-35.cable.dynamic.giga.net.tw] has joined #go-nuts 05:40 < Ccod> well, sounds it at least... I don't have much experience in that field 05:41 < |Craig|> 100 connection requests piled on it all at once, all got through without dropping. I guess the TCP server thingy in the net package is pretty nice 05:42 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.pa.comcast.net] has joined #go-nuts 05:43 < Ccod> have you seen the google cast thing on go? 05:43 < |Craig|> I saw the inital launch video 05:44 < |Craig|> thats about it though 05:45 < Ccod> yeah, I think thats it. There was this thing when they typed ./eval1 ... which i thought was like a go console 05:45 < Ccod> or something 05:45 < Ccod> ... is there something like that somewhere? 05:45 < |Craig|> 247 is the magic number. No matter how much I slow things down, I can't get more connections than that. 05:45 -!- matti___ [~mumboww@c-98-207-108-218.hsd1.ca.comcast.net] has joined #go-nuts 05:46 < |Craig|> Ccod: there is the go playground on the golang site 05:49 -!- fabled [~fabled@83.145.235.194] has joined #go-nuts 05:49 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts 05:49 -!- mode/#go-nuts [+v iant] by ChanServ 05:50 < Ccod> hmm, not really what I was looking for. I wanted a kind of trace on the execution of the code... 05:50 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts 05:52 < krutcha> trying to wrap my head around pkg/xml, anybody played with it much? 05:52 < Ccod> not yet 05:53 < |Craig|> I finally made my server die, some "too many open files" error 05:53 < |Craig|> well, it locked up until I took the load off. It didn't crash 05:57 < Ccod> heh 05:58 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.pa.comcast.net] has quit [Quit: skelterjohn] 05:58 < Ccod> later 05:58 -!- Ccod [~peter@c-76-18-5-93.hsd1.fl.comcast.net] has left #go-nuts [] 05:59 < |Craig|> oh, its the mac default open files limit for a process, makes sense. I should be able to get around that 06:22 -!- jochang [~identd@58-114-203-35.cable.dynamic.giga.net.tw] has quit [Ping timeout: 252 seconds] 06:46 < krutcha> I don't suppose mac/bsd have ulimit? 06:46 < krutcha> on linux ulimit -n shows that number 06:49 -!- mssm [~mssm@ip-95-221-86-196.bb.netbynet.ru] has joined #go-nuts 06:52 < |Craig|> krutcha: I figured it out 06:52 < |Craig|> ulimit just says unlimited, but there is a per process max default I avoided by adding a config file 06:58 < krutcha> nice 06:58 < krutcha> I'm still lost in XML rfc's and vomiting at the size of some of the streams I'm seeing 06:59 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts 07:01 -!- mssm [~mssm@ip-95-221-86-196.bb.netbynet.ru] has quit [Ping timeout: 245 seconds] 07:05 -!- noktoborus [~noxless@gateway/tor-sasl/noktoborus] has quit [Quit: noktoborus] 07:06 -!- Chopinn [~Chopin@ti0018a380-dhcp1590.bb.online.no] has quit [Quit: Leaving] 07:13 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has quit [Quit: leaving] 07:14 -!- mssm [~mssm@ip-95-221-86-196.bb.netbynet.ru] has joined #go-nuts 07:14 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has joined #go-nuts 07:16 < krutcha> is it possible to directly update a struct's data in a map or must one copy out/update/clobber? 07:17 < SoniaKeys> i would expect it to be possible 07:17 < SoniaKeys> but it's easy enough to try a little experiment 07:24 < SoniaKeys> well, it's no problem if you store a pointer to the struct in the map. 07:26 < krutcha> yeah, I'm not going to go there in this case. it's easy enough to copy out/in for my needs. 07:26 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts 07:31 -!- ExtraSpice [~XtraSpice@88.118.33.48] has quit [Quit: Leaving] 07:33 < krutcha> hm when removing a struct from a map, do you have to pass in a valid struct value? 07:33 < krutcha> nil and _ don't seem to work 07:34 < |Craig|> krutcha: nil only works for pointers 07:34 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts 07:34 < krutcha> effective go shows the example: timeZone["PDT"] = 0, false 07:35 < krutcha> but my values are structs, it seems paintful to have to go {"","","",""}, false 07:35 < |Craig|> krutcha: you can use the struct's 0 value 07:36 < |Craig|> new(typeName) 07:36 -!- ucasano [~ucasano@host153-182-static.227-95-b.business.telecomitalia.it] has joined #go-nuts 07:36 < |Craig|> also, if you specify a name for one of the values in the composite literal, you can leave out the others 07:37 < krutcha> but new would allocate an empty struct on the heap just to delete it and the one in the map 07:37 < krutcha> wouldn't it? 07:38 < |Craig|> no matter what you do, you are going to allocate something right? (Not the best design in my opinion) 07:39 < krutcha> in this rare case I'd prefer a _ on the right side. Or maybe an interface function like func (*this map) delete (key) 07:43 < SoniaKeys> the compiler might optimize away the pointless allocations. still, i agree it seems silly to have to supply a value that will be ignored. 07:44 < krutcha> yeah it's a bit wierd, I found a thread on it here: http://groups.google.com/group/golang-nuts/browse_thread/thread/55758d25014282db 07:44 < krutcha> I don't see any examples in there where the value is a big honkin struct tho 07:44 < Archwyrm> timeZone["PDT"] = _ // would seem rather unambiguous, IMHO 07:45 < krutcha> it makes the m[k] = x,false quickly look a lot less clean 07:46 < |Craig|> krutcha: if someone had a big struct, they would use a pointer 07:46 < krutcha> I guess in go I could use pointers there, as the GC would save me 07:46 < Archwyrm> Hence I have mostly been using 'nil, false' which isn't too bad. 07:46 < |Craig|> its not like maps already screw the cache, and the pointer dereferance won't kill you 07:47 < |Craig|> *I mean it is like maps already screw the cache 07:47 < krutcha> alright references it is 07:47 < krutcha> easy change in go :) 07:47 < krutcha> no .'s to change to ->'s 07:48 < Archwyrm> ;) 07:48 < SoniaKeys> i've appreciated that a few times 07:49 < krutcha> though it does sort of hose my initial insertion loop 07:49 < Archwyrm> The syntactical change in C/C++ was to remind you to clean up after yourself. ;) 07:49 < krutcha> I had map[k] = tempBigStruct in a loop of updates 07:49 < krutcha> I surely don't want to pass in 1000 references to the same every changing temp struct 07:50 < krutcha> time to bust out new( 07:50 < |Craig|> just use &{blah} 07:50 < |Craig|> or new if you want 0 values 07:50 -!- adu [~ajr@pool-173-66-11-168.washdc.fios.verizon.net] has quit [Quit: adu] 07:50 -!- noktoborus_ [~noxless@gateway/tor-sasl/noktoborus] has joined #go-nuts 07:51 < krutcha> can you call functions in that paramater list? 07:51 < |Craig|> I don't see why not 07:51 < krutcha> to populate from returned data {x(),y(),z}? 07:51 < krutcha> good 07:58 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has joined #go-nuts 08:06 -!- noktoborus_ [~noxless@gateway/tor-sasl/noktoborus] has quit [Remote host closed the connection] 08:08 -!- SoniaKeys [~soniakeys@c-76-118-178-209.hsd1.ma.comcast.net] has quit [] 08:11 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|] 08:12 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout: 276 seconds] 08:12 -!- noktoborus_ [~noxless@gateway/tor-sasl/noktoborus] has joined #go-nuts 08:14 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Ping timeout: 245 seconds] 08:26 -!- bjarneh [~bjarneh@232.80-203-20.nextgentel.com] has quit [Quit: leaving] 08:43 -!- Project_2501 [~Marvin@82.84.79.101] has joined #go-nuts 08:49 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has quit [Quit: Lost terminal] 09:09 -!- photron_ [~photron@port-92-201-176-25.dynamic.qsc.de] has joined #go-nuts 09:22 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 09:25 -!- awidegreen [~quassel@p5DF1D7D4.dip.t-dialin.net] has joined #go-nuts 09:31 -!- krutcha [~krutcha@S010600045a27676a.vs.shawcable.net] has quit [Quit: Leaving] 09:32 -!- skejoe [~skejoe@188.114.142.231] has joined #go-nuts 09:40 -!- zozoR [~zozoR@5634798d.rev.stofanet.dk] has joined #go-nuts 09:44 -!- fabled [~fabled@83.145.235.194] has quit [Read error: Operation timed out] 09:46 -!- tsykoduk [~tsykoduk@184.78.195.79] has quit [Ping timeout: 276 seconds] 09:48 -!- tsykoduk [~tsykoduk@184.78.195.79] has joined #go-nuts 09:53 -!- jo__ [3a72cb23@gateway/web/freenode/ip.58.114.203.35] has joined #go-nuts 09:54 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has joined #go-nuts 09:59 -!- fabled [~fabled@83.145.235.194] has joined #go-nuts 10:01 -!- terrex [~terrex@84.122.72.127.dyn.user.ono.com] has joined #go-nuts 10:03 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving] 10:07 -!- virtualsue [~chatzilla@nat/cisco/x-lloixnpwewaklifc] has quit [Ping timeout: 240 seconds] 10:10 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has quit [Quit: KVIrc Insomnia 4.0.2, revision: 4740, sources date: 20100627, built on: 2010-10-19 12:51:39 UTC http://www.kvirc.net/] 10:21 -!- femtoo [~femto@95-89-197-196-dynip.superkabel.de] has joined #go-nuts 10:28 -!- Project_2501 [~Marvin@82.84.79.101] has quit [Quit: E se abbasso questa leva che succ...] 10:36 -!- tensorpudding [~user@99.148.202.191] has quit [Read error: Connection reset by peer] 10:36 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Ping timeout: 245 seconds] 11:08 -!- Fish [~Fish@bus77-2-82-244-150-190.fbx.proxad.net] has joined #go-nuts 11:10 -!- terrex [~terrex@84.122.72.127.dyn.user.ono.com] has quit [Quit: Leaving.] 11:12 -!- zozoR2 [~zozoR@563461e3.rev.stofanet.dk] has joined #go-nuts 11:15 -!- noam [noam@IGLD-84-229-71-149.inter.net.il] has joined #go-nuts 11:21 -!- virtualsue [~chatzilla@host81-148-100-129.in-addr.btopenworld.com] has joined #go-nuts 11:23 -!- wrtp [~rog@92.17.98.41] has joined #go-nuts 11:26 -!- virtualsue [~chatzilla@host81-148-100-129.in-addr.btopenworld.com] has quit [Ping timeout: 245 seconds] 11:28 < nsf> 8 files changed, 666 insertions(+), 465 deletions(-) 11:28 < nsf> omg 11:28 < nsf> what a patch 11:29 -!- skejoe [~skejoe@188.114.142.231] has quit [Quit: Lost terminal] 11:31 < nsf> I've just added arrow keys scrolling (per item) to alt go docs 11:34 -!- virtualsue [~chatzilla@host81-139-165-122.in-addr.btopenworld.com] has joined #go-nuts 11:35 -!- wrtp [~rog@92.17.98.41] has quit [Quit: wrtp] 11:35 -!- zozoR2 [~zozoR@563461e3.rev.stofanet.dk] has quit [Quit: Morten. Desu~] 11:53 -!- virtualsue [~chatzilla@host81-139-165-122.in-addr.btopenworld.com] has quit [Ping timeout: 245 seconds] 11:54 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has joined #go-nuts 11:57 -!- ucasano [~ucasano@host153-182-static.227-95-b.business.telecomitalia.it] has quit [Quit: ucasano] 11:59 -!- virtualsue [~chatzilla@host81-139-66-80.in-addr.btopenworld.com] has joined #go-nuts 12:16 -!- wrtp [~rog@92.17.98.41] has joined #go-nuts 12:24 -!- artefon [~thiago@189.59.163.114] has joined #go-nuts 12:25 -!- lmoura_ [~lauromour@187.113.168.168] has quit [Ping timeout: 245 seconds] 12:27 -!- virtualsue_ [~chatzilla@nat/cisco/x-hstxevtxcouglhhg] has joined #go-nuts 12:47 -!- fabled [~fabled@83.145.235.194] has quit [Quit: Ex-Chat] 12:49 -!- araujo [~araujo@190.38.50.25] has joined #go-nuts 12:49 -!- araujo [~araujo@190.38.50.25] has quit [Changing host] 12:49 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts 12:52 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts 13:03 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.pa.comcast.net] has joined #go-nuts 13:12 < hokapoka> Is there any means to load structs from others packages dynamically? 13:17 < hokapoka> For example, if I had a package that would say serialize structs to a file. Would it be possible to build another, seperate, package that exported some structs and some interface that I could interact with for the serialization package, without having to import & re-compile it? 13:17 < hokapoka> s/for/from 13:17 < taruti> like json? 13:19 < hokapoka> The serialization was just an example, I'd like to beable to use the reflect package that would be imported to & use the structs. 13:19 < hokapoka> s/&// 13:21 -!- virtualsue [~chatzilla@host81-139-66-80.in-addr.btopenworld.com] has quit [Ping timeout: 245 seconds] 13:21 < hokapoka> A bit like plugins, so that I could have a standard package that would load structs and call exported functions within the other package, assuming the other package Exposed some standard interfaces. 13:21 < taruti> there is no dynamic loading. 13:21 -!- virtualsue_ [~chatzilla@nat/cisco/x-hstxevtxcouglhhg] has quit [Ping timeout: 255 seconds] 13:22 < hokapoka> okay, so if I wanted todo this I would need to writen another package that would generate the imports and re-complie the main package. 13:22 -!- sauerbraten [~sauerbrat@p508CC67A.dip.t-dialin.net] has joined #go-nuts 13:24 < nsf> skelterjohn: I've added your feature request to my go docs 13:24 < nsf> skelterjohn: I hope your notebook has arrow keys :D 13:24 < hokapoka> I thought that was the case, and as go builds so fast it's no a big deal. In theory it would be quite simple to achive via some standard approach. Just wanted to be sure that I couldn't load other packages dynamically. 13:27 -!- virtualsue [~chatzilla@host81-148-115-114.in-addr.btopenworld.com] has joined #go-nuts 13:29 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.pa.comcast.net] has quit [Quit: skelterjohn] 13:32 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.nj.comcast.net] has joined #go-nuts 13:35 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.nj.comcast.net] has quit [Client Quit] 13:39 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.nj.comcast.net] has joined #go-nuts 13:43 -!- skelterjohn [~jasmuth@c-76-98-219-171.hsd1.nj.comcast.net] has quit [Client Quit] 13:48 -!- wrtp [~rog@92.17.98.41] has quit [Ping timeout: 245 seconds] 13:54 -!- wrtp [~rog@92.17.98.41] has joined #go-nuts 14:02 -!- fenicks [~christian@log77-3-82-243-254-112.fbx.proxad.net] has left #go-nuts [] 14:03 -!- virtualsue [~chatzilla@host81-148-115-114.in-addr.btopenworld.com] has quit [Ping timeout: 252 seconds] 14:09 -!- virtualsue [~chatzilla@host81-139-108-139.in-addr.btopenworld.com] has joined #go-nuts 14:15 -!- rinzai [~rinzai@host81-154-14-173.range81-154.btcentralplus.com] has joined #go-nuts 14:19 -!- meanburrito920 [~john@192.5.109.49] has joined #go-nuts 14:19 -!- meanburrito920 [~john@192.5.109.49] has quit [Changing host] 14:19 -!- meanburrito920 [~john@unaffiliated/meanburrito920] has joined #go-nuts 14:22 -!- speps [d529952a@gateway/web/freenode/ip.213.41.149.42] has joined #go-nuts 14:29 -!- Guest92113 [d529952a@gateway/web/freenode/ip.213.41.149.42] has quit [Quit: Page closed] 14:29 -!- rinzai [~rinzai@host81-154-14-173.range81-154.btcentralplus.com] has quit [Quit: Leaving] 14:36 -!- virtualsue_ [~chatzilla@nat/cisco/x-ewgclewgzmepusib] has joined #go-nuts 14:55 -!- meanburrito920 [~john@unaffiliated/meanburrito920] has quit [Ping timeout: 265 seconds] 15:00 < nsf> http://www.digitalmars.com/d/archives/digitalmars/D/One_year_of_Go_121846.html 15:00 < nsf> warning: trolling insdie 15:00 < nsf> inside* 15:00 < nsf> "Go is the Paris Hilton of programming languages." 15:00 < nsf> it's always good to hear alternative opinion :) 15:03 < bartbes> but is it annoying and omnipresent? 15:04 < nsf> I don't know, I'm just boring, when I'm boring I read flamewars 15:04 < nsf> Go vs. D is kind of fun to me 15:05 -!- femtoo [~femto@95-89-197-196-dynip.superkabel.de] has quit [Quit: Leaving] 15:05 < nsf> bartbes: so.. I guess I'm noticing alt opinions only when I'm boring 15:09 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts 15:11 < nsf> lol, Alexandrescu says that Go has issues with semicolons 15:11 < nsf> I have written like 10k lines of Go code and had zero problems with semicolons 15:11 < nsf> :\ 15:13 < bartbes> the thing is, Go can't help him with his not-quite colon 15:13 < bartbes> sorry, those jokes were horrible 15:13 * bartbes leaves 15:20 < nsf> the funnies part it all things they complain about is lack of generics (of course, if language doesn't have generics you can't write tons of books about it) and semicolons :) 15:20 < nsf> funniest* 15:20 < nsf> yet, still no one was able to provide real example for generics use case in real application 15:21 < nsf> sure, there are some, but are they frequent enough 15:22 < nsf> In C the most thing I use preprocessor for is a generic vector implementation 15:22 < nsf> and that's it 15:22 < nsf> but Go has slices 15:22 < nsf> and even maps 15:22 < nsf> I just don't understand D authors 15:23 < nsf> I guess they are jealous that Go takes much more attention than D, when it was born 15:23 < nsf> D is a total failure 15:23 < nsf> :P 15:25 < skelterjohn> what do you mean, no one can provide a real example for generics use 15:25 < skelterjohn> i certainly can 15:25 < nsf> can you? 15:25 < nsf> do it 15:25 < nsf> :) 15:25 -!- noam [noam@IGLD-84-229-71-149.inter.net.il] has quit [Read error: Connection reset by peer] 15:25 < nsf> it should be from a real, existing application 15:25 -!- noam [noam@IGLD-84-229-71-149.inter.net.il] has joined #go-nuts 15:25 < skelterjohn> I have an algorithm that I work with, developed in my lab 15:25 < skelterjohn> it's called FSSS 15:26 < skelterjohn> it is a search tree algorithm that works on somethign we call an oracle 15:26 < skelterjohn> and the oracle has an underlying type 15:26 < skelterjohn> often this can be an integer 15:26 < skelterjohn> but sometimes it would be nice to have an array 15:26 < skelterjohn> or a string, doesn't matter, as far as FSSS is concerned 15:27 < skelterjohn> i could use interface{}, but that would have literally millions of type assertions that don't need to happen 15:27 < skelterjohn> and speed is important 15:27 < skelterjohn> and i don't feel like making identical copies of FSSS for the different types i want 15:27 < nsf> make a generator 15:28 < skelterjohn> add generics to the language 15:28 < nsf> but why? 15:28 < skelterjohn> so people don't have to make generators 15:28 < nsf> generic algorithms is a rare 15:28 < nsf> why should we have something like that in the language, that isn't essential 15:28 < skelterjohn> because it makes the programmer's life easier 15:29 < skelterjohn> also, the C++ standard template library is a great example of appropriate use of generics 15:29 < skelterjohn> container classes that don't need type assertions 15:29 < nsf> and compiler programmer's life harder and tools programmer's life harder 15:29 < skelterjohn> and can be space efficient 15:29 < skelterjohn> yes - there are many more "regular" programmers than compiler programmers 15:30 < skelterjohn> we could have the compiler programmer's life really easy and just use assembly 15:30 < skelterjohn> save them lots of work 15:30 < nsf> yes, they don't like to spend two hours a day to write a generator 15:30 < nsf> yet* 15:30 < skelterjohn> i don't follow that point 15:31 < skelterjohn> also, literally one of the first things i learned about how to write code (from my dad when I was 13) was "if you're copying code around, you're doing something wrong" 15:31 < nsf> generics in a language touch every feature 15:31 < skelterjohn> now, that may or may not be true 15:31 < nsf> basically adding generics to a language 15:31 < nsf> means making a different language 15:31 < skelterjohn> but it's sort of a deep belief of mine now, since i learned it when i was so young 15:32 < nsf> as a matter of fact it's a lie 15:32 < skelterjohn> the fact that it's hard to add generics to the language is orthogonal to the fact that generics would make the language nicer for some people, like me 15:32 < nsf> if you're copying code around then you have something to change if you can't, then you need to write a generator 15:32 -!- Fish [~Fish@bus77-2-82-244-150-190.fbx.proxad.net] has quit [Ping timeout: 255 seconds] 15:33 < nsf> but also generics will brought tons of crappy unreadable code 15:33 < nsf> like it is now with C++ 15:33 < skelterjohn> btw i know you don't mean offense by calling my dad a liar, but a better way to say that might be "as a matter of fact it's not true" :) 15:33 < nsf> and with D 15:33 -!- Fish [~Fish@bus77-2-82-244-150-190.fbx.proxad.net] has joined #go-nuts 15:34 < nsf> your dad isn't a liar because he belives that it's true 15:34 < nsf> he's just mistaken 15:34 < skelterjohn> i know that's what you meant, that's why i didn't take offense 15:34 < nsf> there is literally no way to avoid that kind of "copy" action 15:34 < nsf> it's just a nice signal to you 15:34 < nsf> "time to do some refactoring" 15:35 < nsf> the worst thing here is to ignore it 15:35 < skelterjohn> right - if i feel the need to copy code somewhere, i refactor the code instead 15:35 < nsf> but by mistake people think they should avoid copying 15:36 < nsf> but still there is something profound wrong with the understanding of the problem 15:36 < skelterjohn> but having code generators is just as bad - you have multiple pieces of code that have exactly the same behavior, and a bug in one is a bug in all of them, but to fix this bug you have to fix it in all those places 15:36 < nsf> if you think that copying is bad, you're trying to make everything generic 15:37 < nsf> otherwise you just write code, and when there are copies you transform them to generic code 15:37 < nsf> code generators aren't bad 15:37 < nsf> Go compiler is written using a code generator 15:37 < nsf> called yacc 15:37 < skelterjohn> the programming language for the compiler is yacc, not C 15:37 < skelterjohn> even if it creates C code as an intermediate step 15:38 < nsf> it's not a programming language, it's sort of a description of rules and it generates C code :) 15:38 < nsf> type is just a description in templates 15:38 < skelterjohn> it's a language that creates a program 15:38 < skelterjohn> aka a programming language 15:38 < nsf> templates are a built-in code generator 15:38 < skelterjohn> i don't think go should have templates 15:38 < skelterjohn> it doesn't make sense with go 15:39 < nsf> but then it goes to the point, what Go should have? no one knows yet 15:39 < skelterjohn> that is a different question than "would some sort of generics be useful?" 15:39 < nsf> nope :) 15:39 < nsf> how one can solve generic algorithms problem in Go 15:40 < nsf> I vote for code generators 15:40 < skelterjohn> they are related, but it's a different question. 15:40 < skelterjohn> here's something that makes code generators not work 15:40 < skelterjohn> someone made GoLLRB - a nice binary search tree package 15:40 < skelterjohn> uses interface{} as a type 15:40 < skelterjohn> this guy should have to distribute his source 15:41 < skelterjohn> not interface, sorry 15:41 < skelterjohn> but an interface 15:41 < skelterjohn> actually that's a bad example 15:41 < skelterjohn> here's a better one 15:41 < skelterjohn> i made a package called gohash 15:41 < skelterjohn> it has a hashmap type that has interface{} as its value type 15:41 < skelterjohn> i shouldn't have to distribute source to let someone use it 15:42 < nsf> why? 15:42 < skelterjohn> which means they can't use a code generator to make a version for their own custom type 15:42 < skelterjohn> because i have a proprietary super algorithm inside that i want to sell 15:42 < nsf> well, you know, selling algorithms is stupid, sorry for my opinion 15:42 < skelterjohn> and THAT is certainly a different issue entirely 15:42 < exch> Rent doesn't pay itself :p 15:43 < nsf> exactly, it just means Go isn't a language you want 15:43 < skelterjohn> but go allows you to distribute only binaries and should continue to do so 15:43 < skelterjohn> well it is, because i don't ahve to distribute source 15:43 < skelterjohn> anyway - in that scenario, code gen doesn't work 15:43 < skelterjohn> but some sort of generics could let the person using the code be type safe and efficient at the same time 15:44 < nsf> haha, if you think that having a binary will stop people from knowing what your algorithm is 15:44 < nsf> you're wrong 15:44 < skelterjohn> irrelevant 15:45 < nsf> it is relevant, because you're complaining about binary vs. source form 15:45 < skelterjohn> it is completely irrelevant - source and binary are not equivalent 15:45 < nsf> nothing can stop other people from using your algorithm, except law (at some level) 15:45 < skelterjohn> otherwise microsoft would include a source DVD with windows 7 15:45 < exch> The legal difference is what it's all about 15:46 < exch> But, you could license out the source itself as well 15:46 < nsf> and as a matter of fact it's not even about the language 15:46 < nsf> it's about implementation 15:46 < skelterjohn> you're moving the goal-posts. the scenario i've explained is why i think generics are useful. 15:47 < nsf> also C++'s and D's templates work only in a source form 15:47 < skelterjohn> so? 15:47 < exch> templates != generics 15:48 < nsf> ok ok 15:48 < nsf> nevermind then 15:49 < skelterjohn> you know what i think would be useful? an interface[]{} type 15:49 < skelterjohn> not an array of interfaces 15:49 < skelterjohn> but an interface on an array 15:50 < skelterjohn> so if i have type FooInter interface{ Foo() } 15:50 < skelterjohn> hmm.. i don't know what the syntax would be 15:50 < skelterjohn> maybe FooInter[] 15:50 < skelterjohn> type FooInter[] could wrap a slice of things that all implement FooInter 15:51 < skelterjohn> it would have to keep size info for the things in the slice, so when i have "x FooInter[] = ... ; x[2].Foo()" it could do it properly 15:51 < nsf> I don't think it's a good idea 15:52 < skelterjohn> it would allow things that take arbitrary types to not have the issue of rebuilding lists 15:52 < skelterjohn> what about it do you think is a bad idea? 15:52 < exch> Isn't that the same as just defining a slice of an interface type? 15:53 < skelterjohn> no - because I can't say var X []FooInter = mySliceOfThingsThatImplementFoo 15:53 < skelterjohn> because that slice is the actual structs, not the interfaces wrapping the structs 15:53 < exch> yes, but thats irrelevant. If they all implement the given interface, you can treat em as such 15:54 < exch> regardless of what they really are underneath 15:54 < skelterjohn> but to do so i'd have to rebuild the slice 15:54 < skelterjohn> for i := range myOtherSlice { myFooSlice[i] = myOtherSlice[i] } 15:54 < nsf> skelterjohn: see how sort.Interface does that 15:54 < exch> oh right, I think I get what you mean 15:54 < nsf> it wraps the whole array to an interface 15:54 < nsf> instead of asking for each element 15:54 < skelterjohn> does it use reflect on the inside 15:54 < skelterjohn> ? 15:54 < nsf> no 15:55 < skelterjohn> oh - but that's because the itnerface defines the necessary array operations 15:56 < nsf> but I don't like sort.Interface, because it involves virtual function calls on each operation 15:56 < skelterjohn> right 15:56 < nsf> it will be as slow as ruby or php 15:56 < nsf> :) 15:56 < nsf> well, actually faster 15:56 < nsf> but still slow 15:56 < nsf> :) 15:56 < skelterjohn> so if it took as a type interface[]{ Less(other interface{}) bool } 15:56 < nsf> even compared to C's qsort 15:56 < skelterjohn> modulo readable syntax 15:56 < skelterjohn> it could be faster 15:57 < nsf> no 15:57 < nsf> any interface is a virtual function calls 15:57 < skelterjohn> but it has fewer of them 15:57 < skelterjohn> only Less would require it 15:57 < skelterjohn> not len or swap 15:58 < skelterjohn> that's half as many virtual function calls 15:58 < nsf> uhm.. you can't implement swap for interface[]{} 15:58 < skelterjohn> you don't have to 15:58 < nsf> without doing a virtual dispatch 15:58 < skelterjohn> you can just say mySlice[i], mySlice[j] = mySlice[j], mySlice[i] 15:58 -!- niemeyer [~niemeyer@189-10-175-46.pltce701.dsl.brasiltelecom.net.br] has joined #go-nuts 15:58 < nsf> yes, but what code it will generate 15:58 < skelterjohn> the type knows the size of the things in it 15:59 < skelterjohn> so it knows exactly which bytes are "mySlice[i]" 15:59 < nsf> ah, yes 15:59 < skelterjohn> and it can copy them 15:59 < nsf> ok, swap solved 15:59 < nsf> other issues are still here 16:00 < nsf> the only reason why I need templates (or code generator) is performance 16:00 < skelterjohn> what are the other issues with interface[]{}? 16:01 < nsf> it doesn't solve other generic algorithms problems 16:01 < nsf> trees you've mentioned 16:01 < skelterjohn> it's not supposed to :) 16:01 < skelterjohn> just another thing that i'd find useful 16:01 < nsf> you need more than that to add a feature to the language 16:01 < nsf> imho 16:02 < skelterjohn> if we add interface[]{}, then the only thing that I would need from generics is type safety 16:02 < skelterjohn> because we can just use interface{} and interface[]{} underneath the hood 16:02 < skelterjohn> though interface[]{} is clearly a horrible way of doing the syntax 16:03 < nsf> maybe simply: interface[] :) 16:03 < skelterjohn> the interface needs some methods 16:03 < skelterjohn> interface[]{Foo()}, eg 16:03 < nsf> interface[ Less(other interface{}) ] 16:03 < nsf> :D 16:03 < skelterjohn> haha 16:03 < skelterjohn> it also needs to be stackable 16:03 < skelterjohn> interface[][]{} 16:04 < nsf> iSlice, lol 16:05 < skelterjohn> i'm gonna bother the ML about it 16:06 < skelterjohn> and see if they make fun of me 16:06 < wrtp> i will :-) 16:06 < skelterjohn> haha 16:07 < wrtp> if arrays why not maps too? 16:07 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts 16:07 < nsf> iMap 16:08 < nsf> iChannel 16:08 < nsf> why not 16:08 < nsf> :) 16:08 < skelterjohn> well, i don't see any reason why not 16:08 < wrtp> anyway you can have arrays that correspond to arbitrary interfaces 16:08 < skelterjohn> it certainly makes sense to want to use it like that 16:09 < skelterjohn> i don't know where you're going with that - can you continue? 16:10 < wrtp> when i want to make a list.List typesafe, i just do: type MyTypesafeList list.List 16:10 < wrtp> and define methods to do the requisite type checking 16:10 < wrtp> i mean, methods taking and returning the required type 16:11 < skelterjohn> right - that's a way to deal with type safety, but not a way to deal with asserts that can be known to succeed at compile-time 16:11 < skelterjohn> both are issues 16:12 < wrtp> i don't think you can deal with the latter without generics 16:12 < skelterjohn> i agree 16:13 < wrtp> because interfaces are "there exists" types not "for all" types 16:13 -!- danslo [~daniel@s5593965d.adsl.wanadoo.nl] has quit [Quit: Leaving.] 16:14 < wrtp> gotta go 16:14 < skelterjohn> peace 16:16 -!- artefon [~thiago@189.59.163.114] has quit [Read error: Connection reset by peer] 16:19 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 240 seconds] 16:27 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 16:28 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts 16:28 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 255 seconds] 16:30 -!- rlab_ [~Miranda@91.200.158.34] has joined #go-nuts 16:31 -!- artefon [~thiago@189.59.198.71] has joined #go-nuts 16:31 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 240 seconds] 16:41 -!- aho [~nya@fuld-4d00d53f.pool.mediaWays.net] has joined #go-nuts 16:45 -!- napsy [~luka@88.200.45.109] has joined #go-nuts 17:09 -!- ymasory_ [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has joined #go-nuts 17:09 -!- ymasory_ [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has quit [Read error: Connection reset by peer] 17:19 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3] 17:28 < wrtp> skelterjohn: so in your example that you posted, if you tried to assign an object of type MyInterface to y that didn't happen to be a Fooer, what would happen? 17:29 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout: 245 seconds] 17:32 -!- mssm [~mssm@ip-95-221-86-196.bb.netbynet.ru] has quit [Ping timeout: 245 seconds] 17:32 -!- awidegreen_ [~quassel@p5DF1E44E.dip.t-dialin.net] has joined #go-nuts 17:33 -!- awidegreen [~quassel@p5DF1D7D4.dip.t-dialin.net] has quit [Ping timeout: 240 seconds] 17:34 -!- napsy [~luka@88.200.45.109] has quit [Ping timeout: 264 seconds] 17:36 -!- napsy [~luka@88.200.96.18] has joined #go-nuts 17:58 < skelterjohn> wrtp: can you be more specific? 17:59 < skelterjohn> oh - i see 17:59 < skelterjohn> interesting point 18:00 < skelterjohn> ok - the type MyInterface[] knows its type at runtime 18:00 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has joined #go-nuts 18:00 < wrtp> so the type check is dynamic? 18:00 < wrtp> that seems wrong to me, if so. 18:00 < skelterjohn> i'm thinking 18:01 < skelterjohn> well, when dealing with interfaces, runtime checks happen all the time 18:01 < skelterjohn> if generics were done as a layer on top of that the check could be skipped 18:01 < skelterjohn> so i don't think that a dynamic check for assignment to a slice-interface is necessarily a bad thing 18:02 < skelterjohn> it'd be equivalent to y.([]NotAFooer)[2] = notAFooerInstance 18:02 < wrtp> dealing with interfaces, runtime checks that can result in an error only occur when you specifically ask to do them 18:02 < skelterjohn> that's true 18:03 < wrtp> i think you mean y[2] = notAFooerInstance.(Fooer) 18:03 < skelterjohn> no - Fooer is the non interface type that happens to have a Foo() method 18:04 < skelterjohn> and you could never convert notAFooerInstance to a Fooer instance 18:04 < wrtp> exactly 18:04 < skelterjohn> but it could still satisfy MyInterface 18:04 < wrtp> but y only accepts Fooer instances 18:04 < skelterjohn> you only know that at runtime 18:04 < wrtp> you might as well use an array of Fooer 18:05 < skelterjohn> you don't know at runtime that Fooer is the solid type you want 18:05 < skelterjohn> you just know it's an array of things that can go Foo() 18:05 < skelterjohn> i may have chosen the names poorly in my example 18:07 < skelterjohn> but that's a good point about type checking only being allowed to fail when you ask for it 18:07 < skelterjohn> anything else would not be typesafe, clearly 18:08 < wrtp> yup 18:08 < wrtp> gotta go again! 18:08 < yiyus> and how do you know, at runtime, if a value can be asigned to an interface[] value? 18:09 < skelterjohn> the interface{}[] type keeps track of the internal type in the same way that interface{} does 18:09 < skelterjohn> it's just an interface for a slice, and needs to know how big its elements are 18:10 < yiyus> but with interface{} you just have to check if you implement interface{}, which makes sense 18:10 < yiyus> but with an interface{}[] you have to check that the underlying types are the same, which i find much less evident 18:10 < skelterjohn> to assign something of type []T to type MyInterface[], you just check T against MyInterface 18:11 < skelterjohn> i don't follow 18:11 < yiyus> but you cannot asign whatever that satisfays MyInterface 18:11 < yiyus> because Type1 and Type2 can both implement MyInterface 18:12 < yiyus> but you cannot mix them in arrays 18:12 < skelterjohn> that's right 18:12 < skelterjohn> this is the issue that wrtp brought up 18:12 < skelterjohn> and i haven't come up with a satisfactory answer yet 18:12 < skelterjohn> but i am thinking 18:12 < yiyus> indeed, it's the same problem 18:13 < skelterjohn> a necessary (but not sufficient) condition for this to be useful is to be able to say y[i] = y[j] 18:13 < skelterjohn> in this case, you know that the types match 18:13 -!- virtualsue [~chatzilla@host81-139-108-139.in-addr.btopenworld.com] has quit [Ping timeout: 245 seconds] 18:13 < skelterjohn> another thing that would be nice to be able to do is say z := y[j]; y[i] = z 18:14 < skelterjohn> but if that is allowed, it is allowed for any z 18:14 < skelterjohn> and i can't figure out a way to get around needing a type assertion there 18:14 < skelterjohn> that could potentially fail 18:14 < skelterjohn> you also can't say y.([]TheRightType)[i] = z, because you don't know TheRightType 18:15 -!- virtualsue_ [~chatzilla@nat/cisco/x-ewgclewgzmepusib] has quit [Ping timeout: 240 seconds] 18:15 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts 18:15 < skelterjohn> y[i] = z could do a silent type assertion, but that will never happen 18:16 < skelterjohn> if this is all wrapped up in generics, though, the type assertion succeeds automatically 18:17 < skelterjohn> so there is that 18:21 < skelterjohn> Well, I posted that. But the argument put a bit of a dent in my idea, though 18:23 -!- virtualsue [~chatzilla@host81-148-89-136.in-addr.btopenworld.com] has joined #go-nuts 18:24 -!- jo__ [3a72cb23@gateway/web/freenode/ip.58.114.203.35] has quit [Quit: Page closed] 18:33 -!- virtualsue [~chatzilla@host81-148-89-136.in-addr.btopenworld.com] has quit [Ping timeout: 245 seconds] 18:38 -!- napsy [~luka@88.200.96.18] has quit [Quit: Lost terminal] 18:38 -!- napsy [~luka@88.200.96.18] has joined #go-nuts 18:39 < wrtp> skelterjohn: if you've got generics, you don't need this, i think 18:39 < skelterjohn> generics need an implementation 18:39 < skelterjohn> you can pretend to do generics without arrays by using interface{} 18:39 < skelterjohn> all you lack is type safety 18:39 < skelterjohn> if you ahve this, you can do it with arrays 18:43 -!- virtualsue [~chatzilla@host81-148-59-74.in-addr.btopenworld.com] has joined #go-nuts 18:44 < wrtp> generics are about much, much more than type safe arrays 18:45 < skelterjohn> it's not the solution, just a part of one possible solution 18:45 < wrtp> think about pointers to functions of data structures defined in terms of the parameterised type, for example 18:45 -!- XenoPhoenix [~Xeno@cpc5-aztw24-2-0-cust39.aztw.cable.virginmedia.com] has quit [Remote host closed the connection] 18:46 < wrtp> interface types cannot be compatible with generic parameter types 18:46 < skelterjohn> i don't think you can have a data structure defined in terms of a parameterized type without source analysis.... not and have it be a continuous block of data 18:46 < wrtp> of course you can - all the major functional programming languages allow it 18:47 -!- femtoo [~femto@95-89-197-196-dynip.superkabel.de] has joined #go-nuts 18:47 < skelterjohn> in java it's not a continuous block of data 18:47 < skelterjohn> the parameterized types are reference types 18:47 < wrtp> sure, that's one approach 18:47 < skelterjohn> in C++ it uses source analysis 18:47 < wrtp> C# does it right 18:47 < skelterjohn> i'm not aware of the other ways this is done 18:48 < wrtp> most functional programming languages, i believe, use a single size for all data types (pointer sized, i'd guess) 18:48 < wrtp> so that makes it easy 18:48 < skelterjohn> doesn't work if your parameterized type is a larger struct 18:49 < wrtp> it does if you keep all structs on the heap 18:49 < skelterjohn> but functional programming languages are safe if the values are const 18:49 < wrtp> C# relies on runtime code generation, i think 18:49 < skelterjohn> if the values are const, then copying a structure that contains a pointer is ok, because you know what it points to can't change and have side-effects 18:50 < wrtp> sure, but i'm not just talking about haskell here 18:50 < skelterjohn> i don't know how that could be safe otherwise 18:51 -!- virtualsue [~chatzilla@host81-148-59-74.in-addr.btopenworld.com] has quit [Ping timeout: 245 seconds] 18:51 < wrtp> you don't copy the structure 18:51 < wrtp> you have code that can deal with all possible sizes of type 18:51 < skelterjohn> this is all starting to sound inefficient 18:51 < wrtp> either several versions of the code, or one version that does memcpy all the time 18:51 < wrtp> yup, and that's the dilemma 18:53 < |Craig|> I'd be happy with a way to import files that does a find and replace on the source to swap a type. 18:53 < wrtp> there's already something that does that 18:53 < |Craig|> wrtp: link? 18:53 < wrtp> can't remember 18:53 < skelterjohn> search the mailing list for roundy gotit 18:54 < |Craig|> I;ll look around, I think I might have saw it once too 18:54 < skelterjohn> roundy is the guy's name 18:54 < skelterjohn> gotit is the (poorly named) package 18:54 < wrtp> it doesn't work so well, as it doesn't work at more than one level 18:54 < |Craig|> I already manually duplicated my container's source for one type so some automation would be nice 18:55 < skelterjohn> this would be appropriate for you 18:55 < |Craig|> excelent 18:56 < wrtp> thing is, most types are actually a very small range of sizes 18:57 < wrtp> byte, word, double word, triple word. not much code passes larger structs by value 18:57 < wrtp> so a memcpy hit probably isn't too bad 18:57 < |Craig|> I'm very aware of how horribly messy generics can be (java). I mostly see them as useful for containers 18:57 < wrtp> (in the latter case) 18:57 -!- virtualsue [~chatzilla@host81-148-75-88.in-addr.btopenworld.com] has joined #go-nuts 18:57 < wrtp> a channel is a form of container... 18:58 < skelterjohn> it'd be nice to be able to use something other than primitive types as keys for a map 18:59 < wrtp> yup - with generics that should be possible (add an argument to map make) 18:59 < wrtp> that means you wouldn't have to privilege some arbitrary method name 18:59 < |Craig|> wrtp: I have a data structure that has good reason to use larger structs by value (up to several words). Its sole purpose is to store objects side by side in memory in hopes of good cache performance and perhaps reduced GC load and fragmentation 19:00 < wrtp> yeah, i've used them too 19:00 -!- tensorpudding [~user@99.148.202.191] has joined #go-nuts 19:01 < |Craig|> Does one copy to remove an object, and one to add an object, indexed as pointers. 19:01 -!- XenoPhoenix [~Xeno@cpc5-aztw24-2-0-cust39.aztw.cable.virginmedia.com] has joined #go-nuts 19:01 < |Craig|> Gotit seems to be missing: https://github.com/droundy/gotit 19:03 < wrtp> hitting the sweet spot for generics is hard. that's why they haven't been done yet! 19:03 < |Craig|> ah, renamed https://github.com/droundy/gotgo/ (better name) 19:04 < |Craig|> I think part of the issues is that there are reasons to use multiple different of generics, and no one wants to clutter the language with several 19:05 < |Craig|> go already has built in generic stuff (like arrays, maps, channels), and some odd functions like close closed and cap. 19:05 < wrtp> generality *and* efficiency... 19:06 < |Craig|> how len closed and cap work seems rather odd to me, arn't they exceptions to how things generally work in go? 19:06 < skelterjohn> the built in functions cheat 19:07 < skelterjohn> overloaded, generic, etc 19:07 < |Craig|> if builtins have to cheat in several places, it indicates something is missing from the language, and when fixed, we will have a real solution + builtin hacks that work different (well maybe gofmt will save us from that and ending up like java) 19:08 -!- SoniaKeys [~soniakeys@c-76-118-178-209.hsd1.ma.comcast.net] has joined #go-nuts 19:09 -!- virtualsue [~chatzilla@host81-148-75-88.in-addr.btopenworld.com] has quit [Remote host closed the connection] 19:09 < |Craig|> the more hacks like that that get added (such as append) the bigger the language gets and the less intensive there is for real generics to rationalize it 19:10 < skelterjohn> i think that's the idea 19:10 < |Craig|> add more mess so we can avoid a feature? 19:10 < skelterjohn> seems that way to me 19:12 < |Craig|> length and cap are fields of an slice, and could be non exported and accessed through methods, but they arn't because generics are missing, so we use some global name space polluting special functions. That kind of thing is the only real issue that bugs me about go 19:13 < Namegduf> They aren't because the design decision was made that built-in types do not have methods. 19:13 < Namegduf> Has nothing to do with generics. 19:13 -!- XenoPhoenix [~Xeno@cpc5-aztw24-2-0-cust39.aztw.cable.virginmedia.com] has quit [Remote host closed the connection] 19:13 < |Craig|> Namegduf: ok, that explanation works for me 19:13 < |Craig|> interesting choice 19:14 < skelterjohn> it does indirectly - because they pollute the namespace where if we had generics they could be "regular" functions defined in packages 19:14 < Namegduf> They could have a magic package as much as magic functions. 19:14 < Namegduf> Hell, we do; unsafe. 19:15 < |Craig|> Thats really different from python where the difference between builtin types and others is almost non existent. Do you know why they decided not to give the builtin types methods? 19:15 -!- Project_2501 [~Marvin@82.84.79.101] has joined #go-nuts 19:15 -!- jochang [~identd@58-114-203-35.cable.dynamic.giga.net.tw] has joined #go-nuts 19:15 < skelterjohn> well, in python the built in functions call methods 19:15 < skelterjohn> len(x) calls x.__len__(), etc 19:16 < Namegduf> It's like the worst of both worlds! 19:16 < Namegduf> :P 19:16 < |Craig|> skelterjohn: yes, and you can make something from scratch that is identical to an int 19:16 < skelterjohn> __plus__ as well? 19:17 < |Craig|> skelterjohn: all operators call methods 19:17 < |Craig|> in python 19:17 < skelterjohn> hey - it beat's C++'s operator overloading 19:17 < skelterjohn> beats 19:18 < |Craig|> in python, you can make immutable, and give them math operators, and make a true int, string or what ever (aside from some performance) without leaving pure python. In go, you can't make any of the built in types. I won't say thats bad, but its really different and it took a while to sink in what it meant as far as implementing containers. 19:19 < |Craig|> My containers can never be like the built in ones 19:19 < Namegduf> Actually 19:19 < Namegduf> *can* you? 19:19 < Namegduf> Python does special optimisations for the built-in int. 19:19 < Namegduf> Can you match its performance, or get close to? 19:20 < skelterjohn> "(aside from some performance)" 19:20 < |Craig|> Namegduf: in python over load __new__ for immutable and interning. Anyway, performance is implimentation specific, not a language thing for python 19:20 < Namegduf> I agree that it's not a language thing for Python 19:21 < |Craig|> you can auctually hack it to claim its class is an int too 19:21 < Namegduf> But it's kind of important, especially for the example of containers. 19:21 < Namegduf> Not that I see the limitation in not being able to reimplement built-in types. 19:22 < |Craig|> Having built in containers and user made ones work differently in the very least adds complexity to learning the language, and lack of interchangeability 19:23 < Namegduf> But does it add complexity compared to alternative proposals that would make them work the same? 19:23 < Namegduf> You'd have to make other language changes. 19:23 < Namegduf> You can't compare "Problem vs Not Having Problem", you have to compare "Problem vs Alternative" 19:23 < |Craig|> It would require generics 19:24 < |Craig|> which yes, would add complexity 19:24 < Namegduf> Also operator overloading 19:24 < Namegduf> x[foo] syntax 19:24 < |Craig|> I'm not saying I have a solution, its just that I don't have any other problems with go to discuss :) 19:24 < skelterjohn> i don't mind not having operator overloading 19:24 < skelterjohn> it doesn't bother me to say myMatrix.Plus(anotherMatrix) 19:25 < Namegduf> I agree that overloading is the enemy of simplicity by way of expanding the number of rules you need to remember. 19:25 < Namegduf> Also less helpful than you'd think with matrixes unless you can add new operators for the additional operations that'd be nice to have. 19:26 < |Craig|> ha, you could allow operators as method names (kinda like scheme/lisp) myMatrix.+(anotherMatrix) (and I will not advocate allowing that) 19:26 < skelterjohn> it has been suggested 19:26 < skelterjohn> i think 1) it is ugly 19:26 < skelterjohn> that's about as far as i went 19:26 < Namegduf> I think there's a problem with associativity with that. 19:27 < Namegduf> And m1 + m2 + m3 is still ugly. 19:27 < Namegduf> Not a problem for Lisp, obviously. 19:27 < |Craig|> I was really glad there was no operator overloading in go 19:28 < |Craig|> its a whole mess I don't have to deal with 19:28 < Namegduf> I wonder what a solution to make Go handle large amounts of matrix multiplication would be. 19:28 < Namegduf> Or whether such a program would be better done in something else. 19:29 < Namegduf> I think it might just be best to take the hit and use methods everywhere. 19:29 < skelterjohn> if you want to write linear algebra, use matlab 19:29 < skelterjohn> if you want to do matrix stuff in go, use gomatrix ;) 19:29 < skelterjohn> certainly matlab will be faster than gomatrix, because the guys who made matlab are way smarter than i am 19:29 < |Craig|> Namegduf: skelterjohn's matric package works, but having it be generic for matrix sizes (so I could type something as a 3*3 and still have it have methods) would be nice. 19:30 -!- virtualsue [~chatzilla@nat/cisco/x-funmgovthqtqktvk] has joined #go-nuts 19:30 < Namegduf> What would be particularly interesting would be to enforce matrix sizes using the type system. 19:30 < skelterjohn> now it's getting messy 19:30 < Namegduf> I wonder if there's a generics proposal that would allow that. 19:30 < skelterjohn> i believe you can do that in C++ 19:30 < |Craig|> I have a package that only works with n*n and n*1 matrixes. I think you could do that generically in C++ 19:31 < |Craig|> I just have to have size checks everywhere, of hope its right 19:31 < |Craig|> *or 19:31 < skelterjohn> it will throw up on you if it's wrong 19:32 < |Craig|> yes, it will, and being able to do that costs time at runtime 19:32 < skelterjohn> not compared to the actual matrix operation 19:32 < |Craig|> Im dealing with 2*2 and 2*1 only here, I think it might be significant 19:32 < Namegduf> Depends on matrix size, yeah. 19:33 < skelterjohn> it's exactly one comparison 19:33 < Namegduf> Right now I'm playing with 4x4 in C. 19:33 < |Craig|> makes the code messy too as the sizes are only in the comments 19:33 < skelterjohn> m1.cols == m2.rows 19:35 < |Craig|> skelterjohn: initing a 2*2 takes 4 calls, all with size checks for row and column, not a set(a,b,c,d) (but you could add that with the ... thing maybe? I need to learn about that). It also many operations would not need to return errors if the sizes were fixed 19:36 < skelterjohn> you can initialize it with a []float64{a,b,c,d} 19:36 < |Craig|> type matrix2x2 [4]float <-- I guess I could do that 19:36 -!- virtualsue [~chatzilla@nat/cisco/x-funmgovthqtqktvk] has quit [Ping timeout: 250 seconds] 19:36 < |Craig|> skelterjohn: I didn't realize that 19:36 < skelterjohn> it's in dense_basic.go, i think 19:37 < |Craig|> ok 19:37 < skelterjohn> func MakeDenseMatrix(elements []float64, rows, cols int) *DenseMatrix 19:37 < skelterjohn> in dense.go 19:38 < |Craig|> skelterjohn: you made your matrixes structs right? 19:38 < |Craig|> I wonder how making them slices or arrays would come out 19:39 < skelterjohn> same length array for different width/height 19:39 < skelterjohn> since it's just their product 19:39 < skelterjohn> could do it with [][]float64, but i do some clever things with a flat array that make that inefficient 19:40 < |Craig|> I had a struct that just contained an int, and things ran faster when I made the type an int (type someName int) (I'm tempted to call it a subclass, but I know thats wrong). 19:41 < |Craig|> optimization in go is fussy. 19:41 < skelterjohn> call it a subtype 19:41 < |Craig|> I added a name to a return value (though didn't use it in the code) and my runtime went down 2%. 19:41 < skelterjohn> neat 19:41 < skelterjohn> that's just because the compiler is young, though 19:42 < |Craig|> ya 19:42 < skelterjohn> also, 2% is usually within the margin of experimental error 19:42 < |Craig|> skelterjohn: I ran several tests on over 10000 loops, I can cosistanct to 3 digets 19:42 < |Craig|> *had consistency 19:43 < |Craig|> I think it was just a cache vs time and place of allocation thing 19:44 < SoniaKeys> i flattened some four dimensional arrays a program of mine. it made code slightly faster, made the data take a little less space, but the bigger surprise for me was that the code was just as easy to understand and in some cases much simpler. 19:46 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Ping timeout: 255 seconds] 19:47 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts 19:47 < skelterjohn> got booted, sorry if it seemed like i was being unresponsive 19:48 < |Craig|> I had some horrible C code (my first C project) that used 3 dimensional arrays and pointer arithmetic. I replaced this line with using the arrays instead of painter arithmetic, and it ran faster (because GCC is smarter than me): *(pIn+*ptrans++)+=*pIn2++; It makes me doubt the value of pointer arithmetic 19:48 < skelterjohn> sometimes when you do stuff with arrays the compiler can vectorize it 19:49 < skelterjohn> where if you do the same thing with pointer arithmetic it cannot 19:50 < SoniaKeys> but in go we don't have multidimensional arrays. i'm sure arrays of arrays are trickier to optimize, slices of slices more so. 19:51 < skelterjohn> i think |Craig| meant an array of an array of an array when he said 3 dimensional array, since he is talking about C 19:52 < |Craig|> multidimisnional arrays in go: this is valid: new([10][10]int) 19:52 < |Craig|> so SoniaKeys we do have them 19:52 < skelterjohn> she means like they have them in, for example, C# 19:52 < SoniaKeys> or fortran 19:52 < skelterjohn> int[10,10] 19:52 < SoniaKeys> right 19:52 < skelterjohn> used like theArray[x,y] = v 19:53 < |Craig|> is it really any different as far as how its structured in memory? Its just a bunch of arrays end to end 19:54 < skelterjohn> it's more like, you're telling the compiler how you want to use the arrays 19:54 < skelterjohn> so it can sometimes take advantage of that information 19:54 < skelterjohn> i'm getting a weird compile error: (node AS2DOTTYPE) used as value 19:54 < skelterjohn> when i'm trying to type assert an interface to another interface 19:54 < skelterjohn> i can't figure out what is causing it 19:55 < skelterjohn> oh duh, nevermind 19:56 < SoniaKeys> i think numpy is wonderful. it'd be wonderful to see something like that for go some day. 19:56 < skelterjohn> i did "if a, ok := b.(A) {... }" 19:56 < skelterjohn> what about numpy would you like to see in go? 19:57 < SoniaKeys> well, speaking memory layout, numpy separates the working shape from the memory layout 19:57 < skelterjohn> i don't know what you mean 19:58 < skelterjohn> i'm not really a nuts-and-bolts kind of guy though 19:59 < SoniaKeys> it stores everything flat internally, but keeps the shape--dimensionallity information in a struct. so you can change the shape dynamically without moving stuff around in memory or reallocating. 19:59 < skelterjohn> you can do that with gomatrix :) 20:00 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has joined #go-nuts 20:00 < SoniaKeys> ok, i confess, i haven't looked at it. i really should... 20:00 < skelterjohn> gomatrix stores the elements in a flat slice, keeps the width and height, but also "step" 20:01 < skelterjohn> and this step parameter allows you to have a sub-matrix use the same data correctly 20:01 < skelterjohn> assuming that's what you meant by changing the shape dynamically 20:01 < SoniaKeys> a stride, in numpy speak, right? 20:01 < skelterjohn> quite possibly, though i'm not familiar with numpy's internals 20:01 -!- virtualsue_ [~chatzilla@nat/cisco/x-onyljcakngevmxpr] has joined #go-nuts 20:01 < SoniaKeys> yes 20:02 < skelterjohn> it's equivalent to the number of columns in the original matrix 20:02 -!- jochang [~identd@58-114-203-35.cable.dynamic.giga.net.tw] has quit [Ping timeout: 265 seconds] 20:02 < skelterjohn> so to go down one row, you add step to the index 20:02 -!- wrtp [~rog@92.17.98.41] has quit [Ping timeout: 240 seconds] 20:03 < SoniaKeys> (installed. i'm looking at it now) 20:04 < skelterjohn> i'd be glad to hear any comments. it was the first major chunk of go that i wrote, and some things are silly 20:05 < skelterjohn> |Craig| pointed out weirdness in the error returns, for instance 20:06 < SoniaKeys> well i think it's cool that it's one of the more installed packages, according to the dashboard 20:06 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts 20:07 < skelterjohn> um - probably because when i test it i use goinstall 20:07 < SoniaKeys> i wrote something similar in C++ years ago. there are plenty of design decisions, i know. 20:07 < skelterjohn> that number has stayed pretty steady since i got it stable 20:07 < skelterjohn> i'd like to see the dashboard count unique IP installs 20:07 < SoniaKeys> haha. i don't think so. i think it counts unique ip addresses or something, to avoid that 20:08 < skelterjohn> hey now 20:09 -!- wrtp [~rog@92.17.98.41] has joined #go-nuts 20:13 < SoniaKeys> do you have the cross product in there somewhere? 20:13 < skelterjohn> no 20:15 < SoniaKeys> that was one i needed recently. it's just one line of code though for the 3x3 matricies i had, so it was no big deal. 20:15 < skelterjohn> might be interesting to have a function that takes n-1 n-vectors and gives one that is perpendicular to all of them 20:16 < skelterjohn> dot is in there, anyway :) 20:16 < SoniaKeys> i saw that one. 20:17 < skelterjohn> well, it's just a.Transpose.Times(b).Trace() 20:17 < skelterjohn> do i actually have it in there as dot somewhere? 20:17 < SoniaKeys> mm, i just ran godoc. i think i saw something like it... 20:18 < skelterjohn> it appears in a comment 20:19 < SoniaKeys> ah 20:19 -!- wrtp [~rog@92.17.98.41] has quit [Ping timeout: 245 seconds] 20:24 -!- wrtp [~rog@92.17.98.41] has joined #go-nuts 20:49 < SoniaKeys> nice variable name in svd 20:50 -!- noam [noam@IGLD-84-229-71-149.inter.net.il] has quit [Read error: Connection reset by peer] 20:50 -!- noam [noam@IGLD-84-229-71-149.inter.net.il] has joined #go-nuts 20:52 < skelterjohn> using greek letters in code was new to me, so i went all out 20:52 < skelterjohn> kind of annoying now :) 20:52 < skelterjohn> especially since it's easy for me to type them on my mac, but not on my linux box 20:55 < SoniaKeys> i think there are ways to make it easier. i haven't used them enough to bother yet. ^v u memorized unicode... 20:55 < Tv> nice way to reduce other people's contributions to copy-paste 20:56 < skelterjohn> on my mac i set it up to switch to the greek keyboard by hitting cmd-opt-space 21:02 -!- photron_ [~photron@port-92-201-176-25.dynamic.qsc.de] has quit [Ping timeout: 255 seconds] 21:03 -!- SirPsychoS [~sp@c-24-13-132-255.hsd1.il.comcast.net] has joined #go-nuts 21:04 < SirPsychoS> Is it not possible to have a const array in Go? "const a [1]byte = [1]byte{0}" gives "const initializer must be constant" 21:04 -!- napsy [~luka@88.200.96.18] has quit [Quit: Lost terminal] 21:05 < skelterjohn> consts have no type 21:05 < SirPsychoS> "const a int = 5" compiles fine 21:05 < SirPsychoS> consts _can_ have no type 21:06 < skelterjohn> you can say, for example "const a = 2" 21:06 < skelterjohn> ah 21:06 < skelterjohn> then i dunno 21:06 -!- artefon [~thiago@189.59.198.71] has quit [Read error: Operation timed out] 21:08 < SirPsychoS> looks like const only applies to scalar values, and not to lists of values like slices, maps, and arrays 21:08 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts 21:09 -!- napsy [~luka@88.200.96.18] has joined #go-nuts 21:09 < SirPsychoS> huh, even structs can't be consts 21:12 -!- htoothrot [~mux@66-169-185-121.dhcp.ftwo.tx.charter.com] has quit [Read error: Connection reset by peer] 21:19 -!- niemeyer [~niemeyer@189-10-175-46.pltce701.dsl.brasiltelecom.net.br] has quit [Ping timeout: 245 seconds] 21:35 -!- XenoPhoenix [~Xeno@cpc5-aztw24-2-0-cust39.aztw.cable.virginmedia.com] has joined #go-nuts 21:35 -!- zozoR [~zozoR@5634798d.rev.stofanet.dk] has quit [Quit: Morten. Desu~] 21:50 -!- femtoo [~femto@95-89-197-196-dynip.superkabel.de] has quit [Quit: Leaving] 22:07 -!- watr_ [~watr@66.183.108.186] has joined #go-nuts 22:08 -!- sauerbraten [~sauerbrat@p508CC67A.dip.t-dialin.net] has quit [Remote host closed the connection] 22:11 -!- tensorpudding [~user@99.148.202.191] has quit [Ping timeout: 255 seconds] 22:11 -!- SoniaKeys [~soniakeys@c-76-118-178-209.hsd1.ma.comcast.net] has quit [] 22:12 < |Craig|> I can't seem to make any of gotgo's example make files to do anything, but the binary sure works. I guess I'll stick with my shell script for building now, and learn about makfiles later 22:14 -!- Fish [~Fish@bus77-2-82-244-150-190.fbx.proxad.net] has quit [Quit: So Long, and Thanks for All the Fish] 22:15 < skelterjohn> i never tried the makefiles 22:15 < skelterjohn> i don't know if they were around when i fooled with gotgo 22:15 < skelterjohn> if you post in the ML i bet dave would be happy to help 22:15 < |Craig|> I don't know how to write make files, and I'm building with a shell script anyway 22:16 < skelterjohn> ah 22:16 < skelterjohn> he might not feel like teaching you make :) 22:16 < skelterjohn> but it is a good tool to have in your belt 22:16 < |Craig|> I just wanted to run the tests after I built gotgo, and I couldn't 22:16 < skelterjohn> i recommend trying to learn it, if you have the time 22:17 < |Craig|> I keep intending to learn make. I wrote a single package make file, but when I found an example multi package one it was 10 times as long and super confusing, and I used a 1 line shell script instead 22:17 < |Craig|> I guess that ended up a 3 line shell script auctually 22:18 < |Craig|> but still trivial 22:18 < skelterjohn> what i do right now is have the template makefile for each package, and a script that runs all of them :s 22:18 < skelterjohn> not very make-pro-ish 22:19 < |Craig|> my shell script is now 5 lines, for 2 packages including using gotgo 22:19 < skelterjohn> i am juggling 20 different packages and 10 different cmd binaries 22:19 < skelterjohn> when i run my build script i feel silly 22:20 < skelterjohn> whoah, i exaggerate. 8 pkgs and 7 cmds 22:20 -!- tensorpudding [~user@99.148.202.191] has joined #go-nuts 22:24 < |Craig|> maybe I'll get a go project to rival my python project with 52 python modules and 5 cython modules 22:24 < |Craig|> I've been keeping my package count low in go due to build annoyances 22:25 < |Craig|> thats one thing that goclipse has down. It auto generates makefiles 22:25 < skelterjohn> the thing that troubled me was having them depend on each other 22:25 < skelterjohn> so i just have my shell script build them in a topological order 22:26 < skelterjohn> i didn't feel like typing in all the dependencies manually 22:27 < |Craig|> just write packages that only have dependices to ones with names earlier in the allphabet 22:28 -!- cenuij [~cenuij@93.26.118.217] has joined #go-nuts 22:28 -!- cenuij [~cenuij@93.26.118.217] has quit [Changing host] 22:28 -!- cenuij [~cenuij@base/student/cenuij] has joined #go-nuts 22:28 < uriel> |Craig|: really, if you are having trouble dealing with building your go projects, you are doing somewhing wrong 22:28 < uriel> the makefiles are *trivial* 22:28 < skelterjohn> ordering them isn't the issue - it's having them do the minimal build necessary that is irritating 22:30 < |Craig|> I looked at this (number 4 there) http://stackoverflow.com/questions/1766720/multi-package-makefile-example-for-go 22:30 < skelterjohn> eep 22:30 < skelterjohn> use the templates 22:30 < |Craig|> lookes far worse than something like 6g tcp/*.go 22:31 < skelterjohn> http://code.google.com/p/gomatrix/source/browse/matrix/Makefile eg 22:31 < |Craig|> skelterjohn: that works for 1 package 22:31 < |Craig|> what if I like lots of tiny packages 22:31 < skelterjohn> oh didn't see the "multi" part 22:33 -!- XenoPhoenix [~Xeno@cpc5-aztw24-2-0-cust39.aztw.cable.virginmedia.com] has quit [Remote host closed the connection] 22:34 < uriel> what are 'subpackages' anyway? 22:34 < skelterjohn> ideally a build tool would peek at the source to discover dependencies 22:34 < vsmatck> When I originally started using Go I thought packages were equivalent to classes. So I broke up everything such that no piece of code has access to variables it didn't need. It didn't turn out well although I'm not sure it was a bad idea. 22:34 < uriel> there are packages, period 22:35 < uriel> vsmatck: thinking of packages as 'classes' is certainly not a good idea, 22:35 -!- rlab_ [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org] 22:35 < vsmatck> yes, but I'm not sure the rest was a bad idea. 22:35 < uriel> (thinking of *anything* as 'classes' is a bad idea) 22:35 -!- awidegreen_ [~quassel@p5DF1E44E.dip.t-dialin.net] has quit [Remote host closed the connection] 22:35 < vsmatck> Although what I was doing created complex dependencies that couldn't be easily managed manually. 22:35 < uriel> i have no clue what you mean by ' such that no piece of code has access to variables it didn't need.', isn't that just the way one build software? 22:36 < uriel> and i have no clue what that has to do with packages 22:36 < vsmatck> Go doesn't encourage that IMO. 22:36 < uriel> functions/methods and structs provide plenty of encapsulation 22:36 < uriel> doesn't encourage what? 22:37 < |Craig|> uriel: can you point me to a trivial multi package make file? 22:37 < vsmatck> I'm thinking like private data members of a class. On that level. 22:37 < uriel> |Craig|: no, because for the most part you should have one Make file per package 22:37 < uriel> (at least that is what I do, and I don't see what the problem with that is) 22:37 < vsmatck> Encapsulation in my go programs is not as complete as in my C++ programs. But it doesn't really feel like much of a problem. *shrug* 22:38 < uriel> vsmatck: structs? 22:38 < skelterjohn> because you can have packages that depend on other packages 22:38 < skelterjohn> and you need them to be rebuilt when the other package changes 22:38 < uriel> vsmatck: buy you were talking about *variables* 22:38 < |Craig|> uriel: thats tolerable, so how to I make my whole project then? I make make files referance eachother? 22:38 < uriel> vsmatck: and unless you are using plenty of globals, I don't see what the problem is (and you obviously should not be using plenty of globals) 22:39 < vsmatck> I didn't say there was a problem. :) 22:39 < vsmatck> I just can't program C++ in Go dammit. heh 22:40 < uriel> |Craig|: see src/pkg/Makefile 22:40 < uriel> vsmatck: I would say that is a very good thing ;P 22:41 < vsmatck> *shrug* It's relative to what you're doing. 22:41 < skelterjohn> uriel: that makefile depends on running a dependencies script 22:41 < nsf> makefiles in Go tree are crappy 22:42 < vsmatck> I have the idea that dividing a go program in to super granular packages is not a good idea. I'm not sure if this is because of lack of fancy build tools though. I think that's a good what to put what I was thinking. 22:43 < uriel> skelterjohn: unless you got hundreds of packages, managing that by hand is trivial 22:43 < nsf> also using shell script is fine 22:44 < nsf> unless the speed of build doesn't bother you 22:44 < vsmatck> I always thought it was really hard to organize my C++ programs in to a tree. Not sure that's necessary tho. 22:44 < skelterjohn> i don't want to manage it by hand. i hate writing build tools 22:44 < skelterjohn> the information is all there - it should figure it out 22:44 < nsf> skelterjohn: only for simple packages and executables 22:44 < nsf> take a look at runtime package in Go's std lib 22:45 < skelterjohn> it does ok with $GOROOT/src/pkg 22:45 < skelterjohn> anything with cgo gets complicated 22:45 < skelterjohn> that's why i never do anything with cgo 22:45 < uriel> is listing each package and its dependencies really so hard? if you don't know what your packages depend on, you are probably making a big mess 22:45 < nsf> well, I have really good makefiles right now, but they are not ready for mass usage yet 22:45 < vsmatck> It can get hard. 22:45 < nsf> and you still need to understand make very well 22:46 < nsf> and if you haven't written your makefiles then probably you don't 22:46 < nsf> :) 22:46 < uriel> nsf: I don't understand make very well, and have had no problems 22:46 < uriel> I just copy what the existing Go packages do 22:46 < vsmatck> That's one data point. 22:47 < nsf> uriel: do you have at least one app that uses multiple local packages? 22:48 < nsf> because the way makefiles are now, it's hard to have that kind of thing 22:48 < nsf> templates are supposed to be used in a recursive fashion 22:48 < uriel> I will admit that having multiple local packages can be a bit akward, but goinstall mostly takes care of all that 22:48 < skelterjohn> how does goinstall do anything with local packages? 22:49 < nsf> well, I have system that solves it, but as I've said.. it doesn't really work yet :) 22:49 < nsf> lately I've been too lazy to finish it 22:49 < uriel> hmmm... this makes me think, why not make goinstall work with local packages? 22:49 < uriel> although that would encourage non-portable code, probably a stupid idea, nevermind 22:49 < nsf> ugh, I don't even use goinstall 22:50 < nsf> the worst tool I've ever seen 22:50 < nsf> :D 22:50 < skelterjohn> i think it's great 22:50 < nsf> it just downloads one Go package (can't work with cgo) and installs it 22:50 < nsf> and that's it 22:50 < nsf> what is so special about it 22:50 < skelterjohn> it also downloads other goinstallable packages that it depends on 22:50 < nsf> it doesn't even track anything 22:51 < skelterjohn> it's nice because for someone to use something i made, i don't have to make a distribution 22:51 < skelterjohn> i just put it on googlecode and tell them what the path is 22:51 < nsf> but it's easy to do, the problem is it doesn't work for a lot of packages (which are cgo based) 22:51 < skelterjohn> sure 22:51 < vsmatck> I like how goinstall understands certain websites (like github). So instead of having to download a tar file I can just point goinstall at the website. It's simple but useful IMO. 22:52 < vsmatck> Makes it easy for me to keep packages up to date. 22:52 < nsf> right, you need to run 1 command instead of 3 22:52 < nsf> what a feature 22:52 < skelterjohn> yep 22:52 < vsmatck> 1 > 3 22:52 < skelterjohn> haha 22:52 < nsf> :) 22:53 < vsmatck> :) 22:53 < skelterjohn> also you can have it track versions by convention 22:53 < skelterjohn> gomatrix.googlecode.com/hg/1.0/matrix will never change 22:53 < skelterjohn> and w/out the 1.0, it's the latest commit 22:56 < nsf> still, I don't like goinstall and I won't fix it, because lately I've been writing too much Go dev tools 22:56 < nsf> not mentioning that I don't know how to fix it :) 22:57 < nsf> it's sad that opengl is broken in go 22:57 < nsf> I'd like to do some graphics stuff :( 22:57 < uriel> sdl should work fine 22:57 < uriel> and exp/draw 22:57 < nsf> http://code.google.com/p/go/issues/detail?id=1262 22:57 < nsf> sdl works 22:58 < nsf> opengl doesn't 22:58 < skelterjohn> i feel like the whole plan9 thing makes it a lot harder for go to work with existing stuff 22:58 < nsf> no, it's not plan9 22:58 < nsf> more like unusual execution model 22:58 < skelterjohn> that's what i mean, i just don't know the right way to talk about it 22:58 < nsf> goroutines, not-compatible stack, calling conventions 22:58 < skelterjohn> the stack and calling conventions 23:02 < uriel> no, it is the Bell Labs/Unix(the real Unix) culture, that clashes with the abomination it has turned into outside the Labs over the last 30 years 23:03 < uriel> the non-compatible stack thing is pretty much necessary if you take as a core language feature that you don't have to worry about stack size anymore 23:04 < uriel> the calling conventions is simply a result of the compilers used, and I guess is more of a somewhat arbitrary divergence, other that it originates from the compilers used 23:04 < nsf> I don't know about culture, but frankly I don't like current Go implementation.. sadly it's the best implementation we have today, gccgo is not an option because its compilation takes hours 23:04 < skelterjohn> well, i don't know enough about architecture to comment 23:04 < nsf> well, it's less than an hour, but still 23:04 < nsf> I'd like to see LLVM based Go implementation 23:05 < nsf> even though LLVM is C++, it's designed as a library so you don't need to recompile it each time 23:05 < uriel> nsf: wtf is wrong with the current implementation? works pretty damned well for me 23:05 < uriel> llvm is awful 23:05 < uriel> it only looks good by comparison with gcc 23:05 < nsf> uriel: lack of dynamic linking support, undocumented hackerish C code 23:05 < skelterjohn> haters gotta hate 23:06 < nsf> I don't like that 23:06 < uriel> nsf: what is 'hackerish' and 'undocumented'? 23:06 < uriel> Go's C code is some of the cleanest around 23:06 < nsf> I don't think so 23:07 < uriel> anyway, would be nice if somebody plugged the Go frontend for gcc into llvm, but I certainly will have no use for it, it would be cool because diversity of implementations is good 23:07 < nsf> it's all purely subjective anyway 23:07 < uriel> nsf: so, point me to a cleaner C codebase of comparable size 23:07 < skelterjohn> the "hackerish" quality may be intrinsic to C, rather than the fault of the people writing it 23:08 < uriel> skelterjohn: exactly 23:08 < nsf> but what's the point of pointing you.. there is only one Go compiler written in C that works :) 23:08 < nsf> and I will use it until there will be a better implementation 23:08 < nsf> but subjectively, I don't like it 23:08 < uriel> skelterjohn: and lets remember, the people writting it pretty much invented C, ken at the very least was the first C programmer and heavily influenced C in many ways 23:08 < uriel> skelterjohn: and he wrote most of the C in the Go distribution 23:08 < skelterjohn> that doesn't mean it's easy to read 23:09 < skelterjohn> or not hackerish :) 23:09 < uriel> sure, but I do find it easier to read than most other C code I have ever seen 23:09 < skelterjohn> i try not to read C code 23:09 < nsf> I had experience debugging Go's runtime 23:10 < uriel> as for 'hackerish', hell, the Lion's comentary on 6th ed Unix shows plenty of 'hackerish' tricks, I find that is part of the beauty of it 23:10 < nsf> don't want to do it again 23:10 < nsf> although now it supports DWARF 23:10 < nsf> at least 23:10 < uriel> nsf: I'm not sure how the DWARF support really helps debugging the runtime 23:11 < nsf> uriel: print statements work too 23:11 < uriel> and I have had to deal with bugs in gcc, and since then I try to avoid touching gcc like the plague 23:11 < nsf> but in the case I had (race condition) the debugger is preferred 23:11 < nsf> well, again.. by me 23:11 < nsf> I don't know about others :) 23:11 < uriel> yes, but what I mean is that when debugging the runtime, as opposed to debugging Go code, the DRARF stuff shouldn't make any difference afaik 23:12 < uriel> as for race conditions, I'm not sure debuggers help much, unless they are concurrency-aware debuggers 23:12 < nsf> but before that you simply wasn't able to debug Go's runtime using gdb 23:12 < uriel> often running a program that is blowing up because of a race, the race will go away if you run it under a debugger 23:12 < nsf> debugger is good at catchin memory corruptions 23:13 < uriel> I certainly hope something acid-like with concurrency-oriented features for debugging will come up som day 23:13 < nsf> that was my case 23:13 < nsf> I had spent two days juggling print statements around 23:13 < nsf> :D 23:13 < nsf> the fix was one liner :D 23:13 < uriel> I might be ignorant, but I still can't quite see how a debugger would hvae helped 23:14 < uriel> (or how gdb would have helped anyway) 23:14 < nsf> well, I don't know 23:14 < nsf> I haven't tried it 23:14 < nsf> but for some reason I thought it should be easier 23:15 < nsf> and I still think that way 23:15 < uriel> I have had to deal with such bugs in C code, and didn't find gdb of much help, but then I barely know how to do more than printing a stack trace or setting a breakpoint in gdb 23:15 < uriel> print based debugging is also much less disruptive of timing-related bugs 23:15 < nsf> in gdb you can set up a breakpoint for write/read access to the specific memory location 23:16 < nsf> it helps sometimes 23:16 < nsf> for example, one functions locks and does something with data structures 23:16 < nsf> and you need to make sure that it's the only thread that accesses this data 23:17 < uriel> so you only access it from one goroutine ;P 23:17 < uriel> just (half) kidding 23:17 < nsf> in runtime it was the actual threads 23:17 < nsf> it was a scheduler bug 23:17 < nsf> were* 23:18 < uriel> well, hopefully those are not too common ^_^ 23:18 < nsf> that one with OpenGL 23:18 < nsf> is one of them 23:18 < nsf> somewhere 23:20 < |Craig|> so I tried to make my 3 go file 2 package project build with Makefiles, and I failed, it look like its not building my other package before main and thus failing before building anything: https://github.com/Craig-Macomber/Grains--Vegetarian-Zombie-Rising/tree/master/Server/ 23:21 < |Craig|> any suggestions? 23:21 < |Craig|> I'm pretty clueless when it comes to make 23:21 < nsf> you totally don't know how to use make 23:21 < nsf> read manual :) 23:21 < |Craig|> nsf: exactly 23:21 < nsf> it is useful knowledge in a perspective 23:22 < nsf> anyway 23:22 < |Craig|> people said it was triviall and yo use the examples, so I did, and I failed 23:22 < nsf> :) 23:22 < nsf> you've defined a var DIRS 23:22 < nsf> defining a VAR doesn't do anything else magically 23:23 < nsf> make is about defining rules and their dependency relationships 23:23 < |Craig|> the example trivial make file for go I was prointed to included autogenerated files and was over 200 lines... I got confused 23:24 < nsf> it defines the DIRS variable as well 23:24 < |Craig|> I need something like main: tcp right? 23:24 < nsf> but then it substitutes it to a rule dependency 23:24 < nsf> ugh 23:24 < nsf> really 23:24 < nsf> read the make manual 23:24 < nsf> http://www.gnu.org/software/make/manual/make.html 23:24 < nsf> it is long 23:24 < nsf> and boring 23:25 < |Craig|> thanks :) 23:26 < |Craig|> I'm just a bit confused why some people say make files for go are trivial and do what pkg.Makefile does when that file is 200+ lines any my shell script i'm using is 5 lines 23:26 < uriel> and it is gmake, which is evil 23:27 < nsf> all makefiles are trivial, because make is not the C++ 23:27 < nsf> but if you don't understand how make works 23:27 < nsf> everything is non-trivial 23:27 < uriel> |Craig|: as far as I can see, you are not specifying any dependencies 23:27 < nsf> of course 23:28 < |Craig|> uriel: I'm aware of that 23:28 < uriel> I don't know how make works, (certainly not how gmake works) 23:28 < uriel> but copy-pasting from other projects is rather trivial 23:28 -!- tsykoduk [~tsykoduk@184.78.195.79] has quit [Ping timeout: 245 seconds] 23:29 < nsf> copy-pasting without understanding 23:29 < nsf> is a waste of time 23:29 < |Craig|> make looks more confusing than go 23:30 < nsf> as uriel have noticed, gmake is indeed :) 23:30 < nsf> but still it is quite simple 23:30 < nsf> preprocessor-like language for defining rules, actions and dependencies 23:31 < uriel> |Craig|: make is certainly more confusing than Go 23:32 < |Craig|> at least make has a manual for me to read. I'll be back when I have learned it's basics, nsf thanks for the link and not being too mad at my foolish attemts to do before understanding 23:32 < nsf> oh, it's not that easy to make me mad 23:32 < nsf> :D 23:33 < |Craig|> asking for help without reading the manual was pretty rude of me though 23:33 < uriel> ok, here is a ridiculously trivial example of how to build a multi-package Go program: 23:33 < nsf> and saying thanks to a guy who sent you to rtfm, well.. it's very nice of you 23:33 < uriel> https://github.com/jackpal/Taipei-Torrent 23:33 < nsf> :) 23:33 < uriel> |Craig|: I don't expect anyone to read the gmake manual, I actually hope nobody reads it 23:36 < nsf> I have different opinion 23:36 -!- noam [noam@IGLD-84-229-71-149.inter.net.il] has quit [Read error: Connection reset by peer] 23:36 -!- noam [noam@IGLD-84-229-71-149.inter.net.il] has joined #go-nuts 23:36 < nsf> it's nice to know how the tool works 23:36 < nsf> especially if everyone uses it 23:37 < skelterjohn> always fun - looking up the deadline for a conference you're working towards so you can make a schedule and seeing that the abstract was due yesterday 23:37 < skelterjohn> i just submitted a "fantastic" abstract to ICAPS 2011 23:38 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn] 23:38 -!- XenoPhoenix [~Xeno@cpc5-aztw24-2-0-cust39.aztw.cable.virginmedia.com] has joined #go-nuts 23:42 < |Craig|> uriel: that project just uses a bash script to run all the make files. Is that considered good design? 23:42 < nsf> no (imho) 23:43 < |Craig|> I could use a bash script to do everything, and it would be as long as one that runs the make files 23:43 < nsf> I've said that to you earlier 23:43 < nsf> nsf | also using shell script is fine 23:44 < nsf> the problem with shell script 23:44 < nsf> it doesn't scale 23:44 < nsf> and it knows nothing about dependencies 23:44 < nsf> and it knows nothing about rules 23:44 < nsf> etc. 23:44 < nsf> make is mostly like shell, but adds an ability to describe these 23:45 < |Craig|> I think gotest needed make files to be used easilly 23:45 < nsf> it uses makefiles 23:45 < nsf> I don't use gotest :) 23:45 < |Craig|> I see 23:47 < uriel> |Craig|: how many hundreds of packages you have or what? 23:48 < |Craig|> at the moment I have 2 trivial packages. I started this project this week 23:48 < uriel> so what the hell is the problem? 23:48 < uriel> just put the thing in a shell script if you like, and be done with it 23:48 < nsf> |Craig|: I use shell scripts even for my C++ projects 23:49 < nsf> at least for few first weeks 23:49 < uriel> one Makefile per package, and a trivial shell script to run them all 23:49 < uriel> it is ridiculously simple, the Makefiles are like five lines, and the shell script like four 23:49 < nsf> then it grows and I add cmake or something 23:49 -!- watr_ [~watr@66.183.108.186] has quit [Ping timeout: 260 seconds] 23:50 < |Craig|> I liked gotest, so it looked like I should have makefiles, and I was lead to believe they were rather easy to learn and setup, but apparently not so. I think i'll stick with my shell script for now 23:50 -!- littlebobby [~bob@unaffiliated/littlebobby] has joined #go-nuts 23:50 < uriel> |Craig|: you should certainly have a Make file per package 23:50 < uriel> but again, that is trivial as you can see in any individual package and their make file 23:51 < uriel> the only question is whatever having a project-wide make file or shell script, but any project with <10 packages, a simple four line shell script should be more than enough 23:58 < plexdev> http://is.gd/hvfM9 by [Ken Thompson] in go/src/cmd/gc/ -- more on dynamic hash in compound literals. --- Log closed Sun Nov 21 00:00:17 2010