--- Log opened Fri Mar 25 00:00:09 2011 --- Day changed Fri Mar 25 2011 00:00 < ww> but, what if i parse it right to left? is that allowed? then i would get 1 instead of 2 00:00 < kamaji> waqas: internal representation 00:00 < kamaji> waqas: oh wait, is ({"a":1,"a":2}).a == 2 part of the spec? 00:00 < waqas> ww: u == decode(encode(u)) fails in various ways by the way, e.g., case sensitivity 00:01 < waqas> kamaji: Yes, it's part of ecmascript, not JSON. 00:01 < ww> in rdf, uris are case sensitive 00:01 < ww> (that is controversial but is nonetheless defined to be so) 00:01 < waqas> ww: Ah, of course 00:01 < kamaji> Right, so I guess it's all about the hashmaps :) 00:01 < kamaji> They've basically done everything but say "Use a hashmap" 00:01 < waqas> ww: It makes sense. That's how XML treats them in general namespacing. 00:03 < ww> right. early on there was a large xml influence. but at least for http uri the host part should really be case insensitive 00:03 < ww> and for mailto probably entirely insensitive 00:03 < ww> but it is not so 00:04 < waqas> Helps make implementation easier 00:04 < ww> (and that's out of scope for the current wg to change) 00:04 < waqas> I mean with non-ASCII characters, you get into an unholy mess, what with combining characters, and so on. 00:04 < ww> what is in scope is how to make rdf more useable from json-land 00:05 < ww> waqas: right 00:07 < steven> <3 00:07 < steven> god bless you all 00:08 < kamaji> hahah 00:11 < kamaji> hmmmmm 00:11 < kamaji> how can I compare two types? 00:12 < kamaji> because I can't use .(type) outside a switch statement 00:12 < kamaji> I just need to test equality basically 00:15 -!- KingPhilroy [~kingphilr@shc-nat-newhall.stonehill.edu] has joined #go-nuts 00:16 < kamaji> Is it even possible without reflect? 00:19 <+iant> not in the general case, but reflect does provide reflect.DeepEqual 00:20 < kamaji> The general case? 00:20 <+iant> I mean, if you want to compare two arbitrary interface values for equality, you need to use DeepEqual 00:20 <+iant> well, actually, you can compare interface values with == 00:21 <+iant> that may do what you need 00:21 <+iant> don't mind me, I don't really know what you are trying to do 00:21 < waqas> I think he wants to know if types are equal, not values. 00:22 < kamaji> well I have a few types which implement an interface, and I want to compare the types 00:22 < kamaji> I'll just paste code, that will be easier :p 00:22 <+iant> you want to see if two different interface values have the same dynamic type? 00:23 < kamaji> http://pastebin.com/HVfmphtc 00:23 < kamaji> iant: yes that 00:23 < kamaji> I think... 00:24 < kamaji> oops, "Feature" should say "MyInterface" 00:24 < kamaji> but obviously that doesn't work 00:25 <+iant> yeah, I think you have to say something like if reflect.Typeof(x) == reflect.Typeof(y) 00:25 < kamaji> aw, poop 00:25 < kamaji> Is there some way I can fudge it with assignments? :D 00:26 <+iant> if you know all the possible types, sure, you can use a set of "_, ok := x.(Type1)" assertions 00:27 < waqas> kamaji: Do you have something against the reflect package? :) 00:27 < kamaji> someone said it was slow :p 00:28 < kamaji> Nah i'll use reflect 00:28 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined #go-nuts 00:28 < kamaji> if that ends up being a problem I can always change it, but I doubt it will 00:28 < kamaji> cheers 00:28 < kamaji> oh wait, one more thing 00:28 < kamaji> if I have two types, T1 and T2 which are both string 00:29 < kamaji> will they be "equal" or not? 00:29 < waqas> I don't think they'll be equal, but test it. 00:30 <+iant> reflect.Typeof is not slow 00:30 < kamaji> iant: now I feel like a jerk :( 00:30 <+iant> no need, just saying 00:30 < kamaji> heheh 00:30 < kamaji> ok testing 00:34 < kamaji> ok it works 00:34 < kamaji> thanks guys 00:37 -!- gid [~gid@220-253-30-88.VIC.netspace.net.au] has quit [Remote host closed the connection] 00:40 -!- nettok [~quassel@200.119.157.38] has joined #go-nuts 00:44 < str1ngs> kamaji: jerk :P 00:48 -!- xxd [~xxd@xxd.lllfff.org.ru] has joined #go-nuts 00:55 -!- yugui_zzz [~yugui@yugui.jp] has quit [Quit: Tiarra 0.1+svn-24729: SIGTERM received; exit] 00:56 -!- yugui [~yugui@yugui.jp] has joined #go-nuts 00:57 -!- bugQ [~bug@c-67-171-127-76.hsd1.ut.comcast.net] has quit [Ping timeout: 252 seconds] 01:00 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Quit: hcatlin] 01:04 < plexdev> http://is.gd/Onzv7Q by [tav] in go/ -- Added a .gitignore file. -- [1 added] -- .gitignore (A) 01:04 -!- mikespook [~mikespook@219.137.75.11] has joined #go-nuts 01:08 -!- bugQ [~bug@c-67-171-127-76.hsd1.ut.comcast.net] has joined #go-nuts 01:08 -!- cbeck [cbeck@gateway/shell/pdx.edu/x-fshuyffsydjrqafk] has quit [Ping timeout: 248 seconds] 01:09 -!- nrl [~nrl@pdpc/supporter/active/nrl] has quit [Quit: leaving] 01:09 -!- pilgrum [~pilgrum@cpe-67-49-71-222.socal.res.rr.com] has joined #go-nuts 01:09 -!- Tuller_ [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts 01:09 < bugQ> kamaji: they will not be equal 01:10 -!- waqas [~waqas@jaim.at] has left #go-nuts [] 01:11 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Ping timeout: 255 seconds] 01:12 < bugQ> it's like C's typedef, they are compatible but not identical 01:13 -!- xxd [~xxd@xxd.lllfff.org.ru] has quit [Read error: Operation timed out] 01:13 -!- jesusaurus [jesusaur@firefly.cat.pdx.edu] has joined #go-nuts 01:14 -!- cbeck [cbeck@gateway/shell/pdx.edu/x-tvxvhslxdodevrjf] has joined #go-nuts 01:14 -!- xxd [~xxd@xxd.lllfff.org.ru] has joined #go-nuts 01:20 -!- xxd [~xxd@xxd.lllfff.org.ru] has left #go-nuts ["WeeChat 0.3.4"] 01:22 < steven> so when is someone gonna write a git implementation in Go? 01:22 < steven> :) 01:22 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X] 01:22 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts 01:23 -!- Tuller_ [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Ping timeout: 255 seconds] 01:23 -!- saturnfive [~saturnfiv@210.74.155.131] has joined #go-nuts 01:24 < jesusaurus> steven: thanks for volunteering ;) 01:24 < steven> hehe 01:24 < steven> i wish i knew how to implement git 01:25 < steven> but those CS concepts like "git trees" and such confuse me 01:25 -!- Tuller_ [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts 01:27 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Ping timeout: 255 seconds] 01:30 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts 01:30 < str1ngs> steven: I have some go bindings to libgit2 in the works 01:30 < str1ngs> right now it does limited things like repo init some ref lookups 01:31 < steven> git would be an excellent language to rewrite git in though 01:32 < steven> with all its built-in libraries for the exact things that git does 01:32 -!- Tuller_ [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Ping timeout: 255 seconds] 01:32 < str1ngs> git or go you mean? 01:33 < str1ngs> anyways ya native go git would be ideal . however quite the task libgit2 is well maintained and documented 01:33 < str1ngs> so its a stop cab for now 01:33 < str1ngs> gap* 01:38 -!- Tuller_ [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts 01:39 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Ping timeout: 255 seconds] 01:46 -!- bugQ [~bug@c-67-171-127-76.hsd1.ut.comcast.net] has quit [Ping timeout: 252 seconds] 01:51 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts 01:54 -!- Tuller_ [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Ping timeout: 255 seconds] 02:02 -!- saturnfive1 [~saturnfiv@210.74.155.131] has joined #go-nuts 02:02 -!- saturnfive [~saturnfiv@210.74.155.131] has quit [Ping timeout: 264 seconds] 02:13 -!- nettok [~quassel@200.119.157.38] has quit [Ping timeout: 246 seconds] 02:14 -!- nettok [~quassel@200.119.177.246] has joined #go-nuts 02:17 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Ping timeout: 255 seconds] 02:21 < str1ngs> echo * poor mans ls 02:28 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has joined #go-nuts 02:28 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has quit [Client Quit] 02:41 < steven> str1ngs: from what i remember hearing about git, its actually really simple. 02:41 < steven> the implementation is only complex because its C ;) 02:41 < str1ngs> steven: it is yes 02:41 < steven> which part? 02:41 < steven> gits simple or libgit is comlpex? 02:42 < str1ngs> libgit2 is simple 02:42 < steven> ah 02:42 < str1ngs> git its self is not that complex 02:42 < steven> im kind of interested in learning how git works 02:42 -!- jscherer26 [~jscherer2@d199-74-181-32.try.wideopenwest.com] has joined #go-nuts 02:42 -!- jscherer26 [~jscherer2@d199-74-181-32.try.wideopenwest.com] has left #go-nuts [] 02:42 < str1ngs> but.. there is alot more ie http ssh transport 02:42 < steven> i know branches confuse the heck out of me, especially how merges are done. 02:42 < str1ngs> fsck type stuff 02:42 < steven> fsck you! 02:42 < steven> ;) 02:42 < str1ngs> branches are quite simple 02:43 < steven> or rather not branches 02:43 < steven> i mean trees 02:43 < steven> git trees 02:45 < str1ngs> are the not btress? 02:45 < str1ngs> btree's 02:45 < steven> i dont know? 02:45 -!- tensorpudding [~user@99.148.205.193] has quit [Remote host closed the connection] 02:45 < str1ngs> I know there is alot of how to's about git float around 02:46 < str1ngs> but this video http://www.youtube.com/watch?v=8dhZ9BXQgc4 probably the best explination on what a git branch is 02:46 < steven> cool thanks 02:46 < str1ngs> also explains why they are so cheap 02:46 < steven> likewise, this video http://www.youtube.com/watch?v=PgGUKWiw7Wk is probably the best explanation of what love really means 02:46 < steven> just fyi 02:48 < str1ngs> on principle I refuse to click that 02:48 -!- artefon [~thiago@189.26.238.78] has quit [Quit: bye] 02:48 < kamaji> This video http://www.youtube.com/watch?v=CD2LRROpph0 is probably the best explanation of what Friday really means 02:50 < steven> str1ngs: oh well. your loss. 02:50 < str1ngs> steven: anyways, right now I'm using libgit2 and I figured I make proper bindings. but if you are instrested look at libgit2 02:50 < steven> cool thanks <3 02:51 < str1ngs> the bindings I'm working on are not complete will be awhile 02:51 -!- Netsplit *.net <-> *.split quits: electro_, dario, prip, htoothrot, pjm0616, mdxi_, chaos95, itrekkie, viirya, fabled, (+24 more, use /NETSPLIT to show all of them) 02:52 < kamaji> noooooooo 02:52 < kamaji> netsplit! 02:52 < kamaji> WE'RE DOOMED 02:52 < kamaji> 2012 02:52 < kamaji> &c. 02:55 -!- Netsplit over, joins: rejb, dju_, Urmel|, itrekkie, Wiz126, GoBIR, Eko 02:57 -!- cbeck [cbeck@gateway/shell/pdx.edu/x-tvxvhslxdodevrjf] has joined #go-nuts 02:57 -!- keithcascio [~keithcasc@nat/google/x-toozphnnaziiiiev] has joined #go-nuts 02:57 -!- pjm0616 [~user@sigfpe-1-pt.tunnel.tserv15.lax1.ipv6.he.net] has joined #go-nuts 02:57 -!- vsayer [~vivek@2001:470:1f04:1a6b:21a:6bff:fe35:d2a5] has joined #go-nuts 02:57 -!- fabled [~fabled@mail.fi.jw.org] has joined #go-nuts 02:57 -!- schmrkc [~marcus@sxemacs/devel/schme] has joined #go-nuts 02:57 -!- viirya [~viirya@cml506-25.csie.ntu.edu.tw] has joined #go-nuts 02:57 -!- Fish [~Fish@exo1066.net2.nerim.net] has joined #go-nuts 02:57 -!- larva_ [~larvanitr@ec2-46-51-171-183.eu-west-1.compute.amazonaws.com] has joined #go-nuts 02:57 -!- leczb_ [~leczb@nat/google/x-qvkkojfukhyolxlw] has joined #go-nuts 02:57 -!- dario [~dario@domina.zerties.org] has joined #go-nuts 02:57 -!- chaos95 [chaos95@mafianode.com] has joined #go-nuts 02:57 -!- prip [~foo@host68-133-dynamic.46-79-r.retail.telecomitalia.it] has joined #go-nuts 02:57 -!- serbaut1 [~joakims@88.80.182.68] has joined #go-nuts 02:57 -!- pi_ [pii@rasm.se] has joined #go-nuts 02:57 -!- tgall_foo [~tgall@206.9.88.154] has joined #go-nuts 02:57 -!- mdxi_ [~mdxi@li11-97.members.linode.com] has joined #go-nuts 02:57 -!- chressie [~chressie@dreggn.in-ulm.de] has joined #go-nuts 02:57 -!- htoothrot [~mux@66-169-185-121.dhcp.ftwo.tx.charter.com] has joined #go-nuts 02:57 -!- xyproto [~alexander@77.40.159.131] has joined #go-nuts 02:57 -!- rmt [~rmt@2a02:790:1:6:1:c:caf0:2] has joined #go-nuts 02:57 -!- electro_ [electro@c-bef570d5.033-10-67626721.cust.bredbandsbolaget.se] has joined #go-nuts 02:57 -!- mpl [~mpl@smgl.fr.eu.org] has joined #go-nuts 02:57 -!- ross` [~ross@83.246.64.67] has joined #go-nuts 02:57 -!- rphillips_ [~rphillips@2001:470:21:31::42dc:59] has joined #go-nuts 02:57 -!- apexo [~apexo@2a01:238:436b:8301:5054:ff:fe87:82fb] has joined #go-nuts 02:57 -!- adg [~nf@2001:470:21:20::4444:61d9] has joined #go-nuts 02:57 -!- ServerMode/#go-nuts [+o adg] by kornbluth.freenode.net 03:07 -!- iant [~iant@216.239.45.130] has quit [Ping timeout: 250 seconds] 03:09 < steven> did i win? 03:12 < kamaji> Yes. 03:13 < steven> woot. 03:14 < kamaji> congratulations! 03:14 < steven> thx :) 03:15 < steven> btw if any of you have an idea how to solve this problem (the very last post in this thread) im all ears: http://groups.google.com/group/golang-nuts/browse_thread/thread/6a29692249f75eb7 03:18 -!- tensorpudding [~user@99.148.205.193] has joined #go-nuts 03:24 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts 03:24 -!- mode/#go-nuts [+v iant] by ChanServ 03:37 -!- sjd [~sjd@204-195-89-40.wavecable.com] has joined #go-nuts 03:45 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has joined #go-nuts 03:50 -!- niemeyer_away [~niemeyer@201-66-179-18.pltce701.dsl.brasiltelecom.net.br] has quit [Ping timeout: 255 seconds] 03:52 < Namegduf> for blah := <-foo.registerForEvent() { ... } is a very pretty idiom. 03:57 < steven> Namegduf: is it new? 03:57 < steven> did i invent it by accident? 03:58 < Namegduf> I don't know, I've not seen it before. 03:58 < sjd> I thought you had to put the range keyword in front of the channel 03:58 < steven> btw the syntax confused me at first and i tried something like that earlier.. but it didnt work so i thought "crap this cant be done".. then i realized, it can! for blan := range foo.registerForEvent() { ... } 03:58 < steven> yeah sjd exactly 03:58 < steven> and no <- operator 03:59 < Namegduf> Yeah, misremembered. 03:59 < steven> but the idea is really helpful 03:59 < steven> only problem left is the fact that it returns one type only 03:59 < sjd> what you have there is aesthetically pleasing though 04:00 < steven> so either i need a bunch of functions to return different types via channels, or i can use a single chan []args, and unpack the event manually via arg[0], arg[1], etc. 04:00 < steven> (which is, of course, much less safe and much less pretty) 04:01 < sjd> just use interface{} and a type switch (dont know if that applies - only saw a small part of the conversation) 04:01 < steven> so basically, it means that for every event-type i end up creating, ill need a new function with almost-identical functionality in it to all the other event functions 04:01 < steven> yeah i can do that sjd.. but im really trying to avoid interface{} and type switching 04:01 < Namegduf> Near identical trivial functionality. :P 04:02 < steven> it pushes what can easily be compile-time errors into runtime panics 04:02 < sjd> for fun? 04:02 < Namegduf> I'm not sure the separate types are avoidable 04:02 < steven> https://gist.github.com/886345 04:03 < Namegduf> There's one alternative I can think of. 04:03 < steven> thats near-trivial, but bad enough to make me want to avoid copying/pasting it 20 times. 04:03 < Namegduf> bot.registerEvent("join") 04:03 < sjd> perhaps an event interface may work here 04:03 < steven> i thought of that too, 04:03 < Namegduf> Have a chan []string 04:03 < Namegduf> It's "safe" and obvious to unpack because you only get one event per event channel. 04:03 < steven> but again, i have to manually unpack the arguments 04:03 < sjd> or, better yet, have explicit channels and use select to handle the events 04:04 < Namegduf> Yeah, you can't unpack them by name (args.channel or whatever) instead of number. 04:05 < sjd> that will give you your type safety and be pretty clean 04:05 < steven> Namegduf: which makes it less safe (index-bounds errors) 04:05 < Namegduf> That's true. 04:05 < Namegduf> sjd: It's already using channels explicitly and can be used with select 04:06 < steven> sjd: that doesnt solve this problem since it already uses different channels 04:06 < steven> https://github.com/sdegutis/go-ircbot/blob/master/bot.go 04:06 < steven> https://github.com/sdegutis/go-ircbot/blob/master/main.go#L14-20 04:07 < exch> main() will exit immediately 04:07 < steven> yeah its not functional yet 04:07 < steven> im just making sure it builds for the time being 04:07 < sjd> steven: thx for the context 04:07 < steven> until i figuer out a way to do good event handling 04:07 < Namegduf> steven: In that case, the only way is to use a type per event 04:07 < steven> so far channels are the best option, but im hoping i can find a better way than this 04:08 < steven> i wonder 04:08 < Namegduf> And the only way to avoid interface{} and type switching is to have a per-event register function 04:08 < Namegduf> You could use anonymous structs 04:08 < Namegduf> Which makes it have less declared and exported. 04:08 < steven> if maybe theres some way of packing channel data so that the same type is passed to all event channels, but each event channel can extract its own relevant data from the event structure 04:08 < Namegduf> But in general... 04:09 < Namegduf> There is, it's interface{} and a type switch. 04:09 < steven> i know theres no concept of unions, right? 04:09 < Namegduf> You're just reinventing the type switch in a different way. :P 04:09 < steven> i suppose thats true, theres no benefit to that over type switches 04:09 -!- dave [~dfc@sydfibre2.atlassian.com] has joined #go-nuts 04:09 < steven> both of them avoid compile-time checks 04:09 < Namegduf> interface{} meets this functionality of unions, which is one reason they're not massively useful. 04:10 < steven> god bless you guys real good right in the face 04:10 < steven> <3 04:10 < sjd> type switches are you're huckleberry here 04:10 < steven> yeah i dont think i can avoid it. well, i mean i can, but then i have other (probably worse) problems 04:11 < Namegduf> I'd do it the way you have done it now. 04:11 < steven> such as duplicated code and tons of boilerplate 04:11 < steven> Namegduf: with the duplicated code and tons of boilerplate? 04:11 < Namegduf> Pretty much. 04:11 < Namegduf> It isn't ideal. 04:11 < steven> this almost-trivial code has to be repeated for 40+something events https://github.com/sdegutis/go-ircbot/blob/master/bot.go#L42-46 04:11 < Namegduf> I'd use anonymous structs, and I don't much mind lots of three line functions 04:12 < Namegduf> It's annoying but if there's real functionality it *should* overwhelm it. 04:12 -!- keithcascio [~keithcasc@nat/google/x-toozphnnaziiiiev] has quit [Quit: Leaving] 04:12 < sjd> I guess I don't see the problem with a lack of compile time checking: as long as you define an event interface, you effectively get that 04:12 < steven> anonymous-structs alleviates the issue of creating new types for each event, but it doesnt work with type-switching, because then what do you type-switch it to? 04:12 < Namegduf> You don't need to type switch. 04:12 < Namegduf> I was saying as one way to make the separate functions less annoying. 04:12 < steven> oh right. 04:12 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 246 seconds] 04:13 < Namegduf> sjd: You still don't have compile-time information about which event you got, and as your behaviour is based on knowing that, you will need to test that at runtime 04:13 < steven> <3 04:13 -!- dfc [~dfc@sydfibre2.atlassian.com] has quit [Ping timeout: 276 seconds] 04:14 < Namegduf> I agree, it's an annoying problem. 04:14 < Namegduf> It's a thing with event-based stuff in general. 04:15 < Namegduf> You need to define an API for each event, or have a not-defined-obviously one looked at at runtime. 04:16 < Namegduf> Where you've lots of events, it gets annoying. And it isn't easy to circumvent. 04:17 -!- arvindht [c2ed8e11@gateway/web/freenode/ip.194.237.142.17] has joined #go-nuts 04:20 < steven> i dont mind definint a lot of events, thats expected. 04:20 < steven> the problem is, i dont want to have to define all that boilerplate code for each event in order to register a new channel per event 04:20 < Namegduf> It's about three lines. 04:21 < steven> if i omitted the concept of "multiple handlers" altogether and just allowed a single event-handler, this isnt an issue 04:21 < Namegduf> An append plus whatever you do to stop concurrent registrations from stepping all over each other. 04:21 -!- edsrzf [~chickench@122-61-221-144.jetstream.xtra.co.nz] has joined #go-nuts 04:21 < steven> because then theres only one channel per event, and my handler can just grab it. 04:21 < Namegduf> Unfortunately not. 04:21 < steven> nuh uh, called it, no callbacks 04:21 < Namegduf> Your bot code would need to be told to send to it. 04:22 < Namegduf> If you send to a channel no one is reading from you will block when the buffer runs out. 04:22 < steven> perhaps. 04:22 < steven> i think theres ways around that though 04:22 < steven> at least, much more elegant than the workarounds for this 04:23 < steven> can a type be used as a value? i dont think so, right? 04:23 < steven> hmm 04:23 < Namegduf> There isn't. 04:23 < steven> oh wait, oops 04:23 < Namegduf> And no, it can't. 04:24 < steven> hi 04:24 < steven> <3 04:24 < edsrzf> ...Except when using the reflect package 04:25 < steven> right on 04:25 < steven> edsrzf++ 04:28 -!- nettok [~quassel@200.119.177.246] has quit [Ping timeout: 255 seconds] 04:31 < steven> ok so 04:31 < steven> ive tried 4 different versions. 04:31 < steven> i like this one the best so far 04:33 < steven> an "inheritance"-based approach with inherited no-op methods: https://github.com/sdegutis/go-ircbot/commit/fc287ab1578269f8bfc5be5e8934f2972ce84ea8 04:34 < steven> a struct-of-specific-event-handlers each conforming to an interface: https://github.com/sdegutis/go-ircbot/commit/e7be7866bc048e5239a6c578ca86999a90251453 04:35 < steven> a single-function callback approach which had a generic signature and required manually unpacking arguments: https://github.com/sdegutis/go-ircbot/commit/326b234051d0365bb81919a5b2256b044c88fddd 04:36 < steven> the first channel approach of taking registering each specific-event-handler in its own goroutine, which ended up in un-refactorable boilerplate on the event-generator's side: https://github.com/sdegutis/go-ircbot/commit/f5c71d292afcd323105c02a1385818da3c82deb0 04:37 < steven> and finally, a channel-based interface{}-(ab)using goroutine which handles every event with type switching: https://github.com/sdegutis/go-ircbot/commit/91a77fe4d3912138976c5cbe5bbe91985fa5a0e7 04:37 < steven> apparently i cant count. thats 5 versions, not 4. 04:38 < Namegduf> Type assertions are the cleanest way to test if something is a given type at runtime, over manual unpacking/testing of generic structures. 04:39 < steven> i think, weighing the pros and cons of each, #5 is the best in terms of (1) minimal code required, (2) cleanest code, (3) most compile-time checking, and (4) least defering of compile-time errors into runtime panics 04:39 < steven> which do you pefer? #4 right? 04:40 < Namegduf> Yeah. 04:40 < steven> ok 04:41 < Namegduf> It's all a matter of opinion, though. 04:41 < steven> not a fan of DRY, eh? 04:41 < steven> i dont think its just opinion in this case.. 04:41 < Namegduf> DRY is misapplied if applied here. 04:41 < steven> when you have code that should be refactored but cant, and ends up being copied/pasted out of necessity, with minor changes each time, thats a recipe for disater 04:41 < Namegduf> The reason you can't refactor it out is that the code is doing different actual things to different actual types. 04:41 < steven> also disaster 04:42 < steven> the only difference between each function would be the type. 04:42 < steven> and since types themselves arent values, i cant refactor that out. 04:43 < Namegduf> They're trivial, tiny functions. 04:43 < steven> that doesnt negate my point. 04:43 < Namegduf> Yes, it does. 04:43 < Namegduf> It isn't a violation of DRY because they do not embody a significant amount of information being repeated. 04:43 < Namegduf> There is no algorithm being repeated. 04:43 < steven> by allowing that to happen you're giving bad practices a foothold. 04:44 < Namegduf> Slippery slope is a fallacy. 04:44 < steven> there is chance for error though. 04:44 < Namegduf> There is always chance for error. 04:44 < steven> ok. lets agree to disagree. 04:44 < steven> you're entitled to your opinion even if its wrong :) 04:44 < steven> ;) 04:44 < steven> nil is a type? 04:44 < steven> cool 04:44 < Namegduf> I don't think so 04:44 < Namegduf> It's untyped 04:45 < steven> it can be used in type switches 04:45 < steven> as a case 04:45 < Namegduf> Ah. 04:45 < steven> like int or float64 04:45 < steven> im sure its a special type though 04:45 < steven> ie, i cant do var a nil 04:45 < steven> :D 04:46 < steven> exch: also notice that loop.Run is a no-op currently ;) 04:47 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has quit [Excess Flood] 04:47 < Namegduf> At an abstract level, you're either declaring the types you support or you're not (and they're undocumented or documented elsewhere) 04:48 < Namegduf> A bunch of tiny functions to do that and provide an API for those event types is about as low cost as you can get a large API 04:48 < Namegduf> You will still need to export a bunch of similiar types and have a lot of boilerplate generation code internally for them, even if you send them down one channel. 04:49 < Namegduf> The scenario fundamentally involves a large number of event types and you can't get rid of that because it's part of the scenario 04:49 < steven> another benefit of this technique btw is that i can simply close(eventChan) on the othe end, and the handler's loop will just exit and thus the goroutine will die gracefully <3 04:49 < Namegduf> Yep. 04:49 < steven> esp with for .. range ch 04:50 < Namegduf> Yeah, it's very pretty. 04:50 < steven> i almost wish i could combine the chan for-range and type-switch, but then i realize im just spoiled because what i have is already very clean and good 04:51 < Namegduf> Probably non-ideal; type switches are the best way of doing what they do, but they probably want to be fairly obvious. 04:52 < Namegduf> Although you can type-assert the output of almost any expression, so... 04:52 < Namegduf> Really, what you're annoyed by is a lack of generics. 04:52 < steven> nah 04:52 < steven> i just see those two lines and how they make my code indented an extra level 04:52 < steven> and if they were combined it would be slightl less noisy in my goroutine 04:52 < Namegduf> I meant with #4 04:52 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has joined #go-nuts 04:52 < steven> oh. 04:52 < Namegduf> Generics == having a single defined register function for all types 04:52 < steven> well, i think it migh be solved with generics, sure 04:53 < steven> but in Ruby, i would solve it by literally passing the type as an argument 04:53 < steven> ie, bot.RegisterForEvent(SomeEventType) 04:53 < steven> but until we can do bot.RegisterForEvent(int) in Go legally, this isnt an option to consider 04:53 < Namegduf> That's equivalent to bot.RegisterForEvent("join") and a type assert in Go 04:54 < steven> not entirely. this way is safer. 04:54 < Namegduf> In Ruby you're just implicitly using them everywhere. :P 04:54 < steven> that way relies on a clean mapping between an identifier and an event struct type 04:54 < steven> this way would actually combine them into one value. 04:54 < steven> ie, your identifier *is* your event type struct, there can never be a mismatch 04:55 < Namegduf> What you fundamentally need to make it better than a type assert is a way to define at compile-time that RegisterForEvent(SomeEventType) returns SomeEventType 04:55 < steven> which is what i was talkiong about. 04:55 < steven> just now. 04:55 < Namegduf> That requires generics. 04:55 < steven> yeah. 04:55 < steven> probably. 04:56 < steven> like i said, it probably does. 04:56 < Namegduf> It doesn't bug me because repetition for different types due to lack of generics causes way more repetition of actual functions 04:56 < Namegduf> Like data structures and such 04:57 < Namegduf> And the repetition there is basically trivial. 04:57 < Namegduf> But I'd say it's part of the same problem. 04:57 < Namegduf> Ruby avoids the issue by not having compile time checks at all, which you can do easily enough. 04:57 < Namegduf> It's just not much better. 04:58 < steven> scala would be able to do it, with compile-time checks afaik 04:58 < Namegduf> Scala has generics. 04:58 < steven> yay! 04:58 < Namegduf> In the form of parameterized types. 05:00 < steven> man, i keep doing this stupid mistake 05:00 < steven> for v := range slice { ... } 05:00 < steven> instead of: for _, v := range slice { ... } 05:01 < Namegduf> I do that, too. 05:01 < steven> they really should be reversed. 05:01 < Namegduf> I lov ranging over a slice, though 05:01 < Namegduf> You can range over nil slices safely. 05:01 < steven> although for maps, it makes sense for key to come first 05:01 < steven> yep :) 05:01 < Namegduf> And zero length ones. 05:01 < steven> reminds me of good old ObjC 05:01 < Namegduf> There's pretty much no way the operation can have invalid input. 05:01 < steven> but better 05:02 -!- zozoR [~Morten@56344966.rev.stofanet.dk] has joined #go-nuts 05:05 -!- sjd [~sjd@204-195-89-40.wavecable.com] has quit [Remote host closed the connection] 05:08 < str1ngs> I like if err := doStuff(); err != nil 05:10 -!- kingfishr [~kingfishr@c-98-207-87-183.hsd1.ca.comcast.net] has joined #go-nuts 05:10 < steven> yeah thats pretty nice 05:20 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping timeout: 252 seconds] 05:21 -!- iant [~iant@216.239.45.130] has joined #go-nuts 05:21 -!- mode/#go-nuts [+v iant] by ChanServ 05:28 -!- Viriix [~joseph@c-67-169-172-251.hsd1.ca.comcast.net] has quit [Quit: Leaving] 05:31 -!- tensai_cirno [~cirno@194.154.66.97] has joined #go-nuts 05:48 -!- itrekkie [~itrekkie@ip72-201-208-165.ph.ph.cox.net] has quit [Quit: itrekkie] 05:58 < str1ngs> I need replicate a stream reader ie sed. read file into a buffer run my regex then save again? 05:58 -!- sysiphus [~opera@unaffiliated/sysiphus] has joined #go-nuts 06:00 < Namegduf> Read input into buffer, run regex, write to output 06:01 < str1ngs> ya what I was thinking 06:01 < str1ngs> the files are not large doesnt have to be that smart 06:02 < Namegduf> Well, if you're a *stream* reader you should presumably be able to operate on arbitrary and potentially infinite streams fed to stdin 06:03 < str1ngs> I'm not dealing with stdin 06:04 < str1ngs> but if there is a way to connect pipes and edit might be easier 06:05 < str1ngs> naw to complex make it simple 06:11 < str1ngs> so open file read it all into buffer line.ReadLine() run regex on the line the write to file one line at atime 06:15 -!- zozoR [~Morten@56344966.rev.stofanet.dk] has quit [Remote host closed the connection] 06:18 -!- cirno_ [~cirno@194.154.66.97] has joined #go-nuts 06:18 -!- tensai_cirno [~cirno@194.154.66.97] has quit [Read error: Connection reset by peer] 06:31 -!- tensorpudding [~user@99.148.205.193] has quit [Remote host closed the connection] 06:39 -!- Guest15688 [~dfc@sydfibre2.atlassian.com] has quit [Quit: Guest15688] 06:51 -!- kingfishr [~kingfishr@c-98-207-87-183.hsd1.ca.comcast.net] has quit [Remote host closed the connection] 06:58 -!- jgonzalez [~jgonzalez@173-14-137-134-NewEngland.hfc.comcastbusiness.net] has joined #go-nuts 06:59 -!- shvntr [~shvntr@113.84.148.123] has joined #go-nuts 07:05 -!- neshaug [~oyvind@213.239.108.5] has quit [Quit: Lost terminal] 07:07 -!- jgonzalez [~jgonzalez@173-14-137-134-NewEngland.hfc.comcastbusiness.net] has quit [Ping timeout: 255 seconds] 07:12 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has quit [Read error: Connection reset by peer] 07:16 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has joined #go-nuts 07:18 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: sudo rm -R /] 07:22 -!- wrtp [~rog@92.17.50.183] has joined #go-nuts 07:23 -!- olegfink [~olegfink@ppp92-100-67-127.pppoe.avangarddsl.ru] has joined #go-nuts 07:27 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts 07:27 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts [] 07:28 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts 07:32 -!- cirno_ [~cirno@194.154.66.97] has quit [Quit: Leaving] 07:37 -!- ExtraSpice [XtraSpice@88.118.35.153] has joined #go-nuts 07:42 -!- pilgrum [~pilgrum@cpe-67-49-71-222.socal.res.rr.com] has quit [Read error: Connection reset by peer] 07:52 -!- rtharper [~tomh@unaffiliated/sioraiocht] has joined #go-nuts 07:55 -!- olegfink [~olegfink@ppp92-100-67-127.pppoe.avangarddsl.ru] has quit [Ping timeout: 240 seconds] 07:58 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts 08:09 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts 08:16 -!- rtharper [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed the connection] 08:29 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 08:31 -!- ronnyy [~quassel@p4FF1C6C8.dip0.t-ipconnect.de] has joined #go-nuts 08:36 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts 08:41 -!- dfc [~dfc@124-169-149-145.dyn.iinet.net.au] has joined #go-nuts 08:47 -!- KyleXY [~kyle@reddit/user/kylexy] has quit [Read error: Operation timed out] 08:47 -!- KyleXY [~kyle@reddit/user/kylexy] has joined #go-nuts 08:48 -!- comex [comex@c-67-188-10-190.hsd1.ca.comcast.net] has quit [Read error: Operation timed out] 08:49 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has quit [Ping timeout: 276 seconds] 08:49 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has quit [Ping timeout: 260 seconds] 08:49 -!- comex [comex@c-67-188-10-190.hsd1.ca.comcast.net] has joined #go-nuts 08:49 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has joined #go-nuts 08:49 -!- pingveno [~pingveno@c-98-246-133-8.hsd1.or.comcast.net] has joined #go-nuts 08:55 -!- nixness [~dsc@78.100.171.45] has quit [Ping timeout: 255 seconds] 08:58 -!- foocraft [~dsc@78.100.171.45] has joined #go-nuts 09:05 -!- shaneoyo [~shaneoyo@123-243-44-35.static.tpgi.com.au] has joined #go-nuts 09:07 -!- shaneoyo [~shaneoyo@123-243-44-35.static.tpgi.com.au] has left #go-nuts [] 09:12 -!- napsy [~luka@193.2.66.6] has joined #go-nuts 09:15 -!- tvw [~tv@212.79.9.150] has joined #go-nuts 09:26 -!- tensai_cirno [~cirno@77.232.15.216] has joined #go-nuts 09:28 -!- mikespook [~mikespook@219.137.75.11] has quit [Quit: Leaving.] 09:34 -!- ildorn [~ildorn@dslb-088-067-146-176.pools.arcor-ip.net] has joined #go-nuts 09:36 -!- saturnfive1 [~saturnfiv@210.74.155.131] has quit [Read error: Connection reset by peer] 09:38 < Namegduf> Where's that comparison of keywords count? 09:40 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has joined #go-nuts 09:42 -!- ildorn [~ildorn@dslb-088-067-146-176.pools.arcor-ip.net] has quit [Quit: Leaving.] 09:45 -!- cenuij [~cenuij@base/student/cenuij] has quit [Remote host closed the connection] 09:52 < nsf> Namegduf: afair in one of the presentations 09:52 < nsf> Rob Pike's most likely 09:56 < nsf> although 09:56 < nsf> can't find it 09:57 -!- saturnfive [~saturnfiv@210.74.155.131] has joined #go-nuts 09:57 < nsf> here it is 09:57 < nsf> $GOROOT/doc/ExpressivenessOfGo.pdf 09:57 < nsf> page 13 09:59 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined #go-nuts 10:00 < nsf> but comparison isn't quite fair 10:00 < nsf> Go count includes keywords, but not predeclared identifiers 10:01 < nsf> true, false, nil, (u)int[8,16,32,64], uint, int, float32, float64, byte, complex, etc. 10:01 < nsf> and they are kind of related to an approximate complexity 10:02 < xyproto> It's here: http://golang.org/doc/ExpressivenessOfGo.pdf 10:02 < Namegduf> Thanks. 10:03 < xyproto> nsf: I agree, but so is the complexity of the most used apis, so it's a slippery slope 10:03 < nsf> yeah 10:03 < xyproto> nsf: and brainfuck is not the least complex language ;) 10:03 < Namegduf> I don't know 10:04 < nsf> semantic entities are important too and their interrelations 10:04 < Namegduf> They're kind of related but I don't think (unsigned) long/short/int is simpler than (u)int[8,16,32,64] 10:04 < Namegduf> It has fewer but they're far more easier to screw up with. 10:04 < nsf> I'm just saying that these are in C's count 10:04 < nsf> but not in Go's 10:04 -!- ronnyy [~quassel@p4FF1C6C8.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 10:05 < nsf> Go actually has a bit more "keywords" than C 10:05 < nsf> (if we pretend that predeclared identifier is a keyword) 10:06 < nsf> but yet, Go is simpler than C 10:06 < nsf> :) 10:12 < wrtp> there's a big difference between predeclared identifiers and keywords 10:12 < nsf> no 10:13 < wrtp> in C, much of libc counts as "predeclared identifiers" - ANSI doesn't allow you to redefine printf, for example 10:13 < nsf> but we're not talking about Go lib 10:14 < wrtp> the difference between a predeclared identifier and a keyword is that you don't need to know about predeclared identifiers 10:14 < nsf> and even C's preprocessor 10:14 < wrtp> b 10:14 < wrtp> ut 10:14 < wrtp> 10:14 < nsf> just languages 10:14 < wrtp> 10:14 < wrtp> b 10:14 < wrtp> ut y 10:14 < wrtp> ou 10:14 < wrtp> but you do need to know about keywords 10:14 < wrtp> [grr] 10:14 < nsf> you can't use go without knowing its predeclared identifiers :) 10:14 < wrtp> you can 10:15 < wrtp> of course, you need to know a few 10:15 < nsf> all types in Go are predeclared identifiers 10:15 < edsrzf> The parser doesn't need to know about predeclared identifiers. Is that what you mean? 10:15 < wrtp> but not all of them 10:15 < wrtp> edsrzf: i mean that if i want to declare a variable called "complex128" there's no problem with that 10:15 < edsrzf> Yep, that's true too. 10:15 < wrtp> or a method called "make" or "new" 10:15 < nsf> but whatever, I'm not in a mood of arguing for the sake of arguing 10:16 < edsrzf> Awww, but I love a good argument for the sake of arguing. ;) 10:17 -!- skejoe [~skejoe@188.114.142.162] has quit [Quit: Lost terminal] 10:18 < wrtp> the predeclared identifiers are really like Go's standard library. 10:22 < ww> no arguing! 10:25 -!- saturnfive [~saturnfiv@210.74.155.131] has quit [Read error: Connection reset by peer] 10:48 -!- waqas [~waqas@jaim.at] has joined #go-nuts 10:52 -!- virtualsue [~chatzilla@nat/cisco/x-mweyoezzzuejhcwg] has joined #go-nuts 10:55 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has quit [Ping timeout: 250 seconds] 10:56 -!- aho [~nya@fuld-590c77c2.pool.mediaWays.net] has joined #go-nuts 11:07 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has joined #go-nuts 11:09 -!- sysiphus [~opera@unaffiliated/sysiphus] has quit [Ping timeout: 255 seconds] 11:09 -!- saturnfive [~saturnfiv@219.144.170.100] has joined #go-nuts 11:10 -!- saturnfive [~saturnfiv@219.144.170.100] has left #go-nuts [] 11:14 -!- edsrzf [~chickench@122-61-221-144.jetstream.xtra.co.nz] has quit [Remote host closed the connection] 11:17 -!- boscop [~boscop@f055201026.adsl.alicedsl.de] has joined #go-nuts 11:22 -!- rlab_ [~Miranda@91.200.158.34] has joined #go-nuts 11:23 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 264 seconds] 11:30 -!- shvntr [~shvntr@113.84.148.123] has quit [Ping timeout: 255 seconds] 11:31 -!- shvntr [~shvntr@113.84.148.123] has joined #go-nuts 11:31 -!- sysiphus [~opera@unaffiliated/sysiphus] has joined #go-nuts 11:48 -!- arvindht [c2ed8e11@gateway/web/freenode/ip.194.237.142.17] has quit [Quit: Page closed] 12:00 -!- artefon [~thiago@dhcp37.usuarios.dcc.ufmg.br] has joined #go-nuts 12:08 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Quit: peace in teh middle east] 12:09 -!- jgonzalez [~jgonzalez@173-14-137-134-NewEngland.hfc.comcastbusiness.net] has joined #go-nuts 12:11 -!- tobier [~tobier@c-1e9de055.712-1-64736c11.cust.bredbandsbolaget.se] has quit [Remote host closed the connection] 12:20 -!- napsy [~luka@193.2.66.6] has quit [Ping timeout: 255 seconds] 12:28 -!- sysiphus [~opera@unaffiliated/sysiphus] has quit [Quit: sysiphus] 12:30 -!- ako [~nya@fuld-590c7b20.pool.mediaWays.net] has joined #go-nuts 12:33 -!- aho [~nya@fuld-590c77c2.pool.mediaWays.net] has quit [Ping timeout: 248 seconds] 12:38 < nsf> http://pastie.org/1713179 12:38 < nsf> hehe 12:38 < nsf> how brutal is that? :) 12:39 < nsf> hopefully it works :) 12:39 -!- shvntr [~shvntr@113.84.148.123] has quit [Ping timeout: 264 seconds] 12:40 < nsf> http://pastie.org/1713117 12:40 < nsf> that's the other piece 12:42 < fzzbt> nsf: is gocode broken for newest go? 12:42 < nsf> fzzbt: I don't know 12:42 < fzzbt> it's not compiling 12:42 < fzzbt> uh, i meant newest release version 12:42 < nsf> what's your version of Go? 12:42 < fzzbt> newest release 12:42 < fzzbt> branch 12:43 < nsf> I've updated gocode by accident for the latest weekly 12:43 < nsf> which is 2011-03-15 12:43 < nsf> next time it will be updated for the release again 12:43 < nsf> as README says 12:43 < fzzbt> oki 12:48 -!- shvntr [~shvntr@113.84.148.123] has joined #go-nuts 12:52 -!- artefon [~thiago@dhcp37.usuarios.dcc.ufmg.br] has quit [Ping timeout: 264 seconds] 12:53 -!- gr0gmint [~quassel@87.61.162.99] has joined #go-nuts 12:54 -!- RobertLJ [~RobertLJ@c-68-44-164-102.hsd1.nj.comcast.net] has joined #go-nuts 12:55 -!- shvntr [~shvntr@113.84.148.123] has quit [Quit: leaving] 12:55 < wrtp> nsf: looks pretty complex to me, and you're not even taking constants into account AFAICS 12:56 < wrtp> the go equivalent is half the number of lines of code and does more: http://golang.org/src/cmd/gc/typecheck.c#342 12:56 < nsf> they are taken 12:56 < nsf> see second lin 12:56 < nsf> link* 12:57 < wrtp> nsf: but is_int doesn't return true if t is a constant int 12:57 < nsf> it's not documented, but it is 12:57 -!- tensai_cirno [~cirno@77.232.15.216] has quit [Quit: Leaving] 12:57 < nsf> :) 12:57 < nsf> I have two built-in types: BUILTIN_INT and BUILTIN_CONST_INT 12:57 < wrtp> builtin_stypes[BUILTIN_CONST_INT] == stype_t::INT ?? 12:57 < nsf> both are of class INT 12:58 < nsf> no 12:58 < nsf> builtin_stypes is an array of stype_t* 12:58 < nsf> but 12:58 < nsf> builtin_stypes[BUILTIN_CONST_INT]->type == stype_t::INT 12:58 < nsf> yes 12:58 < wrtp> so what's the difference between is_int and is_const_int ? 12:59 < nsf> is_const_int says it's const int and only const int 12:59 < nsf> is_int includes both const int and int 12:59 < wrtp> i thought you said stype_t::INT is the same as builtin_stypes[BUILTIN_CONST_INT] 12:59 < nsf> no 12:59 < wrtp> or are you abusing operator overloading 12:59 < wrtp> ? 13:00 < nsf> stype_t::type_t is a classification of types 13:00 < nsf> for example each of builtin ints has this class 13:00 < nsf> e.g. BUILTIN_INT8 13:00 < nsf> BUILTIN_INT16 13:00 < nsf> etc. 13:00 < wrtp> is == overloaded? 13:00 < wrtp> it looks like a simple pointer comparison 13:01 < nsf> no 13:01 < nsf> and yes 13:01 < nsf> it is 13:02 < nsf> wrtp: anyways, you can't see the whole hierarchy, so I will explain the whole picture later if you want 13:02 < nsf> when the commit is ready 13:02 < nsf> and it works 13:02 < nsf> at least partially :) 13:02 < wrtp> so is_int(x) is exactly equivalent to is_const_int(x) because x == stype_t::INT and x == builtin_stypes[BUILTIN_CONST_INT] and style_t::INT == builtin_stypes[BUILTIN_CONST_INT] 13:02 < nsf> :( 13:02 < nsf> x is stype_t* 13:02 < nsf> stype_t struct has a field 'type' 13:03 < nsf> x->type == stype_t::INT for is_int 13:03 < nsf> and for is_const_int 13:03 < nsf> x == builtin_stypes[BUILTIN_CONST_INT] 13:03 < wrtp> ah, i hadn't noticed to "->type" in is_int 13:03 < wrtp> s/to/the 13:03 < nsf> yeah 13:04 < nsf> and well, my type system is a bit more complex than Go's 13:04 < nsf> because it includes pointer arithmetic 13:06 < nsf> wrtp: and gc compiler is too brutal to me :) 13:06 < nsf> it uses goto a lot 13:06 < wrtp> looks simpler to me. you don't seem to have interfaces, slices, maps etc 13:06 < nsf> ah, that.. yes 13:07 < nsf> but they are not the part of binary expressions anyway 13:07 < nsf> I meant the binop case 13:07 < wrtp> sure they are 13:07 < nsf> uhm, no 13:07 < wrtp> interface{}(2) == "hello" 13:07 < nsf> hm, ok 13:07 < nsf> I was wrong :) 13:08 < wrtp> that one thing is as complex as your pointer arithmetic, i think 13:09 < nsf> maybe 13:10 -!- iant [~iant@216.239.45.130] has quit [Ping timeout: 250 seconds] 13:11 -!- shvntr [~shvntr@113.84.148.123] has joined #go-nuts 13:20 -!- tensorpudding [~user@99.148.205.193] has joined #go-nuts 13:22 -!- niekie [~niek@CAcert/Assurer/niekie] has quit [Ping timeout: 264 seconds] 13:30 -!- emjayess [~emjayess@pix1.i29.net] has joined #go-nuts 13:31 -!- shvntr [~shvntr@113.84.148.123] has quit [Quit: leaving] 13:31 < xyproto> I want to go through all lines in a file, change each line a bit and then write everything to a new file. However, the textfile is about 500MB. Is there a better way than reading it to string, splitting it into lines then trying to assemble it again? Any map-like function (ref Haskell/Python)? 13:32 < xyproto> (for dealing with files, that is) 13:32 < Namegduf> "Go Program" is the worst pun ever 13:32 < Namegduf> For a presentation title 13:32 < xyproto> Something like changeFile(inputFilename, outputFilename, lineChangeFunction) ? 13:33 < xyproto> Namegduf: I agree :) 13:33 -!- tobier [~tobier@c-1e9de055.712-1-64736c11.cust.bredbandsbolaget.se] has joined #go-nuts 13:33 < Namegduf> I consider that an advantage. 13:33 < nsf> xyproto: if you need to do it once 13:33 < nsf> don't use Go 13:33 < nsf> use ruby :) 13:33 < Namegduf> s/ruby/sed/ 13:34 < Namegduf> :P 13:34 < nsf> whatever 13:34 < nsf> something that has required functionality 13:34 < Namegduf> xyproto: Use ReadlIne 13:35 < nsf> f = File.new("testfile") 13:35 < nsf> f.each {|line| puts "#{f.lineno}: #{line}" } 13:35 < nsf> that's ruby 13:35 -!- plainhao [~plainhao@208.75.85.237] has joined #go-nuts 13:35 < nsf> or f.each_line 13:36 < nsf> afaik they are equivalent 13:37 < wrtp> for {s, err := in.ReadString('\n'); if err != nil {break}; out.WriteString(process(s))} 13:37 < wrtp> where in is a bufio.Reader and out is a bufio.Writer 13:37 < nsf> but you need also to compile it :) 13:38 < xyproto> nsf: The result needs to be possible to execute on Windows, without installing anything extra. As few dependencies as possible. 13:38 < nsf> ah 13:38 < nsf> then Go is the right choice 13:38 < nsf> statically compiled binaries will help you 13:38 < xyproto> nsf: other than that, I agree, ruby (or python) are better choices :) 13:39 -!- shvntr [~shvntr@113.84.148.123] has joined #go-nuts 13:39 < nsf> even my gaming windows installation has ruby and python :D 13:39 < nsf> lol 13:39 < xyproto> nsf: I don't even have a gaming windows installation, starcraft 2 runs great in wine, if I feel the urge to play ;) 13:40 < nsf> I play different kind of games 13:40 < xyproto> wrtp: thank you, I will try that 13:40 < xyproto> nsf: kinds of games that does not run in a console emulator, dosbox, wine or natively? unpossible! 13:41 < nsf> try crysis 2 :D 13:41 < xyproto> nsf: ok, ok ;) 13:42 -!- iant [~iant@67.218.107.170] has joined #go-nuts 13:42 -!- mode/#go-nuts [+v iant] by ChanServ 13:43 < wrtp> xyproto: if speed is an issue, you might want to use ReadSlice and Write 13:44 < xyproto> wrtp: cool, I'll look into it. I've never used those. 13:45 < wrtp> xyproto: bufio is a very useful package 13:46 < xyproto> wrtp: yes, it looks great. However, I have to search a bit to find a way to open a file as something bufio.* will like. 13:46 < wrtp> xyproto: just use os.Open and then bufio.NewReader or NewWriter 13:47 < wrtp> or, easier, bufio.NewReader(os.Stdin) will work 13:47 < xyproto> wrtp: great, thanks 13:48 -!- tobier [~tobier@c-1e9de055.712-1-64736c11.cust.bredbandsbolaget.se] has quit [Quit: leaving] 13:49 -!- tobier [~tobier@c-1e9de055.712-1-64736c11.cust.bredbandsbolaget.se] has joined #go-nuts 13:56 -!- Fish [~Fish@exo1066.net2.nerim.net] has quit [Ping timeout: 260 seconds] 13:56 < xyproto> what would be the function signature of a function f() that receives a function ? 13:56 < nsf> http://pastie.org/1713499 13:56 < xyproto> f(g func) did not work... 13:57 < nsf> yay! it works (sort of) 13:57 < xyproto> interface{}? 13:57 < nsf> xyproto: what function? 13:57 < nsf> function has a type 13:57 <+iant> xyproto: you have to give the parameters and return types of the function 13:57 < nsf> func(int)int 13:57 <+iant> you can't just say "some functoin" 13:57 < nsf> for example 13:57 < xyproto> aha 13:57 < nsf> func() for void func 13:58 < wrtp> f func(func()) 13:58 < nsf> uhm 13:58 < nsf> ya, it's valid and confusing 13:58 < wrtp> or func f(arg func()) 13:58 < nsf> that's better :) 13:59 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts 13:59 < wrtp> i don't think the former is confusing, really - it's a variable holding a function that takes a function as an argument 13:59 < nsf> yes and it is confusing :) 13:59 < nsf> at least for me 13:59 < wrtp> any more confusing than f func(int) ? 14:00 < nsf> certainly 14:00 < wrtp> ok 14:00 < nsf> f func(f func()) 14:00 < nsf> lol 14:00 < nsf> surprisingly it's less confusing that way 14:00 < wrtp> f func(f func(f func())) func(f func()) 14:01 < wrtp> :-) 14:01 < nsf> :) 14:01 < nsf> f func(f func(f func())) (f func(f func())) 14:01 < wrtp> f func(func(func())) func(func()) 14:01 < xyproto> you got the func alright :P 14:01 < nsf> I guess it's easy for a true LISPer 14:01 < nsf> lol 14:02 < nsf> oh, I think my variant isn't valid 14:02 < wrtp> more like a typed language like ML or haskell really. you can't describe types in lisp 14:02 < nsf> you can't name the parameter and the result using the same name 14:04 < wrtp> the usual signature for a three arg function in haskell, when translated to Go, would be something like: f func(a int) func(b int) func(c int) int 14:04 < wrtp> == f func(a, b, c int) int 14:06 < nsf> ok, now it's time for the most interesting part 14:06 < nsf> constant evaluation 14:07 * nsf dives into a gmplib's manual 14:07 < nsf> s/a/the/ 14:07 < xyproto> ok, I followed your tips and wrote a function that takes an input and output filename and a function that changes lines, using ReadSlice. Does it look ok? Critique & comments are welcome: http://go.pastie.org/1713543 14:07 < wrtp> nsf: you could just steal go's implementation for the time being... 14:08 < nsf> wrtp: I will steal iant's 14:08 < nsf> partially 14:08 < nsf> :D 14:08 < nsf> since I'm using the same libs for arbitrary precision math as gccgo 14:08 < wrtp> xyproto: you'd be better off using a bufio.Writer for your output 14:08 < xyproto> wrtp: oh, ok 14:09 < xyproto> wrtp: thanks, I'll fix it 14:09 < wrtp> xyproto: and i'd probably just use a literal '\n' rather than SEP 14:10 < nsf> for such a short app it doesn't matter 14:10 < wrtp> xyproto: if you're going to convert to string, then just use bufio.ReadString 14:10 < wrtp> the only advantage of ReadSlice is it avoids allocating for each line 14:10 < wrtp> but converting to string does an allocation anyway 14:11 -!- pharris [~Adium@rhgw.opentext.com] has joined #go-nuts 14:11 < xyproto> I don't really need string, when I think about it 14:11 < wrtp> xyproto: you should probably return an error from changeFile rather than bool 14:12 < wrtp> then main can print the error if it wants to 14:12 < xyproto> wrtp: good point, I'll try that too 14:13 < wrtp> otherwise it looks ok 14:14 -!- gr0gmint [~quassel@87.61.162.99] has quit [Remote host closed the connection] 14:14 < xyproto> however, now it does not produce any output anymore. I must be doing something wonky: http://go.pastie.org/1713571 14:14 < wrtp> xyproto: if you use bufio.Writer, remember to defer a flush of it 14:14 < wrtp> yup, that's the problem 14:14 < wrtp> defer out.Flush() 14:15 < wrtp> after NewWriter 14:15 < xyproto> wrtp: aha, thanks 14:15 -!- shvntr [~shvntr@113.84.148.123] has quit [Read error: Connection reset by peer] 14:15 < xyproto> wrtp: yey, it worked! Thanks 14:15 * ww complains loudly about building gcc on a mac where macports causes duelling versions of libiconv 14:16 -!- dfc [~dfc@124-169-149-145.dyn.iinet.net.au] has quit [Quit: dfc] 14:18 -!- niekie [~niek@CAcert/Assurer/niekie] has joined #go-nuts 14:21 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts 14:25 -!- rtharper [~tomh@unaffiliated/sioraiocht] has joined #go-nuts 14:27 -!- Fish [~Fish@exo3753.pck.nerim.net] has joined #go-nuts 14:27 -!- shvntr [~shvntr@113.84.148.123] has joined #go-nuts 14:35 -!- skejoe_ [~skejoe@188.114.142.162] has joined #go-nuts 14:36 -!- skejoe [~skejoe@188.114.142.162] has quit [Read error: Operation timed out] 14:36 -!- dfc [~dfc@124-169-149-145.dyn.iinet.net.au] has joined #go-nuts 14:42 < steven> macports? 14:42 < steven> dude, use homebrew, ww 14:44 < jnwhiteh> homebrew doesn't have a gcc formula, because gcc is included in XCode 14:44 < jnwhiteh> but yeah, I agree. 14:44 < steven> it has llvm and clang 14:44 < steven> oh wait, not clang. 14:44 < steven> oops 14:44 < ww> well.. has to be gcc because of gogcc 14:44 < steven> i wonder why theres no gcc/clang for mac outside of xcode? 14:44 < steven> i dont get that 14:44 < ww> and has to be built by hand because i need a cros compiler 14:45 < steven> and im banned for life from #macdev so i cant ask them 14:45 < jnwhiteh> ww: bummer =/ 14:45 < ww> i'm not using macports to build it, just that macports is getting in the way 14:46 * ww wonders if linux or something runs on the macbook air yet... 14:47 < jnwhiteh> Ubuntu still isn't fully compatible due to the GPT issue 14:47 < jnwhiteh> just get rid of macports and use homebrew 14:47 < jnwhiteh> and you shouldn't have any issues 14:47 < steven> exactly 14:47 < steven> homebrew is the awesomesauce 14:48 < jnwhiteh> indeed =) 14:48 < Namegduf> steven: What did you do? 14:49 < Namegduf> And yay, my 15 minute introduction to Go went well. 14:50 < steven> Namegduf: when? 14:50 < steven> Namegduf: also, awesome :) 14:50 < Namegduf> "lifetime ban". It sounded like an amusing story.. 14:50 < steven> oh right. 14:50 < steven> so remember how im really nice and cool and stuff? 14:50 < Namegduf> No. 14:50 < Namegduf> Haha, no, I'm kidding. 14:50 < Namegduf> Yes. 14:50 < steven> heh 14:50 < steven> well anyway, this is a pretty new thing 14:50 < steven> i used to be the opposite. 14:51 < Namegduf> Ah. 14:51 < steven> yeah. not too amusing of a story. 14:51 < steven> sorry to disappoint 14:51 < Namegduf> 'sokay. 14:55 -!- iant [~iant@67.218.107.170] has quit [Quit: Leaving.] 14:56 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has joined #go-nuts 15:03 < xyproto> os.Open wants a perm unit32 argument, what should it be set to on Windows? 0666? 0? 15:04 < xyproto> uint32 15:04 -!- iant [~iant@nat/google/x-anjobhuskwobvske] has joined #go-nuts 15:04 -!- mode/#go-nuts [+v iant] by ChanServ 15:05 < wrtp> xyproto: opening for reading or writing? 15:05 < wrtp> for reading, 0 15:05 < wrtp> f 15:05 < wrtp> or 15:05 < wrtp> for writing, 0666 should be fine 15:05 < wrtp> (well, creating - for writing and reading without creating the perm will be ignored) 15:06 < nsf> 0644 ;) 15:06 < nsf> ah windows 15:07 -!- sysiphus [~opera@unaffiliated/sysiphus] has joined #go-nuts 15:07 < wrtp> 0666 is better - then umask can take effect 15:07 < wrtp> mind you, i prefer the plan 9 way of doing things - permissions are inherited from the parent directory. no need for umask. 15:08 -!- TheMue [~TheMue@p5DDF5FED.dip.t-dialin.net] has joined #go-nuts 15:08 < waqas> Windows doesn't make use of the perm argument 15:09 < waqas> That is: syscall.Open in syscall_windows.go (called by os.Open) 15:10 * nsf hates C++'s implicit conversions 15:10 < xyproto> wrtp: for writing, yes 15:11 -!- dfc [~dfc@124-169-149-145.dyn.iinet.net.au] has quit [Quit: dfc] 15:11 < xyproto> wrtp: the plan9 way sounds nicer, I agree 15:11 < nsf> unsigned int is ambigous with const char * :( 15:11 < aiju> nsf: what the FUCK? 15:11 < wrtp> xyproto: waqas is correct. under windows the permission seems to be ignored 15:11 < nsf> aiju: what? :) 15:11 < aiju> don't char * and const char * need conversions? 15:11 < xyproto> ok, thanks 15:11 < nsf> aiju: from non-const to const conversion is implicit 15:12 < wrtp> xyproto: but in general, use 0666 - that way your code will remain portable 15:12 < xyproto> ok 15:12 < wrtp> (when creating, that is) 15:12 -!- arun_ [~arun@unaffiliated/sindian] has quit [Ping timeout: 248 seconds] 15:13 < xyproto> how about '\n' for newlines on *nix/win, how does the go packages handle that? Or do they just not relate to lines, only bytes? 15:13 -!- dfc [~dfc@124-169-149-145.dyn.iinet.net.au] has joined #go-nuts 15:13 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts 15:13 < kimelto> when/where? 15:14 < wrtp> xyproto: i think it's reasonable to use \n as line separator and treat \r as space 15:14 < wrtp> or you could just strip off \r if you like 15:14 < wrtp> it's good to work on both \r\n and \n 15:14 -!- saturnfive [~saturnfiv@219.144.170.100] has joined #go-nuts 15:15 < aiju> oh god, \r\n 15:15 < wrtp> but writing... well, i'd just write with \n only, but it depends what tools need to read the output file 15:15 < kimelto> mac only use \r, right? 15:15 < aiju> no 15:15 < aiju> mac os (not x) did 15:15 < wrtp> some bits of mac do 15:15 < aiju> mac os x uses \n 15:15 < kimelto> oh! Im a bit late. 15:16 < Namegduf> Use whichever is used by your file format 15:16 < wrtp> i think most windows tools work with \n these days 15:16 < aiju> after all os x is <hypocritical bs>FULL POSIX COMPLIANT</hypocritical bs> 15:16 < Namegduf> If your file format doesn't define one, get a better file format 15:16 < aiju> Namegduf: "text" 15:16 < Namegduf> For text files, \n suffices; only Notepad on Windows has a problem 15:16 -!- DerHorst [~Horst@e176101095.adsl.alicedsl.de] has joined #go-nuts 15:16 < aiju> lots of windows programs have problems 15:16 < Namegduf> [citation needed] 15:17 < Namegduf> Wordpad works, Word works (IIRC) 15:17 < wrtp> yeah, i always use wordpad when i need to 15:17 < Namegduf> Notepad++ works 15:17 < wrtp> why they haven't fixed notepad, i do not know 15:17 < kimelto> use xml! 15:17 * kimelto hides 15:17 < aiju> kimelto: trollface.jpg 15:18 < wrtp> they're probably still using the same binary from 20 years ago 15:18 < aiju> it's windows 15:18 < aiju> they never fix anything 15:18 < aiju> it took them decades to fix the DLL path security hole 15:18 < aiju> everytime they fix something, some lobotomized flatworms depended on it 15:19 < aiju> and much of MS's income comes from lobotomized flatworms 15:19 < Namegduf> It's an obscure but lucrative market. 15:20 -!- skejoe_ [~skejoe@188.114.142.162] has quit [Quit: Lost terminal] 15:21 -!- skelterjohn [~jasmuth@c-68-46-33-145.hsd1.nj.comcast.net] has quit [Quit: skelterjohn] 15:26 -!- DerHorst [~Horst@e176101095.adsl.alicedsl.de] has quit [Ping timeout: 255 seconds] 15:26 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has quit [Ping timeout: 240 seconds] 15:27 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 15:28 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has joined #go-nuts 15:29 -!- rlab_ [~Miranda@91.200.158.34] has quit [Ping timeout: 260 seconds] 15:34 -!- saturnfive [~saturnfiv@219.144.170.100] has left #go-nuts [] 15:38 < steven> wow aiju you made 'labotomized flatworms' appear in the same exact columns twice ina row 15:38 < steven> when monospace anyway 15:39 < steven> awesome <3 15:41 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has quit [Remote host closed the connection] 15:43 < aiju> lol 15:45 -!- jokooon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has joined #go-nuts 15:49 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has quit [Ping timeout: 264 seconds] 15:49 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se] has joined #go-nuts 15:53 -!- rejb [~rejb@unaffiliated/rejb] has quit [Quit: .] 15:54 -!- shvntr [~shvntr@113.84.148.123] has quit [Quit: leaving] 15:54 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts 15:57 -!- ExtraSpice [XtraSpice@88.118.35.153] has quit [Quit: Leaving] 15:58 -!- xyproto [~alexander@77.40.159.131] has quit [Read error: No route to host] 15:59 -!- DerHorst [~Horst@e176101095.adsl.alicedsl.de] has joined #go-nuts 16:03 < TheMue> ah, my redis client is now working f*cking fine, yeah 16:05 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has quit [Read error: Connection reset by peer] 16:06 < steven> woot TheMue 16:06 < steven> also thanks for answering my ML question TheMue <3 16:06 < TheMue> hope it helped 16:06 < steven> woot, two of my go projects are on golang's projects page :D 16:06 < steven> gorm and godo! 16:07 < ww> why is everyone talking about ML these days? 16:07 < TheMue> I've got only one, the Tideland Common Go Library. but it's a bunch of packages. 16:08 < TheMue> ww: and why here? *smile* 16:08 < ww> yesterday i was in the office of a prof here (university of edinburgh) who said that if the ml people hadn't gotten bogged down in corner cases of the type system and had instead made a good broad set of libraries it would have overtaken python... 16:08 < ww> TheMue: "here" is probably because of interfaces. i think go is the first language since ml to emphasise them 16:08 < TheMue> i see a lot of haskel talks around 16:09 < ww> and "here" is, at informatics, in #swig and #go-nuts ... so far 16:09 < TheMue> ww: hehe, and steven talks about the mailing list, not the lang 16:09 < ww> oh.... 16:09 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts 16:09 * ww blushes 16:09 < TheMue> maybe i should have used satire tags 16:10 -!- shvntr [~shvntr@113.84.148.123] has joined #go-nuts 16:10 < aiju> languages which care about being popular are likely not worth using ;P 16:10 < TheMue> rofl 16:11 < ww> aiju: well there's unpopular, and then there's abandonware 16:11 < steven> ww: im talking about the mailing list 16:11 < steven> oh 16:11 < steven> sorry 16:11 < steven> he said it 16:11 < steven> btw, Go is pretty fricken cool 16:11 < steven> god bless you all real good 16:11 < steven> right in the face 16:11 < aiju> Historically, languages designed for other people to use have been bad: Cobol, PL/I, Pascal, Ada, C++. The good languages have been those that were designed for their own creators: C, Perl, Smalltalk, Lisp. -- Paul Graham 16:12 < steven> aiju: :) 16:12 < TheMue> sound reasonable 16:12 < TheMue> +s 16:14 -!- ShadowIce` [~pyoro@HSI-KBW-109-193-120-162.hsi7.kabel-badenwuerttemberg.de] has joined #go-nuts 16:14 -!- ShadowIce` [~pyoro@HSI-KBW-109-193-120-162.hsi7.kabel-badenwuerttemberg.de] has quit [Changing host] 16:14 -!- ShadowIce` [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts 16:14 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Ping timeout: 252 seconds] 16:15 * ww is surprised to see that gccgo is written in c++ 16:15 -!- anticw [~anticw@c-67-169-68-180.hsd1.ca.comcast.net] has quit [Read error: Connection reset by peer] 16:15 < aiju> i'm surprised to see that there is such a thing as gccgo 16:16 -!- jokooon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has quit [Quit: Quitte] 16:16 * ww is suprised to see that there is such a thing as aiju 16:17 < aiju> haha 16:17 < aiju> well, i tend to surprise people, in both ways 16:18 -!- dfc [~dfc@124-169-149-145.dyn.iinet.net.au] has quit [Quit: dfc] 16:18 -!- KyleXY [~kyle@reddit/user/kylexy] has quit [Read error: Operation timed out] 16:19 -!- shvntr [~shvntr@113.84.148.123] has quit [Read error: Connection reset by peer] 16:20 -!- anticw [~anticw@c-67-169-68-180.hsd1.ca.comcast.net] has joined #go-nuts 16:20 -!- waqas [~waqas@jaim.at] has left #go-nuts [] 16:23 -!- xyproto [~alexander@77.40.159.131] has joined #go-nuts 16:29 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.] 16:29 -!- piranha [~piranha@5ED42E59.cm-7-5a.dynamic.ziggo.nl] has quit [Quit: Computer has gone to sleep.] 16:30 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has joined #go-nuts 16:31 -!- ronnyy [~quassel@p4FF1C6C8.dip0.t-ipconnect.de] has joined #go-nuts 16:33 < plexdev> http://is.gd/RxuqPj by [Russ Cox] in go/ -- A+C: Roger Pau Monné (individual CLA) 16:33 < plexdev> http://is.gd/mqk1Vu by [Russ Cox] in 3 subdirs of go/src/pkg/runtime/ -- runtime: fix arm build 16:33 -!- leczb_ [~leczb@nat/google/x-qvkkojfukhyolxlw] has quit [Read error: No route to host] 16:34 < jnwhiteh> I am in typing hell =/ 16:34 < jnwhiteh> I'm interacting with a binary data object, so its a mix of uint/int of different sizes 16:35 < jnwhiteh> so I think I'm going to leave the binary representation as is, and then move them into 'standard' types for me to interact with. 16:35 < jnwhiteh> or I might cry =) 16:35 -!- leczb [~leczb@nat/google/x-rxhdmokrnwolvolc] has joined #go-nuts 16:35 < aiju> jnwhiteh: ehm 16:35 < aiju> jnwhiteh: what about encoding/binary? 16:36 < jnwhiteh> I'm using encoding/binary to get and put the data, that's not the issue 16:36 < jnwhiteh> its interacting with the different values in their sized forms, causes me to add casts absolutely everywhere so I'm going to fix that =) 16:38 -!- jokoon [~jorinovsk@LMontsouris-156-26-32-176.w80-14.abo.wanadoo.fr] has quit [Quit: Quitte] 16:47 < TheMue> oh, first time I need the fallthrough statement 16:50 < plexdev> http://is.gd/8cJnvb by [Roger Pau Monné] in go/src/pkg/http/cgi/testdata/ -- http: modified perl cgi test to remove newline from env variables 16:50 < plexdev> http://is.gd/GqqDJF by [Russ Cox] in go/src/pkg/http/pprof/ -- http/pprof: cpu profiling support 16:51 -!- virtualsue [~chatzilla@nat/cisco/x-mweyoezzzuejhcwg] has quit [Read error: Operation timed out] 16:53 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts 16:54 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has joined #go-nuts 16:54 -!- virtualsue [~chatzilla@nat/cisco/x-agcsklajxyhkwpog] has joined #go-nuts 16:56 < TheMue> ah, create anonymous empty structs a la Configuration{} for default values is nice 16:56 -!- Fish [~Fish@exo3753.pck.nerim.net] has quit [Quit: So Long, and Thanks for All the Fish] 16:57 -!- Fish [~Fish@exo3753.pck.nerim.net] has joined #go-nuts 17:16 < skelterjohn> TheMue: what do you mean? 17:17 < xyproto> just that he likes initializing structs with the {}, with a Java (?) influenced choice of words, I would guess? 17:17 < xyproto> TheMue: is it so? 17:18 < TheMue> skelterjohn: In my case I pass the configuration of my Redis client as a struct. If the internal values aren't set I take default values. So I can say rd := NewRedisDatabase(Configuration{}) 17:18 < Namegduf> That's good. 17:18 < skelterjohn> what if some of the values are ints 17:18 < skelterjohn> and 0 isn't the default, but what you want? 17:18 < skelterjohn> what i do is, for any Config struct, I pair it with a ConfigDefault() function 17:18 < skelterjohn> so I'd say NewRedisDatabase(ConfigDefault()) 17:19 < TheMue> skelterjohn: Would be a way too, but I like also NewRedisDatabase(Configuration{PoolSize: 25}) 17:20 < skelterjohn> yes, that would require multiple lines with my method 17:20 < Namegduf> Zero value being default is good 17:20 < skelterjohn> on a related note, i always load up my config object from the command line using goargcfg.googlecode.com/hg/argcfg :) 17:20 < Namegduf> Special casing zero to support it is sad 17:20 < Namegduf> I don't know what I prefer. 17:20 < TheMue> skelterjohn: hehe 17:21 -!- matsl [~matsl@1-1-4-2a.mal.sth.bostream.se] has joined #go-nuts 17:21 < taruti> didn't argcfg have a contaginous license? 17:21 < Namegduf> I see no licence here 17:21 < skelterjohn> i don't remember what license i gave it 17:21 < Namegduf> Or even copyright info 17:21 < skelterjohn> i really just made it for myself 17:21 < skelterjohn> someone else can outright steal it if they feel like 17:22 < Namegduf> It parses command line arguments into a map? 17:22 < skelterjohn> no 17:22 < skelterjohn> uses reflect to load up a struct 17:22 < Namegduf> Ah. 17:22 < skelterjohn> and even does so recursively 17:23 < skelterjohn> so that -A.B=5 will look for a struct field named "A" inside your config object, and set its "B" field to 5 17:23 < skelterjohn> i've found it a real time saver 17:23 < Namegduf> Ah, I see. 17:23 < Namegduf> Interesting, not quite what I think I might want but gives me ideas, thanks. 17:23 < skelterjohn> it's not really appropriate for "products" 17:23 < skelterjohn> but it's great for my experimentation code 17:24 * exch will stich with a good old fashioned optarg thingy parser 17:24 * Namegduf has an idea to make his server automatically persist global state as a means of "configuration", but this presents issues with recovering from serious screwups 17:24 < skelterjohn> Namegduf: feel free to rip off (or ignore) my code, as you see fit 17:24 < TheMue> so, pushed into repo at google code 17:24 < Namegduf> I might just write an arbitrary argument->map thing 17:24 < TheMue> btw, redis is a nice little db 17:25 < xyproto> I like redis 17:26 < Namegduf> Basically I want to make configuration simple, and easy to make web-based 17:26 < Namegduf> Because thousand line configuration files for IRC does not improve its survival in non-technical communities 17:28 -!- matsl [~matsl@1-1-4-2a.mal.sth.bostream.se] has left #go-nuts ["Leaving"] 17:28 < TheMue> xyproto: My client is extreme flexible due to a simple Command() method and result sets as well as transactions. Additionally it handles binaries ([]byte) and does some convenience mapping of []string and map[string]string. 17:29 -!- Project_2501 [~Marvin@82.84.77.224] has joined #go-nuts 17:30 -!- novabyte [~novabyte@m5.mullvad.net] has joined #go-nuts 17:36 < plexdev> http://is.gd/KjZzNK by [Ian Lance Taylor] in 2 subdirs of go/src/pkg/runtime/darwin/ -- runtime/darwin: remove unused local variables. 17:37 < plexdev> http://is.gd/XSXZni by [Ian Lance Taylor] in go/src/pkg/runtime/ -- runtime: always set *received in chanrecv. 17:37 < plexdev> http://is.gd/2mujo8 by [Ian Lance Taylor] in go/test/ -- test: match gccgo error messages for label.go and label1.go. 17:47 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts 17:53 < plexdev> http://is.gd/iXfEOs by [Russ Cox] in go/src/pkg/runtime/pprof/ -- runtime/pprof: disable test on darwin 17:59 -!- waqas [~waqas@jaim.at] has joined #go-nuts 18:01 < novabyte> does Go support runtime reflection? 18:02 < waqas> Yes 18:02 < waqas> See docs for the reflect package 18:02 < novabyte> waqas: could you point me to some example code? :) 18:04 < waqas> fmt.Print* works using reflection. Source here: http://golang.org/src/pkg/fmt/print.go 18:04 < novabyte> waqas: thank you. 18:06 < novabyte> I saw on the mailing list there are some go-llvm bindings, does anyone know in what state they're in? 18:12 < nsf> novabyte: I'm the author 18:12 < nsf> they are in an abandoned state 18:12 < novabyte> nsf: i was thinking of using the bindings in a university project 18:12 < nsf> github.com/nsf/gollvm 18:12 < novabyte> nsf: nvm that answers my question 18:12 < nsf> novabyte: if it works for you, do it :) 18:13 < nsf> although I'm not sure it even compiles 18:13 < novabyte> nsf: lol, i dont know enough about Go and LLVM to fill in the gaps as necessary 18:13 < nsf> I see 18:13 < novabyte> nsf: if I knew the language better I'd use them and contribute back. 18:14 < novabyte> nsf: only have a few months to write a compiler :) 18:14 < nsf> LLVM is a good choice 18:14 < novabyte> nsf: def, wanted to combine it with learning a new language ;) 18:14 < nsf> but I would use C/C++ for that 18:15 < novabyte> nsf: why? 18:15 < novabyte> nsf: i thought Go was a systems language? 18:15 < nsf> more libraries and tools and languages are stable 18:15 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has joined #go-nuts 18:15 < nsf> Go is fine, but it's still in development 18:15 < nsf> and as you can see there is a lack of solid libraries 18:15 < nsf> (gollvm as an example) 18:16 < nsf> in fact I'm writing a compiler right now as well :D 18:16 < nsf> in C++ 18:16 < novabyte> nsf: you've filled in support for a parser generator and the early go-llvm bindings... the rest I could fill in :) 18:16 < nsf> with parser generators there is a better situation 18:16 < nsf> goyacc afaik is complete and works 18:17 < novabyte> nsf: what about golemon? 18:17 < nsf> well, it may or may not work 18:17 < novabyte> nsf: lol 18:17 < nsf> it was implemented via hacks 18:17 < novabyte> nsf: oh ok. 18:17 < nsf> because lemon originally uses union as an important part of its structure 18:18 < nsf> I've replaced union usage with interface{} based hacks 18:18 -!- littlebobby [~bob@unaffiliated/littlebobby] has joined #go-nuts 18:18 < nsf> not sure if it's 100% correct 18:18 < nsf> so it may or may not work :) 18:18 < novabyte> nsf: i c. 18:18 < novabyte> nsf: so your compiler project, for a personal language? 18:19 < nsf> currently yeah, I'm the only developer and spec is in my head 18:19 < nsf> but I have big plans :) 18:19 -!- littlebobby [~bob@unaffiliated/littlebobby] has quit [Client Quit] 18:19 < nsf> something like C with Go syntax 18:19 < novabyte> nsf: you wanted manual memory management? 18:19 < nsf> yes 18:20 < nsf> it's not like I want it to use always 18:20 < nsf> but I need a good low level language 18:20 < novabyte> nsf: well fit generics in too and I'll come running ;) 18:20 < nsf> yes, there is a plan for that as well 18:20 < nsf> but first milestone is to provide all the C features 18:20 < novabyte> nsf: I do *really* like the simplicity in the Go syntax 18:21 < nsf> my syntax is even more simpler :) 18:21 < nsf> Go has few bad places 18:21 < nsf> for example: 18:21 < novabyte> nsf: but I hate the auto semi-colon stuff, why would you want the lexer to insert tokens for you... 18:21 < nsf> (*int)(x) 18:21 < nsf> you can't say whether it's a pointer deref + function call or type cast 18:21 < nsf> I use different syntax for type casting: 18:21 < nsf> <*int>x 18:22 < nsf> another minor problem with compound literals 18:22 < novabyte> nsf: or just turn cast into a keyword? 18:22 < nsf> novabyte: no, it's a bad idea 18:22 < novabyte> nsf: why? 18:22 -!- unofficialmvp1 [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts 18:22 < uriel> nsf: <*int>x has its own issues 18:22 -!- unofficialmvp1 [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts [] 18:22 < nsf> like C++'s static_cast<*int>(x) or D's cast(int)x, too much typing 18:22 < nsf> uriel: no 18:22 < nsf> at least not now 18:23 < nsf> uriel: name one 18:23 < nsf> :) 18:23 -!- littlebobby [~bob@unaffiliated/littlebobby] has joined #go-nuts 18:23 < nsf> C++ has issues with that syntax inside template definitions, but its because expressions are allowed inside those brackets 18:24 < nsf> template <typename X, a > b> 18:24 < nsf> my parser is LALR(1) without any hacks at the moment 18:24 < exch> "(*int)(x)" how does that translate to a pointer deref + function call? 18:24 -!- virtualsue [~chatzilla@nat/cisco/x-agcsklajxyhkwpog] has quit [Read error: Operation timed out] 18:25 < nsf> var int *func(int) 18:25 < nsf> (*int)(x) 18:25 < novabyte> nsf: too much typing... i call it clarity... :) 18:25 < nsf> int is not a keyword in Go 18:25 < exch> you cant do that 18:25 < exch> oh wait 18:25 < exch> mm 18:25 < exch> forgot about the keyword is not really a keyword thing 18:25 < nsf> exch: int is a predeclared identifier :) 18:25 < exch> yea 18:26 < novabyte> nsf: really? why? 18:26 < nsf> novabyte: why what? 18:26 < exch> var int bool; int = false 18:26 < exch> nice 18:26 < nsf> Go specs specifies all the types that way 18:26 < nsf> ask Go devs :) 18:26 < novabyte> nsf: is int a predeclared identifier? rather than a keyword? 18:26 < nsf> novabyte: yes, according to Go spec 18:27 < novabyte> nsf: interesting but very strange to me... 18:27 < nsf> because it's just another type name 18:27 < nsf> like any other 18:27 < nsf> type Int int 18:27 -!- tvw [~tv@212.79.9.150] has quit [Remote host closed the connection] 18:27 < nsf> etc. 18:27 < novabyte> nsf: hmmm ok. 18:27 < nsf> it confuses most syntax highlighters though :) 18:27 < novabyte> nsf: so this language of yours anything I can try out ;) 18:28 < nsf> novabyte: when it's ready, maybe 18:28 < novabyte> nsf: sure 18:28 < nsf> currently I have no idea what I will end up with 18:28 < novabyte> nsf: i keep thinking of a Go with manual memory management + generics. 18:29 < nsf> yeah, me too 18:29 < nsf> in fact I'm not just thinking :) I'm working on it 18:29 < novabyte> nsf: lol 18:29 < nsf> but also few other quirks 18:29 < aiju> syntax highlighting is evil anyway ;P 18:29 < nsf> like union types are back, pointer arithmetic is back, *void is back 18:29 < novabyte> nsf: I don't know Go well enough to notice it's quirks 18:29 < aiju> ergo, confusing syntax highlighters is a good thing 18:29 < novabyte> nsf: ah ok. 18:30 < nsf> ah, that issue with compound literals which requires hacks for LALR(1) 18:30 < nsf> type X [1]int 18:30 < nsf> if X{1}[0] == 1 { } 18:30 < aiju> it's basically C in green 18:30 < nsf> it's ambiguous 18:30 < nsf> because X is a valid expression 18:31 < nsf> and LALR(1) parser will think that this is: 18:31 < nsf> if X{1} 18:31 < nsf> a valid if statement 18:31 < novabyte> nsf: yep 18:31 < nsf> go itself resolves that issue by disallowing that and allowing this: 18:31 < nsf> if (X{1}[0] == 1) { } 18:31 < nsf> I use different syntax for compound literals 18:31 < nsf> <type>{...} 18:32 < aiju> if it were up to me, I'd reintroduce braces-free if statements 18:32 < novabyte> aiju: its not worth the agro ;) 18:32 < nsf> aiju: yeah, but it's kind of hard to accomplish 18:32 < nsf> without returning () around conditional expr 18:33 < aiju> novabyte: this is something which really bugs me and only after i've used go quite a lot 18:33 < nsf> novabyte: regarding semicolon insertion 18:34 < nsf> I agree that compiler shouldn't force that 18:34 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts 18:34 < nsf> e.g. two options: use that feature or not 18:34 < novabyte> nsf: reminds me of javascript's... "let me complete that for you" 18:34 < nsf> it should be enabled/disabled via compiler switch or via heuristic 18:34 < novabyte> nsf: agreed 18:34 < aiju> novabyte: javascript has such a thing? 18:34 < novabyte> nsf: compiler switch 18:35 < nsf> novabyte: I'd go with both :) 18:35 < nsf> actually I like semicolon insertion 18:35 < nsf> so the default will be it 18:35 < novabyte> aiju: http://inimino.org/~inimino/blog/javascript_semicolons 18:35 < nsf> but then compiler detects if you use manual semicolons 18:35 < nsf> and disables that feature 18:35 < nsf> allowing you to write all kinds of things like: 18:36 < nsf> func x() 18:36 < nsf> { 18:36 < nsf> etc. 18:36 < novabyte> aiju: it was just a quick google for an article about it, but yes javascript has optional semi-colons 18:36 < nsf> (e.g. '{' on its own line) 18:36 < aiju> novabyte: oh just the semicolons 18:36 -!- variable [~variable@unaffiliated/variable] has joined #go-nuts 18:36 < variable> kimelto: hey 18:36 < aiju> novabyte: i thought you meant something like automatic variable completion shit 18:36 < novabyte> nsf: why bother complicating the compiler, just flag it? 18:36 < novabyte> aiju: nope sorry 18:36 < nsf> novabyte: I don't think it's such a big complication 18:37 < nsf> it's heuristic after all 18:37 < nsf> it gives no promises that it would work 18:37 < novabyte> nsf: maybe I'm just lazy :) 18:37 < nsf> but if it would work for most cases, it's good 18:37 < aiju> out of 88 if statements in one file i wrote, *67* are one line if statements 18:38 < nsf> aiju: :) 18:38 < novabyte> aiju: if ( something-true) { do-something } // one line :) 18:38 < aiju> novabyte: that one hurts my eyes an incredible amount 18:39 < aiju> it's the code equivalent of sodium hydroxide 18:39 < aiju> and, gofmt would split it, i suppose 18:39 -!- variable [~variable@unaffiliated/variable] has left #go-nuts ["Trojan horse ran out of hay"] 18:39 < novabyte> aiju: can you do something-true && do-something in Go? 18:39 < nsf> aiju: how about a special if statement form exclusively for you? 18:39 < nsf> expr ? expr 18:39 < aiju> nsf: hahaha 18:39 < nsf> for example 18:39 < aiju> like in bash 18:39 -!- [Pete_27] [~noname@110-174-103-31.static.tpgi.com.au] has joined #go-nuts 18:39 < aiju> i like that one even les 18:39 < aiju> +s 18:39 < nsf> a > b ? max = a 18:40 < nsf> lol 18:40 < aiju> i'd rather live with the three line monster, then 18:40 < nsf> Go's are fine in one line 18:40 < nsf> if a > b { max = a } 18:40 < plexdev> http://is.gd/y9u5dJ by [Rob Pike] in go/src/pkg/flag/ -- flag: fix error in documentation example. 18:40 < str1ngs> hmm I cant os.Copy or os.Cp is it in another package? 18:40 < plexdev> http://is.gd/Uoxft2 by [Ian Lance Taylor] in go/test/fixedbugs/ -- test: match gccgo error messages for bug274.go. 18:40 < str1ngs> find* 18:40 < plexdev> http://is.gd/QVjASU by [Rob Pike] in go/test/ -- test/run: clear $E in case it's already set in environment. 18:41 < novabyte> aiju: really so it's only if (something-true) do-something is acceptable to you? 18:41 < nsf> I think it's possible to have both 18:41 < nsf> if (a > b) max = a 18:41 < nsf> and 18:41 < nsf> if a > b { max = a } 18:42 < nsf> but I won't do this 18:42 < nsf> :) 18:42 < aiju> i'm not entirely sure about it 18:42 < nsf> but you have to disallow paren expr in the second form 18:42 < nsf> like 'if (a > b) { max = a }' 18:42 < nsf> is not valid anymore 18:42 < novabyte> nsf: i always prefer the "one true way" approach 18:43 < nsf> novabyte: I like Go's syntax too and I don't understand aiju 18:43 < str1ngs> python is -> attaway :P 18:43 < nsf> because writing parens around conditional expr is very painful to me 18:43 < novabyte> nsf: just pick a form and go for it... my preference is whichever is easier form for the parser ;) 18:43 < nsf> novabyte: I've picked long time ago 18:44 < aiju> note that i'm not just getting pissed off about something which looks strange or something (like most people who discouver Go), it's actual experience 18:44 < novabyte> nsf: yeh im sure... it was just a general statement 18:44 < aiju> and, i like Go's syntax, too 18:44 < str1ngs> os.Copy where is it? 18:44 < aiju> another thing from experience: a two-statement for loop 18:44 < nsf> str1ngs: copy is a built-in function 18:44 < nsf> but 18:44 < nsf> uhm.. 18:45 < str1ngs> to copy one file to another? 18:45 < nsf> what do you need? 18:45 < nsf> ah, there is no such thing 18:45 < aiju> something along "for x := getchar(); x != '0' {println(x)}" 18:45 < str1ngs> so os.Pipe ? 18:45 < nsf> open one file for reading, open another for writing 18:45 < str1ngs> ya Pipe I guess 18:45 < nsf> and io.Copy 18:46 < str1ngs> Pipe returns a connected pair of Files; reads from r return bytes written to w. It returns the files and an Error, if any. 18:46 < str1ngs> let me check io.Copy should have checked io sonner 18:47 < aiju> str1ngs: Pipe is for communicating between processes 18:47 < aiju> not copying files 18:47 < str1ngs> it works on file descriptors 18:47 < str1ngs> but anyways io.Copy is better 18:48 < dfr|work> argh..... interface{} doesn't cover functions, seems like? 18:48 < dfr|work> or am I missing something? 18:49 -!- rutkowski [~adrian@178235051224.walbrzych.vectranet.pl] has joined #go-nuts 18:49 < nsf> dfr|work: it should work for everything 18:49 < dfr|work> nsf, okay, lemme make sure that what I have works then. Thanks 18:50 < str1ngs> aiju: If I confused Pipe sorry not use to working with low level stuff 18:50 < aiju> no need to apologize 18:50 < aiju> happens ;) 18:52 < novabyte> aiju & nsf: does Go support annotations (e.g. @DbField)? 18:52 < aiju> what do you mean? 18:52 < novabyte> aiju: like Java annotations? 18:52 < aiju> i don't know Java 18:52 < nsf> yeah, I'm not sure what it means 18:53 < nsf> I don't know Java as well :) 18:53 < gmilleramilar> novabyte: not really 18:53 < aiju> (i know just enough to stay away from it, as far as possible) 18:53 < nsf> there are tags for struct field 18:53 < nsf> fields* 18:53 < gmilleramilar> novabyte: you can put tags on struct fields 18:53 < nsf> not sure if it's close 18:53 < gmilleramilar> but that's about it. 18:53 < nsf> yeah 18:54 < novabyte> gmilleramilar: hmmm that might be enough ;) 18:54 < uriel> hmmm... I'm the only one that can't access this anymore: 18:54 < gmilleramilar> nsf: java annotations can go on lots of different things, and have a much more extensive reflection model 18:54 < uriel> http://codereview.appspot.com/4276060/diff/12001/doc/go_spec.html 18:54 < aiju> uriel: no 18:54 < nsf> gmilleramilar: thanks for information :) 18:54 < skelterjohn> uriel: is that the thing about generics? 18:54 < uriel> skelterjohn: yes 18:54 < skelterjohn> i could never view it, even when you first posted it here 18:54 < uriel> or was 18:54 < nsf> uriel: "You do not have permission to view this issue" 18:54 < nsf> :( 18:54 < nsf> I know what it is 18:55 < str1ngs> this when I'm done I'm going to have a unix DSL ie cp(src string, dest string) 18:55 < nsf> April's fool day is soon 18:55 < uriel> nsf: that is what I said ;P 18:55 < nsf> hehe 18:55 < nsf> didn't know that :) 18:55 < nsf> but I'm sure that's what it is 18:56 < novabyte> gmilleramilar: ummm, could you point me to example code? 18:57 < plexdev> http://is.gd/U9TLFI by [Albert Strasheim] in go/src/pkg/net/ -- net: add FileConn, FilePacketConn, FileListener 18:57 < plexdev> http://is.gd/VCgFee by [Albert Strasheim] in go/src/pkg/syscall/ -- syscall: GetsockoptInt for darwin, freebsd. 18:58 < dfr|work> nsf, ah, i see.. The issue us that []string and []interface{} are different beasts. 18:58 < nsf> dfr|work: yes 18:58 -!- ako [~nya@fuld-590c71a8.pool.mediaWays.net] has joined #go-nuts 18:58 < dfr|work> nsf, so i basically cannot ask for a slice of "whatever", right? 18:59 < nsf> you can 18:59 < nsf> but you can't ask for "whatever slice" 18:59 < kimelto> may I have a slice of bread? 18:59 < dfr|work> nsf, well, what I mean is a slice of 'whatevers' in it :) 18:59 < nsf> slice of "whatever" is []interface{} 18:59 < nsf> but you want to use concrete slice as abstract slice 18:59 < dfr|work> nsf, ah, i see. But a slice of strings is also a slice of whatevers. 19:00 < nsf> no, not really 19:00 < nsf> Go can't think of it as slice of whatevers 19:00 < nsf> only you can 19:00 < nsf> :) 19:00 < dfr|work> nsf, yea. Plus, slice of whatevers can add whatever to it.. whereas slice of strings is more restrictive. 19:00 < nsf> yes 19:00 < dfr|work> nsf, oh well. Anyhow.. there goes my implementation of for_each. :( 19:00 < dfr|work> nsf, oh wellz 19:00 -!- aho [~nya@fuld-590c7b20.pool.mediaWays.net] has quit [Ping timeout: 255 seconds] 19:01 < nsf> many tried using Go for generics kind of thing 19:01 < nsf> it doesn't work, live with it 19:01 -!- Venom_bbl [~pjacobs@66.54.185.131] has quit [Ping timeout: 240 seconds] 19:01 < nsf> :) 19:01 < dfr|work> nsf, oh, I'll keep trying, no worries. ;) 19:01 < dfr|work> nsf, that's how I learn intricacies of language -- trying to do weird things and see if I can get away with it :) 19:01 -!- binarypie [~binarypie@c-24-6-151-185.hsd1.ca.comcast.net] has joined #go-nuts 19:01 -!- binarypie [~binarypie@c-24-6-151-185.hsd1.ca.comcast.net] has quit [Remote host closed the connection] 19:02 -!- binarypie [~binarypie@c-24-6-151-185.hsd1.ca.comcast.net] has joined #go-nuts 19:02 < nsf> I learn much more now when I'm trying to create a language that looks like Go but isn't Go 19:02 < nsf> :) 19:02 < nsf> many syntax and semantics quirks come out 19:03 < dfr|work> nsf, to do that you first have to have a good idea of what go is, and I'm lacking on that front. ;) 19:03 < nsf> well, I've made an autocompletion for Go previously, yeah 19:03 -!- yonkeltron [~yonkeltro@unaffiliated/yonkeltron] has joined #go-nuts 19:04 < yonkeltron> does go have generics? 19:04 < nsf> yonkeltron: no 19:04 < skelterjohn> lol 19:04 < yonkeltron> why lol? it's a valid question! 19:04 < yonkeltron> nsf: thanks. 19:04 < aiju> yonkeltron: there has been some sort of suggestion about that one recently 19:04 < nsf> yonkeltron: it's commonly asked :) 19:04 < aiju> (or an early april fools' joke) 19:05 < nsf> and it looks like there will be an april fools' joke about that 19:05 < nsf> :D 19:05 < skelterjohn> yonkeltron: because of the discussion two minutes ago 19:05 < skelterjohn> was about go+generics 19:05 < yonkeltron> ah. are there plans for generics or some other mechanism to preserve type-safety while making it not suck to produce related data structures? 19:05 < yonkeltron> skelterjohn: haha! 19:05 < aiju> yonkeltron: nobody knows 19:05 < dfr|work> nsf, I'd suggest just sayign that go doesn't scale, and rewriting the compiler to compile to java bytecode. 19:05 < yonkeltron> i imagine it is asked pretty often... 19:05 < dfr|work> nsf, that's so much more believable ;D 19:05 < nsf> yonkeltron: certainly there is a wish like that in community 19:05 < aiju> dfr|work: what the fuck? Java scales even less than Go 19:06 < novabyte> yonkeltron: http://golang.org/doc/go_faq.html#generics 19:06 < yonkeltron> i was actually wondering if rob pike was in here. he's old friends with my faculty from uni 19:06 < nsf> dfr|work: uhm, what are you talking about? :) 19:06 < dfr|work> nsf, april fools 19:06 < skelterjohn> yonkeltron: typically no, he isn't in the irc chan 19:06 < nsf> dfr|work: ah 19:06 < dfr|work> aiju, that's the point ;) 19:06 < yonkeltron> skelterjohn: ah. gotcha. 19:06 < nsf> dfr|work: yeah that would be funny 19:06 < skelterjohn> and when i say typically, i mean i have never known him to be here 19:07 < skelterjohn> he reads the mailing list though 19:07 < yonkeltron> novabyte: that's a fair deflection, actually. 19:07 < yonkeltron> skelterjohn: good to know. heh. 19:07 < dfr|work> nsf, that joke is a bit old in the ruby community, so..... ;) 19:07 < yonkeltron> my faculty always spoke rather highly of him from their time at bell labs, i believe 19:07 < nsf> hehe 19:07 < aiju> ruby is a joke 19:07 < skelterjohn> but he might have a secret irc identity 19:07 < yonkeltron> aiju: don't hate. 19:07 < skelterjohn> maybe aiju is really rob pike 19:07 < novabyte> yonkeltron: I like the bit "we don't feel an urgency for them, although we understand some programmers do." 19:07 < aiju> hahaha 19:07 < dfr|work> aiju, i think we went over that already. 19:07 < aiju> yonkeltron: i don't see any reason not to hate a language which has a ".nonzero?" method on integers 19:08 < yonkeltron> aiju: ok, look 19:08 < aiju> and yeah, everyone is full of me talking about it ;P 19:08 < yonkeltron> aiju: let's say you're friends with lisp 19:08 < skelterjohn> it's true 19:08 < yonkeltron> and lisp meets this chick smalltalk 19:08 < skelterjohn> i'm done with the aiju vs ruby rant 19:08 < nsf> another holywar 19:08 < skelterjohn> no need to prolong it, yonkeltron 19:08 < yonkeltron> and smalltalk is pretty hot stuff 19:08 < yonkeltron> they have a kid 19:08 < yonkeltron> boom 19:08 < yonkeltron> why hate? 19:08 < yonkeltron> ok 19:08 < yonkeltron> fair enough 19:08 < nsf> I like ruby but as a tool for _shell_ tasks 19:08 < novabyte> yonkeltron: just leave it 19:08 < nsf> not for serious stuff 19:08 < yonkeltron> hehe 19:08 < yonkeltron> ok, ok 19:09 < dfr|work> yonkeltron, if you're a ruby fanboi, this chat is not too friendly. Be careful ;) 19:09 < yonkeltron> well, i believe that you don't really know a lanaugage unless you can name 5 non-trivial things about it which you hate 19:09 < dfr|work> yonkeltron, yea, that doesn't prevent people from looking about weird things and saying it sux0rz :P 19:09 < skelterjohn> that might be true for people in the ruby community 19:09 < novabyte> yonkeltron: basically use whatever lang you like, and if you dont like it dont use it :) (or write your own) 19:10 < aiju> yonkeltron: that was just an example, pretty symbolic for the whole language 19:10 < nsf> yeah, writing your own is the best idea 19:10 < aiju> and i really don't want to discuss it 19:10 < novabyte> nsf: that was a reference to you ;) 19:10 < aiju> (and most people here don't want me to discuss it) 19:10 < yonkeltron> well discussions about language philosophies are often-interesting but rarely-fruitful 19:10 < nsf> novabyte: I'm saying it's not because of me 19:10 < nsf> simply because more languages is more choice 19:11 < nsf> and eventually all langauges are affected by each other 19:11 < nsf> faster and better evolution as a result 19:11 < skelterjohn> i don't think "choice" is a good thing, by definition 19:11 < novabyte> nsf: the reference "write your own" 19:11 < nsf> yonkeltron: talks about languages are cheap 19:11 < nsf> without trying to do something 19:11 < yonkeltron> nsf: same with type systems, imho... 19:12 * ww peeks in on the channel... 19:12 < str1ngs> can we all agree that Java sucks though? 19:12 < aiju> yeah 19:12 < nsf> str1ngs: sure 19:12 < aiju> Java sucks through a tin straw 19:12 < aiju> +h 19:12 < str1ngs> ok we have common ground.. continue 19:12 < aiju> haha 19:12 < novabyte> str1ngs: sigh... 19:12 < aiju> 20:14 < yonkeltron> nsf: same with type systems, imho... 19:12 < yonkeltron> java the language, sucks... 19:12 < aiju> strong typing, done ;P 19:12 * ww looks at the channel topic 19:12 < aiju> java the vm, sucks even more 19:13 < nsf> well, I can't say java sucks 19:13 < nsf> I don't know it 19:13 < nsf> I've written zero lines of java code 19:13 < aiju> i've written 200 lines or so 19:13 < nsf> but I've seen java apps 19:13 < novabyte> str1ngs: check out http://www.mirah.org/ 19:13 < nsf> and it wasn't the best thing I saw 19:13 < aiju> yonkeltron: type systems is probably the best example for "right thing for the right job" 19:14 * ww tries to change the topic to alt.lang.gripe... and fails 19:14 < nsf> JVM is a failure platform 19:14 < yonkeltron> novabyte: mirah seems cool, def 19:14 < nsf> like you know there is a language called Boo 19:14 < nsf> for .NET/Mono platfor 19:14 < novabyte> aiju: should avoid it, it looks like ruby code 19:14 < nsf> platform* 19:14 < nsf> I saw its manifesto 19:14 < nsf> and I was really inspiried 19:15 < nsf> but then I've discovered what .NET actually is 19:15 < skelterjohn> by what evidence do you claim that "JVM is a failure platform"? 19:15 < novabyte> yonkeltron: i'm toying with it at the moment. nice idea. 19:15 < nsf> fuck that "solid platform" 19:15 < yonkeltron> novabyte: good to know 19:15 < nsf> skelterjohn: well, for me 19:15 < dfr|work> skelterjohn, it was bought by Oracle. :( 19:15 < nsf> everything that has garbage collector is 19:15 < yonkeltron> dfr|work: you're funny! 19:15 < nsf> even Go, sorry :D 19:15 < str1ngs> GC is good to some regards 19:15 < nsf> yeah 19:16 < novabyte> nsf: what a ridiculously sweeping statement... 19:16 < waqas> "everything that has garbage c" - that gives me a lot of context ^^ 19:16 -!- plainhao [~plainhao@208.75.85.237] has quit [Quit: plainhao] 19:16 < nsf> but for a strongly typed language that tries to be fast 19:16 < dfr|work> yonkeltron, the act of having been bought made it a failure platform. :( 19:16 < nsf> I don't think so 19:16 < yonkeltron> hehe 19:16 < yonkeltron> perhaps you're right but who can tell 19:16 < yonkeltron> ok 19:16 < nsf> I don't mind using lua for example 19:16 < dfr|work> yonkeltron, before then it was only debatable. :) 19:16 < yonkeltron> humans, thank you for entertaining my questions 19:16 < yonkeltron> i wish you all well 19:16 < yonkeltron> have a peaceful weekend 19:16 -!- yonkeltron [~yonkeltro@unaffiliated/yonkeltron] has left #go-nuts ["Killed buffer"] 19:17 < dfr|work> why did he decide I was human? :( 19:17 < skelterjohn> i hope to have a violent weekend 19:17 < dfr|work> hurts my programmed lack of feelings 19:17 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts 19:17 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-151-209.clienti.tiscali.it] has joined #go-nuts 19:17 < nsf> I hope to have a productive weekend 19:17 < nsf> :) 19:18 < dfr|work> nsf, lies. 19:18 < nsf> more type checking for crawl and const expression evaluation as a minimum 19:18 < dfr|work> nsf, I'm doing two piloting lessons over weekend. And need to work on my SC2 =/ 19:18 < dfr|work> and maybe am gonna see if I can find enclosure for my hobby elwire project =/ 19:18 < aiju> 20:18 < skelterjohn> by what evidence do you claim that "JVM is a failure platform"? 19:19 < aiju> christ, just look at JVM cpu/memory use 19:19 < nsf> Java doesn't have unsigned integers and can't have arrays as true struct fields 19:19 < nsf> wtf 19:19 < skelterjohn> look at how many places its used 19:19 < nsf> what were they thinking about? 19:19 < aiju> skelterjohn: flies and shit 19:19 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Quit: Leaving.] 19:19 < skelterjohn> my point is, you need to define "failure" 19:20 < Namegduf> Java 19:20 < nsf> :D 19:20 * Namegduf reads up now 19:20 < aiju> Java has double and Double 19:20 < Namegduf> Wow, psuedorelevant. 19:20 -!- Project_2501 [~Marvin@82.84.77.224] has quit [Ping timeout: 248 seconds] 19:20 < aiju> language redundancy on a whole new level 19:20 < Namegduf> You're right anyway, in order to call something a failure you need usable failure criteria 19:20 < novabyte> bye all, thanks for the chat... not interested in lang/platform flaming 19:21 < aiju> haha 19:21 -!- novabyte [~novabyte@m5.mullvad.net] has left #go-nuts [] 19:21 < str1ngs> lol 19:21 * aiju adds a 1 to "people scared of IRC" 19:21 < str1ngs> ok any more Rubyist or Java beans left? 19:21 * Namegduf pulls out his pitchfork 19:22 < aiju> the last good thing built with ruby were lasers 19:22 < Namegduf> Burn the witches 19:22 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts 19:22 < str1ngs> if you are not a go nut GTFO. nsf you can stay 19:22 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Client Quit] 19:22 < aiju> haha 19:22 < nsf> lol 19:22 < aiju> INTERFACES OR GTFO 19:22 < nsf> what makes me so different? 19:22 < nsf> ah, yes, I still support gocode 19:23 < aiju> i haven't written much Go recently, i probably should quit :x 19:23 < aiju> i wasted my time figuring out that a JIT in lisp is 10 times (actually more) slower than an interpreter in javascript 19:23 -!- virtualsue [~chatzilla@nat/cisco/x-lyfimpincrrhyovs] has joined #go-nuts 19:23 < nsf> aiju: :D 19:24 < aiju> i've been reading LISP propaganda 19:24 < nsf> yeah, sometimes performances surprise me as well 19:24 < aiju> "LISP can be faster than C, because of access to the compiler" 19:24 < nsf> like this parrot virtual machine 19:24 -!- rtharper [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed the connection] 19:24 < aiju> and now WHAT THE FUCK 19:24 < nsf> it ten times slower than python for example 19:24 -!- snearch [~snearch@f053009210.adsl.alicedsl.de] has joined #go-nuts 19:24 < nsf> who needs that kind of thing 19:24 < Namegduf> Wow, that's impressive. 19:24 < aiju> i simply can't work with languages that slow 19:24 < Namegduf> aiju: Ruby is slower 19:24 < Namegduf> Ruby is the god of slow 19:24 < aiju> Namegduf: ruby is always slower 19:25 < aiju> has to be a result of special relativity or something 19:25 < Namegduf> Makes sense. 19:25 < aiju> it's probably an exception 19:25 < Namegduf> I mean, PHP is a horribly bloated and slow language 19:25 < aiju> "given right frames of reference, anything can be fast, except Ruby" 19:26 < aiju> PHP is bloated? huh? 19:26 -!- rtharper [~tomh@188-220-5-137.zone11.bethere.co.uk] has joined #go-nuts 19:26 < aiju> it's truly badly designed, yes 19:26 -!- rtharper [~tomh@188-220-5-137.zone11.bethere.co.uk] has quit [Changing host] 19:26 -!- rtharper [~tomh@unaffiliated/sioraiocht] has joined #go-nuts 19:26 < nsf> also PHP does this: 19:26 -!- ronnyy [~quassel@p4FF1C6C8.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 19:26 < nsf> a + b + c as (a + (b + c)) 19:26 -!- waqas [~waqas@jaim.at] has left #go-nuts [] 19:27 < nsf> :\ 19:27 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has joined #go-nuts 19:27 < nsf> like, why... every other lang I know is left assoc 19:28 < ww> nsf: left handed language desIgners? 19:28 < nsf> I call it: "designed by accident" 19:28 < Namegduf> That is PHP, yes 19:28 < nsf> when author didn't really know what he's doing 19:28 < aiju> this sounds more like a perl feature 19:28 < Namegduf> aiju: PHP uses fucktons of RAM and is prone to leak because the author not only didn't know what he was doing 19:28 < aiju> remember that operator precedence chart? 19:29 < Namegduf> He publicly and unrepentantly doesn't CARE to know what he's doing 19:29 < ww> well... rIght or left assocIatIvIty Is arbItrary... rIght 19:29 < ww> sorry, I key Is stuck 19:29 < nsf> :D 19:29 < aiju> didn't one php dev quit because he hated jews? 19:29 < nsf> I think for some languages it's arbitrary (as defined in spec) 19:30 < nsf> but most implementations still use left associativity 19:30 -!- deso_ [~deso@91-64-173-62-dynip.superkabel.de] has joined #go-nuts 19:31 < aiju> this happens when people inhale too much math 19:31 < aiju> gets them believing things like this are unimportant because their math prof says so 19:31 < nsf> haskell happens 19:31 < nsf> :\ 19:31 * nsf hides 19:31 < aiju> (x+1)-1 and x+(1-1) can mean different things in computing 19:31 < aiju> esp. floating point arithmetic 19:31 < nsf> ya 19:32 < ww> so long as It's consIstent... 19:32 < aiju> 1 + 1 != 2, the magic world of floating point 19:32 < Namegduf> It should == 2 19:33 < Namegduf> Floating point can represent integers in a certain range exactly 19:33 < Namegduf> And that certainly includes "1" 19:33 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts 19:33 < aiju> Namegduf: i remember seeing some pretty simple example where weird stuff happened 19:33 < Namegduf> aiju: Perhaps you're thinking 0.1 + 0.1 19:33 < aiju> i think it even was with integers 19:34 * aiju scratches head 19:34 < aiju> Namegduf: and yeah, i know the theory, Intel floating point manages to defy it ;P 19:34 < Namegduf> aiju: If x was sufficiently huge that it was outside the safe integer range, your example could work 19:34 < aiju> Namegduf: no, it was two or three simple and small integers, but i really forgot it 19:34 < Namegduf> Ah, okay. 19:35 < nsf> also I wonder sometimes why some really productive people do stupid things 19:35 < nsf> for example 19:35 < nsf> minecraft game 19:35 < nsf> a pseudo random world 19:35 < aiju> hahahahahaha 19:35 < aiju> minecraft is (from a sweng point of view) pure shit 19:35 < nsf> but author uses absolute floating point values always 19:35 < nsf> why!!!?!?!??! 19:35 < aiju> nsf: he is clueless 19:35 < str1ngs> is there away to pass multi value returns to other methods and functions. ie path.Join(os.Getwd(),"foo") 19:35 < aiju> i mean it's written in JAVA and he hates GIT in favour of SUBVERSION 19:35 < nsf> I mean seriously, it should use some kind of offset tables 19:36 < nsf> because float losses precision very fast 19:36 < aiju> ah 19:36 < aiju> 0.1 + 0.2 == 0.3 19:36 < Namegduf> Minecraft's server is bad on resources even for *Java* 19:36 < aiju> so, no integers 19:36 < Namegduf> Yeah, when you get fractional all bets are off. 19:36 < nsf> but I must say the game isn't that bad for two years of development 19:36 < nsf> but it could be much better 19:36 < Namegduf> Minecraft the game isn't a bad idea 19:37 < aiju> yeah 19:37 < aiju> but the implementation _SUCKS HORRIBLY_ 19:37 < Namegduf> It horrifies me how many people will pay a total of millions for an alpha with no guarantee of completeness 19:37 < Namegduf> I'm sure EA are taking notes 19:37 < nsf> hehe 19:37 < aiju> EA games pissed me off so much in the past 19:37 < nsf> AAA companies have different idea of successful game 19:37 < Namegduf> I mean seriously, he could have quit and retired and no one would have had recourse at that point 19:37 < nsf> they make games like assassin's creed 19:38 < Namegduf> s/games like .*/bad games/ 19:38 < nsf> very beautiful and with horrible gameplay :) 19:38 < aiju> look at nethack 19:38 < Namegduf> It's the Hollywood syndrome 19:38 < nsf> screenshots and trailers that's what people buy 19:38 < Namegduf> Too much money involved, too much management, too many morons buying whatever looks pretty 19:38 -!- DerHorst [~Horst@e176101095.adsl.alicedsl.de] has quit [Quit: Verlassend] 19:38 < nsf> welcome to Earth, lol 19:38 < Namegduf> Leading to incredibly conservatism in terms of innovation and huge amounts of money on pretty 19:39 < Namegduf> *incredible 19:39 < nsf> ya 19:39 < aiju> and copy protection and all that HORRIBLE CRAP 19:40 < nsf> sad stuff 19:40 < nsf> :) 19:41 < aiju> i have to break the law to play a game i legally acquired 19:41 < nsf> hahaha 19:42 < aiju> but then again, most of such games suck so much, that reading books, programming Go and scrubbing toilets is a better idea 19:42 < nsf> :D 19:42 < nsf> good picture 19:42 < nsf> like a life of a very strongly opinioned programmer :) 19:43 < aiju> hahaha 19:43 < Archwyrm> There's a couple Minecraft server implementations written in Go. 19:43 < Archwyrm> I find this one particularly interesting https://github.com/huin/chunkymonkey 19:44 < nsf> I've seen it long time ago 19:44 < nsf> is it alive? 19:44 < Archwyrm> More or less. 19:44 < Archwyrm> Last commit on the 10th. 19:44 < nsf> i see 19:44 < Archwyrm> Work seems to come in bursts. 19:45 < nsf> I'll check it out someda 19:45 < nsf> someday* 19:45 < Archwyrm> That one is a fork of the original which is maybe what you saw though and has gone on its own merry way. 19:45 < Namegduf> There's a bunch of alternative implementations. 19:46 < Namegduf> Even the Java ones perform better than the official. 19:46 < Namegduf> I respect Notch as a creative ideas guy, but jeeze. 19:47 < nsf> yeah, indie games like that is the last hope we have 19:47 < nsf> even if they suck :) 19:47 < nsf> technically 19:47 < Archwyrm> I don't know, everything that has been added so far seems to have been upon a whim (which is perhaps not a bad thing). 19:47 < aiju> blah "indie" 19:47 < Namegduf> Well, I have more games than I can play. 19:47 < Namegduf> I go back to DOS stuff on occasion. 19:47 < Archwyrm> Same. 19:47 < Namegduf> The game industry is welcome to go die 19:47 < Namegduf> I have enough available to cover my remaining lifespan. 19:47 < nsf> I don't like minecraft's GUI stagnation 19:48 < aiju> i play Touhou and it's more likely that i take over the world than that i ever beat THAT game 19:48 < Namegduf> It took me over a hundred games of NetHack to ascend. 19:48 < Archwyrm> aiju: GUI stagnation? 19:48 < aiju> s/aiju/nsf 19:48 < Archwyrm> Oh, sorry. :x 19:48 < aiju> Namegduf: i never ascended :( 19:49 < Namegduf> aiju: :( 19:49 < aiju> Namegduf: i once got into the lowest level .. and the wizard defeated me there 19:49 < Namegduf> Ouch. 19:49 < nsf> for example it would be nice to have an ability to move things quickly from inventory to the chest 19:49 < aiju> that pissed me off so much that i didn't play for months 19:49 < nsf> and back 19:49 < nsf> and it's such an easy thing to add 19:49 < Archwyrm> Neither have I, my characters just die in different and random ways, but it is still entertaining. I play Dungeon Crawl Stone Soup mostly though. 19:50 < Archwyrm> s/random/interesting/ 19:50 < aiju> You fall in a pit. 19:50 < aiju> The pit is spiked. 19:50 < aiju> The spikes are poisoned. 19:50 < aiju> You die. 19:50 < Archwyrm> :) 19:51 < Archwyrm> Dwarf Fortress is quite interesting in that it is also eschews graphics for gameplay. 19:51 < Archwyrm> I've never had enough free time to get seriously into it though. 19:51 < aiju> i find dwarf fortress interesting, but it also gets boring 19:51 < str1ngs> how do you guys handle long err chains like this https://gist.github.com/887526 19:52 < str1ngs> ie can avoid doing if err != nil after every err return 19:52 < nsf> it depends 19:52 < nsf> if it's ok to os.Exit 19:52 < nsf> just write a function 19:53 < aiju> str1ngs: why are you checking for error after defer? 19:53 < nsf> func checkIfError(err os.Error) 19:53 < str1ngs> aiju: I just moved defer up 19:53 < nsf> if it's not to os.Exit 19:53 < nsf> then panic 19:53 < nsf> str1ngs: https://github.com/nsf/bin2go 19:53 < nsf> see how I do it here 19:54 < Archwyrm> str1ngs: I do as nsf suggests. 19:54 < nsf> I use a func "checkOutputFailure" 19:54 < str1ngs> ok but if I want to recover then use panic with a defer recover? 19:54 < nsf> yeah 19:55 < nsf> I don't see other way of doing that 19:55 < str1ngs> kk but still say use the checkError func 19:55 < nsf> but manual if err != nil isn't that bad 19:55 < aiju> try to keep the failing parts small 19:55 < aiju> which is good practice anyway 19:55 < nsf> IO btw is the only thing 19:56 < nsf> that looks like that 19:56 < aiju> not quite 19:56 < str1ngs> aye but I sometimes get lazy and dont handly all err's and I should 19:56 < aiju> strconv also fails ;P 19:56 < nsf> well, the most common thing that actually fails 19:56 < nsf> is IO 19:56 < nsf> strconv is IO 19:56 < nsf> input processing though 19:57 < str1ngs> aiju: i'm ok back to checking after defer. doesnt return err call defer before returning? 19:58 < aiju> str1ngs: yeah, but WHY would you do that? 19:58 < str1ngs> I dont see that it matter. the file needs to close 19:58 < aiju> e.g., fdest should be nil if it fails 19:58 < aiju> so it segfaults 19:58 < str1ngs> ah good point 19:59 -!- keithcascio [~keithcasc@nat/google/x-zdxzasnqlrwukzqm] has joined #go-nuts 19:59 < aiju> if err != nil, never rely on the actual function value to be anything 19:59 < aiju> unless the doc explicitly states something else 20:00 < str1ngs> and I probably dont need to err check os.Stat. since os.Open pretty much the same thing 20:00 < aiju> yes you should 20:00 < nsf> it depends 20:00 < aiju> also, there is fstat 20:00 < nsf> if you want to be as robust as possible :) 20:00 < nsf> check everything 20:00 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn] 20:01 < aiju> if you write something which is anything but a quick 100 lines proof of concept hack 20:01 < Namegduf> Error checks on I/O can be skipped if the best response to a fail, or at least an acceptable one, is to just move on and keep trying 20:01 < aiju> check the fucking err value 20:01 < Namegduf> Printing to stdout is a common case, for example 20:01 < str1ngs> aiju: fstat? 20:01 < aiju> str1ngs: os.Fstat 20:02 < Namegduf> If not, you need to observe that and consider it and pretend to scrach your non-existent beard 20:02 < Namegduf> Unless you're a Real Programmer 20:02 < str1ngs> wait I can use fsrc.Stat should give me a FileInfo 20:02 < Namegduf> In that case scratch your real one 20:02 < aiju> oh wait 20:02 < Namegduf> And decide what to do with your error handling. 20:02 < aiju> it's called File.Stat 20:02 < aiju> not Fstat, sorry 20:02 < str1ngs> aye got it thanks 20:07 -!- tvw [~tv@e176005120.adsl.alicedsl.de] has joined #go-nuts 20:07 < str1ngs> ok this is great thanks. I'll just leave the err handling chain for now. and let w/e calls this handle it 20:13 < Namegduf> str1ngs: Public functions should never "leak" panics 20:13 < Namegduf> Aside that constraint, do whatever's convenient 20:13 < Namegduf> Just make sure you can reason with it nicely to ensure panics are properly caught. 20:14 -!- littlebobby [~bob@unaffiliated/littlebobby] has quit [Ping timeout: 248 seconds] 20:14 < plexdev> http://is.gd/1pRifP by [Peter Mundy] in go/src/pkg/net/ -- net: fix Windows build 20:15 < str1ngs> right now its just a private function. But I'll do more reading on panic handling 20:16 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-151-209.clienti.tiscali.it] has quit [Ping timeout: 276 seconds] 20:22 < str1ngs> I wont show you my sed function lol 20:26 -!- vinisterx [~ryan@74-129-201-27.dhcp.insightbb.com] has quit [Quit: WeeChat 0.3.2] 20:30 < dfr|work> is there an extension commonly use to designate that a file is a go template? 20:31 < plexdev> http://is.gd/j8XYaj by [Ian Lance Taylor] in go/test/fixedbugs/ -- test: match gccgo error messages for bug016.go. 20:31 -!- vinisterx [~ryan@74-129-201-27.dhcp.insightbb.com] has joined #go-nuts 20:31 -!- vinisterx [~ryan@74-129-201-27.dhcp.insightbb.com] has quit [Client Quit] 20:33 -!- RobertLJ [~RobertLJ@c-68-44-164-102.hsd1.nj.comcast.net] has quit [Ping timeout: 250 seconds] 20:38 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts 20:39 < kamaji> javascript closures 20:39 < kamaji> wat. 20:40 < kamaji> Can we have go in the browser pls 20:43 < aiju> javascript closures are quite similar to Go closures o.O 20:44 < kamaji> You have to wrap them in js 20:46 < kamaji> which is 20:46 < kamaji> weird 20:47 < aiju> what? 20:47 -!- sysiphus [~opera@unaffiliated/sysiphus] has quit [Remote host closed the connection] 20:47 < aiju> function (x) { return x + 1; } 20:48 < kamaji> It's in a for loop 20:48 -!- skelterjohn [~jasmuth@c-68-46-33-145.hsd1.nj.comcast.net] has joined #go-nuts 20:48 < kamaji> actually I don't know how that looks in go? maybe it's the same then :\ 20:48 < kamaji> no you'd just do function variables I guess 20:50 < ww> js closures w/ global scope vars. mess 20:51 < aiju> most of js is a mess anyway 20:51 < aiju> you can redefine undefined! 20:51 < kamaji> are you kidding?! 20:51 < kamaji> that's hilarious 20:51 < aiju> yeah 20:52 < kamaji> hahaha 20:54 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.4] 21:01 -!- femtooo [~femto@95-89-249-242-dynip.superkabel.de] has joined #go-nuts 21:01 -!- gr0gmint [~quassel@87.61.162.99] has joined #go-nuts 21:03 -!- pharris [~Adium@rhgw.opentext.com] has quit [Quit: Leaving.] 21:03 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:f08c:12ea:a5a7:d0f8] has joined #go-nuts 21:04 -!- femtoo [~femto@95-89-249-242-dynip.superkabel.de] has quit [Ping timeout: 255 seconds] 21:08 -!- Venom_X [~pjacobs@74.61.90.217] has joined #go-nuts 21:08 -!- rutkowski [~adrian@178235051224.walbrzych.vectranet.pl] has quit [Quit: WeeChat 0.3.3-dev] 21:15 -!- comex_ [comex@c-67-188-10-190.hsd1.ca.comcast.net] has joined #go-nuts 21:16 -!- snearch [~snearch@f053009210.adsl.alicedsl.de] has quit [Quit: Verlassend] 21:17 -!- comex [comex@c-67-188-10-190.hsd1.ca.comcast.net] has quit [Read error: Operation timed out] 21:17 -!- ccount [~ccount@aleph0.de] has quit [Read error: Operation timed out] 21:17 -!- rotorooter [~roto@64.79.202.154] has quit [Read error: Operation timed out] 21:17 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has quit [Read error: Operation timed out] 21:18 -!- ccount [~ccount@aleph0.de] has joined #go-nuts 21:19 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has joined #go-nuts 21:20 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Remote host closed the connection] 21:24 < ww> iant: is gold relevant on arm? 21:25 < ww> some old writings about it suggest only x86, and cannot easily find anything more recent written about it 21:25 * ww crosses fingers waiting for this build of gcc to complete yielding a working cross-gccgo 21:28 < aiju> "some old writings" 21:28 < aiju> cave paintings? 21:29 < ww> http://lwn.net/Articles/274859/ 21:30 < ww> three years ago almost to the day 21:30 -!- roto [~roto@64.79.202.154] has joined #go-nuts 21:30 -!- edsrzf [~chickench@122-61-221-144.jetstream.xtra.co.nz] has joined #go-nuts 21:31 -!- littlebobby [~bob@unaffiliated/littlebobby] has joined #go-nuts 21:34 < str1ngs> I think gold is relevant on arm/linux just not for none elf stuff 21:34 < str1ngs> ie mac I guess? 21:35 < edsrzf> Yeah, I think it's only for ELF binaries. 21:35 -!- tdc [~santegoed@host217-44-215-18.range217-44.btcentralplus.com] has joined #go-nuts 21:36 -!- gr0gmint [~quassel@87.61.162.99] has quit [Read error: Connection reset by peer] 21:36 < aiju> i thought gold was a metal 21:39 < aiju> oh some funny linker iant wrote 21:40 < str1ngs> ww: On x86 GNU/Linux systems the gccgo compiler is able to use a small discontiguous stack for goroutines. this might suggest no though 21:41 < str1ngs> ww: so you might not be able to use gold. but all you will miss is the extra goroutines 21:45 -!- TheMue [~TheMue@p5DDF5FED.dip.t-dialin.net] has quit [Quit: TheMue] 21:45 < ww> argh 21:45 < ww> checking for shl_load... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. 21:46 < str1ngs> I assume you are using --target ? 21:46 < ww> yes 21:47 < str1ngs> and you used --target with binutils? 21:47 < ww> ... try building without c++ support 21:48 < str1ngs> you need c++ for gccgo 21:48 < ww> .... yes, --target=arm-android-eabi 21:48 < str1ngs> since its written in c++ :P 21:48 < ww> right but *maybe* c++ to build gccgo but not c++ to use it 21:48 < str1ngs> aye 21:49 < ww> so i don't need arm-android-eabi-g++ 21:49 < ww> or actually, libstdc++ which is where the problem happens 21:49 < aiju> what the fuck is wrong with 5g? 21:49 < aiju> oh wait, this was a cgo issue, wasn't it? 21:49 < ww> aiju: we've been through this before. cgo 21:49 < str1ngs> 5g cant make calls to C 21:49 < ww> yes 21:49 < aiju> blargh 21:50 < str1ngs> ww: are you putting all this on your blog? 21:50 < ww> yes, i'm rewriting it as i figure out what works... 21:50 < str1ngs> great thank you 21:51 < str1ngs> I cant mess with it now. but later hopefully I can .. I need hardware :( 21:51 < aiju> you'll be faster fixing 5g than getting fucking autotools to corss compile 21:51 < aiju> *cross 21:51 <+iant> ww: gold works for ARM 21:52 <+iant> the Android developers are using it 21:53 < ww> iant: thanks. i enabled it in the build, just wasn't sure it would get used 21:55 -!- femtooo [~femto@95-89-249-242-dynip.superkabel.de] has quit [Read error: Connection reset by peer] 21:57 < ww> iant: i wish the android developers would document the process they use to build the ndk better 21:58 <+iant> I've never tried it myself 22:02 -!- KirkMcDonald [~Kirk@python/site-packages/KirkMcDonald] has quit [Ping timeout: 250 seconds] 22:03 -!- KirkMcDonald [~Kirk@python/site-packages/KirkMcDonald] has joined #go-nuts 22:04 < plexdev> http://is.gd/8L0hj1 by [Rob Pike] in 8 subdirs of go/src/ -- testing: set up structure for faster testing using the new -test.short flag. 22:04 < plexdev> http://is.gd/tcfrtT by [Dave Cheney] in go/src/ -- build: handle broken awk in version.bash 22:13 -!- emjayess [~emjayess@pix1.i29.net] has quit [Quit: Leaving] 22:18 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org] 22:21 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:f08c:12ea:a5a7:d0f8] has quit [Quit: Leaving.] 22:22 -!- m4dh4tt3r [~Adium@c-69-181-223-245.hsd1.ca.comcast.net] has quit [Quit: Leaving.] 22:22 -!- tdc [~santegoed@host217-44-215-18.range217-44.btcentralplus.com] has quit [Quit: tdc] 22:22 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has quit [Ping timeout: 276 seconds] 22:24 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts 22:26 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the Fish] 22:30 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 22:31 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has joined #go-nuts 22:36 < plexdev> http://is.gd/fWbz2z by [Ian Lance Taylor] in go/test/fixedbugs/ -- test: match gccgo error messages for bug081.go. 22:44 -!- piranha [~piranha@5ED43A0B.cm-7-5a.dynamic.ziggo.nl] has quit [Quit: Computer has gone to sleep.] 22:50 -!- prip [~foo@host68-133-dynamic.46-79-r.retail.telecomitalia.it] has quit [Ping timeout: 260 seconds] 22:50 -!- bugQ [~bug@c-67-171-127-76.hsd1.ut.comcast.net] has joined #go-nuts 22:58 -!- tvw [~tv@e176005120.adsl.alicedsl.de] has quit [Remote host closed the connection] 22:59 -!- deso_ [~deso@91-64-173-62-dynip.superkabel.de] has quit [Ping timeout: 276 seconds] 23:03 -!- prip [~foo@host62-124-dynamic.35-79-r.retail.telecomitalia.it] has joined #go-nuts 23:05 -!- tensorpudding [~user@99.148.205.193] has quit [Remote host closed the connection] 23:11 < dfr|work> mhmm... so do regex do multiline matches? =/ 23:11 < aiju> structured regex! 23:12 < dfr|work> aiju, mhmm? 23:12 < aiju> just suggesting random Plan 9 things 23:12 < dfr|work> =/ 23:13 < dfr|work> yea, seems like the go regexp package is really really simplistic, hehe 23:13 < dfr|work> :) 23:23 -!- iant [~iant@nat/google/x-anjobhuskwobvske] has quit [Quit: Leaving.] 23:25 -!- boscop [~boscop@f055201026.adsl.alicedsl.de] has quit [Ping timeout: 250 seconds] 23:26 -!- tensorpudding [~user@99.148.205.193] has joined #go-nuts 23:30 < skelterjohn> why wouldn't regex do multiline matches? 23:30 < skelterjohn> \n is just another character in a string 23:31 < dfr|work> skelterjohn, well, in perl regexes, you sometimes need to specify an option to do multiline match (m, i think...) 23:32 < skelterjohn> does perl do matches off a stream? 23:32 < dfr|work> skelterjohn, huh? 23:32 < skelterjohn> i don't know perl, trying to understand why it might treat newlines as special 23:33 < skelterjohn> and if you use newlines to separate bits of data on a stream that would make sense 23:33 < dfr|work> skelterjohn, i don't do perl much either. The reason I mentioned is because Perl derived regex tend to be the ones you see everywhere, i think 23:34 < dfr|work> skelterjohn, you do have a point though. I dunno, it's just one thing I'm usually finicky with regex-ed -- if it doesn't work and I have a multiple line string I'm trying to match, gotta make sure it actually tries to match the whole string :) 23:38 < plexdev> http://is.gd/ZC0PFs by [Rob Pike] in 9 subdirs of go/src/pkg/ -- testing: shorten some tests. 23:44 -!- jgonzalez [~jgonzalez@173-14-137-134-NewEngland.hfc.comcastbusiness.net] has quit [Ping timeout: 255 seconds] 23:47 < dfr|work> ack. 23:48 -!- m4dh4tt3r [~Adium@213.sub-75-208-177.myvzw.com] has joined #go-nuts 23:52 < dfr|work> apparently there're different kinds of nils =/ 23:53 < dfr|work> or at least they're displayed differently with %s when doing printf =/ 23:55 < edsrzf> Yeah, there are different types of nils. It can be confusing. 23:58 < dfr|work> when I do var bar interface{}; bar = foo where foo is not a pointer, does bar become a pointer and that's why it's not nil anymore? 23:59 < dfr|work> basically: http://pastie.org/1715990 23:59 < dfr|work> it says that bar is not nil =/ 23:59 < dfr|work> and I'm majorly confused as to why.... 23:59 < skelterjohn> bar is an interface that contains a pointer that happens to be nil --- Log closed Sat Mar 26 00:00:08 2011