--- Log opened Wed Oct 13 00:00:00 2010
--- Day changed Wed Oct 13 2010
00:00 < SirPsychoS> iant: they just removed the exp/iterable package today,
along with the list.List·Iter() method, so it looks like they're un-recommending
that method
00:00 <+iant> the problem is that it's not very efficient
00:00 < SirPsychoS> yep, exactly what the commit message said
00:00 <+iant> but I don't nkow of any replacement for it
00:00 <+iant> and I'm not even sure what a replacement would look like
00:00 < nsf> good old for ;; loop
00:02 < hallas> wrote a 80 line long array implementation with Push(),
Get(), RemoveIndex(), Remove(), Push(), Length() and now Slice() for the range
statement
00:02 < plexdev> http://is.gd/fZo2z by [Rob Pike] in go/doc/ -- Effective
Go: update examples to use new logging interface.
00:02 < hallas> oops wrote push two times
00:02 <+iant> DoublePush
00:03 < hallas> hehe
00:03 <+iant> every array needs that
00:03 < hallas> included a constructor NewArray(vs...  interface{}) (a
*Array) {}
00:03 < skelterjohn> what does your array do that's interesting?
00:03 < skelterjohn> and don't take that as a challenge - i'm just
interested
00:03 < SirPsychoS> PushHard(e interface{}) // pushes its argument onto the
end of the list, then pushes a zero-value of the same type
00:05 < hallas> skelterjohn: dont know, it just solves a simple need for me
00:05 < SirPsychoS> also, that sounds a lot like container/vector
00:05 < hallas> skelterjohn: i think most people have their own push and
remove
00:05 < skelterjohn> yeah - i was just thinking it sounds a lot like
container/vector
00:06 < skelterjohn> container/vector.Vector can work with range because
it's a subtype of []interface{}
00:06 < skelterjohn> so if you have your array really be "type Array
[]interface{}" then it will work with range
00:07 < hallas> yeah, just realized that
00:07 < hallas> that that also answers my question from before
00:07 < skelterjohn> hooray
00:08 < hallas> can vector only hold string, int?
00:08 < SirPsychoS> speaking of containers - is there any interest in a
package container/graph (or, say, graph/adjlist)?  I've been working on one as
(part of) a CS assignment, and it's beginning to shape up
00:08 < SirPsychoS> hallas: I believe there's StringVector, IntVector, and
(interface{})Vector
00:08 < SirPsychoS> and {String,Int}Vector.go are generated from Vector.go,
just replacing interface{} with string and int
00:09 < skelterjohn> SirPsychoS: I think it would be nice to have as a third
party library
00:09 < skelterjohn> i don't feel that it is a common enough need to warrant
being in the core
00:09 < SirPsychoS> libstdc++ doesn't have graphs either, does it?
00:09 < hallas> SirPsychoS: so vector is actually everything I need :)
00:10 < skelterjohn> SirPsychoS: I wouldn't know
00:10 < Tv> SirPsychoS: perhaps make the name more explicit, what kind of
graphs it is for, how does it store them, etc
00:10 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X]
00:10 < Tv> adjlist sounds better than graph, in my mind
00:11 < SirPsychoS> Tv: yeah, that would allow for graph/adjmatrix and
graph/edgelist to exist as well
00:12 < SirPsychoS> hmm, package graph defines interface Graph { AddVertex,
DelVertex, etc.} and then graph/* implement 3 versions of it
00:12 < skelterjohn> <plug> if you want to do an adjmatrix, i suggest
gomatrix.googlecode.com </self-plug>
00:13 < SirPsychoS> heh, matrix being [][]bool, not an actual linear-algebra
matrix
00:14 < SirPsychoS> or I guess [][]interface{} to allow edge labels
00:14 < skelterjohn> SirPsychoS: you don't like edge weights?
00:15 < SirPsychoS> sure, but what if you want your edges to be labeled with
strings, or struct {x,y int}s, or whatever else you need?
00:15 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
00:15 < skelterjohn> i guess, but using numbers as edge labels is a very
common use case
00:15 < SirPsychoS> I mean, dijkstra's algorithm is fairly meaningless for
string-labeled graphs
00:16 < SirPsychoS> lol
00:16 < SirPsychoS> very common, but not the only
00:16 < skelterjohn> and it generalizes the bool representation
00:17 < SirPsychoS> like, weight < 0 means no edge?
00:17 < skelterjohn> depends on context
00:17 < skelterjohn> if it's representing distances, for instance, infinity
00:18 -!- b00m_chef [~watr@66.183.100.197] has quit [Ping timeout: 265 seconds]
00:18 -!- littlebobby [~bob@unaffiliated/littlebobby] has quit [Quit: Ex-Chat]
00:19 < SirPsychoS> do IEEE floats have a value for infinity?
00:19 < skelterjohn> -math.Log(0)?  :)
00:19 < skelterjohn> certainly if you try to fmt.Printf that, it will say
+inf
00:19 <+iant> SirPsychoS: yes
00:21 -!- Tv [~tv@gige.bur.digisynd.com] has quit [Ping timeout: 252 seconds]
00:21 -!- Ritterbeck [~Ritterbec@cpe-66-61-33-23.neo.res.rr.com] has joined
#go-nuts
00:22 < SirPsychoS> ehh, well, for now it's just an adjacency list
implementation - i may or may not deal with other implementations later
00:22 < SirPsychoS> unfortunately this is all in subversion (my backwards CS
department still uses it for some reason)
00:24 < nsf> staring at gccgo source code, looks like everything is fine
with multifile packages
00:24 < nsf> :\
00:24 <+iant> well, sure, the Go library has a lot of them
00:25 <+iant> perhaps this is something specific to package main
00:25 < nsf> maybe
00:34 < plexdev> http://is.gd/fZpOW by [Rob Pike] in go/src/pkg/log/ -- log:
reduce allocations
00:36 < nsf> I guess I'll build debug build tomorrow and try that with a
debugger
00:38 < nsf> it's hard to figure out something by just staring at C++ code
00:38 < nsf> contains much more indirections than C code
00:41 < SirPsychoS> alright, api spec question: if you call a function
called DelUndirectedEdge(a,b) on a graph, and an edge only exists from a to b, but
not from b to a, would you expect it to fail, or would you expect it to delete the
edge from a to b and succeed?
00:42 < skelterjohn> i would expect a graph to be either directed or
undirected from the get-go
00:42 < KirkMcDonald> SirPsychoS: If it is a digraph, I would expect that to
fail.
00:42 < KirkMcDonald> SirPsychoS: Um.
00:43 < KirkMcDonald> But the "Undirected" in there confuses me.
00:43 < skelterjohn> directed graphs and undirected graphs are different
animals
00:43 < KirkMcDonald> Yes,.
00:43 < SirPsychoS> well, this graph is directed
00:43 < skelterjohn> then saying DelUndirectedEdge shouldn't be one of its
methods
00:43 < KirkMcDonald> SirPsychoS: Then why does it have a method dealing
with undirected edges?
00:43 < SirPsychoS> but the Undirected functions just add both directions
00:43 < KirkMcDonald> SirPsychoS: I see.
00:43 < skelterjohn> i think that's a bad idea
00:43 < SirPsychoS> so you can use it easily as if it were an undirected
graph
00:43 < KirkMcDonald> I'd probably call it "DelBothEdges()
00:43 < KirkMcDonald> "
00:43 < SirPsychoS> hmm, why's it bad?
00:44 < KirkMcDonald> Or whatever.
00:44 < skelterjohn> digraphs have digraph operations
00:44 < skelterjohn> undirected graphs and digraphs have no subset/superset
relation
00:44 < skelterjohn> they're just different things.  though they're related,
clearly
00:46 < SirPsychoS> why can't we say that undirected graphs are a subset of
directed graphs where (for all x, y that are vertices, edge(x,y) -> edge(y,x)
and label(x,y)==label(y,x)) ?
00:46 < skelterjohn> not convention, that's all
00:46 < SirPsychoS> ah
00:47 < SirPsychoS> s/->/iff/
00:47 < skelterjohn> this isn't really convincing, but in graphical models
of probability distributions, there are families of distributions that can be
expressed by directed graphical models but not undirected graphical models, and
vice versa
00:49 -!- mikespook [~mikespook@219.137.254.247] has joined #go-nuts
00:49 < SirPsychoS> so shall I discard the Add/DelUndirectedEdge methods and
make it a pure digraph?
00:50 < KirkMcDonald> I certainly wouldn't give these methods those names.
00:50 < skelterjohn> yeah - that's a good wait to put it
00:51 < SirPsychoS> well, they're not really that useful - all they do
internally is call AddEdge twice
00:55 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
00:57 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
01:00 -!- mikespook1 [~mikespook@58.61.203.140] has joined #go-nuts
01:00 -!- mikespook [~mikespook@219.137.254.247] has quit [Ping timeout: 252
seconds]
01:00 -!- mikespook1 [~mikespook@58.61.203.140] has quit [Client Quit]
01:02 -!- enherit [~enherit@cpe-98-149-170-48.socal.res.rr.com] has quit [Quit:
leaving]
01:04 -!- iant [~iant@67.218.105.113] has quit [Quit: Leaving.]
01:06 < plexdev> http://is.gd/fZrDI by [Nigel Tao] in go/src/pkg/image/ --
image: add an offset to Tiled.
01:08 < hallas> good night (from denmark, eu)
01:08 < skelterjohn> night
01:08 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has left
#go-nuts []
01:13 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
01:29 -!- cthom [~cthom@166.196.69.138] has joined #go-nuts
01:37 -!- cthom [~cthom@166.196.69.138] has quit [Quit: Yaaic - Yet another
Android IRC client - http://www.yaaic.org]
01:38 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
01:39 -!- littlebobby [~bob@unaffiliated/littlebobby] has joined #go-nuts
01:41 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts
01:42 -!- mode/#go-nuts [+v iant] by ChanServ
01:43 * exch fixed bug in russ's gosqlite thingy
01:48 -!- adg [~nf@124.169.158.192] has quit [Read error: Connection reset by
peer]
01:48 -!- adg [~nf@210-84-53-30.dyn.iinet.net.au] has joined #go-nuts
01:49 -!- mode/#go-nuts [+o adg] by ChanServ
01:53 -!- littlebobby [~bob@unaffiliated/littlebobby] has quit [Quit: Ex-Chat]
02:02 -!- mat_ [~mat@mx3.absolight.net] has quit [Read error: Connection reset by
peer]
02:11 -!- joyer [~user@59.41.223.18] has joined #go-nuts
02:24 -!- aho [~nya@fuld-4d00d761.pool.mediaWays.net] has quit [Ping timeout: 245
seconds]
02:25 < uriel> exch: congrats :)
02:30 -!- aho [~nya@fuld-4d00d6c2.pool.mediaWays.net] has joined #go-nuts
02:48 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has quit
[Ping timeout: 240 seconds]
02:50 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has quit [Ping timeout: 245 seconds]
02:52 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
02:52 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
03:01 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has quit
[Ping timeout: 245 seconds]
03:04 -!- Kylarr [Kylarr@122-148-63-115.static.dsl.dodo.com.au] has joined
#go-nuts
03:06 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
03:11 -!- noktoborus [~noktoboru@host-208-107.hosts.vtc.ru] has joined #go-nuts
03:14 -!- mat_ [~mat@mx3.absolight.net] has joined #go-nuts
03:14 < Ritterbeck> Anyone have an interest in building a quantitative
finance library in Go?
03:15 <@adg> what does that mean?
03:15 < Ritterbeck> Are you familiar with Quantlib?
03:16 < Ritterbeck> It is a library in C++ for valuing different financial
products
03:17 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
03:18 -!- Ritterbeck [~Ritterbec@cpe-66-61-33-23.neo.res.rr.com] has quit [Quit:
Leaving]
03:25 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has quit
[Ping timeout: 245 seconds]
03:37 < SirPsychoS> is the compiler smart enough to optimize out the memory
accesses if you do "for i, _ := range someslice" ?
03:37 <@adg> No, I'm not.  I've not done any work in the financial sector.
03:37 <@adg> SirPsychoS: what do you mean by "memory accesses" ?
03:39 < SirPsychoS> "for i, v := range someslice" needs to copy from ram
into v len(someslice) times
03:39 < SirPsychoS> but "for i, _ := range someslice" shouldn't need to do
that at all
03:39 < plexdev> http://is.gd/fZCbA by [Andrew Gerrand] in
go/src/pkg/runtime/ -- runtime: remove done TODO from SetFinalizer
03:39 <@adg> either way the value is registerized
03:39 < SirPsychoS> aka is that as efficient as "for i:=0;
i<len(someslice); i++"
03:40 <@adg> i can't say definitively, but i would imagine so
03:40 <@adg> i bet if you benchmarked the two approaches you would find the
difference negligable
03:44 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 260
seconds]
04:04 -!- aho [~nya@fuld-4d00d6c2.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
04:31 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has joined #go-nuts
04:42 -!- fabled [~fabled@mail.fi.jw.org] has joined #go-nuts
04:42 -!- xuser [~xuser@unaffiliated/xuser] has joined #go-nuts
04:49 -!- Arrow55 [~Arrow@bas9-quebec14-1168093772.dsl.bell.ca] has joined
#go-nuts
04:50 < Arrow55> Quick Question, I want some advice on a project that I've
already reported to Go Nuts a while back, should I start a new post about it?
04:50 < Arrow55> Or should I just reply on the old thread?
04:54 -!- dj2 [~dj2@2002:63ec:1a4e:0:21f:5bff:fe35:feb5] has quit [Remote host
closed the connection]
04:58 -!- scm [scm@d071101.adsl.hansenet.de] has quit [Read error: Operation timed
out]
04:59 -!- Arrow55 [~Arrow@bas9-quebec14-1168093772.dsl.bell.ca] has quit [Quit:
Leaving]
04:59 -!- drd [~eric@compassing.net] has joined #go-nuts
05:00 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has quit [Ping timeout:
255 seconds]
05:01 -!- scm [scm@d071196.adsl.hansenet.de] has joined #go-nuts
05:30 -!- wmohchi [~wmohchi@60.247.97.98] has joined #go-nuts
05:33 -!- dju [dju@fsf/member/dju] has joined #go-nuts
05:36 -!- dju [dju@fsf/member/dju] has quit [Max SendQ exceeded]
05:37 -!- dju [dju@fsf/member/dju] has joined #go-nuts
05:45 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has joined #go-nuts
06:14 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has quit [Ping timeout:
240 seconds]
06:17 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has joined #go-nuts
06:28 -!- Project_2501 [~Marvin@82.84.94.184] has joined #go-nuts
06:28 -!- fabled [~fabled@mail.fi.jw.org] has quit [Ping timeout: 240 seconds]
06:29 -!- lmoura__ [~lauromour@186.212.106.35] has joined #go-nuts
06:31 -!- lmoura_ [~lauromour@186.212.107.220] has quit [Read error: Operation
timed out]
06:40 -!- wjlroe [~will@78-86-14-131.zone2.bethere.co.uk] has joined #go-nuts
06:42 -!- ExtraSpice [~XtraSpice@78-57-137-162.static.zebra.lt] has joined
#go-nuts
06:46 -!- littlebobby [~bob@unaffiliated/littlebobby] has joined #go-nuts
06:51 -!- fabled [~fabled@83.145.235.193] has joined #go-nuts
07:16 -!- tensorpudding [~user@99.148.202.191] has quit [Read error: Connection
reset by peer]
07:18 < SirPsychoS> edit_test.go:13: cannot use g (type *graph.Graph) as
type *graph.Graph in function argument
07:18 < SirPsychoS> errr, what?
07:21 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has quit [Quit: Morten.  Desu~]
07:23 -!- tensorpudding [~user@99.148.202.191] has joined #go-nuts
07:24 < SirPsychoS> ahhh they weren't the same package...
"../graph/_obj/graph" and "graph"
07:34 -!- wjlroe [~will@78-86-14-131.zone2.bethere.co.uk] has quit [Quit: Computer
has gone to sleep]
07:41 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
07:56 -!- araujo [~araujo@192.100.124.156] has joined #go-nuts
07:56 -!- araujo [~araujo@192.100.124.156] has quit [Changing host]
07:56 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
07:58 -!- photron [~photron@port-92-201-126-85.dynamic.qsc.de] has joined #go-nuts
08:13 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has joined
#go-nuts
08:17 -!- wrtp [~rog@92.17.85.103] has joined #go-nuts
08:19 -!- wjlroe [~will@212.169.34.114] has joined #go-nuts
08:33 -!- SRabbelier [~SRabbelie@ip138-114-211-87.adsl2.static.versatel.nl] has
joined #go-nuts
08:36 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
08:59 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
09:10 -!- teralaser [~teralaser@unaffiliated/teralaser] has joined #go-nuts
09:15 -!- jmettraux [~jmettraux@211.19.55.177] has quit [Remote host closed the
connection]
09:18 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
09:21 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
09:26 -!- ikaros [~ikaros@dslb-188-097-076-206.pools.arcor-ip.net] has joined
#go-nuts
09:30 -!- skejoe [~skejoe@188.114.142.231] has joined #go-nuts
09:31 -!- virtualsue [~chatzilla@nat/cisco/x-wzrvguvnkexycjuy] has joined #go-nuts
09:38 -!- peterdn [~peterdn@dhcp-110-228.new.ox.ac.uk] has joined #go-nuts
09:43 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 276
seconds]
09:44 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
09:49 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 252
seconds]
09:51 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
09:57 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 240
seconds]
10:41 -!- fabled [~fabled@83.145.235.193] has quit [Quit: Ex-Chat]
10:45 -!- littlebobby [~bob@unaffiliated/littlebobby] has quit [Quit: Ex-Chat]
10:47 -!- SirPsychoS [~sp@c-24-13-132-255.hsd1.il.comcast.net] has quit [Ping
timeout: 250 seconds]
10:53 -!- fabled [~fabled@mail.fi.jw.org] has joined #go-nuts
10:55 -!- joyer [~user@59.41.223.18] has quit [Ping timeout: 240 seconds]
10:58 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has joined #go-nuts
11:01 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
11:02 -!- virtualsue [~chatzilla@nat/cisco/x-wzrvguvnkexycjuy] has quit [Ping
timeout: 250 seconds]
11:05 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 245
seconds]
11:06 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
11:11 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 245
seconds]
11:12 -!- artefon [~thiago@189.59.157.229.dynamic.adsl.gvt.net.br] has joined
#go-nuts
11:15 -!- mduft [~mduft@gentoo/developer/mduft] has quit [Remote host closed the
connection]
11:18 -!- mduft [~mduft@gentoo/developer/mduft] has joined #go-nuts
11:26 -!- napsy_ [~luka@88.200.96.18] has joined #go-nuts
11:40 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
11:43 -!- Kylarr [Kylarr@122-148-63-115.static.dsl.dodo.com.au] has quit []
11:45 -!- Project_2501 [~Marvin@82.84.94.184] has quit [Quit: E se abbasso questa
leva che succ...]
11:58 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
12:05 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has joined
#go-nuts
12:06 -!- virtualsue [~chatzilla@nat/cisco/x-ydliebbldtjvyuwa] has joined #go-nuts
12:11 -!- Whip [3aaf1956@gateway/web/freenode/ip.58.175.25.86] has joined #go-nuts
12:12 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
12:15 < Whip> I have a lot of trouble thinking outside of the traditional
object oriented model of programming in Go.
12:15 < Whip> It's almost like there is too much freedom.
12:15 < Whip> Anyone else experience this?
12:16 -!- Kylarr [Kylarr@122-148-63-115.static.dsl.dodo.com.au] has joined
#go-nuts
12:16 < exch> nope.  It took some getting used to the move away from the old
fashioned OOP model, but it's been worth it
12:20 -!- thiago__ [~thiago@189.26.196.166.dynamic.adsl.gvt.net.br] has joined
#go-nuts
12:21 < Whip> I wish there were generics, otherwise I feel like it's not
/really/ worth investing a lot of effort into getting good at it.
12:22 -!- artefon [~thiago@189.59.157.229.dynamic.adsl.gvt.net.br] has quit [Ping
timeout: 240 seconds]
12:22 < skelterjohn> generics are something that i believe will happen one
day
12:22 < skelterjohn> in the mean time, you can use interface{} to write that
code
12:23 < skelterjohn> i did experience the OO->IO phase shift, though
12:23 < exch> possibly.  They have not been denied outright, it's just
difficult to find a generics solution that doesn't mess up the language or
compiler too much
12:23 < skelterjohn> at first i tried to cram java OO on top of go
12:23 < nsf> I don't understand people which come here and complain about
the go language, no one forces you to use it (yet, hahahaha)
12:24 < exch> :P
12:24 < skelterjohn> no one forces you to listen to their complaints, either
=p
12:24 < skelterjohn> they're just curious and want to talk about the
language
12:24 < skelterjohn> i think it's a good thing
12:24 < nsf> well, unforunately I have to read everything on this channel
12:24 < skelterjohn> to be otherwise would be a signal that no one cares
12:24 < exch> it also helps to bring out those issues that yield the most
interest
12:24 < nsf> of course I can ignore that
12:25 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has joined
#go-nuts
12:25 < Whip> I'm interested in how others dealt with the change of
thinking.
12:26 < nsf> personally I have trouble thinking in terms of OOP
12:26 < skelterjohn> someone showed me a different way to do it, and then i
got it
12:26 < nsf> Go's object model is fine to me
12:26 < Whip> I an totally sold on Go's features, I want it to be my
language of choice.
12:26 < Whip> *am
12:27 < exch> I 'dealt' with it by just reading a lot of the Go package code
and just trying stuff out
12:27 < hallas> I understood that objects did not exists in Go
12:27 < skelterjohn> the idea that, in java or C++, people spend hours
wasting time designing class hierarchies really resonated with me
12:27 < skelterjohn> now instead of relating classes together, i just write
code that does things
12:27 < hallas> meant for @nsf
12:27 < exch> Go's simple syntax and strict style enforcement make it easy
to read other people's code
12:27 < skelterjohn> interfaces help generalize things that do things
12:27 < skelterjohn> that's all
12:28 < nsf> hallas: define "object"
12:28 < hallas> nsf: you said object model, im just curious what you mean
12:28 < hallas> nsf: I jumped into the convo ;) so i dont know anything
12:28 < skelterjohn> "no, *you* explain yourself first!"
12:28 < skelterjohn> :)
12:28 < nsf> I meant the features in Go which help me thinking in terms of
objects
12:28 < nsf> e.g.  interfaces, methods
12:28 < hallas> receivers
12:29 < nsf> channels as well
12:29 < skelterjohn> a method is a function with a receiver
12:29 -!- Guest53035 [~luka@88.200.96.18] has quit [Ping timeout: 265 seconds]
12:30 < hallas> skelterjohn: no arguing there
12:31 < hallas> what feature about go do you guys like the most (answer in
one word or two)
12:31 < hallas> ?
12:31 < skelterjohn> go.
12:31 < Whip> Goroutines.
12:31 < exch> interfaces
12:31 < skelterjohn> the go keyword, that is
12:32 < exch> the absence of complicated type hierarchies is bliss.  You can
just get on with the important stuff
12:32 < nsf> I like the absence of type hierarchies
12:33 < nsf> now if I see a language which supports traditional inheritance,
I won't even learn it
12:33 < nsf> waste of time
12:33 < hallas> I like that i can group expressions
12:34 < Whip> Group?
12:34 < hallas> Group = "(" Expression ")" .
12:34 < Whip> This is new to me.
12:35 < hallas> simple thing, but saves time and makes the code look
prettier
12:35 < skelterjohn> is this something more than "a = (b+c)" vs "a = b+c"?
12:36 < hallas> i think I copy pasted the wrong grammar
12:36 < nsf> I think he means: a, b = 1, 2
12:36 < Whip> Oh that, yes that's very handy.
12:36 < skelterjohn> yeah i like that too
12:37 < hallas> =)
12:37 < skelterjohn> python has that
12:37 < Whip> I like how it has anonymous functions.
12:37 < Whip> That was something lacking from C++ I found.
12:38 < hallas> can you do
12:38 < hallas> go (
12:38 < hallas> func {}()
12:38 < hallas> func {}()
12:38 < hallas> )
12:38 < hallas> ?
12:39 < hallas> havent got a compiler around atm
12:39 < Whip> What's wrong with go func{}() twice?
12:39 < hallas> saves time if you're starting a bunch of routines
12:39 < skelterjohn> hallas: golang.org has a playground you can type code
into and compile/run
12:40 < skelterjohn> hallas: the word "go" has as many characters as two
parentheses
12:40 < skelterjohn> and you have more carriage returns
12:41 < skelterjohn> though i realize that in the limit there would be fewer
12:41 < hallas> skelterjohn: at compiler level, the statement should be
faster to work with
12:41 < Whip> I tried, you can't do it.
12:41 < hallas> skelterjohn: but i wont bet anything on it :) just theory
12:42 < skelterjohn> i think it's a fairly uncommon use-case
12:42 -!- sacho [~sacho@82.137.65.22] has quit [Read error: Connection reset by
peer]
12:42 < skelterjohn> and that kind of (\n\n) stuff works only outside of
functions, right now
12:42 < skelterjohn> i don't see that changing
12:42 < hallas> ok
12:43 < Whip> I wonder what kind of complications generics brings.
12:43 -!- sacho [~sacho@95-42-85-213.btc-net.bg] has joined #go-nuts
12:44 < skelterjohn> i'm writing a post to the ml right now
12:44 < skelterjohn> i think i have a pretty simple approach
12:44 < skelterjohn> that wouldn't require a lot of work to implement
12:44 < skelterjohn> i assume
12:44 < skelterjohn> i'm not familiar with the compiler code, though
12:45 < Whip> The reluctance to make them part of the language must come
from the odd cases where "correct" behaviour gets ambiguous I imagine.
12:46 < Whip> What's the ml?
12:46 < skelterjohn> mailing list
12:47 < Whip> Heh, "go-crazy", is that an experimental compiler?
12:49 < skelterjohn> ?
12:49 < Whip> One of the posts says "unfortunately I haven't had the time to
implement it in go-crazy."
12:50 < skelterjohn> i'd need some context to guess what that's referring to
12:51 < Whip>
http://groups.google.com/group/golang-nuts/browse_thread/thread/de384624dd42d8bb
12:52 < hallas> when using go/printer, i cant seem to make my custom styler
use the html tags I specify, when printing
12:53 < hallas> probably wrong mode
12:53 < hallas> it sure was
12:54 < hallas> :)
13:00 -!- teralaser [~teralaser@unaffiliated/teralaser] has left #go-nuts []
13:02 -!- emmanueloga [~emmanuelo@190.244.15.163] has quit [Ping timeout: 264
seconds]
13:05 -!- Whip [3aaf1956@gateway/web/freenode/ip.58.175.25.86] has quit [Quit:
Page closed]
13:06 -!- napsy_ [~luka@88.200.96.18] has joined #go-nuts
13:16 < uriel> farcebook group for Go nuts:
http://www.facebook.com/home.php?sk=group_140911009288559
13:17 < soul9> uriel: you got an idea for storing tuples in a file?  i will
need to do some queries on it too..
13:18 < soul9> something like csv i could use, but then for each query i
have to traverse the file..
13:18 < soul9> using sqlite right now, but I hate it
13:18 -!- Fish9 [~Fish@86.65.182.207] has quit [Remote host closed the connection]
13:19 -!- Fish9 [~Fish@86.65.182.207] has joined #go-nuts
13:20 < uriel> soul9: depends on the nature of your dataset
13:20 < uriel> by the way, somebody should rewrite pq in Go ;)
13:21 < soul9> it's very simple: it's just 11 words per tuple
13:21 < soul9> so it's relatively short text for each element
13:21 < uriel> soul9: this days, you probably have enough ram to keep the
whole thing in memory
13:21 < uriel> and doing linear searches unless your query rate or data side
is ridiculously huge
13:22 < uriel> so just put it on a csv, load it into an array or map, and
you are done
13:22 < uriel> if you want to get really fancy, use json, the json package
is quite good
13:22 < uriel> but that is probably over-kill
13:22 < soul9> yeah
13:23 < soul9> yeah, csv...but then the query ..
13:23 < soul9> well, it can get ridiculously huge
13:23 < soul9> i have 23k tuples in the test dataset, and it'll grow by a
lot
13:24 < soul9> i don't want to depend on having 4G of RAM at least, that's
java's job..
13:24 < uriel> define 'a lot'
13:25 < uriel> even 100k of tuples is nothing
13:25 < uriel> or a million
13:25 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Quit:
Leaving.]
13:26 < skelterjohn> not when you are doing linear search....
13:26 < soul9> :)
13:26 -!- emmanueloga [~emmanuelo@190.244.15.163] has joined #go-nuts
13:26 < soul9> i might get to one million
13:27 < soul9> but i don't think more, that's probably a sane upper limit
13:28 < skelterjohn> you need to look them up by some key?  that map can
use?
13:28 < soul9> er, i need to look them up on variable number of keys
13:29 < soul9> sometimes 10, sometimes only 2 keys are used
13:29 < skelterjohn> weird
13:29 < soul9> yes, string keys
13:29 < soul9> short and simple string keys
13:29 < skelterjohn> how does the variable-number-of-keys work?
13:29 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has quit [Remote host closed the connection]
13:30 < skelterjohn> and could you just concatonate the strings with a
special character for a single key?
13:30 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
13:30 < soul9> well, if the index is empty it's ignored
13:30 < soul9> no, i don't think so
13:30 < skelterjohn> if the index is empty?
13:30 < soul9> so there's 10 indexes
13:30 < soul9> and one content which makes the 11 element tuple
13:31 < uriel> skelterjohn: you can use a map as an index depending on the
data
13:31 < soul9> when i do a query, i query on either 2, 3...10 indexes
13:31 < skelterjohn> oh like a select
13:31 < skelterjohn> you have a relational database
13:31 < uriel> soul9: anyway, if you keep the thing sorted by the most
commonly used keys you probably should be fine
13:31 < soul9> so i don't think using a single concatenated string as index
would work, except if i use a regexp i guess
13:31 < skelterjohn> why not use sqlite?
13:32 < soul9> well, that's what i'm using right now, i was just wondering
wether uriel had an idea to replace it, since we share feelings for sqlite
13:32 -!- skejoe [~skejoe@188.114.142.231] has quit [Quit: Lost terminal]
13:32 < soul9> skelterjohn: which sqlite lib is the most mature?
13:33 < skelterjohn> russ cox made one
13:33 < skelterjohn> i haven't used any of them
13:33 < soul9> ah..ok so you don't know that most of them are pretty stale
;)
13:33 < exch> I'm using russ's lib in my current project
13:33 < soul9> oh?
13:33 < soul9> i started using kuronenko's one
13:33 < soul9> hmm
13:33 < exch> it's a simple API, but it works.  There's a 'bug' in there
though.  At leats I feel it's a bug, but Russ mentioned he did it on purpose
13:34 < soul9> ?
13:35 < exch> loading a blob from the database.  You get it as byte slice,
but once you call Stmt.Finalize(), that memory becomes invalid.  So you should
copy it before you call Finalize()
13:35 < soul9> ah, okay
13:35 < soul9> i don't use blobs anyways ;)
13:35 < exch> Cost me 3 hours of hair pulling to figure out where that was
coming from ><
13:35 < soul9> but i liked kuronenko's one because it has a test file from
which i can see how it's used..
13:36 < soul9> oh well, i'll try to figure out russ' one since it seems more
active
13:36 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving]
13:38 < exch> oh, there's also the issue of update/insert commands.
Basically anything that does not return a result set.  You have to call
sqlite.Next() after executing it, otherwise the command will not be comitted
13:38 -!- iant [~iant@67.218.105.113] has joined #go-nuts
13:38 -!- mode/#go-nuts [+v iant] by ChanServ
13:38 < mpl> soul9: I'm using it (not very extensively) in gogallery if you
want to check it out.
13:39 < mpl> soul9: russ's sqlib that is.
13:39 < exch>
http://github.com/jteeuwen/mudkip/blob/master/data/sqlite/store.go here's the use
case I have
13:40 < soul9> sweet!  thanks guys!
13:40 < mpl> http://code.google.com/p/gogallery/source/browse/sql.go
13:40 < soul9> great
13:46 -!- dj2 [~dj2@216.16.242.254] has joined #go-nuts
13:50 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
13:53 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
13:57 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 245
seconds]
13:59 -!- araujo [~araujo@213.28.64.66] has joined #go-nuts
13:59 -!- araujo [~araujo@213.28.64.66] has quit [Changing host]
13:59 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
14:07 -!- Guest75485 [~luka@88.200.96.18] has quit [Ping timeout: 240 seconds]
14:19 -!- littlebobby [~bob@unaffiliated/littlebobby] has joined #go-nuts
14:21 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has quit [Remote host closed the connection]
14:21 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
14:26 -!- ExtraSpice [~XtraSpice@78-57-137-162.static.zebra.lt] has quit [Quit:
Leaving]
14:35 -!- kanru [~kanru@118-168-234-222.dynamic.hinet.net] has joined #go-nuts
14:44 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
14:47 -!- pn_ [~pn@HSI-KBW-078-042-071-073.hsi3.kabel-badenwuerttemberg.de] has
joined #go-nuts
14:50 -!- ronnyy [~quassel@p4FF1C73E.dip.t-dialin.net] has joined #go-nuts
14:51 < pn_> in interface implementation do the names of the func-arguments
matter.?if I have somefunc(a string, b bool) in the interface definition and
somefunc(blah1 string, ugh bool) in the implementation
14:51 -!- thiago__ [~thiago@189.26.196.166.dynamic.adsl.gvt.net.br] has quit
[Quit: bye]
14:52 -!- xuser [~xuser@unaffiliated/xuser] has left #go-nuts []
14:53 < exch> nope, you can even omit the names from the interface
definition
14:53 < exch> as long as the types match
14:53 < pn_> thx perfect
14:56 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Ping timeout: 245
seconds]
14:59 -!- cthom [~cthom@32.164.89.238] has joined #go-nuts
15:00 < wrtp> anyone see my post about possible netchan development in
golang-dev and have any comment?
15:02 < wrtp> (i thought it was quite a neat idea, but it's probably obvious
and been discounted for any number of possible reasons...)
15:07 -!- iant [~iant@67.218.105.113] has quit [Quit: Leaving.]
15:08 -!- napsy_ [~luka@88.200.96.18] has joined #go-nuts
15:09 -!- plainhao [~plainhao@mail.xbiotica.com] has joined #go-nuts
15:13 < yiyus> wrtp: there was some talk about using netchan with pipes and
i think everybody liked the idea and afaiu your patch would allow it, so in
principle i like it
15:15 < wrtp> yiyus: i think my patch would actually be pretty much
orthogonal to allowing netchan to work with pipes (something which i'd like too,
BTW)
15:15 < yiyus> anyway, i have not really used netchan, so i cannot say too
much
15:16 < wrtp> np
15:16 < wrtp> thanks for your input anyway
15:17 -!- kanru [~kanru@118-168-234-222.dynamic.hinet.net] has quit [Ping timeout:
252 seconds]
15:18 -!- iant [~iant@nat/google/x-pwlmfhiehhctkyqx] has joined #go-nuts
15:18 -!- mode/#go-nuts [+v iant] by ChanServ
15:25 -!- Guest96532 [~luka@88.200.96.18] has quit [Quit: leaving]
15:25 -!- napsy_ [~luka@88.200.96.18] has joined #go-nuts
15:28 < wrtp> ah, seems like rob has everything in hand.
15:41 -!- synth [~cb@obfuscated.us] has joined #go-nuts
15:42 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
15:51 -!- matti_ [~mumboww@c-98-207-108-218.hsd1.ca.comcast.net] has quit [Quit:
matti_]
15:53 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has joined #go-nuts
16:07 -!- matti_ [~mumboww@c-98-207-108-218.hsd1.ca.comcast.net] has joined
#go-nuts
16:14 -!- Fish [~Fish@9fans.fr] has joined #go-nuts
16:18 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has quit [Ping timeout: 252 seconds]
16:18 -!- ExtraSpice [~XtraSpice@78-57-137-162.static.zebra.lt] has joined
#go-nuts
16:18 -!- awidegreen [~quassel@62.176.237.78] has joined #go-nuts
16:19 -!- jefferai [quassel@kde/amarok/mitchell] has left #go-nuts
["http://quassel-irc.org - Chat comfortably.  Anywhere."]
16:21 -!- werdan7 [~w7@freenode/staff/wikimedia.werdan7] has joined #go-nuts
16:21 -!- dj2_ [~dj2@216.16.242.254] has joined #go-nuts
16:24 -!- dj2 [~dj2@216.16.242.254] has quit [Ping timeout: 240 seconds]
16:25 -!- artefon [~thiagon@150.164.2.20] has joined #go-nuts
16:29 -!- Tv [~tv@gige.bur.digisynd.com] has joined #go-nuts
16:30 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
16:30 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
16:33 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has quit [Quit:
Leaving]
16:34 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has joined #go-nuts
16:35 -!- fabled [~fabled@mail.fi.jw.org] has quit [Quit: Ex-Chat]
16:39 < nsf> uhm..  Russ once said:
16:40 < nsf> The packages I found that were using both godefs and
16:40 < nsf> cgo I was able to change to use just cgo; you shouldn't
16:40 < nsf> need godefs too.
16:40 < nsf> how one can replace godefs usage with cgo?
16:40 < nsf> my case is that I have an enum in a C file and I want to
reflect it in the Go
16:40 < nsf> I thought godefs is a perfect tool for that
16:41 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
16:42 < nsf> or he meant the struct case only
16:44 -!- synth [~cb@obfuscated.us] has left #go-nuts []
16:46 -!- ronnyy [~quassel@p4FF1C73E.dip.t-dialin.net] has quit [Remote host
closed the connection]
16:49 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts
16:49 -!- virtualsue [~chatzilla@nat/cisco/x-ydliebbldtjvyuwa] has quit [Ping
timeout: 272 seconds]
16:50 -!- ronnyy [~quassel@p4FF1C73E.dip.t-dialin.net] has joined #go-nuts
16:53 -!- wrtp [~rog@92.17.85.103] has quit [Quit: wrtp]
16:55 -!- stalled [~stalled@unaffiliated/stalled] has quit [Ping timeout: 265
seconds]
16:58 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Quit:
Leaving.]
16:58 -!- Project_2501 [~Marvin@82.84.94.184] has joined #go-nuts
16:58 -!- b00m_chef [~watr@66.183.100.197] has joined #go-nuts
16:59 -!- wrtp [~rog@92.17.85.103] has joined #go-nuts
17:01 -!- MaksimBurnin [~max@44.188-224-87.telenet.ru] has joined #go-nuts
17:04 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has quit
[Quit: Ex-Chat]
17:05 -!- wjlroe [~will@212.169.34.114] has quit [Quit: Computer has gone to
sleep]
17:07 -!- pn_ [~pn@HSI-KBW-078-042-071-073.hsi3.kabel-badenwuerttemberg.de] has
quit [Remote host closed the connection]
17:07 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 260 seconds]
17:09 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
17:10 -!- stalled [~stalled@unaffiliated/stalled] has joined #go-nuts
17:12 -!- rutkowski [~adrian@078088207115.walbrzych.vectranet.pl] has joined
#go-nuts
17:13 -!- ucasano [~ucasano@host153-182-static.227-95-b.business.telecomitalia.it]
has joined #go-nuts
17:20 -!- amacleod [~amacleod@pool-96-252-93-11.bstnma.fios.verizon.net] has
joined #go-nuts
17:22 -!- skelterjohn [~jasmuth@tvwna-ip-b-154.princeton.org] has joined #go-nuts
17:28 -!- cthom [~cthom@32.164.89.238] has quit [Ping timeout: 264 seconds]
17:30 -!- raylu [raylu@c-24-131-193-106.hsd1.pa.comcast.net] has joined #go-nuts
17:31 -!- skelterjohn [~jasmuth@tvwna-ip-b-154.princeton.org] has quit [Quit:
skelterjohn]
17:40 -!- virtualsue [~chatzilla@nat/cisco/x-igeruqabronxksnj] has joined #go-nuts
17:41 < raylu> connection.go:116: to pass 'a' as ...interface { }, use
'a...'
17:42 < raylu> putting 'a...' as an argument doesn't seem to work.  is there
something i'm missing?
17:42 < raylu> the actual line is from goirc:
17:42 < raylu> func (conn *Conn) error(s string, a...  interface{}) {
conn.Err <- os.NewError(fmt.Sprintf(s, a)) }
17:43 <+iant> a...  as the last argument should work, assuming you are using
the latest release
17:43 -!- ronnyy [~quassel@p4FF1C73E.dip.t-dialin.net] has quit [Remote host
closed the connection]
17:43 <+iant> and assuming a is []interface{}
17:43 < raylu> using 'a...' as the last argument gives me the same error and
additionally,
17:43 < raylu> connection.go:116: final argument in variadic function
missing type
17:44 <+iant> a...  would be in the call expression, not in the func
definition
17:44 <+iant> that is, you want fmt.Sprintf(s, a....)
17:44 <+iant> probably
17:44 < raylu> oh.
17:45 -!- kkress [~kkress@64.62.173.125] has quit [Quit: leaving]
17:45 < raylu> ah ha.  that's what you get for putting everything on one
line, i guess
17:45 -!- kkress [~kkress@c-65-49-35-49.tilenetworks.com] has joined #go-nuts
17:45 -!- kkress [~kkress@c-65-49-35-49.tilenetworks.com] has quit [Client Quit]
17:45 -!- kkress [~kkress@c-65-49-35-49.tilenetworks.com] has joined #go-nuts
17:47 -!- amacleod [~amacleod@pool-96-252-93-11.bstnma.fios.verizon.net] has quit
[Quit: Bye Bye]
17:53 -!- ville- [~ville@a107.ath.cx] has quit [Remote host closed the connection]
17:53 -!- ucasano [~ucasano@host153-182-static.227-95-b.business.telecomitalia.it]
has quit [Quit: ucasano]
18:02 -!- atsampson [~ats@94-194-126-16.zone8.bethere.co.uk] has quit [Ping
timeout: 265 seconds]
18:02 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving]
18:03 * nsf is working on LLVM bindings, 325 of 1200 lines of Core.h is done :P
18:03 < nsf> writing bindings is so boring :)
18:03 < nsf> thank god vim has macros
18:04 < photron> nsf: you could write a bindings generator or add go support
to existing ones :)
18:04 < photron> +instead
18:04 * exch points at swig
18:05 -!- atsampson [~ats@94-194-126-16.zone8.bethere.co.uk] has joined #go-nuts
18:06 < nsf> automatic generators are a subject of constant failure
18:06 <+iant> but easier to keep up to date once they are working
18:06 < nsf> true
18:06 < nsf> but LLVM's C++ api is huge
18:06 < nsf> I'm writing bindings for C api
18:06 < nsf> other languages do the same
18:06 < nsf> e.g.  ocaml
18:07 <+iant> I'm not really suggesting that you do anything different
18:07 < nsf> also I'm fixing their names inconsistency
18:07 < nsf> like LLVMDisposeContext vs.  LLVMModuleDispose
18:07 < nsf> :P
18:07 < nsf> anyway
18:08 * nsf is back to work
18:11 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
18:12 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 264 seconds]
18:13 < uriel> adg: the spam in golang-dev is annoying, seems that almost
one per day gets through, and every time I report it, gmail suggest me to
unsibscribe from the group...
18:14 <+iant> I report the spam in the groups interface every time I see it
18:14 <+iant> a lot more spam does get blocked
18:14 < uriel> I report it in the gmail interface, doesn't seem to make any
difference
18:14 <+iant> my hope is that reporting it via the groups interface will
stop from getting into the group in the first place
18:14 < uriel> of course a lot more spam gets blocked, but too much gets
trhough still
18:16 * uriel gave up all hope of the groups spam filtering ever working properly,
same with search, which still is considerably more broken than either google.com
or gmails mailbox search
18:17 < plexdev> http://is.gd/g0BKe by [Rob Pike] in go/src/pkg/log/ -- log:
fix out-of-date package comment
18:35 -!- unRuhe [~pn@HSI-KBW-095-208-088-177.hsi5.kabel-badenwuerttemberg.de] has
joined #go-nuts
18:36 < unRuhe> is there something like a void pointer in go.  I want to
design an interface with a method that might return different types
18:36 -!- enherit [~enherit@cpe-98-149-170-48.socal.res.rr.com] has joined
#go-nuts
18:37 < Tv> unRuhe: interface{}
18:37 < unRuhe> :D
18:37 < unRuhe> okay empty interface
18:37 < unRuhe> ty very much
18:39 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
18:42 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
18:44 -!- skelterjohn [~jasmuth@tvwna-ip-b-154.princeton.org] has joined #go-nuts
18:50 -!- skelterjohn [~jasmuth@tvwna-ip-b-154.princeton.org] has quit [Quit:
skelterjohn]
18:51 -!- qIIp [~qIIp@134.29.57.68] has joined #go-nuts
19:03 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has quit [Remote host closed the connection]
19:03 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
19:05 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has quit [Ping timeout:
240 seconds]
19:06 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has joined #go-nuts
19:07 -!- ct529 [~quassel@77-44-78-159.xdsl.murphx.net] has joined #go-nuts
19:07 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has quit [Client Quit]
19:08 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
19:12 < unRuhe> is this valid [10]interface{}
19:12 < unRuhe> ?
19:13 < exch> yes
19:14 < unRuhe> then my mistake is somewhere else
19:16 < wrtp> unRuhe: what's the error?
19:17 < unRuhe> just a sec
19:17 -!- peterdn [~peterdn@dhcp-110-228.new.ox.ac.uk] has quit [Quit: ChatZilla
0.9.86-rdmsoft [XULRunner 1.9.2/20100222071121]]
19:17 < unRuhe> http://pastebin.com/8SDh9URi
19:18 < exch> data []interface{} is a slice, [10]interface{} is an array
19:19 < exch> either use make([]interface{}, 10), or ([10]interface{})[0:10]
to get a slice of the array
19:19 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has quit [Quit: Morten.  Desu~]
19:19 < exch> A slice is basically a pointer to an underlying fixed size
array.  You can't treat one as the other like you are trying to do
19:20 < plexdev> http://is.gd/g0FVD by [Russ Cox] in 4 subdirs of
go/src/cmd/ -- 5l, 6l, 8l: indent, outdent
19:20 < unRuhe> okay thank u
19:22 < unRuhe> i read about slices but didnt quite get it because
programmers-english is real hard for me :)
19:22 < exch> In Go you will rarely use fixed arrays.  It pays to learn
about slices, cos they are used everywhere and very convenient
19:23 < unRuhe> did i get it right that i can change the size of the
underlying array during runtime?
19:24 -!- skelterjohn [~jasmuth@c-71-230-156-50.hsd1.nj.comcast.net] has joined
#go-nuts
19:25 < hallas> back
19:25 < exch> You can't.  You have to create a new, larger array and copy
it's contents.  However a slice can be defined with both a length and maximum
capacity.  As long as the length of the slice does not exceed the capacity, yuo
can make it larger without creating a whole new slice
19:26 < unRuhe> cool, I think thats what the tutorial page said too but now
i get it :D
19:26 < exch> v := make([]int, 0, 10); <-that slice has length 0, but can
'grow' to 10 elements by doing 'v = v[0:len(v)+1]'.  Once len(v) is larger or
equal to the capacity (10), you have to recreate it
19:27 < nsf> but looks like there will be a new built-in function 'append'
19:27 < nsf> which will do the growth thing for you
19:27 < exch> at some point
19:28 < unRuhe> nsf, but that development is in progress?
19:28 < nsf> I don't know
19:28 < nsf> there was a proposal on the ML
19:28 < nsf> seems people like it
19:28 < unRuhe> i'd like it
19:28 * nsf too
19:30 < unRuhe> did I get it right that once go can use c and c++ libs we'll
be able to do gui work with like gtk+ and Qt?
19:30 < exch> It already can
19:30 < nsf> there is a gtk bindings somewhere
19:30 < nsf> called go-gtk
19:30 < unRuhe> cool thats nice
19:30 < exch> http://go-lang.cat-v.org/library-bindings <- here's a bunch
of C/C++ bindings
19:30 < nsf> http://github.com/mattn/go-gtk
19:30 -!- plainhao [~plainhao@mail.xbiotica.com] has quit [Quit: plainhao]
19:31 < unRuhe> this is a very cool irc channel
19:31 * unRuhe likes
19:31 < mpl> unRuhe: it's missing quite a lot of things but it's already
pretty good for simple apps
19:31 < nsf> I'm working on LLVM bindings right now :)
19:31 < nsf> just finished Types section, starting Values section
19:31 < nsf> ugh..
19:32 < skelterjohn> sounds un-fun
19:32 * nsf sighs
19:32 < nsf> it's not fun
19:32 < wrtp> if you want to convert stuff to use append before it's
implemented, just use this implementation for each type that you need:
http://pastebin.com/3WcLWCAC
19:32 < nsf> skelterjohn: basically it's just a lot of that kind of
functions:
19:32 < nsf> func VoidTypeInContext(c Context) (t Type) { t.c =
C.LLVMVoidTypeInContext(c.c); return }
19:33 < nsf> :D
19:33 < wrtp> i think it's equivalent to the proposed new built-in append
function
19:33 < uriel> unRuhe: you missed the kid that joined, asked for help fixing
something in his code, demanded help right away because he was in a big hurry, and
left, all in the space of one minute, without anyone else saying anything
19:33 < skelterjohn> you'd think someone would write a tool to automate
19:33 < rutkowski> Was there any news about new garbage collector maybe?
19:33 < uriel> unRuhe: now that was cool!
19:33 < nsf> skelterjohn: well, you can't really automate that a lot
19:33 < nsf> because there are many small cases
19:33 < nsf> for type conversions, etc.
19:33 < nsf> sometimes naming sucks
19:34 -!- aho [~nya@fuld-4d00d388.pool.mediaWays.net] has joined #go-nuts
19:34 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
19:34 < nsf> like LLVM C API uses GetParamTypes, I use simply ParamTypes as
Go style suggests
19:35 < nsf> also english issues
19:35 < nsf> LLVM C API: IsPackedStruct
19:35 < nsf> me: IsStructPacked
19:35 < taruti> nsf: you have a llvm Go binding?
19:35 < unRuhe> wrtp, TY
19:35 < nsf> taruti: I'm writing them right now
19:35 < taruti> any link?
19:35 < nsf> not yet
19:36 < nsf> Basically I will make a port of Core.h and then I will test it
19:36 < nsf> I though about asking help, but it's a job for one
19:36 < nsf> anyway, end of break, back to work :P
19:37 -!- skelterjohn [~jasmuth@c-71-230-156-50.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
19:37 -!- illya77 [~illya77@89-100-133-95.pool.ukrtel.net] has joined #go-nuts
19:44 -!- b00m_chef [~watr@66.183.100.197] has quit [Ping timeout: 255 seconds]
19:44 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has quit [Ping timeout: 252 seconds]
19:45 -!- unRuhe [~pn@HSI-KBW-095-208-088-177.hsi5.kabel-badenwuerttemberg.de] has
quit [Remote host closed the connection]
19:45 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 265
seconds]
19:47 -!- niemeyer [~niemeyer@201-40-152-123.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
19:50 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
19:51 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has quit [Ping timeout:
264 seconds]
19:51 -!- Hopsy [~Hopsy@77.62.238.136] has joined #go-nuts
19:52 < plexdev> http://is.gd/g0Iv3 by [Russ Cox] in 7 subdirs of go/src/ --
5l, 6l, 8l: first pass cleanup
19:54 -!- illya77 [~illya77@89-100-133-95.pool.ukrtel.net] has quit [Quit:
illya77]
19:58 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has joined #go-nuts
19:58 -!- rutkowski [~adrian@078088207115.walbrzych.vectranet.pl] has quit [Quit:
WeeChat 0.3.3-dev]
20:05 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts
20:06 -!- ct529 [~quassel@77-44-78-159.xdsl.murphx.net] has quit [Remote host
closed the connection]
20:07 < nsf> is there any way to take an address of Go's string?
20:07 < nsf> LLVM uses StringRef class a lot, and basically it's a ptr +
length
20:07 < nsf> the same representation as Go uses
20:07 < nsf> s/any/a/
20:08 < nsf> &s[0] doesn't work
20:09 < niemeyer> nsf: uintptr(unsafe.Pointer(&s)), IIRC
20:09 < nsf> &s works, thanks
20:10 < nsf> well, wait
20:10 < nsf> it has type *string
20:10 < KirkMcDonald> That gives a pointer.  I don't think it is a pointer
to the actual character buffer.
20:10 < hallas> its a string pointer
20:10 < nsf> ok, let's hack it
20:10 < hallas> what do you need to achieve?
20:11 < nsf> Go's string is a 'struct { char *ptr; int len; }'
20:11 < nsf> if we're taking an address of that struct
20:11 < KirkMcDonald> nsf: So &s will be in effect a pointer to a pointer.
20:11 < nsf> the address matches 'ptr'
20:11 < hallas> nope, dont think so
20:11 < hallas> try &s.ptr ?
20:11 < nsf> ah, yes
20:11 < nsf> pointer to a pointer
20:12 < KirkMcDonald> nsf: Is that the actual layout of a Go string, though?
20:12 < nsf> well, currently yes
20:12 < KirkMcDonald> Okay.
20:12 < nsf> it's in runtime.h
20:12 < hallas> its simply a pointer to the place where the string is, and
the amount of bytes from that point on that is actually part of the string
20:12 < nsf> hallas: please stop explaining
20:13 < nsf> you're wasting your energy :)
20:13 < hallas> :-(
20:13 < KirkMcDonald> I always liked the reason why D's dynamic arrays
(which include strings) were laid out like struct { size_t length; void *ptr; }
20:13 < nsf> KirkMcDonald: what's the reason?
20:13 < nsf> efficient allocation?
20:14 < nsf> like struct + string at the same time
20:14 < KirkMcDonald> nsf: It's so you could pass them to printf!  Hehe.
20:14 < KirkMcDonald> printf("%*s", d_string)
20:14 < nsf> ah, I see
20:14 <+iant> !
20:14 < nsf> quite interesting
20:14 < KirkMcDonald> It's not guaranteed to work on all architectures.
20:14 <+iant> yeah, %* takes int, not size_t
20:15 < nsf> another hack
20:15 < KirkMcDonald> iant: Also the layout of calling with a struct into a
variadic vs.  two arguments is not guaranteed to be the same.
20:15 < niemeyer> nsf: (*reflect.StringHeader)(unsafe.Pointer(&s)).Data
gives you the address to the data
20:15 -!- mduft_ [~mduft@gentoo/developer/mduft] has joined #go-nuts
20:15 < KirkMcDonald> I believe it breaks on Solaris, for instance.
20:15 -!- mduft [~mduft@gentoo/developer/mduft] has quit [Read error: Connection
reset by peer]
20:15 < nsf> niemeyer: thanks
20:15 < nsf> but I think I will avoid hacks
20:15 < nsf> just use C.CString
20:15 < nsf> who cares about one alloc anyway :)
20:17 < KirkMcDonald> But it's mostly moot now, since D has its own writef
function.
20:19 -!- mduft__ [~mduft@193.186.16.254] has joined #go-nuts
20:19 -!- mduft_ [~mduft@gentoo/developer/mduft] has quit [Read error: Connection
reset by peer]
20:24 < plexdev> http://is.gd/g0Knl by [Russ Cox] in 14 subdirs of
go/src/cmd/ -- various: avoid %ld etc
20:24 < plexdev> http://is.gd/g0Knq by [Ken Thompson] in 3 subdirs of
go/src/ -- fix arm bug in reflect.call
20:28 < niemeyer> nsf: I guess I'm significantly more tolerant than that :)
20:29 < nsf> who cares about ten mallocs?  :)
20:29 < nsf> or I misunderstood you
20:29 < niemeyer> nsf: No, the other way around..  the above line doesn't
look too hackish to me at all
20:29 < nsf> ah, I see
20:29 < nsf> well, maybe it isn't
20:30 < niemeyer> nsf: It's just unsafe, but as long as "s" stays around for
the duration of whatever is being done with its data, should be cool
20:30 < nsf> but I don't want to add 'reflect' package dependency yet
20:30 < niemeyer> Ah, I see..  that's cool
20:30 < niemeyer> nsf: Regarding tolerance, wait until you see the mmap I've
been hacking in my spare time ;-)
20:30 < nsf> although I've added a TODO item, which says that I should
consider using 'reflect' for LLVM bindings
20:30 < nsf> because it may help there
20:31 < nsf> niemeyer: hehe
20:33 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 276
seconds]
20:34 < KirkMcDonald> That's the thing about immutable strings.
20:34 < KirkMcDonald> They're only immutable as long as they're still alive.
20:35 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
20:35 -!- artefon [~thiagon@150.164.2.20] has quit [Quit: Leaving]
20:35 -!- virtualsue [~chatzilla@nat/cisco/x-igeruqabronxksnj] has quit [Ping
timeout: 252 seconds]
20:35 < niemeyer> KirkMcDonald: Hahaha
20:35 < KirkMcDonald> So once I wrote the Python bindings for D.
20:36 < KirkMcDonald> Originally I had it so that Python strings were
exposed to D as just a D slice over the internal buffer of the Python string.
20:36 < niemeyer> KirkMcDonald: You should create a patent on strings which
are allocated on immutable memory
20:36 < KirkMcDonald> This worked reasonably well, until I discovered that,
once the Python string was collected, that memory may be reused for other objects.
20:37 < niemeyer> Once allocated, they stay unchanged forever
20:38 < nsf> LLVMBool DontNullTerminate
20:38 < nsf> llvm c api rocks
20:39 < nsf> it's done that way because the common way of handling string is
null termination
20:39 -!- pothos_ [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:39 < nsf> and ',0)' looks better than ',1)'
20:39 < nsf> :D
20:39 < nsf> C++ API has 'bool AddNull' instead
20:39 -!- pothos_ [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read
error: Connection reset by peer]
20:40 < nsf> I guess I will turn in back in Go
20:40 -!- pothos_ [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:40 < nsf> :\
20:41 -!- pothos_ [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read
error: Connection reset by peer]
20:41 -!- pothos_ [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:42 < nsf> s/in/it/
20:42 -!- pothos_ [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read
error: Connection reset by peer]
20:42 < nsf> :\
20:42 -!- pothos_ [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:42 < niemeyer> Null termination must be one of the worst ideas in the
life of computing
20:42 -!- pothos [~pothos@111-240-217-33.dynamic.hinet.net] has quit [Ping
timeout: 265 seconds]
20:42 < nsf> agreed
20:42 < niemeyer> I'm sure there must be a good historical reason for it,
but I've never heard it
20:43 -!- pothos_ [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read
error: Connection reset by peer]
20:43 <+iant> it lets you represent the length of a string in a single byte
20:43 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:43 <+iant> so it is a good choice if you are very memory constrained
20:43 < niemeyer> iant: Well, only if most of the strings are empty, which
feels pretty weird
20:43 < anticw> it's also pretty easy to work with in various common C loops
20:43 < nsf> "At the time C (and the languages that it was derived from)
were developed, memory was extremely limited, so using only one byte of overhead
to store the length of a string was attractive."
20:43 < exch> if a string has no fixed size, you can't know if the length
can fit in 1, 2, or 4, etc bytes..
20:44 < nsf> (c) wiki
20:44 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:44 <+iant> no, I mean you have to represent the length of a string
somehow
20:44 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:44 <+iant> a null byte gives you the length in one byte
20:44 < niemeyer> Well..  what about using *that same byte* to represent the
length?
20:44 <+iant> it's just that you have to walk through the string to get
there
20:44 < exch> Just because there is more memory now, is no reason to use
more bytes, if less works just as well :p
20:44 <+iant> that would limit you to strings up to 255 byte slong
20:44 <+iant> which is insufficient
20:44 < nsf> niemeyer: but that limits you to 255 characters
20:44 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:45 < niemeyer> Of course..  var-ints et al
20:45 <+iant> yeah, people have done that too, but now you're getting
complicated
20:45 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:45 < niemeyer> iant: Well..  that's a pretty light talk for a decision
which would be around for several decades :-)
20:45 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:45 < niemeyer> I'm sure there was further consideration, so I still
ponder about what the debate at the time looked like.
20:46 <+iant> ask ken, I guess
20:46 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:46 <+iant> pascal used a length word followed by the string
20:46 <+iant> C used null termination
20:46 < niemeyer> iant: Yeah, I surely would like to hear the story, when I
get a chance to talk to him
20:46 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:46 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:47 < aho> http://en.wikipedia.org/wiki/C_string#History
20:47 < aho> derp :f
20:47 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:47 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:47 < niemeyer> aho: Yeah, was pasted above too
20:47 < KirkMcDonald> Null termination may represent the length in a single
byte, but it also prohibits a certain value from appearing within the string.
20:48 < aho> ah
20:48 <+iant> Dennis Ritchie or somebody had a list of things he did not
like about Pascal
20:48 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:48 < niemeyer> KirkMcDonald: Yeah, I guess that's the whole point, isn't
it :)
20:48 <+iant> I can't find it now, though
20:48 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:48 < KirkMcDonald> Pascal used 1-indexed arrays, didn't it?
20:48 < anticw> http://www.lysator.liu.se/c/bwk-on-pascal.html
20:49 <+iant> ah, Kernighan
20:49 <+iant> thanks
20:49 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:49 < anticw> that one is seared into my brain saldy
20:49 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:49 < anticw> iant: look at 2.1 :-)
20:50 < aho> http://www.joelonsoftware.com/articles/fog0000000319.html - Why
do C strings work this way?  It's because the PDP-7 microprocessor, on which UNIX
and the C programming language were invented, had an ASCIZ string type.  ASCIZ
meant "ASCII with a Z (zero) at the end."
20:50 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:50 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:50 < niemeyer> aho: Interesting, thanks
20:51 < niemeyer> That's forwarding the question, though :-)
20:51 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:51 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:51 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:52 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:52 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:53 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:53 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:53 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:54 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:54 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:55 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:55 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:56 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has quit [Read error:
Connection reset by peer]
20:56 -!- pothos [~pothos@111-240-212-186.dynamic.hinet.net] has joined #go-nuts
20:58 -!- MaksimBurnin [~max@44.188-224-87.telenet.ru] has quit [Quit: Leaving.]
20:58 -!- dj2_ [~dj2@216.16.242.254] has quit [Remote host closed the connection]
20:59 < pingveno> Is there any way to parse command line flags based on an
arbitrary array?
20:59 < pingveno> That's as opposed to the array that's passed in to main
20:59 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
20:59 < anticw> yes
20:59 < anticw> if i understand you
20:59 < anticw> you 'regsiter' things then call flag.Parse()
21:00 < anticw> the idiom where you hvae var fFoo = flag.Type(...)
21:00 < wrtp> pingveno: you can assign to os.Args
21:00 < anticw> doesn't have to be done like that, you can do this
dynamically before the .Parse()
21:00 < wrtp> but otherwise, i think you're out of luck
21:00 < wrtp> copy the code
21:00 < pingveno> anticw: flag.Parse doesn't take an arbitrary arrag
21:01 < pingveno> I'm reluctant to assign to os.Args because there will be
multiple main-like functions that will be running.
21:01 < anticw> pingveno: can you give a concrete example of what you wnat?
21:02 < anticw> calling flag.Type(...) is like a registration, you can do
that dynamically in whatever form you like
21:03 < wrtp> anticw: if you wanted to do some arg-like parsing on a
sub-compoment of a program, rather than at the top level, how would you do it?
21:03 < pingveno> Pipelining where each component has a name and flags that
are only aimed toward it.
21:03 < pingveno> Like OS pipes, but without context switching.
21:03 < anticw> wrtp: at the level you grok you know what args you want,
call flag.Type(...) if htat's what you want
21:04 < wrtp> anticw: no, because arg.Parse only parses args from os.Args,
not some arbitrary args that i might wish to parse also
21:04 < wrtp> pingveno: it's a good thing to do, but you'll have to
rewrite/mutate the arg package.  it's not hard.
21:04 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
21:05 < anticw> wrtp: ah, i see what you mean ...  it seems you can change
os.Args at that stage though
21:05 < wrtp> anticw: yeah, but you run the risk of interfering with other
pieces of program.  and you have to put a lock around it to be thread safe
21:05 * pingveno thinks there will probably be third-party packages some time.
21:06 < wrtp> pingveno: it's really a very easy problem to solve
21:06 < wrtp> arg parsing is easy
21:06 < anticw> wrtp: is flag parsing really done all over the place where
you have to worry about that?
21:06 -!- wjlroe [~will@78-86-14-131.zone2.bethere.co.uk] has joined #go-nuts
21:07 < wrtp> anticw: i don't understand the question
21:07 < anticw> wrt to being thread safe, i think it's common (but not
exclusively the case) to parse flags in or near main() or some called variant
21:07 < anticw> not all over the place at any time
21:08 < wrtp> it depends on your code
21:08 < pingveno> That sounds like it risks difficult to hunt down bugs.
21:09 < wrtp> if you've got a little program that's putting pipelines
together in parallel, then it's quite possible that each command in the pipeline
might parse its arguments in parallel too
21:11 < pingveno> Oy
21:11 < pingveno> Class time
21:11 -!- stalled [~stalled@unaffiliated/stalled] has quit [Ping timeout: 265
seconds]
21:11 < pingveno> Thanks guys.  I'll see what I can do.
21:11 < wrtp> have fun
21:11 -!- qIIp [~qIIp@134.29.57.68] has quit [Quit: leaving]
21:11 < pingveno> I will...  I hope
21:21 -!- stalled [~stalled@unaffiliated/stalled] has joined #go-nuts
21:27 -!- mduft_ [~mduft@gentoo/developer/mduft] has joined #go-nuts
21:27 -!- mduft__ [~mduft@193.186.16.254] has quit [Read error: Connection reset
by peer]
21:29 -!- hallas [~hallas@x1-6-30-46-9a-b2-c5-1f.k891.webspeed.dk] has left
#go-nuts []
21:35 -!- ikaros [~ikaros@dslb-188-097-076-206.pools.arcor-ip.net] has quit [Quit:
Leave the magic to Houdini]
21:37 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Quit:
Leaving.]
21:40 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
21:42 -!- Hopsy [~Hopsy@77.62.238.136] has left #go-nuts
["Bothallchoractorschumminaroundgansumuminarumdrumstrumtruminahumptadumpwaultopoofoolooderamaunsturnup"]
21:47 -!- Fish [~Fish@9fans.fr] has quit [Remote host closed the connection]
21:48 -!- Project_2501 [~Marvin@82.84.94.184] has quit [Quit: E se abbasso questa
leva che succ...]
21:52 -!- wjlroe [~will@78-86-14-131.zone2.bethere.co.uk] has quit [Quit: Computer
has gone to sleep]
21:58 -!- ExtraSpice [~XtraSpice@78-57-137-162.static.zebra.lt] has quit [Ping
timeout: 240 seconds]
22:15 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has joined
#go-nuts
22:16 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has quit [Quit:
Leaving]
22:22 -!- awidegreen [~quassel@62.176.237.78] has quit [Read error: Connection
reset by peer]
22:27 < plexdev> http://is.gd/g0SlE by [Russ Cox] in go/src/pkg/ -- arm:
enable 8 more packages
22:36 -!- wrtp [~rog@92.17.85.103] has quit [Quit: wrtp]
22:47 * nsf sighs
22:47 < nsf> Values section is finished
22:48 < nsf> two big sections to go
22:48 < nsf> llvm.go is already more than 1000 lines of code
22:48 < nsf> :P
22:54 -!- kanru [~kanru@118-168-234-222.dynamic.hinet.net] has joined #go-nuts
23:02 -!- stalled [~stalled@unaffiliated/stalled] has quit [Ping timeout: 265
seconds]
23:05 -!- tgall_foo [~tgall@gentoo/developer/dr-who] has quit [Ping timeout: 250
seconds]
23:06 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has quit [Ping timeout:
265 seconds]
23:09 -!- rbraley [~rbraley@ip72-222-128-78.ph.ph.cox.net] has joined #go-nuts
23:17 -!- stalled [~stalled@unaffiliated/stalled] has joined #go-nuts
23:18 -!- photron [~photron@port-92-201-126-85.dynamic.qsc.de] has quit [Ping
timeout: 250 seconds]
23:22 -!- iant [~iant@nat/google/x-pwlmfhiehhctkyqx] has quit [Quit: Leaving.]
23:26 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X]
23:31 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Ping timeout: 276
seconds]
23:32 -!- jmettraux [~jmettraux@211.19.55.177] has joined #go-nuts
23:32 -!- iant [~iant@67.218.105.113] has joined #go-nuts
23:32 -!- mode/#go-nuts [+v iant] by ChanServ
23:42 -!- tgall_foo [~tgall@gentoo/developer/dr-who] has joined #go-nuts
23:46 < yiyus> i have updated my brainfuck interpreted and moved it to
bitbucket, who should i contact to change the link in the dashboard?
23:46 <@adg> yiyus: adg@golang.org
23:46 < yiyus> k
23:46 <@adg> yiyus: you know, there's a bf interpreter in the go distro:
test/turing.go
23:46 -!- dj2 [~dj2@CPE001f5b35feb4-CM0014048e0344.cpe.net.cable.rogers.com] has
joined #go-nuts
23:47 < yiyus> i know, i based mine in it
23:47 < yiyus> but mine also reads input, test/turing.go doesn't
23:47 <@adg> ah :)
23:47 <@adg> I say that because I had a friend implement a BF interpreter in
Go, and he didn't realise there already was one; his was a lot longer than
turing.go :P
23:48 < yiyus> it was my first go "project", improving turing.go
23:48 <@adg> cool!
23:49 < yiyus> but i have changed the interface, now it accepts the program
as a string and you pass to it an io.Reader and an io.Writer for io
23:50 < yiyus> i wonder if there should be an Interpreter interface in some
package
23:50 < yiyus> (not yet, but is something that i guess could appear in the
future)
23:51 -!- hoisie [~hoisie@c-67-188-239-219.hsd1.ca.comcast.net] has joined
#go-nuts
23:52 < raylu> so i have a rbot.conf.example file that i want the makefile
to copy to rbot.conf.  i have the build rule for rbot.conf set up, but i don't
know how to add it to "all"
23:55 < yiyus> raylu: all: rbot.conf
23:55 < raylu> doesn't the Make.inc or Make.cmd define it already, though?
23:56 < yiyus> it will just be added to the all rule, it does not overwrite
it
23:57 < raylu> oh hey...  what do you know.  thanks
--- Log closed Thu Oct 14 00:00:10 2010