--- Log opened Mon Jan 10 00:00:02 2011
00:00 -!- wrtp [~rog@92.17.58.122] has quit [Quit: wrtp]
00:00 <@adg> kamaji: you can't?
00:00 < kamaji> type os.File has no field or method Flush
00:00 <@adg> oh, well, yeah that's why ;)
00:00 < kamaji> :<
00:01 < kamaji> gahh~
00:01 < kamaji> so how do I .....  flush stdout?  :D
00:03 <@adg> i'm not sure you can
00:03 < kamaji> noooooo
00:03 < kamaji> it must have been changed, people are using it on the
mailing list
00:03 < kamaji> that sucks!
00:03 <@adg> try syscall.Fsync(os.Stdout.Fd())
00:04 -!- Sieben [leone2009@arkana.iiens.net] has left #go-nuts []
00:04 <@adg> http://golang.org/search?q=Flush some other, buffered types
define a Flush method
00:05 < kamaji> the bufio?
00:06 < kamaji> the cgo one just calls a C function
00:06 <@adg> the cgo one is part of a demo program, ignore that
00:06 <@adg> i refer to bufio, http, flate, etc
00:13 < temoto> kamaji, i've been told that os.Stdout is not buffered, so
there's no way or need to flush it.
00:13 < temoto> But if you can determine if it is buffered, i'd be happy to
learn.
00:14 < niekie> Being really bored does odd things to me.
00:14 < niekie> I just wrote a time machine that actually works in Go:
http://pastebin.com/JNK5mtkW (only travels into the future so far ;))
00:15 -!- watr_ [~watr@66.183.100.58] has joined #go-nuts
00:15 < kamaji> temoto: oh, cheers
00:16 < kamaji> just like Occam :D
00:16 < kamaji> good ole occam.
00:16 < temoto> niekie, they usually write nanoseconds = seconds * 1e9
00:17 < niekie> temoto: ah, thanks ;)
00:19 < temoto> niekie, played in Braid?
00:19 < niekie> The game Braid?  I've played that, yes :)
00:20 < temoto> Is that what inspired you on time machine?
00:21 < niekie> temoto: not really.  It was just generally intended as a
somewhat lame joke, heh.
00:21 < niekie> But Braid is quite a nice game, yeah.
00:21 < kamaji> temoto: it's unbuffered
00:22 < kamaji> hoorah
00:24 < niekie> temoto: unfortunately it's not available on Linux except on
the HIB2.  Luckily I grabbed that :)
00:24 -!- robzor [~robin@109.130.41.179] has joined #go-nuts
00:24 < kamaji> ok......  really dumb question: where does the thing scanned
by scanln go?
00:24 < robzor> is this the right place for questions regarding building
gccgo?
00:25 -!- robzor [~robin@109.130.41.179] has quit [Quit: robzor]
00:26 < temoto> kamaji, to arguments.
00:27 < temoto> var x *int; Scanln(x)
00:27 -!- robonobo [~robin@109.130.41.179] has joined #go-nuts
00:27 < kamaji> temoto: if I put a string in, will it still use space
seperated values?
00:27 < temoto> kamaji, docs says yes.
00:29 < temoto> I think you need Read and a small tokenizer.
00:30 <@adg> robonobo: sure
00:30 < kamaji> temoto: I think you're right :P
00:35 < kamaji> altho, Scan is just saying there was nothing on input when I
run it
00:35 < kamaji> it's not even waiting
00:35 < kamaji> I feel i've missed something here
00:36 < temoto> Did you pass any arguments to it?
00:36 < kamaji> oh I forgot to check err
00:36 < temoto> Maybe you closed stdin.
00:36 < kamaji> I forgot to pass a pointer :|
00:37 < kamaji> that was a little dumb
00:40 < kamaji> yey, tworks
00:40 < temoto> cool
00:41 < temoto> niekie, do you know akinator?
00:41 < temoto> the character guessing website
00:46 -!- virtualsue [~chatzilla@93-97-62-8.zone5.bethere.co.uk] has quit [Quit:
ChatZilla 0.9.86 [Firefox 3.5.16/20101130074220]]
00:47 < kamaji> gonna go play some BC2, thanks for the help everyone!
00:47 -!- kamaji [~kamaji@cpc2-aztw22-2-0-cust775.aztw.cable.virginmedia.com] has
quit [Quit: fwoop]
00:58 -!- niemeyer [~niemeyer@201-40-141-234.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
01:13 -!- niemeyer [~niemeyer@201-40-141-234.pltce701.dsl.brasiltelecom.net.br]
has quit [Ping timeout: 240 seconds]
01:16 -!- rbraley [~rbraley@ip72-222-134-229.ph.ph.cox.net] has joined #go-nuts
01:23 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
01:24 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has joined #go-nuts
01:26 -!- napsy [~luka@88.200.96.18] has quit [Quit: Lost terminal]
01:39 -!- Tuller [~tuller@c-69-143-52-174.hsd1.va.comcast.net] has quit [Remote
host closed the connection]
01:44 -!- watr_ [~watr@66.183.100.58] has quit [Ping timeout: 240 seconds]
01:46 < temoto> map is automatically expanded to hold more elements, right?
Does it get automatically shrinked too?  How to do so, if it does not?
01:51 -!- cafesofie [~cafesofie@rnwifi-164-107-93-114.resnet.ohio-state.edu] has
joined #go-nuts
01:53 < skelterjohn> I don't believe you have any control over this
02:06 < foocraft> is there any way I can snooze the garbage collector?
02:07 < yebyen> ??
02:07 < yebyen> he shouldn't be collecting anything you haven't dropped your
references to...
02:08 < yebyen> you just want it to lay off your buses for a little while?
02:08 < foocraft> yes, because I think its stop-the-world behavior is coming
in the way of some analysis I'm doing
02:10 -!- Electrik [~iddqd@wikia/Kyano] has joined #go-nuts
02:10 -!- Electrik [~iddqd@wikia/Kyano] has left #go-nuts ["leaving"]
02:10 -!- bmizerany [~bmizerany@112.sub-69-99-159.myvzw.com] has joined #go-nuts
02:21 -!- shvntr [~shvntr@116.26.130.38] has joined #go-nuts
02:27 <@adg> foocraft: i think there's a way of disabling the GC entirely
02:27 -!- toyoshim_ [~toyoshim@y168217.dynamic.ppp.asahi-net.or.jp] has quit [Ping
timeout: 255 seconds]
02:27 <@adg> foocraft: but i don't think you can turn it off temporarily
02:28 <@adg> foocraft: you can call runtime.GC() to initiate a collection
manually, that might help avoid stopping during critical points
02:28 < taruti> one can think wishfully of a better GC
02:28 <@adg> (for example, were I writing a game I would call runtime.GC()
after a vsync
02:28 <@adg> taruti: as the sysadmins here say, 'Hope is not a strategy.'
02:29 < foocraft> adg, alright, so I guess I need to figure out whn does the
GC get triggered automatically
02:30 < foocraft> runtime.GC() doesn't guarantee that I wouldn't be
interrupted, but it makes it less often that I will get interrupted, I would
think.
02:32 <@adg> ohh actually
02:32 <@adg> foocraft: try setting runtime.MemStats.EnableGC = false
02:32 <@adg> foocraft: and then set it back to true and call runtime.GC()
when you're done
02:33 < foocraft> nice, thanks a lot adg
02:33 <@adg> np
02:33 * foocraft checks the runtime package
02:33 <@adg> http://golang.org/pkg/runtime/#MemStatsType
02:34 <@adg> i wasn't sure if the instance of MemStats was read-only, but it
looks like the GC consults it to determine wether it should run
02:34 <@adg> whether
02:34 <@adg> let me know how it goies :)
02:34 <@adg> goes
02:35 -!- waqas [~waqas@jaim.at] has left #go-nuts []
02:38 < tylergillies> im unmarshaling twitter json into a generic
interface{}, but i can't figure out the method to get the values out of the
interface
02:39 <@adg> tylergillies: you need to use type inference
02:40 <@adg> tylergillies:
http://golang.org/doc/go_spec.html#Type_assertions
02:41 <@adg> tylergillies: also see "Type switches"
http://golang.org/doc/go_spec.html#Switch_statements
02:41 < tylergillies> what type do i assert in the interface to?
02:42 <@adg> map[string]interface{} is the default for a JSON object
02:42 <@adg> i'm writing a blog post about this right now, actually ;)
02:42 < tylergillies> awesome, can't wait to read it
02:42 <@adg> here's an example of using a type assertion to access some
bencoded data, basically the same way json.Decode works:
https://github.com/nf/torrentfix/blob/master/torrentfix.go
02:43 <@adg> (line 32)
02:45 < skelterjohn> i wonder how I can improve on this: func IsNaN(x
float64) bool { return fmt.Sprintf("%v", x) == "NaN" }
02:46 < tylergillies> panic: interface conversion: interface is []interface
{ }, not map[string] interface { }
02:47 <@adg> tylergillies: that's because a JSON array is of type
[]interface{}
02:47 <@adg> (as distinct from a JSON object)
02:51 -!- enherit [~enherit@75.92.111.122] has joined #go-nuts
02:53 -!- rbrewster [~rbrewster@pool-96-255-165-204.washdc.fios.verizon.net] has
joined #go-nuts
02:54 -!- cafesofie [~cafesofie@rnwifi-164-107-93-114.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
02:55 < |Craig|> skelterjohn: One language I used had x!=x when x is Nan
02:55 < skelterjohn> interesting idea
02:55 < |Craig|> I don't know if that works in go
02:58 < rbrewster> x == x when x is NaN.
02:59 < rbrewster> Scratch that, the opposite of what I said.
02:59 < skelterjohn> no - x != x for go
02:59 < skelterjohn> NaN is never equal to anything
03:05 < |Craig|> thats handy
03:06 < temoto> skelterjohn, will you remove the IsNaN function now?  :)
03:07 < skelterjohn> depends how long the name of the variable i'm checking
is ;)
03:09 < temoto> I found a way to put a timeout on socket read/writes:
tcpConn.SetTimeout(sec * 1e9)
03:09 < temoto> produces awkward "resource is temporary unavailable" error,
but works just fine.
03:19 -!- ios_ [~ios@180.191.131.201] has joined #go-nuts
03:20 -!- ios_ [~ios@180.191.131.201] has left #go-nuts []
03:30 -!- toyoshim_ [~toyoshim@ac131134.dynamic.ppp.asahi-net.or.jp] has joined
#go-nuts
03:55 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has joined #go-nuts
03:57 -!- teejae [~teejae@softbank219185095092.bbtec.net] has joined #go-nuts
04:04 -!- jhawk28 [~jhawk28@user-387c58d.cable.mindspring.com] has quit [Ping
timeout: 264 seconds]
04:22 -!- swdunlop [~swdunlop@96.26.45.40] has quit [Ping timeout: 276 seconds]
04:24 -!- swdunlop [~swdunlop@c-24-18-157-143.hsd1.wa.comcast.net] has joined
#go-nuts
04:27 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
04:34 -!- bmizerany [~bmizerany@112.sub-69-99-159.myvzw.com] has quit [Remote host
closed the connection]
04:37 -!- cafesofie [~cafesofie@rnwifi-164-107-93-114.resnet.ohio-state.edu] has
joined #go-nuts
04:46 -!- Scorchin [~Scorchin@host86-145-52-72.range86-145.btcentralplus.com] has
quit [Quit: Scorchin]
04:48 < tylergillies> adg: thanks for the help i got it working nicely
04:48 <@adg> tylergillies: great
04:52 < tylergillies> is there a way to return the type of a variable?
04:53 < KirkMcDonald> tylergillies: The type of a variable is static.
04:55 < tylergillies> if i unmarshall into an interface i don't know what
type some of the values in that interface are before hand
04:57 <@adg> tylergillies: you can use the reflect package to inspect values
04:57 <@adg> tylergillies: ie, reflect.TypeOf
04:57 < taruti> or a type switc
04:57 < taruti> h
04:57 <@adg> tylergillies: but if you know they're one of a few specific
types, use a type switch (i mentioned a link to teh go spec earlier)
04:57 <@adg> ie, switch v := v.(type) { case int: ...  }
04:58 <@adg> tylergillies: this blog post mentions them a little
http://nf.id.au/go-maps
04:59 < tylergillies> adg: thanks
05:01 < tylergillies> switch and select statements in go are awesome
05:16 <@adg> =D
05:29 -!- enherit [~enherit@75.92.111.122] has quit [Ping timeout: 264 seconds]
05:39 -!- gits [~gits@77.94.219.158] has left #go-nuts ["Leaving"]
05:42 < teejae> adg: per your suggestions, have reorg'd the thrift library
structure
05:42 < teejae> adg: https://github.com/teejae/thrift/tree/go_thrift/
05:50 -!- swdunlop [~swdunlop@c-24-18-157-143.hsd1.wa.comcast.net] has quit [Ping
timeout: 255 seconds]
05:50 <@adg> teejae: cool, will take a look
05:51 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-155-186.clienti.tiscali.it] has
joined #go-nuts
05:55 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
05:57 -!- zozoR [~zozoR@56346ed3.rev.stofanet.dk] has joined #go-nuts
06:03 -!- swdunlop [~swdunlop@96.26.45.40] has joined #go-nuts
06:07 -!- mosva [~mosva@unaffiliated/mosva] has joined #go-nuts
06:07 < mosva> Hi nuts!
06:12 < Project_2501> _o/
06:18 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has joined #go-nuts
06:19 -!- unofficialmvp [~dev@94-62-164-227.b.ipv4ilink.net] has left #go-nuts []
06:34 < teejae> adg: you think for go code-generated files, it matters
whether we use tabs/spaces?  seems like for thrift compiler, all other generators
use spaces.
06:35 < exch>
http://www.mprescient.com/journal/2011/1/9/concurrency-in-go-a-call-center-tutorial.html
06:36 <@adg> teejae: some projects have a "gofmt must be a no-op" precommit
hook
06:36 <@adg> teejae: if you want it to look like all other Go code, use tabs
06:36 < teejae> adg: ah true
06:37 -!- wtfness [~dsc@78.101.137.236] has quit [Remote host closed the
connection]
06:47 -!- fabled [~fabled@83.145.235.194] has joined #go-nuts
06:48 -!- foocraft [~dsc@78.101.137.236] has quit [Quit: Leaving]
06:50 -!- eikenberry [~jae@ivanova.zhar.net] has quit [Quit: End of line.]
06:53 -!- watr_ [~watr@66.183.100.58] has joined #go-nuts
07:03 -!- robonobo [~robin@109.130.41.179] has left #go-nuts []
07:03 -!- robonobo [~robin@109.130.41.179] has joined #go-nuts
07:16 -!- lmoura_ [~lauromour@186.212.117.111] has joined #go-nuts
07:17 -!- dforsyth [~dforsyth@c-76-21-40-117.hsd1.ca.comcast.net] has quit [Quit:
Updating Textual - http://www.codeux.com/textual/ — :-)]
07:17 -!- dforsyth [~dforsyth@c-76-21-40-117.hsd1.ca.comcast.net] has joined
#go-nuts
07:19 -!- lmoura [~lauromour@187.59.113.96] has quit [Ping timeout: 250 seconds]
07:30 -!- bmizerany [~bmizerany@c-76-21-40-207.hsd1.ca.comcast.net] has joined
#go-nuts
07:31 -!- adu [~ajr@c-76-23-82-40.hsd1.in.comcast.net] has joined #go-nuts
07:32 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
joined #go-nuts
07:39 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
07:42 -!- zozoR [~zozoR@56346ed3.rev.stofanet.dk] has quit [Remote host closed the
connection]
07:43 -!- zozoR [~zozoR@56346ed3.rev.stofanet.dk] has joined #go-nuts
07:48 -!- krig [kegie@stalin.acc.umu.se] has joined #go-nuts
07:50 -!- robonobo_ [~robin@109.130.189.16] has joined #go-nuts
07:50 -!- robonobo [~robin@109.130.41.179] has quit [Ping timeout: 240 seconds]
08:04 -!- watr_ [~watr@66.183.100.58] has quit [Ping timeout: 240 seconds]
08:14 -!- mosva [~mosva@unaffiliated/mosva] has quit [Quit: mosva]
08:16 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
08:17 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: sudo rm -R /]
08:20 -!- fabled [~fabled@83.145.235.194] has quit [Quit: Ex-Chat]
08:26 -!- Fish [~Fish@exo3753.pck.nerim.net] has quit [Quit: So Long, and Thanks
for All the Fish]
08:26 -!- Fish [~Fish@exo3753.pck.nerim.net] has joined #go-nuts
08:30 -!- fabled [~fabled@mail.fi.jw.org] has joined #go-nuts
08:36 -!- jkakar [~jkakar@93.158.36.53] has joined #go-nuts
08:40 -!- jkakar [~jkakar@93.158.36.53] has quit [Read error: Connection reset by
peer]
08:50 -!- rbrewster [~rbrewster@pool-96-255-165-204.washdc.fios.verizon.net] has
quit [Quit: Leaving]
08:58 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
09:00 -!- robonobo [~robin@109.130.189.16] has quit [Quit: robonobo]
09:02 -!- wrtp [~rog@92.17.62.109] has joined #go-nuts
09:04 -!- adu [~ajr@c-76-23-82-40.hsd1.in.comcast.net] has quit [Quit: adu]
09:06 -!- nettok [~quassel@200.119.185.164] has quit [Ping timeout: 265 seconds]
09:06 -!- robonobo [~robin@109.130.189.16] has joined #go-nuts
09:07 -!- foocraft [~dsc@dyn-86-36-43-92.wv.qatar.cmu.edu] has joined #go-nuts
09:07 < foocraft> http://fpaste.org/OfRm/
09:08 < foocraft> for some reason, I never get a "Hello from thread 2" from
this program
09:09 < jumzi> Hello from thread 1
09:09 < jumzi> wtf?
09:09 < foocraft> hi jumzi, from foocraft
09:10 < foocraft> but yeah, can you spot anything wrong with this?
09:10 < jumzi> Fedora?
09:11 < jumzi> Acutally i have to admitt that i haven't a clue, i tell
myself to start using go all the time but stuff keeps getting inbetween so i sit
here to sniff it abit
09:14 < foocraft> jumzi, use it seriously, and I think it'll pay off really
well.
09:15 < jumzi> Well it isn't ported to either obsd or plan9 yet :'(
09:15 < foocraft> wait, actually, if I set gomaxprocs to 3, in the case
where I have 2 cores, it worked
09:16 < foocraft> jumzi, I tend to think that the plan9 part is utter BS.
Because 6{g,l} are for plan9
09:16 <@adg> foocraft: what happens if you do select{} instead of for{} ?
09:17 < foocraft> adg, it works, even when I set it to 2 hmm
09:18 < jumzi> foocraft: Wah?  It *is* for plan9?
09:18 -!- LeNsTR [~lenstr@unaffiliated/lenstr] has joined #go-nuts
09:18 < foocraft> jumzi,
http://golang.org/doc/go_faq.html#What_kind_of_a_name_is_6g
09:18 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Read error: Operation
timed out]
09:19 <@adg> foocraft: it's because none of the threads yield, as far as the
scheduler is concerned
09:19 <@adg> foocraft: basically you've created an unrealistic pathalogical
case
09:20 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
09:20 < jumzi> foocraft: Yeah, the name comes from plan9s set of compilers,
doesn't mean it works on plan9
09:21 < foocraft> adg, can you elaborate a bit more on that?
09:21 < foocraft> looking at the documentation for select, I get a feeling
for why it worked, but not sure
09:22 <@adg> foocraft: the scheduler is a simple one, but it relies on the
fact that your goroutines are going to perform a channel send or blocking syscall
or some such, something the scheduler can use to know when to switch goroutines
09:23 <@adg> foocraft: so if your program just loops forever printing -
something that no real concurrent program would actually do - the scheduler screws
up and only schedules the one goroutine
09:23 <@adg> select{} is equivalent to for{} except that instead of being a
spin-loop it's a wait-loop
09:23 <@adg> (ie it's waiting for nothing)
09:24 <@adg> it's the standard way to make main() block forever without
wasting cycles
09:26 < foocraft> so select is like sigsuspend, in C. (I think)
09:26 <@adg> select{}
09:26 <@adg> select itself is a whole lot more useful than just that
09:27 < foocraft> I'm trying to get my head around that
09:27 < foocraft> because obviously select{} is one use case
09:28 < foocraft> so in general it's select { code that has send/receive }
09:29 < foocraft> or a switch statement with some send/receive, for that
matter
09:29 < foocraft> but what is special about that one vs.  a normal switch
statement
09:30 < foocraft> or a for { send/receive } statement, as well
09:32 <@adg> select is like a switch statement, but it blocks until one of
its cases is ready to send or receive
09:32 <@adg> this is a very powerful construct
09:32 <@adg> a normal switch statement is just like an if/else
09:33 < foocraft> but wouldn't an if also block if one of its conditionals
has something to do with a chan op?
09:33 <@adg> yes, but it would block on the _first_o ne
09:33 <@adg> one
09:33 < foocraft> ooooh
09:33 <@adg> select{} will choose whichever case is ready
09:33 <@adg> :)
09:33 < foocraft> very powerful construct indeed
09:33 <@adg> commonly you have for { select{ case blah blah } }
09:34 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
09:34 <@adg> so you loop forever sending and receiving messages
09:35 < foocraft> so I suppose select basically spawns a thread for each
chanop
09:35 < foocraft> something similar, I would imagine
09:37 <@adg> it puts its hooks into the scheduler
09:37 <@adg> doesn't spawn any new threads or anything
09:39 < foocraft> I'll look into it, but thanks for making it clear :)
09:40 < foocraft> jumzi, more reason to use go: select statements and
channels
09:40 < foocraft> well and go routines
09:42 < foocraft> using for { select { the simple 2 go routine program } }
forced me to set my gomaxprocs to 3
09:43 -!- kashia__ [~Kashia@port-92-200-125-182.dynamic.qsc.de] has quit [Quit:
This computer has gone to sleep]
09:43 < foocraft> when select {} at the end of the program allowed the
program to run without modification to gomaxprocs
09:45 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
09:50 -!- foocraft [~dsc@dyn-86-36-43-92.wv.qatar.cmu.edu] has quit [Ping timeout:
240 seconds]
09:50 -!- Zoopee [alsbergt@zoopee.org] has quit [Quit: Ejected]
09:51 -!- Zoopee [alsbergt@zoopee.org] has joined #go-nuts
09:57 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Read error: Operation
timed out]
10:03 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
10:03 < wrtp> foocraft: if you used fmt.Println rather than println, then
your program would work
10:04 < wrtp> print and println are intended for debugging only
10:07 -!- photron [~photron@port-92-201-12-254.dynamic.qsc.de] has joined #go-nuts
10:08 -!- ExtraSpice [~XtraSpice@88.118.33.48] has joined #go-nuts
10:12 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: Quit]
10:28 < robonobo> hi
10:29 < robonobo> i'm trying to build gccgo on mac osx in to a specified
prefix, but make errors out because it can't find libgcc
10:29 -!- bmizerany [~bmizerany@c-76-21-40-207.hsd1.ca.comcast.net] has quit
[Remote host closed the connection]
10:29 < robonobo> anyone have an idea what could cause this?
10:32 -!- tensorpudding [~user@99.23.127.179] has quit [Remote host closed the
connection]
10:32 -!- artefon [~thiago@dhcp16.usuarios.dcc.ufmg.br] has joined #go-nuts
10:45 -!- boscop [~boscop@f055147031.adsl.alicedsl.de] has joined #go-nuts
10:48 -!- virtualsue [~chatzilla@nat/cisco/x-ceggddcxkfxztfuc] has joined #go-nuts
10:58 < teejae> robonobo: i've never installed gccgo, but do you have xcode
installed?
10:58 < robonobo> yes
10:58 < robonobo> i've built tons of stuff on this machine
10:59 < teejae> robonobo: sorry, no idea :)
11:01 < robonobo> i'll try again when the east coast wakes up
11:07 -!- virtualsue [~chatzilla@nat/cisco/x-ceggddcxkfxztfuc] has quit [Ping
timeout: 255 seconds]
11:08 -!- andreas_hindborg [~andreas@x1-6-00-1e-2a-29-58-14.k776.webspeed.dk] has
quit [Ping timeout: 265 seconds]
11:09 -!- robonobo [~robin@109.130.189.16] has quit [Quit: robonobo]
11:10 -!- andreas_hindborg [~andreas@x1-6-00-1e-2a-29-58-14.k776.webspeed.dk] has
joined #go-nuts
11:10 -!- robonobo [~robin@109.130.189.16] has joined #go-nuts
11:14 < wrtp> robonobo: i tried and failed to install gccgo on macos.  but
that was ages ago.
11:23 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving]
11:24 -!- niemeyer [~niemeyer@201-40-141-234.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
11:49 -!- teejae [~teejae@softbank219185095092.bbtec.net] has quit [Quit: teejae]
12:01 -!- virtualsue [~chatzilla@nat/cisco/x-ndcfhukyacqdyibq] has joined #go-nuts
12:11 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
12:22 -!- virtualsue [~chatzilla@nat/cisco/x-ndcfhukyacqdyibq] has quit [Ping
timeout: 260 seconds]
12:51 -!- sauerbraten [~sauerbrat@p508CE9B2.dip.t-dialin.net] has joined #go-nuts
12:53 -!- gr0gmint [~quassel@87.60.23.38] has joined #go-nuts
12:59 -!- cafesofie [~cafesofie@rnwifi-164-107-93-114.resnet.ohio-state.edu] has
quit [Remote host closed the connection]
13:07 -!- cane9 [~john@unaffiliated/johnnybuoy] has joined #go-nuts
13:15 -!- toyoshim_ [~toyoshim@ac131134.dynamic.ppp.asahi-net.or.jp] has quit
[Ping timeout: 255 seconds]
13:17 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
13:17 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
13:18 -!- virtualsue [~chatzilla@nat/cisco/x-pipqmhijtnynoowy] has joined #go-nuts
13:21 -!- grouzen [~grouzen@ip23-159.200.109.crimea.com] has quit [Ping timeout:
240 seconds]
13:35 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has quit [Quit:
DarthShrine]
13:46 -!- rlab_ [~Miranda@91.200.158.34] has joined #go-nuts
13:49 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 276 seconds]
13:50 -!- robonobo [~robin@109.130.189.16] has quit [Quit: robonobo]
13:51 -!- artefon [~thiago@dhcp16.usuarios.dcc.ufmg.br] has quit [Quit: bye]
13:57 -!- shvntr [~shvntr@116.26.130.38] has quit [Ping timeout: 260 seconds]
14:01 -!- plainhao [~plainhao@208.75.85.237] has joined #go-nuts
14:15 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
14:16 -!- shvntr [~shvntr@222.50.224.128] has joined #go-nuts
14:18 -!- shvntr [~shvntr@222.50.224.128] has quit [Client Quit]
14:20 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 246
seconds]
14:26 -!- skejoe [~skejoe@188.114.142.162] has quit [Quit: Lost terminal]
14:31 -!- femtoo [~femto@95-89-196-150-dynip.superkabel.de] has joined #go-nuts
14:32 -!- jesmon [~user@static-71-244-114-122.albyny.fios.verizon.net] has joined
#go-nuts
14:33 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
14:35 -!- rlab_ [~Miranda@91.200.158.34] has quit [Ping timeout: 272 seconds]
14:54 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
14:56 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Client Quit]
14:57 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
14:59 < skelterjohn> morning
14:59 < GilJ> afternoon :)
14:59 -!- virtualsue [~chatzilla@nat/cisco/x-pipqmhijtnynoowy] has quit [Ping
timeout: 264 seconds]
15:08 -!- virtualsue [~chatzilla@nat/cisco/x-eqfdhvjzpgsphmgh] has joined #go-nuts
15:11 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
15:13 -!- virtualsue [~chatzilla@nat/cisco/x-eqfdhvjzpgsphmgh] has quit [Ping
timeout: 240 seconds]
15:14 -!- drry [~drry@unaffiliated/drry] has joined #go-nuts
15:27 -!- grouzen [~grouzen@ip23-159.200.109.crimea.com] has joined #go-nuts
15:31 -!- DerHorst [~Horst@e176099245.adsl.alicedsl.de] has joined #go-nuts
15:37 -!- kamaji [~kamaji@cpc2-aztw22-2-0-cust775.aztw.cable.virginmedia.com] has
joined #go-nuts
15:39 -!- enherit [~enherit@75.92.111.122] has joined #go-nuts
15:39 < kamaji> Can I use datafmt to write an arbitrary parser?
15:40 < skelterjohn> what is datafmt?
15:40 < kamaji> i'm not really sure
15:40 < kamaji> that's the problem :p
15:40 < skelterjohn> if it's what scanf uses, no
15:41 < skelterjohn> an arbitrary parser needs to be supplied a grammar of
some sort
15:41 < skelterjohn> where do you see datafmt?
15:42 < skelterjohn> ah, found it
15:42 < skelterjohn> one sec
15:42 -!- robonobo [~robin@109.130.189.16] has joined #go-nuts
15:42 < skelterjohn> i believe that is used for serialization of data
structures
15:42 < skelterjohn> rather than arbitrary concepts
15:42 < kamaji> oh right
15:43 -!- enherit [~enherit@75.92.111.122] has quit [Client Quit]
15:43 < kamaji> Is there something that can take a grammar and give me
tokens?
15:43 < skelterjohn> goyacc :)
15:44 < skelterjohn> what are you interested in doing, by the way?
15:44 < skelterjohn> i might be able to give better advice if i know what
the goal is
15:44 < kamaji> writing a little prompt thingie
15:44 < kamaji> that behaves a bit like a shell at least
15:45 < kamaji> so it will clear on ^L and exit on ^D, stuff like that
15:45 < skelterjohn> you don't need an expressive grammar to mimic a shell
15:45 < skelterjohn> the grammar is very simple
15:45 < kamaji> no but I wanted to have commands
15:45 < kamaji> but if I can just write a grammar it would be easier to add
things
15:45 < skelterjohn> line := <executable> <argument>*
15:45 -!- cane9 [~john@unaffiliated/johnnybuoy] has quit [Quit: Ex-Chat]
15:46 < skelterjohn> would regexps be appropriate?
15:46 < kamaji> right, but if I wanted to start having settings like "a =
foo"
15:46 < skelterjohn> ok - you can do that with regexps
15:46 < kamaji> well it needs to look at it on a character by character
basis
15:46 < kamaji> so the things like ^L will work
15:46 < skelterjohn> that is a different issue
15:46 < kamaji> and it just seems like a state-machine type parser will do
better
15:46 < kamaji> cause it can wait on input and then notify as soon as a
token is matched
15:47 < skelterjohn> state-machines are equivalent to regexps
15:47 < kamaji> but with a regex I'd have to test all the matches each time
a character is received
15:47 < skelterjohn> why not just watch for ^L, ^D until return is hit
15:47 < kamaji> whereas a state machine will traverse as input is received
15:47 < skelterjohn> then throw that thing to the regexp
15:47 < kamaji> seems hacky :P
15:47 < skelterjohn> not to me, it doesn't
15:47 < skelterjohn> there are two distinct phases
15:48 < skelterjohn> typing and running
15:48 < skelterjohn> seems reasonable to have two different things take care
of them
15:48 < kamaji> if you ^L you don't want to lose buffer though
15:48 < kamaji> although yeah
15:48 < kamaji> then that means my way is superdumb
15:48 < skelterjohn> :(
15:48 < kamaji> lol
15:48 < kamaji> good advice~
15:49 < skelterjohn> is that the slashdot '~' or a typo for '!'?
15:49 < kamaji> slashdot ~?
15:49 < kamaji> it's not sarcasm if that's what you mean
15:49 < skelterjohn> it is :)
15:49 < kamaji> not to me~
15:50 < kamaji> It's just a nice little decoration :P
15:50 < skelterjohn> now i'm confused.
15:50 < kamaji> oh sorry
15:50 < kamaji> it's not sarcasm
15:50 < kamaji> to me
15:50 < skelterjohn> haha
15:50 < kamaji> there...  I think we're clear?  :D
15:50 < skelterjohn> yes
15:50 < kamaji> hehehe
15:55 -!- artefon [~thiago@187.59.184.163] has joined #go-nuts
15:55 -!- DerHorst [~Horst@e176099245.adsl.alicedsl.de] has quit [Remote host
closed the connection]
15:58 -!- Venom_X [~pjacobs@75.92.43.21] has joined #go-nuts
16:07 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
quit [Quit: leaving]
16:11 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has joined #go-nuts
16:16 -!- LuitvD [~me@beigetower/luitvd] has joined #go-nuts
16:23 -!- virtualsue [~chatzilla@nat/cisco/x-djbmnddozthzqcde] has joined #go-nuts
16:26 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.]
16:28 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping
timeout: 265 seconds]
16:28 -!- iant [~iant@216.239.45.130] has joined #go-nuts
16:28 -!- mode/#go-nuts [+v iant] by ChanServ
16:33 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
16:40 -!- ronnyy [~quassel@p4FF1C513.dip0.t-ipconnect.de] has joined #go-nuts
16:43 -!- ronnyy [~quassel@p4FF1C513.dip0.t-ipconnect.de] has quit [Remote host
closed the connection]
16:55 -!- TheMue [~TheMue@p5DDF51E8.dip.t-dialin.net] has joined #go-nuts
16:55 -!- cco3-hampster [~conleyo@nat/google/x-mhnhqrwzlrhgtnjp] has joined
#go-nuts
17:00 -!- ymasory [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has joined
#go-nuts
17:03 -!- WonTu [~WonTu@p57B55FAB.dip.t-dialin.net] has joined #go-nuts
17:03 -!- WonTu [~WonTu@p57B55FAB.dip.t-dialin.net] has left #go-nuts []
17:16 < kamaji> can I have a callback inside a struct like this: "Print
func() string"
17:18 < skelterjohn> certainly
17:19 < kamaji> schweet
17:21 -!- daxt [~daxt@112.135.68.25] has joined #go-nuts
17:29 < skelterjohn> though, it won't satisfy an interface with "Print()
string", for instance
17:38 -!- daxt_ [~daxt@112.135.75.38] has joined #go-nuts
17:39 -!- daxt_ [~daxt@112.135.75.38] has quit [Remote host closed the connection]
17:40 -!- daxt [~daxt@112.135.68.25] has quit [Ping timeout: 240 seconds]
17:40 < skelterjohn> if you've got a go builder that will build a projects
dependencies in normal operation, would you expect it to clean that project's
dependencies on a clean step, or just clean that one project without touching its
dependencies?
17:46 < wrtp> skelterjohn: good question...
17:46 < skelterjohn> i am leaning towards cleaning the deps
17:47 < skelterjohn> because cleaning is the opposite of building
17:47 < skelterjohn> and adding -c should undo whatever happened without the
-c
17:47 < wrtp> yeah, but that implies that cleaning a single package could
clean the entire go tree...
17:47 < exch> I often make multi-pkg projects which depend on one another.
I'd hate to have to manually clean each one individually, when a build tool can do
it just as well
17:47 < skelterjohn> which is why i added a -e option: be exclusive
17:48 < skelterjohn> for my build tool, if you just say "gb" or "gb -c", it
will build or clean everything
17:48 < wrtp> maybe -e is the right answer
17:48 < skelterjohn> this only applies when you specify a specific package
on the command line
17:48 < skelterjohn> -e causes it to not try to build (or clean) any
unlisted deps
17:51 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Remote host closed the connection]
17:52 -!- aconran [~aconran-o@adsl-67-119-205-150.dsl.pltn13.pacbell.net] has
joined #go-nuts
17:52 -!- grouzen [~grouzen@ip23-159.200.109.crimea.com] has quit [Ping timeout:
272 seconds]
17:53 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has joined #go-nuts
17:54 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
17:54 -!- daharon [~daharon@173-11-102-86-SFBA.hfc.comcastbusiness.net] has joined
#go-nuts
17:55 -!- fabled [~fabled@mail.fi.jw.org] has quit [Quit: Ex-Chat]
17:58 -!- tvw [~tv@212.79.9.150] has quit [Read error: Connection reset by peer]
18:00 -!- keithcascio [~keithcasc@nat/google/x-yehamvuayscrbrog] has joined
#go-nuts
18:02 -!- femtoo [~femto@95-89-196-150-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
18:03 -!- swdunlop [~swdunlop@96.26.45.40] has quit [Ping timeout: 250 seconds]
18:04 -!- exch [~exch@h78233.upc-h.chello.nl] has quit [Ping timeout: 246 seconds]
18:19 -!- Ccod [~peter@131.91.71.249] has joined #go-nuts
18:22 < Ccod> I think when I tried to edit my .bash_profile I fouled things
up...  I don't have access to many of my terminal commands anymore, not even vim
to edit the file I messed up.  What other ways can I access and edit that file?
18:25 < temoto> /usr/bin/vim
18:25 < temoto> most probably, you messed your PATH variable
18:25 < temoto> Ccod, ^
18:26 < taruti> Has anyone created an API to do async IO (which may be
implemented with go-routines)?
18:26 < Ccod> thx I will give that a shot
18:26 -!- sav [~lsd@jagat.xored.org] has joined #go-nuts
18:26 -!- sav [~lsd@jagat.xored.org] has quit [Excess Flood]
18:27 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-155-186.clienti.tiscali.it] has
quit [Read error: Connection reset by peer]
18:28 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-155-186.clienti.tiscali.it] has
joined #go-nuts
18:29 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
18:32 < taruti> just need to integrate channel based concurrency and IO
18:35 -!- devrim [~Adium@cpe-72-225-239-227.nyc.res.rr.com] has quit [Quit:
Leaving.]
18:39 -!- virtualsue [~chatzilla@nat/cisco/x-djbmnddozthzqcde] has quit [Quit:
ChatZilla 0.9.86 [Firefox 3.5.16/20101130074220]]
18:40 < Ccod> is there a way to edit my $PATH without vim?
18:41 < aiju> PATH=....
18:41 < aiju> you can also use any other editor!
18:41 < aiju> like ED!
18:41 < jumzi> What?
18:41 < jumzi> you can edit $PATH with vim?
18:42 < skelterjohn> vim ~/.bashrc
18:42 < jumzi> Well that wasn't very direct :p
18:42 < aiju> PATH=$(echo $PATH | vi -)
18:43 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-155-186.clienti.tiscali.it] has
quit [Read error: Connection reset by peer]
18:43 < aiju> this one really edits $PATH
18:43 < Ccod> k
18:43 < jumzi> NO
18:43 < aiju> haha
18:43 < aiju> not a good idea
18:43 < jumzi> Ccod: Please check up on enviroment variables
18:44 < jumzi> You'll save allot of headache
18:44 < Ccod> will do thx
18:44 -!- Ccod [~peter@131.91.71.249] has quit [Quit: Ccod]
18:45 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-169-197.clienti.tiscali.it] has
joined #go-nuts
18:45 -!- jrslepak [~jrslepak@rover-204-227.rovernet.mtu.edu] has joined #go-nuts
18:54 < robonobo> hi, 'm trying to build gccgo on mac osx in to a specified
prefix, but make errors out because it can't find libgcc
18:54 < robonobo> anyone know how to fix this?
18:54 < aiju> use 6g
18:54 < taruti> are you building from the top of gcc tree according to gcc
build instructions?
18:54 < taruti> with separate objdir etc
18:55 < robonobo> taruti: i'm not sure what that means
18:55 < robonobo> am i building rom the top directory?
18:55 < jumzi> You could also use 6g for that extra carriage return compile
speed
18:56 < robonobo> jumzi: yes, i know, i have that already built, but i'm
writing a go formula for homebrew,
18:56 < aiju> "go formula"?
18:56 < jumzi> homebrew?
18:57 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-169-197.clienti.tiscali.it] has
quit [Read error: Connection reset by peer]
18:57 < aiju> and why does it need gccgo
18:57 < taruti> robonobo: 1) create an empty directory and cd there, 2) use
/path/to/gcc/source/configure --lots-of-flags, 3) make, 4) make install
18:58 < taruti> robonobo: i.e.  call the gcc configure, not the gccgo one
18:58 < robonobo> homebrew is a pretty new package manager for osx.  it's on
github
18:58 < robonobo> taruti: yeah, i got that far
18:59 < robonobo> it's the -lots-of-flags i'm gaving problems with
19:00 -!- nettok [~quassel@200.119.150.123] has joined #go-nuts
19:01 < taruti> you might want to ask iant if you have a abnormal gcc
configuration
19:01 <+iant> gccgo doesn't support Mac OS yet
19:02 <+iant> it would be great if somebody familiar with Mac OS X sorted
that out
19:02 -!- exch [~exch@h78233.upc-h.chello.nl] has joined #go-nuts
19:03 < aiju> just print a message to use 6g
19:03 -!- daharon_ [~daharon@173-11-102-86-SFBA.hfc.comcastbusiness.net] has
joined #go-nuts
19:05 -!- jrslepak [~jrslepak@rover-204-227.rovernet.mtu.edu] has quit [Quit:
jrslepak]
19:05 -!- daharon [~daharon@173-11-102-86-SFBA.hfc.comcastbusiness.net] has quit
[Ping timeout: 264 seconds]
19:07 -!- markcol [~markcol@74.125.59.1] has joined #go-nuts
19:09 < robonobo> iant: thanks
19:09 <+iant> It's issue 463
19:16 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn]
19:18 < wrtp> taruit: re: async io: the standard interface *is* an interface
to async io
19:19 < taruti> wrtp: yes, but I'd like to have a channel based io interface
where I can send/receive io requests rather than blocking calls
19:19 -!- robonobo [~robin@109.130.189.16] has quit [Quit: robonobo]
19:20 < wrtp> taruti: go func() {n, err := fd.Read(...); c <- n}()
19:20 < wrtp> :-)
19:20 < taruti> wrtp: when adding various Sync():s to that it gets complex
quite fast
19:21 < wrtp> Sync?
19:21 < taruti> syscall.Sync (fsync)
19:21 < taruti> basically "have all outgoing io requests been done and call
Sync"
19:23 < wrtp> i'm not sure i see the problem
19:25 < taruti> one needs to have bookkeeping of the pending calls mainly
19:25 < wrtp> if you're generating requests asynchronously, then there's no
good time to call Sync
19:25 < wrtp> you could just call it every few seconds
19:25 < wrtp> why do you need to call Sync anyway?
19:25 < wrtp> i've never called it ever
19:25 < wrtp> in C or Go
19:26 * taruti has called it lots of times in C
19:26 < wrtp> only from the command line when i'm about to shut down
19:26 < wrtp> syscall.Sync is not fsync BTW
19:27 < taruti> sorry.  Fsync.
19:27 -!- creack [~charme_g@163.5.84.215] has quit [Ping timeout: 272 seconds]
19:28 < taruti> should probably sleep on this
19:29 -!- aconran_ [~aconran-o@adsl-67-119-205-150.dsl.pltn13.pacbell.net] has
joined #go-nuts
19:29 -!- devrim [~Adium@160.79.7.234] has joined #go-nuts
19:30 -!- aconran [~aconran-o@adsl-67-119-205-150.dsl.pltn13.pacbell.net] has quit
[Read error: Operation timed out]
19:34 -!- robonobo [~robin@109.130.189.16] has joined #go-nuts
19:38 -!- illya77 [~illya77@85-74-133-95.pool.ukrtel.net] has joined #go-nuts
19:39 < wrtp> tuaruti: something like the WaitGroup implementation (see
http://codereview.appspot.com/3770045/) would make it quite easy to wait for
pending calls to complete.
19:39 < wrtp> s/tuaruti/taruti/
19:39 < taruti> thanks
19:40 -!- creack [~charme_g@163.5.84.215] has joined #go-nuts
20:05 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
20:07 < wrtp> Namegduf: done!
20:08 < Namegduf> That CR got accepted?
20:08 < wrtp> yup
20:08 < Namegduf> Nice.
20:08 < wrtp> submitted
20:09 -!- markcol [~markcol@74.125.59.1] has quit [Quit: markcol]
20:10 -!- markcol [~markcol@74.125.59.1] has joined #go-nuts
20:11 < wrtp> Namegduf: hg sync; have fun!
20:22 -!- Fish- [~Fish@88.162.170.133] has joined #go-nuts
20:26 -!- binarypie [~binarypie@c-24-6-151-185.hsd1.ca.comcast.net] has joined
#go-nuts
20:32 -!- sauerbraten [~sauerbrat@p508CE9B2.dip.t-dialin.net] has quit [Remote
host closed the connection]
20:33 -!- sauerbraten [~sauerbrat@p508CE9B2.dip.t-dialin.net] has joined #go-nuts
20:33 -!- artefon [~thiago@187.59.184.163] has quit [Read error: Connection reset
by peer]
20:36 -!- xash [~xash@d004026.adsl.hansenet.de] has joined #go-nuts
20:37 -!- illya77 [~illya77@85-74-133-95.pool.ukrtel.net] has quit [Read error:
Connection reset by peer]
20:37 < kamaji> blarg
20:38 < kamaji> how do you read character by character from stdin?
20:38 < aiju> .Read?
20:38 < kamaji> that's bytes
20:38 < aiju> oh yeah
20:38 < kamaji> so it doesn't work for utf8
20:38 < kamaji> bufio has ReadRune but it seems to wait for a newline
20:39 < aiju> unix?
20:39 < kamaji> you mean am I using unix?
20:39 < kamaji> yea
20:39 < aiju> you need to turn off line buffering
20:39 < aiju> if you want it not to read per line
20:40 < kamaji> I thought it was unbuffered?
20:40 < aiju> why should it?
20:42 < kamaji> I dunno...  I was just expecting it to because occam does
20:44 < aiju> why do you want to do this anyway?
20:44 < kamaji> catch control characters
20:44 < kamaji> like tab and ^L
20:44 < aiju> oic
20:44 < aiju> yeah, you need to disable line buffering for that
20:45 < kamaji> but it's so un-csp~
20:45 < aiju> how so?
20:45 < aiju> what does this even has to do with CSP
20:45 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
20:45 < kamaji> well you'd model stdin and stdout as character channels
20:46 < kamaji> and then have a buffer process
20:46 < kamaji> in csp
20:46 < aiju> this is not a Go decision
20:46 < aiju> this is fundamental to UNIX terminals
20:46 < Namegduf> Does CSP require horrendously inefficient design or is
that just an application of it?
20:46 < kamaji> you can turn it off by default
20:46 < Namegduf> I mean...  that sounds like a reasonable place to think
about efficiency
20:47 < kamaji> you can interleave those processes
20:47 < kamaji> it's not necessarily running in parallel
20:47 < kamaji> it's just you design it so it can be split up
20:47 < Namegduf> That doesn't make processing things character by character
fast
20:47 < Namegduf> Which it isn't.
20:48 < aiju> the point of line buffering is making working via a 110 baud
connection more pleasant
20:48 < kamaji> aiju: I mean Go can turn it off by default
20:48 < aiju> kamaji: i don't think Go should do that
20:48 < kamaji> ok
20:48 < Namegduf> That would be slow.
20:48 < aiju> it would interfere too much with the underlying model
20:49 < kamaji> I thought CSP was the underlying model?
20:49 < wrtp> i'm not sure there's a portable way of putting the current tty
into raw mode from Go
20:49 < aiju> no, the model underlying UNIX I/O
20:49 < aiju> stdin/stdout
20:49 < kamaji> oh right
20:49 < Namegduf> CSP-based concurrency is orthagonal to everything else in
Go.
20:49 < wrtp> i may be wrong though
20:50 -!- cafesofie [~cafesofie@dhcp-140-254-204-149.osuwireless.ohio-state.edu]
has joined #go-nuts
20:50 < kamaji> wrtp: so stdin is definitely buffered regardless of whether
bufio is used?
20:50 < aiju> kamaji: bufio is another kind of buffering
20:50 < aiju> bufio is done to avoid tons of kernel syscalls
20:51 < wrtp> kamaji: no.  because the tty might be in raw mode before the
prog is started.  try "stty cbreak; 6.out"
20:51 < aiju> when reading few amounts of characters at once
20:51 -!- ronnyy [~quassel@p4FF1C513.dip0.t-ipconnect.de] has joined #go-nuts
20:51 < aiju> line buffering is done at the terminal to avoid communication
with the computer
20:51 < aiju> (remember that all UNIX terminals still have 110 baud
terminals connected via serial line in mind)
20:52 < Namegduf> The amusing thing there is that it doesn't work for SSH
20:52 < Namegduf> Because the line buffering there is done remotely.
20:53 -!- robonobo [~robin@109.130.189.16] has quit [Quit: robonobo]
20:53 < kamaji> wrtp: oh, that works
20:53 < kamaji> thanks
20:54 < kamaji> aiju: how can a program set its input to be unbuffered then?
20:54 < kamaji> if it's controlled by the terminal
20:55 < kamaji> I know it's possible in C, but I don't really understand :P
20:55 < aiju> kamaji: it sends a certain control sequence
20:55 < aiju> dependent on the terminal
20:55 < aiju> so you should use a library to do it
20:55 < kamaji> oh, by terminal do you mean the os-controlled thingie
20:55 < kamaji> rather than "xterm"?  :P
20:55 < aiju> i mean xterm
20:55 < kamaji> oh :|
20:55 < aiju> termios(3) for C
20:56 < aiju> dunno whether there are Go bindings
20:56 < kamaji> but how does it send a control sequence?  I mean where does
it go?
20:56 < aiju> you simply output it
20:56 -!- pothos_ [~pothos@111-240-165-86.dynamic.hinet.net] has joined #go-nuts
20:56 < kamaji> like to stdout?
20:56 < aiju> there are many control sequences
20:56 < aiju> yeah
20:56 < aiju> console_codes(4) lists 'em
20:56 < kamaji> wouldn't it be possible to inject control sequences to a
program then?
20:56 < aiju> what do you mean?
20:57 < kamaji> well if I did /nick <controlsequence>
20:57 < aiju> usually they start with ESC
20:57 -!- TheMue [~TheMue@p5DDF51E8.dip.t-dialin.net] has quit [Quit: TheMue]
20:57 < Namegduf> If you can cause a program to output arbitrary binary
garbage
20:57 < Namegduf> Then yes, you can cause it to reconfigure the terminal of
the viewing user
20:57 < kamaji> Namegduf: but if I set my nick to that control sequence, it
might pop up in your client?
20:57 < kamaji> if your client didn't check the string
20:58 < Namegduf> No, because the server wouldn't allow it, and if it did my
client would probably not allow it.
20:58 < kamaji> right, bad example
20:58 < kamaji> but some protocol allowing it
20:58 < Namegduf> Whether you could say it would be a better test because
the server won't check that
20:58 < Namegduf> But still I'm sure the client would
20:58 -!- pothos [~pothos@111-240-168-252.dynamic.hinet.net] has quit [Ping
timeout: 260 seconds]
20:58 < kamaji> but if neither checked for arbitrary characters, I could
just screw with people's terminals?
20:58 -!- robonobo [~robin@109.130.189.16] has joined #go-nuts
20:58 < aiju> lol eyah
20:58 < kamaji> oh man that is so cool
20:59 < wrtp> there were some great security holes using this stuff and old
style real text terminals
20:59 < kamaji> I gotta try dat
20:59 < aiju> DOS allows executing programs
20:59 < aiju> look up ANSI bombs
20:59 -!- robonobo [~robin@109.130.189.16] has left #go-nuts []
20:59 < kamaji> haha
20:59 < kamaji> that's so cool
21:00 < aiju> with UNIX terminals it's mostly colours and shit
21:00 < kamaji> right
21:02 -!- Venom_X [~pjacobs@75.92.43.21] has quit [Ping timeout: 272 seconds]
21:03 < kamaji> aw, now I have to write a mini-IRC client to test some of
this
21:03 < kamaji> so much to do
21:04 -!- markcol [~markcol@74.125.59.1] has quit [Quit: markcol]
21:04 -!- markcol [~markcol@74.125.59.1] has joined #go-nuts
21:05 < wrtp> quite a few (most?) people don't view IRC through a
cursor-addressing interface
21:05 < wrtp> and any decent IRC client will filter out ESC chars
21:05 < wrtp> old unix write(1) was fun.
21:06 < aiju> how so?
21:06 < kamaji> especially when nobody else knows about mesg n
21:06 < wrtp> it wrote directly to people's ttys
21:06 < aiju> oh write(1)
21:06 < aiju> i read write(2)
21:06 < kamaji> wait, are you telling me write can send control sequences?
21:06 < aiju> haha
21:06 < kamaji> holy balls
21:06 < wrtp> it certainly could back in 1988...
21:06 -!- cafesofie [~cafesofie@dhcp-140-254-204-149.osuwireless.ohio-state.edu]
has quit [Remote host closed the connection]
21:06 < kamaji> it better still be able to
21:07 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
21:08 < kamaji> awwwwwww
21:08 < kamaji> my dreams...  shattered...
21:09 -!- cafesofie [~cafesofie@dhcp-140-254-204-149.osuwireless.ohio-state.edu]
has joined #go-nuts
21:13 -!- plainhao [~plainhao@208.75.85.237] has quit [Quit: plainhao]
21:15 -!- tvw [~tv@e176000225.adsl.alicedsl.de] has joined #go-nuts
21:17 -!- bmizerany [~bmizerany@208.66.27.62] has joined #go-nuts
21:19 -!- tvw [~tv@e176000225.adsl.alicedsl.de] has quit [Remote host closed the
connection]
21:20 -!- tvw [~tv@e176000225.adsl.alicedsl.de] has joined #go-nuts
21:23 -!- grouzen [~grouzen@ip23-159.200.109.crimea.com] has joined #go-nuts
21:26 -!- sauerbraten [~sauerbrat@p508CE9B2.dip.t-dialin.net] has quit [Remote
host closed the connection]
21:26 < wrtp> kamaji: ttys were out of date 20 years ago
21:27 < aiju> nowadays you use CLOUDS
21:28 -!- fzzbt [~fuzzybyte@77.79.7.8] has quit [Ping timeout: 250 seconds]
21:28 < kamaji> heh
21:28 -!- emjayess [~emjayess@pix1.i29.net] has joined #go-nuts
21:33 -!- ronnyy [~quassel@p4FF1C513.dip0.t-ipconnect.de] has quit [Remote host
closed the connection]
21:35 -!- fzzbt [~fuzzybyte@77.79.7.8] has joined #go-nuts
21:42 -!- iLeNsTR [~lenstr@unaffiliated/lenstr] has quit [Quit: iLeNsTR]
22:00 -!- gr0gmint [~quassel@87.60.23.38] has quit [Remote host closed the
connection]
22:08 -!- photron [~photron@port-92-201-12-254.dynamic.qsc.de] has quit [Ping
timeout: 255 seconds]
22:13 -!- Fish- [~Fish@88.162.170.133] has quit [Quit: So Long, and Thanks for All
the Fish]
22:16 -!- exch [~exch@h78233.upc-h.chello.nl] has quit [Read error: Connection
reset by peer]
22:17 -!- DarthShrine [~angus@pdpc/supporter/student/DarthShrine] has joined
#go-nuts
22:18 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Remote host closed the connection]
22:18 -!- tensorpudding [~user@99.23.127.179] has joined #go-nuts
22:20 -!- jumzi [~jumzi@c-89-233-234-125.cust.bredband2.com] has quit [Read error:
Operation timed out]
22:21 -!- virtualsue [~chatzilla@nat/cisco/x-zivcnsrvgibjppgi] has joined #go-nuts
22:22 -!- exch [~exch@h78233.upc-h.chello.nl] has joined #go-nuts
22:24 -!- jumzi [~jumzi@c-89-233-234-125.cust.bredband2.com] has joined #go-nuts
22:28 -!- dforsyth_ [~dforsyth@bastion.inap.yelpcorp.com] has joined #go-nuts
22:29 -!- gid [~gid@220-253-152-68.VIC.netspace.net.au] has joined #go-nuts
22:34 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
22:41 -!- zozoR [~zozoR@56346ed3.rev.stofanet.dk] has quit [Quit: Morten.  Desu~]
22:41 -!- xash [~xash@d004026.adsl.hansenet.de] has quit [Ping timeout: 276
seconds]
22:45 -!- sxs [~sxs@dslb-188-104-178-198.pools.arcor-ip.net] has joined #go-nuts
22:45 < sxs> hi
22:46 -!- unhygienix [~unhygieni@host86-185-228-150.range86-185.btcentralplus.com]
has joined #go-nuts
22:50 -!- napsy [~luka@88.200.96.18] has quit [Quit: leaving]
22:51 -!- zav [~lsd@189001130056.usr.predialnet.com.br] has joined #go-nuts
22:51 < sxs> i have some consts and a map for printing them as sting:
http://pastebin.com/fetLX23k how can i 'search' a string in the map.  I wanna have
a func (f *Fruite)ToInt(name string) int {} which looks if the value string is in
the map and returns the key.  I only found
http://localhost:6060/doc/effective_go.html#maps to check if a key is present.
22:52 < aiju> sxs: just walk through all elements until it matches …
22:52 < sxs> no other way?  what is if i have 1000 froots?
22:52 < aiju> do you?
22:53 < aiju> in that case you'd need to sort them and use a binary search
22:53 < sxs> no, up to 256.  in real i wanna write a byte code interpreter.
the froot names are the real opcode names ;)
22:53 < sxs> so i will have max 256 'fruits'
22:53 < aiju> and why do you need to get numbers from strings?
22:54 -!- cafesofie [~cafesofie@dhcp-140-254-204-149.osuwireless.ohio-state.edu]
has quit [Remote host closed the connection]
22:54 < sxs> because i wanna have the possibility to translate vice versa
from real byte code in []byte and humanreadable byte code like"iadd 1,2,3\niload
1,2\n..."
22:55 -!- sav [~lsd@jagat.xored.org] has joined #go-nuts
22:55 -!- sav [~lsd@jagat.xored.org] has quit [Excess Flood]
22:55 < aiju> sxs: it's unlikely to be the bottleneck
22:56 < sxs> ok, i'l trust you :)
22:57 < sxs> i thought mybe i missed something in the documentation, so i
ksed.
22:57 < sxs> asked
23:00 < sxs> another question: when i make the map[Fruite]string{} then i
got a compile error, if i omit the , at the end of the last key value line.  why
that?
23:01 < sxs> if i remove the , after "Pinaple" in my paste bin code i got an
error.  allthough there is no more item after that.
23:02 -!- binarypie [~binarypie@c-24-6-151-185.hsd1.ca.comcast.net] has quit [Ping
timeout: 246 seconds]
23:03 -!- toyoshim_ [~toyoshim@ac133116.dynamic.ppp.asahi-net.or.jp] has joined
#go-nuts
23:03 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
23:04 -!- boscop [~boscop@f055147031.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
23:07 -!- toyoshim_ [~toyoshim@ac133116.dynamic.ppp.asahi-net.or.jp] has quit
[Ping timeout: 255 seconds]
23:09 -!- Kashia [~Kashia@port-92-200-125-182.dynamic.qsc.de] has joined #go-nuts
23:12 -!- emjayess [~emjayess@pix1.i29.net] has quit [Quit: Leaving]
23:13 -!- arun [~arun@unaffiliated/sindian] has quit [Ping timeout: 260 seconds]
23:13 -!- creack [~charme_g@163.5.84.215] has quit [Ping timeout: 255 seconds]
23:14 -!- gr0gmint [~quassel@87.60.23.38] has joined #go-nuts
23:14 -!- LuitvD [~me@beigetower/luitvd] has quit [Quit: Leaving]
23:17 -!- skelterjohn [~jasmuth@c-68-45-238-234.hsd1.nj.comcast.net] has joined
#go-nuts
23:20 -!- arun [~arun@unaffiliated/sindian] has joined #go-nuts
23:22 -!- cafesofie [~cafesofie@rnwifi-164-107-92-229.resnet.ohio-state.edu] has
joined #go-nuts
23:22 -!- wrtp [~rog@92.17.62.109] has quit [Quit: wrtp]
23:27 -!- creack [~charme_g@163.5.84.215] has joined #go-nuts
23:28 -!- unhygienix [~unhygieni@host86-185-228-150.range86-185.btcentralplus.com]
has quit [Quit: unhygienix]
23:42 -!- Adys [~Adys@cpc3-chap8-2-0-cust26.aztw.cable.virginmedia.com] has joined
#go-nuts
23:42 -!- Adys [~Adys@cpc3-chap8-2-0-cust26.aztw.cable.virginmedia.com] has quit
[Changing host]
23:42 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
23:51 -!- sxs [~sxs@dslb-188-104-178-198.pools.arcor-ip.net] has quit [Quit: sxs]
23:54 < kamaji> Oh, I found this: https://github.com/kless/go-linoise
23:54 < kamaji> it's basically what I wanted :D
23:55 < kamaji> and there's a terminal wrapper
https://github.com/kless/go-term
23:56 -!- jesmon [~user@static-71-244-114-122.albyny.fios.verizon.net] has quit
[Remote host closed the connection]
23:56 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
23:58 < kamaji> but it doesn't compile ;_;
23:59 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Connection reset by
peer]
--- Log closed Tue Jan 11 00:00:01 2011