Go Language Resources Go, golang, go... NOTE: This page ceased updating in October, 2012

--- Log opened Thu Oct 07 00:00:09 2010
00:02 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
00:02 -!- iant1 [~iant@67.218.105.113] has quit [Quit: Leaving.]
00:02 -!- itrekkie [~itrekkie@ip72-211-128-31.tc.ph.cox.net] has joined #go-nuts
00:03 -!- iant [~iant@67.218.105.113] has joined #go-nuts
00:03 -!- mode/#go-nuts [+v iant] by ChanServ
00:05 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X]
00:07 -!- navigator [~navigator@p54892B26.dip.t-dialin.net] has quit [Ping
timeout: 240 seconds]
00:10 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
00:14 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
00:20 -!- tensorpudding [~user@99.148.202.191] has quit [Read error: Connection
reset by peer]
00:23 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
00:23 -!- itrekkie [~itrekkie@ip72-211-128-31.tc.ph.cox.net] has quit [Quit:
itrekkie]
00:27 -!- Tv [~tv@gige.bur.digisynd.com] has quit [Ping timeout: 276 seconds]
00:41 -!- tensorpudding [~user@99.148.202.191] has joined #go-nuts
00:54 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
00:59 -!- rup [~rupert@deathknight.net] has quit [Read error: Operation timed out]
01:01 -!- rupert_ [~rupert@deathknight.net] has joined #go-nuts
01:04 -!- iant [~iant@67.218.105.113] has quit [Quit: Leaving.]
01:13 < enferex> Hmm, so I get an undefined symbol for "syscall.Clock()" I
assume, my 6g compiler does not support that routine?
01:17 < exch> syscall package mixes windows, osx and other arch functions in
the docs.  Some of them are obviously only available on certain operating systems.
Using syscall is not a very portable solution
01:18 < enferex> exch: true, but im just doing some performance analysis
01:18 < enferex> nothing portable
01:18 < exch> fair enough
01:20 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 240 seconds]
01:21 < enferex> exch: I just need an alternative for geting clock ticks,
Times and CLock from the sycall package do not seem to be supported.  I could use
time.Nanoseconds() but I do not like that for the performance analysis I am trying
to conduct.
01:23 < exch> I am not sure if there is anything else available in the
standard libs
01:24 < enferex> Surly there is somethinf for performance analysis?  And I
am just overlooking it.
01:24 < exch> You can write benchmarks using the testing package
01:24 < exch> Not sure if those offer what you need
01:27 < enferex> ah thanks for your insight
01:35 < exch> Can someone explain to me what is going on here?
http://gist.github.com/614410 particularly why the I64() call in run2() yields the
clean 16 value we previously set, eventhough the buffer is not properly
initialized.  In run1() it is initialized, but the call returns garbage.
01:36 < exch> I understand that it should in both cases return garbage,
because it's indexing uninitialized memory
01:50 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has joined
#go-nuts
02:00 -!- msolo [~msolo@nat/google/x-xaxtujlmctboepps] has quit [Read error:
Operation timed out]
02:05 -!- steveno [~stevenoli@paludis/cheerleader/steveno] has quit [Quit:
steveno]
02:11 -!- steveno [~stevenoli@c-24-131-221-195.hsd1.pa.comcast.net] has joined
#go-nuts
02:11 -!- steveno [~stevenoli@c-24-131-221-195.hsd1.pa.comcast.net] has quit
[Changing host]
02:11 -!- steveno [~stevenoli@paludis/cheerleader/steveno] has joined #go-nuts
02:14 -!- steveno [~stevenoli@paludis/cheerleader/steveno] has quit [Client Quit]
02:28 -!- itrekkie [~itrekkie@ip72-211-128-31.tc.ph.cox.net] has joined #go-nuts
02:33 -!- enherit [~enherit@71-83-188-75.dhcp.lnbh.ca.charter.com] has joined
#go-nuts
02:34 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts
02:34 -!- mode/#go-nuts [+v iant] by ChanServ
02:38 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has quit
[Remote host closed the connection]
02:40 < enferex> I know go supports inline assembly, but I have yet to find
any example for the syntax.
02:42 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Ping
timeout: 252 seconds]
02:42 < exch> enferex: it doesn't.  You can link assembly files into your
program though.  Assembly code is often platform specific.  By allowing inlining,
you counteract portability.
02:42 -!- iant [~iant@216.239.45.130] has joined #go-nuts
02:42 -!- mode/#go-nuts [+v iant] by ChanServ
02:42 < exch> enferex: look at the bytes package in $GOROOT/src/pkg/bytes
for an example
02:43 < enferex> ah ok
02:43 < enferex> thanks
02:43 < enferex> I was grepping around the source tree too
02:43 < exch> 'OFILES = asm_$(GOARCH).$O' in the makefile, links in the
right asm file for the right platform
02:50 -!- b00m_chef [~watr@66.183.100.197] has joined #go-nuts
02:50 -!- slashus2 [~slashus2@74-141-107-118.dhcp.insightbb.com] has joined
#go-nuts
02:58 -!- IRWolfie1 [irwolfie@ircnoob.com] has joined #go-nuts
02:59 -!- yihuang [~yihuang@183.17.161.148] has joined #go-nuts
02:59 -!- yihuang [~yihuang@183.17.161.148] has left #go-nuts []
02:59 -!- KirkMcDo1ald [~Kirk@24.143.227.33] has joined #go-nuts
03:00 -!- KirkMcDonald [~Kirk@python/site-packages/KirkMcDonald] has quit [Remote
host closed the connection]
03:00 -!- IRWolfie- [irwolfie@ircnoob.com] has quit [Ping timeout: 272 seconds]
03:01 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
03:14 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
03:15 -!- itrekkie [~itrekkie@ip72-211-128-31.tc.ph.cox.net] has quit [Quit:
itrekkie]
03:18 -!- tsykoduk [~tsykoduk@184.78.195.79] has quit [Ping timeout: 255 seconds]
03:18 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has joined
#go-nuts
03:18 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has quit
[Client Quit]
03:19 -!- tsykoduk [~tsykoduk@184.78.195.79] has joined #go-nuts
03:21 -!- itrekkie [~itrekkie@ip72-200-114-29.tc.ph.cox.net] has joined #go-nuts
03:23 -!- itrekkie_ [~itrekkie@ip72-200-110-103.tc.ph.cox.net] has joined #go-nuts
03:25 -!- itrekkie [~itrekkie@ip72-200-114-29.tc.ph.cox.net] has quit [Ping
timeout: 265 seconds]
03:27 -!- mode/#go-nuts [+v agl] by ChanServ
03:34 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
03:36 -!- agl [~agl@207-237-83-222.c3-0.nyw-ubr1.nyr-nyw.ny.cable.rcn.com] has
quit [Remote host closed the connection]
03:37 -!- tsykoduk [~tsykoduk@184.78.195.79] has quit [Ping timeout: 264 seconds]
03:44 -!- mode/#go-nuts [-o adg] by ChanServ
03:45 -!- mode/#go-nuts [+v adg] by ChanServ
03:45 -!- adg [~nf@124.169.158.192] has left #go-nuts []
03:45 -!- adg [~nf@124.169.158.192] has joined #go-nuts
03:45 -!- mode/#go-nuts [+o adg] by ChanServ
03:50 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
03:57 -!- itrekkie [~itrekkie@ip72-200-110-103.tc.ph.cox.net] has quit [Ping
timeout: 240 seconds]
03:58 -!- itrekkie [~itrekkie@ip72-200-110-103.tc.ph.cox.net] has joined #go-nuts
03:59 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has quit
[Remote host closed the connection]
03:59 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
04:11 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has quit
[Ping timeout: 252 seconds]
04:16 -!- b00m_chef [~watr@66.183.100.197] has quit [Ping timeout: 240 seconds]
04:31 -!- itrekkie_ [~itrekkie@ip72-200-114-29.tc.ph.cox.net] has joined #go-nuts
04:35 -!- itrekkie [~itrekkie@ip72-200-110-103.tc.ph.cox.net] has quit [Ping
timeout: 276 seconds]
04:40 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has joined #go-nuts
04:44 -!- b00m_chef [~watr@66.183.100.197] has joined #go-nuts
04:44 -!- itrekkie [~itrekkie@ip72-200-114-29.tc.ph.cox.net] has quit [Read error:
Connection reset by peer]
04:44 -!- itrekkie [~itrekkie@ip72-200-114-29.tc.ph.cox.net] has joined #go-nuts
04:45 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has quit [Quit: Morten.  Desu~]
04:46 -!- msolo [~msolo@75-25-136-127.lightspeed.plalca.sbcglobal.net] has joined
#go-nuts
04:50 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 252
seconds]
04:50 -!- itrekkie [~itrekkie@ip72-200-114-29.tc.ph.cox.net] has quit [Ping
timeout: 250 seconds]
04:56 -!- KirkMcDonald [~Kirk@24.143.227.33] has quit [Changing host]
04:56 -!- KirkMcDonald [~Kirk@python/site-packages/KirkMcDonald] has joined
#go-nuts
05:01 -!- scm [scm@d019086.adsl.hansenet.de] has quit [Ping timeout: 265 seconds]
05:02 -!- scm [scm@d071058.adsl.hansenet.de] has joined #go-nuts
05:23 -!- slashus2 [~slashus2@74-141-107-118.dhcp.insightbb.com] has quit [Quit:
slashus2]
05:52 -!- paulzhol [~yuval@bzq-79-181-8-207.red.bezeqint.net] has joined #go-nuts
05:59 -!- ikaros [~ikaros@188.107.214.200] has joined #go-nuts
06:05 -!- ikaros [~ikaros@188.107.214.200] has quit [Quit: Leave the magic to
Houdini]
06:08 -!- ikaros [~ikaros@188.107.214.200] has joined #go-nuts
06:15 -!- b00m_chef [~watr@66.183.100.197] has quit [Ping timeout: 276 seconds]
06:23 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
06:24 -!- mrw [~mrw@ip72-197-26-205.sd.sd.cox.net] has joined #go-nuts
06:25 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:d94:51b7:61d3:b19f] has joined
#go-nuts
06:26 < Gertm> I'm trying to figure out how to use container/vector.  Does
anyone have an example on how to use that?
06:32 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
06:36 -!- mrw [~mrw@ip72-197-26-205.sd.sd.cox.net] has quit [Quit: Colloquy for
iPhone - http://colloquy.mobi]
06:49 < vsmatck> Gertm: What I often do is look at the pkg source directory
for a _test.go file.
06:49 < Gertm> ah, that's a good idea, lemme try that
06:51 < Gertm> thanks vsmatck, this is indeed very helpful.  I never thought
of that because the test files aren't listed with the package source files in the
docs
06:57 -!- ucasano [~ucasano@95.231.79.71] has joined #go-nuts
07:00 * vsmatck high fives Gertm.
07:00 < uriel> adg: silly idea, but just thought that maybe instead of
deleting completed items from the roadmap, maybe you could liste them as completed
somehow (add "(completed)" after them, or put them in a separate list)
07:01 < KirkMcDonald> <s>
07:01 < uriel> adg: that way when people take another look at the roadmap,
they know what has been done, instead of wondering if the item has been dropped
from the roadmap for other reasons
07:04 < enferex> Are there any good resources currently in go for peasuring
clock cycles for routines?
07:04 -!- wjlroe [~will@78-86-14-131.zone2.bethere.co.uk] has joined #go-nuts
07:06 < enferex> the benchmark.go in go/src/testing just uses Nanoseconds,
but that doesnt really count cycles.
07:09 -!- paulzhol [~yuval@bzq-79-181-8-207.red.bezeqint.net] has quit [Remote
host closed the connection]
07:10 -!- photron [~photron@port-92-201-30-121.dynamic.qsc.de] has joined #go-nuts
07:12 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
07:20 < msolo> do you need cycle-accuracy?
07:20 < plexdev> http://is.gd/fPcgH by [Russ Cox] in go/ -- A+C: Graham
Miller (individual CLA)
07:20 < plexdev> http://is.gd/fPcgM by [Graham Miller] in
go/src/pkg/runtime/ -- runtime: faster strequal, memequal
07:21 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
07:22 < enferex> msolo: that would be ideal
07:23 < msolo> well, you might be able to hook up some assembly to read the
TSC
07:23 < enferex> that was my plan
07:23 < enferex> but Aside from doing makefile stuff, i didnt see an inline
method for inserting asm directly into the go source.
07:24 < msolo> not that i'm trying to stop you, i'm just trying to
understand what requires that level of accuracy
07:24 -!- mikeg [~michael@ip68-110-226-15.dc.dc.cox.net] has quit [Ping timeout:
252 seconds]
07:24 < msolo> i don't know about inlining, but you can slip something into
the runtime package
07:24 < taruti> enferex: one can call functions written in assembly
07:26 < enferex> taruti: Ok, ill have to investigate that more
07:26 < enferex> I was looking more for an inline method instead
07:26 < taruti> why?
07:26 < enferex> because I know how to do it that way ;-)
07:27 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
07:27 < taruti> the sources have plenty of examples of functions written in
either C or asm
07:27 -!- mikeg [~michael@ip68-110-226-15.dc.dc.cox.net] has joined #go-nuts
07:28 < taruti> just declare them in the go source without the body: "func
foo() int"
07:30 < enferex> thx
07:30 < enferex> ill poke around some more
07:37 < plexdev> http://is.gd/fPdk4 by [Russ Cox] in go/src/cmd/gc/ -- gc:
fix error for 1 <- "foo"
07:37 -!- mumbow [~mumboww@c-98-207-108-218.hsd1.ca.comcast.net] has quit [Ping
timeout: 272 seconds]
07:40 -!- wrtp [~rog@92.17.67.123] has joined #go-nuts
07:40 -!- msolo [~msolo@75-25-136-127.lightspeed.plalca.sbcglobal.net] has quit
[Quit: msolo]
07:43 < enferex> taruti: Thanks!  just looked at a few makefiles and such!
07:46 -!- enherit [~enherit@71-83-188-75.dhcp.lnbh.ca.charter.com] has quit [Ping
timeout: 276 seconds]
07:47 -!- enherit [~enherit@71-83-188-75.dhcp.lnbh.ca.charter.com] has joined
#go-nuts
07:52 < enferex> So I have a .c file and compiled it with 6c.  I have a
resulting .6 object file.  However, it is still undefined in my main package at
link time.  The main package file has the declaration.
07:53 -!- ExtraSpice [~XtraSpice@88.118.34.223] has joined #go-nuts
07:53 < wrtp> enferex: are you trying to link c with go?
07:53 < enferex> yep
07:53 < taruti> enferex: does the function have a correct name?
07:53 -!- sacho [~sacho@79-100-50-200.btc-net.bg] has quit [Ping timeout: 240
seconds]
07:53 < enferex> yep identical prototype
07:54 < taruti> enferex: with package name prepended?
07:54 < enferex> no?
07:54 < enferex> Do I have to define a package for the .c file?
07:55 < taruti> void ·memcpy(char *a, char *b, int len) { ...  }
07:55 < taruti> note the middle dot before the function name
07:56 < enferex> ? so in my source .c file I basically have: int
test_func(void) {return 9;}
07:56 < enferex> I comple that fine with 6c and get mysource.6
07:57 < enferex> in my .go file, I declare: func test_func() int;
07:59 -!- mikeg [~michael@ip68-110-226-15.dc.dc.cox.net] has quit [Ping timeout:
264 seconds]
07:59 < taruti> int ·test_func(void) {return 9;}
07:59 < taruti> (do you see the unicode middle dot?)
07:59 < enferex> no I do not
08:00 < enferex> i see a '?'
08:00 < enferex> irssi didnt pick it up
08:00 < enferex> U+00B7
08:00 < taruti> http://bitbucket.org/taruti/go-extra/src/tip/fuse/helpers.c
08:00 < enferex> oh thanks :-)
08:04 < enferex> now when I link, I am getting "undefined main.test_func"
08:05 < taruti> hmm.  let me create a simple showcase
08:08 < enferex> no worries, ill need to get back to this later tonight
08:10 < wrtp> enferex: you need a utf-8 aware text editor
08:10 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has joined
#go-nuts
08:11 -!- mikeg [~michael@ip68-110-226-15.dc.dc.cox.net] has joined #go-nuts
08:12 < enferex> wrtp: I added the character
08:12 -!- wjlroe [~will@78-86-14-131.zone2.bethere.co.uk] has quit [Quit: Computer
has gone to sleep]
08:12 < enferex> and ran 6c on the: int _middledot_ test_func(void) { return
9; }
08:13 < enferex> compiled it fine
08:13 < enferex> i need to go , I should bb later tonight
08:13 < enferex> thanks so much for all the info
08:14 < enferex> im screen'd so I should get your reply when I ssh back to
this box
08:15 -!- mikeg [~michael@ip68-110-226-15.dc.dc.cox.net] has quit [Ping timeout:
265 seconds]
08:21 -!- mikeg [~michael@ip68-110-226-15.dc.dc.cox.net] has joined #go-nuts
08:22 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 264 seconds]
08:28 -!- lmoura [~lauromour@186.212.114.106] has quit [Ping timeout: 240 seconds]
08:35 -!- Fish9 [~Fish@86.65.182.207] has quit [Remote host closed the connection]
08:41 -!- lmoura [~lauromour@187.59.120.237] has joined #go-nuts
08:42 -!- foolcraft [~dsc@86.36.49.1] has joined #go-nuts
08:42 < foolcraft> hey all
08:42 < foolcraft> just curious, can I write a device driver in Go?
08:42 < foolcraft> (It seems as such a highlevel language)
08:47 -!- Fish9 [~Fish@86.65.182.207] has joined #go-nuts
08:48 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:d94:51b7:61d3:b19f] has quit
[Ping timeout: 272 seconds]
08:52 -!- photron [~photron@port-92-201-30-121.dynamic.qsc.de] has quit [Quit:
Leaving]
08:52 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:d94:51b7:61d3:b19f] has joined
#go-nuts
08:54 < plexdev> http://is.gd/fPiKj by [Russ Cox] in go/src/cmd/gc/ -- gc:
elide dead code
08:54 < plexdev> http://is.gd/fPiKN by [Russ Cox] in go/src/cmd/gc/ -- gc:
better error for method non-call
08:55 < plexdev> http://is.gd/fPiLu by [Graham Miller] in go/misc/cgo/life/
-- life: fix for new slice rules
08:56 -!- wjlroe [~will@212.169.34.114] has joined #go-nuts
08:57 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:d94:51b7:61d3:b19f] has quit
[Ping timeout: 276 seconds]
08:57 -!- photron [~photron@port-92-201-30-121.dynamic.qsc.de] has joined #go-nuts
08:58 -!- foolcraft [~dsc@86.36.49.1] has quit [Quit: leaving]
08:59 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
joined #go-nuts
09:04 -!- wjlroe [~will@212.169.34.114] has quit [Ping timeout: 264 seconds]
09:05 -!- wjlroe [~will@212.169.34.114] has joined #go-nuts
09:07 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:d94:51b7:61d3:b19f] has joined
#go-nuts
09:12 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
09:20 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
09:22 -!- virtualsue [~chatzilla@nat/cisco/x-qoqkfoukmgrkzyns] has joined #go-nuts
09:27 < plexdev> http://is.gd/fPkX1 by [Luuk van Dijk] in 4 subdirs of
go/src/cmd/ -- [568]a: precise linenumbers for statements.
09:31 -!- jmettraux [~jmettraux@211.19.55.177] has quit [Remote host closed the
connection]
09:38 -!- welterde [welterde@thinkbase.srv.welterde.de] has quit [Excess Flood]
09:52 -!- welterde [welterde@thinkbase.srv.welterde.de] has joined #go-nuts
09:56 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
10:00 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-177-190.clienti.tiscali.it] has
joined #go-nuts
10:09 -!- ikaros [~ikaros@188.107.214.200] has quit [Quit: Leave the magic to
Houdini]
10:35 -!- mumbow [~mumboww@c-98-207-108-218.hsd1.ca.comcast.net] has joined
#go-nuts
10:44 < plexdev> http://is.gd/fPqDF by [Russ Cox] in go/src/cmd/gc/ -- gc:
maybe the code is only mostly dead
10:44 < plexdev> http://is.gd/fPqDO by [Russ Cox] in
go/src/pkg/runtime/amd64/ -- runtime: fix argument dump in traceback
10:44 < plexdev> http://is.gd/fPqEa by [Russ Cox] in go/src/pkg/net/ -- net:
allow _ in names
10:45 -!- dju [dju@fsf/member/dju] has quit [Quit: Quitte]
10:50 -!- virtualsue [~chatzilla@nat/cisco/x-qoqkfoukmgrkzyns] has quit [Ping
timeout: 252 seconds]
10:52 -!- ucasano [~ucasano@95.231.79.71] has quit [Ping timeout: 276 seconds]
10:58 -!- yihuang [~yihuang@183.17.149.216] has joined #go-nuts
10:59 -!- fabled [~fabled@xdsl-83-150-94-237.nebulazone.fi] has quit [Ping
timeout: 245 seconds]
11:00 -!- fabled [~fabled@83.145.235.193] has joined #go-nuts
11:01 < plexdev> http://is.gd/fPs04 by [Russ Cox] in
go/src/pkg/runtime/tiny/ -- runtime: fix tiny build
11:04 -!- virtualsue [~chatzilla@nat/cisco/x-frtjrmbkghfcywvd] has joined #go-nuts
11:05 < enferex> back
11:11 < enferex> p Atan2 *
11:11 < enferex> wrong term :-)
11:21 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 240 seconds]
11:21 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
11:27 -!- jmettraux [~jmettraux@PPPbm5391.kanagawa-ip.dti.ne.jp] has joined
#go-nuts
11:31 -!- sacho [~sacho@194.141.26.53] has joined #go-nuts
11:38 < jnwhiteh> if I have a [4]byte and want to 'cast' that to a numeric
type (uint32 in this case), I assume I have to use the unsafe package to do this.
Anyone have any pointers on how I would accomplish that?
11:41 < taruti> jnwhiteh: just take the address of the first member and cast
that as unsafe.Pointer, then cast that unsafe.Pointer to uint32* etc
11:41 < jnwhiteh> okay, I'll give that a try
11:42 < enferex> taruti: Just went back to hackin on my c linkage to go
11:43 < jnwhiteh> if I have a [4]byte and want to 'cast' that to a numeric
type (uint32 in this case), I assume I have to use the unsafe package to do this.
Anyone have any pointers on how I would accomplish that?
11:43 < jnwhiteh> err sorry about htat
11:45 < wrtp> jnwhiteh: DON'T USE UNSAFE
11:45 < wrtp> :-)
11:45 < wrtp> use encoding/binary
11:45 < jnwhiteh> okay, I'll just not build this application then =)
11:45 < jnwhiteh> hrm
11:45 < jnwhiteh> had no idea that package existed, thank you!
11:46 < bortzmeyer> jnwhiteh: I strongly agree with wrtp
11:46 < wrtp> binary.LittleEndian.Uint32(data)
11:46 < wrtp> or bigendian if you prefer
11:47 < wrtp> you should almost never use unsafe
11:47 < jnwhiteh> indeed
11:47 < bortzmeyer> jnwhiteh: you can get real examples in
http://github.com/bortzmeyer/grong (a DNS server, so it has to handle binary)
11:53 < jnwhiteh> bortzmeyer: thanks for the examples.
11:53 < jnwhiteh> In the broader scheme of things I need to read binary data
from disk into a struct
11:53 < jnwhiteh> it seems I should be able to do this using
encoding/binary, right?
11:57 -!- KirkMcDonald [~Kirk@python/site-packages/KirkMcDonald] has quit [Ping
timeout: 240 seconds]
11:57 < wrtp> jnwhiteh: yes
11:57 < jnwhiteh> perfect, got it working
11:57 < wrtp> "Read reads structured binary data from r into data.  Data
must be a pointer to a fixed-size value or a slice of fixed-size values.  A
fixed-size value is either a fixed-size arithmetic type (int8, uint8, int16,
float32, complex64, ...) or an array or struct containing only fixed-size values."
11:58 < jnwhiteh> super easy too =)
12:01 -!- sacho [~sacho@194.141.26.53] has quit [Read error: Operation timed out]
12:01 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 265
seconds]
12:03 < plexdev> http://is.gd/fPwq2 by [Russ Cox] in 2 subdirs of
go/src/cmd/ -- 5l, 8l: dregs
12:04 < wrtp> cool
12:05 -!- KirkMcDonald [~Kirk@24.143.227.33] has joined #go-nuts
12:05 -!- KirkMcDonald [~Kirk@24.143.227.33] has quit [Changing host]
12:05 -!- KirkMcDonald [~Kirk@python/site-packages/KirkMcDonald] has joined
#go-nuts
12:08 < enferex> so my foreign c function is compiled with 6c, I have a
declaration .go file compiled with its own package name.  And that compiles fine.
My main package imports this package, uses the foreign C function declared in that
package.  The main package compiles fime, but does not link properly "undefined
routine" And the C implmentation has the unicode middle dot....
12:09 < taruti> are you sure you are linking things properly?
12:11 < enferex> I was thinking so
12:11 < enferex> 6l my_main.6 and that imports "./my_foreign_function"
12:14 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
12:14 -!- taruti [taruti@aoi.yi.org] has quit [Quit: Reconnecting]
12:14 -!- taruti [taruti@ultra.violetti.org] has joined #go-nuts
12:15 < enferex> taruti: Ill have to look more into this tomorrow, im not
feeling well
12:15 < taruti> ok
12:15 < enferex> thanks so much for your help though
12:21 -!- yihuang [~yihuang@183.17.149.216] has left #go-nuts []
12:38 -!- atsampson [~ats@94-194-126-16.zone8.bethere.co.uk] has quit [Ping
timeout: 276 seconds]
12:38 -!- atsampson [~ats@94-194-126-16.zone8.bethere.co.uk] has joined #go-nuts
12:39 -!- cenuij [~cenuij@93.26.136.97] has joined #go-nuts
12:39 -!- cenuij [~cenuij@93.26.136.97] has quit [Changing host]
12:39 -!- cenuij [~cenuij@base/student/cenuij] has joined #go-nuts
12:46 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has joined
#go-nuts
12:53 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
12:56 -!- ucasano [~ucasano@host153-182-static.227-95-b.business.telecomitalia.it]
has joined #go-nuts
12:59 -!- mduft [~mduft@gentoo/developer/mduft] has quit [Remote host closed the
connection]
12:59 -!- mduft [~mduft@gentoo/developer/mduft] has joined #go-nuts
13:03 -!- skejoe [~skejoe@188.114.142.231] has joined #go-nuts
13:10 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has joined #go-nuts
13:12 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 240 seconds]
13:18 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
13:18 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
13:30 -!- kanru [~kanru@218-161-121-217.dynamic.hinet.net] has joined #go-nuts
13:31 -!- kanru [~kanru@218-161-121-217.dynamic.hinet.net] has quit [Client Quit]
13:31 -!- kanru [~kanru@218-161-121-217.dynamic.hinet.net] has joined #go-nuts
13:44 -!- tsykoduk [~tsykoduk@184.78.195.79] has joined #go-nuts
14:03 -!- kanru [~kanru@218-161-121-217.dynamic.hinet.net] has quit [Ping timeout:
265 seconds]
14:06 -!- kanru [~kanru@218-161-121-217.dynamic.hinet.net] has joined #go-nuts
14:06 -!- tsykoduk [~tsykoduk@184.78.195.79] has quit [Ping timeout: 252 seconds]
14:06 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
14:08 -!- tsykoduk [~tsykoduk@184.78.195.79] has joined #go-nuts
14:11 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
14:12 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
14:18 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
14:20 < plexdev> http://is.gd/fPHPs by [Anthony Martin] in go/src/pkg/big/
-- big: fix panic and round correctly in Rat.FloatString
14:28 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has quit [Ping timeout: 240
seconds]
14:38 -!- kanru [~kanru@218-161-121-217.dynamic.hinet.net] has quit [Ping timeout:
276 seconds]
14:41 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has joined #go-nuts
14:59 -!- sacho [~sacho@79-100-50-200.btc-net.bg] has joined #go-nuts
15:07 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
15:12 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
15:18 -!- jmettraux [~jmettraux@PPPbm5391.kanagawa-ip.dti.ne.jp] has quit [Remote
host closed the connection]
15:47 < uriel> adg: I was watching the original Go presentation by rob, and
while it has aged fairly well it made me think of something
15:48 < uriel> adg: it would be really nice if we could have a 'State of the
Gopher' kind of tech talk, that covered all the new stuff and what has changed
over the last year
15:49 < uriel> right now, if somebody watches the original talk, they can
get a somewhat miguided impression about a few things, and it is quite a bit of
work to dig through mailing lists and so on to find out what has changed in
various fronts
15:50 < uriel> also, I know quite a few people that when Go was released
checked it out, thought 'this is cool, but it is an experiment and clearly it is
not quite ready yet'
15:50 < uriel> it would be nice to have something to point them to as a
refresher that covers the current status and so on
15:54 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has quit [Quit: Coyote finally
caught me]
15:54 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has joined #go-nuts
15:55 -!- kanru [~kanru@118-168-235-106.dynamic.hinet.net] has joined #go-nuts
15:55 -!- petrux [~petrux@host16-224-static.53-82-b.business.telecomitalia.it] has
quit [Quit: leaving]
16:01 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
16:07 -!- ikaros [~ikaros@188.107.214.200] has joined #go-nuts
16:10 -!- awidegreen [~quassel@62.176.237.78] has joined #go-nuts
16:13 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 240 seconds]
16:14 -!- kanru [~kanru@118-168-235-106.dynamic.hinet.net] has quit [Ping timeout:
260 seconds]
16:14 -!- skejoe [~skejoe@188.114.142.231] has quit [Quit: leaving]
16:19 -!- MaksimBurnin [~max@44.188-224-87.telenet.ru] has joined #go-nuts
16:19 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X]
16:29 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
16:31 -!- ficoos [~saggi@109-186-93-130.bb.netvision.net.il] has joined #go-nuts
16:32 < ficoos> hi, I keep getting "./main.go:3: syntax error: unexpected :,
expecting }" on the default sample.  It crashes on import "fmt".
16:33 -!- zippity [5ab4c407@gateway/web/freenode/ip.90.180.196.7] has joined
#go-nuts
16:33 < Soultaker> ficoos: can you paste your code somewhere?
16:36 -!- ficoos [~saggi@109-186-93-130.bb.netvision.net.il] has quit [Remote host
closed the connection]
16:36 -!- ficoos [~saggi@109-186-93-130.bb.netvision.net.il] has joined #go-nuts
16:38 < ficoos> hi, I keep getting "./main.go:3: syntax error: unexpected :,
expecting }" on the default sample.  It crashes on import "fmt".
16:39 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
16:41 -!- eikenberry [~jae@ivanova.zhar.net] has joined #go-nuts
16:42 < exch> ficoos: as Soultaker said, can you paste tour code somewhere?
We can't help you if we can't see what you wrote.
16:42 < exch> s/tour/your/
16:42 < ficoos> exch: it is the example for the main page
16:43 < exch> the 'hello world' example?
16:43 < ficoos> exch: yap
16:44 < nsf> ficoos: what's your version of the compiler, what OS?
16:44 < ficoos> 8g version 5099 linux
16:44 < ficoos> 386
16:44 < nsf> are you sure that the source file you're trying to compile is
encoded in utf-8?
16:45 < nsf> very strange error on a such a simple file
16:45 < nsf> because there are no ','
16:45 < ficoos> nsf: it was the first thing I checked
16:45 < nsf> only in the hello world string itself
16:46 < ficoos> nsf: I also have only pure ascii in it
16:46 < nsf> i see, so it's not the example from the web site
16:46 < nsf> because you've modified it
16:46 < nsf> paste it somewhere please :)
16:47 < ficoos> It was, but when it failed I tried minimizing it
16:47 < exch> there's not a whole lot to minimize on that one :)
16:47 < nsf> just copy & paste it
16:47 < ficoos> this also fails `package main;import "fmt"`
16:47 < ficoos> nsf: as the whole source code
16:47 < nsf> hm..
16:48 < ficoos> I think something get screwed up on import
16:48 < exch> weird
16:48 < nsf> well, maybe error tells us that there is something wrong in the
archive file
16:48 < nsf> version mismatch maybe
16:49 < anticw> do a clean rebuild & reinstall
16:49 < anticw> check paths
16:49 < anticw> certainly that should work
16:49 * nsf hates gc's error messages
16:49 < anticw> nsf: they're getting better slowly
16:49 < ficoos> I double checked the paths
16:50 < nsf> ficoos: you can also try the hello world without 'fmt'
16:50 < nsf> package main; func main() { println("Hello, world"); }
16:50 < nsf> if it works
16:51 < nsf> then definitely something is wrong with the fmt.a
16:51 < ficoos> worked without fmt
16:51 < ficoos> I did 8g -d
16:51 < ficoos> http://pastebin.com/5j6qVKKM
16:52 < nsf> $GOROOT/pkg/linux_386/fmt.a
16:52 < nsf> you can check this file with a text editor
16:52 < nsf> it contains Go-like code at the beginning
16:53 < nsf> which describes types and funcs from that module
16:53 < nsf> apparently something is wrong with it
16:54 < ficoos> nsf: it has !<arch> then __.SYMDEF and a bunch of
numbers
16:54 < nsf> well, it's the beginning
16:54 < nsf> search for "import"
16:54 < nsf> oh wait
16:54 < nsf> no
16:54 < nsf> for '$$'
16:55 < nsf> or just upload it somewhere :D
16:55 < ficoos> found it
16:55 < nsf> I'll take a look
16:55 < nsf> actually I have a parser that parses these "headers"
16:56 < nsf> so, maybe it will give me a hint
16:57 < ficoos> http://dl.dropbox.com/u/926655/fmt.a
16:57 < nsf> I think you have a version mismatch
16:57 < nsf> but let's see
16:57 -!- Fish [~Fish@9fans.fr] has joined #go-nuts
16:58 < nsf> I'll try to import it on my compiler, sec
16:58 < nickaugust> how do you set an element of a *reflect.SliceValue??  i
can return the value of the element with Elem()...  and theres func(v *SliceValue)
SetValue(x Value) which "sets v to the value of x" but I dont see how I can
specify a particular element ie index[1].
16:58 < nickaugust> so I try getting a sub-slice with a single element
something like index.Slice(0, 0).SetValue(foo) but that panics:
16:58 < nickaugust> panic: interface conversion: reflect.Value is
*reflect.StructValue, not *reflect.SliceValue
16:58 -!- wrtp [~rog@92.17.67.123] has quit [Quit: wrtp]
16:59 < nsf> ficoos: works on my compiler
16:59 -!- wrtp [~rog@92.17.67.123] has joined #go-nuts
16:59 < nickaugust> but its a slice of structs...  hmmm im missing something
here...  code:
16:59 < nickaugust> http://sprunge.us/WDGK
16:59 < nsf> ficoos: so..  just update the Go compiler to the latest release
16:59 < ficoos> nsf: I just did `hg pull` like the getting started guid says
17:00 < nsf> you need to do hg update -r 'release' also
17:00 < ficoos> I did, `0 files updated, 0 files merged, 0 files removed, 0
files unresolved`
17:00 < nsf> [nsf @ ~]$ 8g -V
17:00 < nsf> 8g version 6432 release release.2010-09-29
17:00 < nsf> your -V should say this
17:00 < nsf> but it shows older version
17:00 <+iant> nickaugust: that does seem like a deficiency
17:01 -!- wrtp [~rog@92.17.67.123] has quit [Client Quit]
17:01 < nsf> maybe you have an older compiler somewhere in your PATH
17:01 < nsf> and as a result
17:01 < nsf> there is a versiom mismatch
17:01 < nsf> between a lib and a compiler
17:01 < nsf> btw, it's a common mistake for some reason
17:01 < nickaugust> iant: so im not going crazy?  :)
17:01 < ficoos> grrr which 8g showed I had one lying around
17:02 <+iant> hmmm, actually, I think using Elem might work
17:02 < nsf> ficoos | 8g version 5099 linux
17:02 < nsf> you told me this
17:02 <+iant> use Elem to get a Value, and set that Value
17:02 <+iant> that might actually change the value in the slice
17:02 < nsf> 5099 doesn't look like the latest release
17:03 < ficoos> nsf: yea, as I sayed I had an old hg lying around sowhere
else in my PATH, which showed me it was taking the wrong one
17:04 < nsf> well, was that the problem?
17:04 < ficoos> nsf: yea, sorry for all the trouble.
17:05 < nsf> np
17:10 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
17:12 < skelterjohn> just did an "hg pull -u", and when i finished
installing the new version, it has a message about debuggers
17:13 < skelterjohn> is this new?
17:13 < skelterjohn> and is there some convenient documentation on these
debuggers?
17:14 -!- markcol [~markcol@74.125.59.1] has joined #go-nuts
17:22 -!- zippity [5ab4c407@gateway/web/freenode/ip.90.180.196.7] has quit [Quit:
Page closed]
17:25 < nickaugust> iant: ok index.Elem(i).SetValue(model) doesnt panic..
and the returned slice has the correct Len() but the struct fields seem to be
empty...  just checking for bugs elsewhere...
17:27 -!- virtualsue [~chatzilla@nat/cisco/x-frtjrmbkghfcywvd] has quit [Ping
timeout: 255 seconds]
17:27 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 240 seconds]
17:30 -!- wjlroe [~will@212.169.34.114] has quit [Ping timeout: 272 seconds]
17:34 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 240 seconds]
17:35 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has joined #go-nuts
17:39 -!- virtualsue [~chatzilla@host81-139-116-4.in-addr.btopenworld.com] has
joined #go-nuts
17:41 -!- napsy [~luka@88.200.96.18] has joined #go-nuts
17:41 -!- ucasano [~ucasano@host153-182-static.227-95-b.business.telecomitalia.it]
has quit [Quit: ucasano]
17:50 < skelterjohn> huh - Make.amd64 disappeared from src...
17:52 -!- deso [~deso@x0561a.wh30.tu-dresden.de] has joined #go-nuts
17:54 < nickaugust> Makefile:1: /home/nick/src/go/src/Make.386: No such file
or directory
17:55 < nickaugust> hmmm
17:57 < EthanG> yeah I was surprised when all that disapeared & left my p9p
equivalents.  I hadn't used them in weeks & I looked at the source thinking "what
are all those rc files doing there?
18:01 < nickaugust> skelterjohn: just using Make.inc instead seems to work
18:02 < skelterjohn> yes
18:02 < skelterjohn> but now all my makefiles are broken :'(
18:02 < skelterjohn> temporarily, anyway
18:03 < nickaugust> awk :)
18:03 < skelterjohn> that seems harder than just editing the files
18:06 -!- djm [~djm@paludis/slacker/djm] has left #go-nuts ["dywypi?"]
18:13 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
18:18 < nickaugust> iant: yes reflect.SliceValue.Elem(i).SetValue() works as
expected.  should be more explicit in the docs though
18:18 < nickaugust> imho
18:28 -!- dahankzter [~henrik@92-244-3-192.customers.ownit.se] has quit [Quit:
Leaving.]
18:34 < nsf> does anyone know why C has '->' token?
18:35 < Tv> nsf: pointer deref
18:35 < nsf> I know what it means
18:35 < nsf> I'm curious why it exists
18:35 < nsf> :)
18:36 < Tv> nsf: you mean as opposed to just using . for both?
18:36 < nsf> because you can apply a simple rule for '.' selector: if a
variable is a pointer, then deref and select, otherwise simply select
18:36 < nsf> yes
18:36 < Tv> maybe it made compiler writing simpler
18:37 < nsf> also I guess C and C++ are the only two languages which have
this "thing"
18:37 < nsf> and C++ has it for obvious reasons
18:37 < Tv> oh and there's the a->*b case etc
18:38 < Tv> err sorry that was c++ only
18:38 < nsf> hm..
18:39 < Tv> maybe they just considered it nicer to have operators be more
explicit
18:39 < Tv> sorry, pointers
18:39 < nsf> I guess
18:39 < Tv> this cold is making my brain all wonky
18:39 < nsf> I'm just thinking about type systems, preparing myself for
adding one to my toy language :)
18:40 < Tv> hah
18:49 -!- plainhao [~plainhao@mail.xbiotica.com] has joined #go-nuts
19:02 -!- ikaros [~ikaros@188.107.214.200] has quit [Quit: Leave the magic to
Houdini]
19:10 -!- wjlroe [~will@78-86-14-131.zone2.bethere.co.uk] has joined #go-nuts
19:11 -!- plainhao [~plainhao@mail.xbiotica.com] has quit [Quit: plainhao]
19:11 -!- ikaros [~ikaros@188.107.214.200] has joined #go-nuts
19:12 -!- cenuij [~cenuij@base/student/cenuij] has quit [Remote host closed the
connection]
19:25 -!- MaksimBurnin [~max@44.188-224-87.telenet.ru] has quit [Ping timeout: 240
seconds]
19:26 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
19:26 < skelterjohn> Tv: what did a->*b do?
19:26 < skelterjohn> same as *(a->b)?
19:27 < Tv> skelterjohn: b was a pointer to member, somehow
19:27 -!- emmanueloga [~emmanuelo@190.244.15.163] has quit [Ping timeout: 264
seconds]
19:27 <+iant> in C++ ->* is used for a member function pointer
19:27 < Tv> i can't remember details
19:27 < Tv> c++ is one of those things i try to forget ;)
19:27 < skelterjohn> so &(a->b)?
19:27 <+iant> no
19:27 < Tv> skelterjohn: no, more like both a and b are pointers
19:27 <+iant> look up "member function pointer"
19:27 <+iant> it's a pointer to some method, but not associated with any
specific object
19:28 <+iant> it's used when an object has several methods with the same
signature
19:28 <+iant> the member function pointer tells you which method you want
19:28 < Tv> there's no C equivalent, but it's sort of like the pointer
offset inside a struct
19:28 <+iant> right
19:28 < skelterjohn> k
19:28 < skelterjohn> can we treat methods as objects, yet, in go?
19:28 < skelterjohn> pass them around like we can normal functions?
19:29 < skelterjohn> i know that used to be a "todo" item
19:29 <+iant> yes, method expressions should work now
19:29 -!- emmanueloga [~emmanuelo@190.244.15.163] has joined #go-nuts
19:31 < uriel> ficoos: you need to do hg pull -u
19:32 < ficoos> uriel: everything was already solved with the kind help of
nsf, thanks anyway.
19:33 < uriel> ficoos: sorry, I should wait to finish reading backlog before
answering questions ;P
19:34 < ficoos> uriel: No need to be sorry for being keen to help.  Good
day.
19:35 < uriel> heh
19:36 < uriel> iant: I guess 'method expressions' is one more item that
needs removing from the roadmap ;)
19:37 <+iant> guess so
19:38 < uriel> other than the make/new merge, are there any other language
changes in the pipeline?
19:38 * uriel can't remember
19:38 <+iant> I'm not even sure the make/new merge is going to go through
19:38 < skelterjohn> boo
19:38 < skelterjohn> i liked that idea
19:38 <+iant> I kind of liked it too
19:39 <+iant> it may still happen
19:39 <+iant> there were some alternative proposals that were also good
19:39 < skelterjohn> i think make(pointer type) should definitely work, even
if you leave in new
19:40 < Namegduf> Anything is better than &Type{}
19:40 < skelterjohn> try new(Type)
19:40 < Namegduf> Yeah, I know, I was rather surprised to find out that
people were using &Type{} as a general thing.
19:40 < Tv> what's wrong with that?
19:41 < Tv> just style, or actual issues?
19:41 < skelterjohn> style
19:41 < uriel> what is wrong with &Type{}?
19:41 < Tv> i kinda liked the fact that it doesn't need a magic "create a
new thing" syntax
19:41 < Tv> you just put in a literal and take its address
19:42 < uriel> and less keywords is always a good thing
19:42 -!- tvw [~tv@212.79.9.150] has quit [Remote host closed the connection]
19:42 < Namegduf> It reads poorly compared to what you're doing.
19:42 <+iant> although technically "new" is not a keyword, it is a
predeclared identifier
19:42 < Namegduf> Type{} is an odd kind of constructor, and to use it in
general is less clear to me than new(Type).
19:42 < Tv> iant: does that mean i can obscure it in some scope?  even worse
;)
19:42 < Namegduf> Well, constructor...  allocation function?
19:43 <+iant> Tv: that is what it means, yes
19:43 <+iant> although it is unlikely that much confusion could result
19:43 < uriel> iant: technicalities aside, it wouldn't be a bad thing to be
able to have functions/methods called 'new'
19:44 <+iant> well, you can
19:44 < uriel> Namegduf: it is not odd at all
19:44 <+iant> of course, if you do that, your package won't be able to call
the predeclared new
19:44 < Namegduf> uriel: I sure it is.
19:44 < Namegduf> *Sure it is.
19:44 <+iant> well, not if you have a package level function named "new"
19:44 < uriel> Namegduf: it is not different from how you define literal
maps, and arrays
19:44 < Namegduf> v := Type{} is less clear for me to read than v :=
new(Type)
19:45 < uriel> Namegduf: why?
19:45 < skelterjohn> it's a clear style issue, therefore kinda moot in my
opinion
19:46 < Namegduf> I suppose because I think of it a special-case syntax that
exists only for some types, for the given function of initialising entries.
19:47 < Namegduf> Using it in general means that your normal method of
allocating types doesn't work for basic types (and the syntax would be utterly
arbitrary if it did, as the {} corresponds to nothing).
19:47 < uriel> Namegduf: it exists for all types already!
19:47 < Namegduf> What, they changed it so you can go int{}?
19:47 < Namegduf> I was under the impression that didn't work.
19:48 < uriel> you can: []string{foo: "bar", baz: "bax"}
19:48 < Namegduf> Yes, but that's not what I said.
19:48 <+iant> you can't use int{}
19:48 < Namegduf> Can you string{}?
19:48 <+iant> it only works for composite types
19:48 < Namegduf> I thought so.
19:48 < uriel> Namegduf: what would even that mean?
19:48 < skelterjohn> "a := &int{}" invalid type for composite literal
19:48 -!- clip9_ [clip9@er.en.svarteper.com] has joined #go-nuts
19:49 < skelterjohn> presumably "a := string{}" would mean the same as "var
a string"
19:49 < uriel> I'm not against allowing &int{42}, but seems rather silly
when you can just type 42
19:49 < Tv> i mean, seriously, i'm very likely to the var cur, new int or
something like that
19:49 < Tv> s/the/type/
19:49 < Namegduf> uriel: My point is that as syntax goes, it's arbitrary to
use it as the method of allocating non-composite types.
19:49 < Namegduf> It has no correspondance to what you're doing.
19:49 < uriel> Namegduf: why?  again, this is already the case for maps and
arrays
19:50 <+iant> there is a proposal to permit &int(42); &int{42} will probably
never work
19:50 < Namegduf> uriel: Which are composite types.
19:50 < Namegduf> It's arbitrary because {} represents the elements to set
to a non-default value for a composite type.
19:50 -!- deso_ [~deso@x0561a.wh30.tu-dresden.de] has joined #go-nuts
19:50 < uriel> Namegduf: so, that is what the &foo{} syntax is for:
composite types!
19:50 < Namegduf> Are you *reading* what I'm writing?
19:50 < Namegduf> I know it's for composite types.
19:50 < uriel> Namegduf: I am, but I don't get it
19:51 < Namegduf> Then wait for enough time for me to write the whole thing,
you're replying to things you don't even dispute because they aren't about
composite types.
19:51 < uriel> what the hell else do you want/expect?  it is not arbitrary
at all: it is how you allocate composite types
19:51 < Namegduf> I said it would be arbitrary to allow it for non-composite
types.
19:51 < mpl> uriel: wow, uriel, is it a dream or you've actually become
patient?  ;>
19:52 < Namegduf> This was leading up to my actual point, which relied on
that as a premise.
19:52 < skelterjohn> i'd rather read an argument about gofmt, i think
19:53 < Namegduf> My *point* is that using it as the normal means of
allocating composite types either means you need to allow it for non-composite
types, which is exceedingly arbitrary in syntax, or you need to have a different
normal way of allocating a zero value for composite and non-composite types in
your code, which to me is inconsistent.
19:53 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
19:53 < uriel> Namegduf: I thought you said you already dislike the current
usage of &Foo{}
19:55 < Namegduf> uriel: I think it boils down to, for present usage: I find
having different syntax be the norm for allocating non-composite and composite
types ugly, because it's the same operation being performed the same way in both
cases.
19:55 <+iant> there is a difference between composite and non-composite
types
19:55 <+iant> the &T{} syntax would initialize fields of a composite type
19:55 <+iant> the &T() syntax (which does not currently exist) would
initialize entire values of any type
19:55 < Namegduf> T() is nice.
19:56 < taruti> iant: why is it not possible to view builtin types as
composites on the literal level?
19:56 <+iant> consider the type []interface{}
19:57 <+iant> and suppose I want to store a single value of type
[]interface{} in that slice
19:57 <+iant> then using T{} for syntaxes becomes ambiguous
19:57 <+iant> do I want the value, or do I want to store the value in a
slice?
19:58 < taruti> []interface{[]interface{}} ?
19:58 <+iant> []interface{v} where v has type []interface{}
19:58 -!- madari [madari@AM.irc.fi] has joined #go-nuts
20:00 -!- atsampso1 [~ats@94-194-126-16.zone8.bethere.co.uk] has joined #go-nuts
20:01 -!- Adys [~Adys@unaffiliated/adys] has quit [Ping timeout: 245 seconds]
20:01 -!- mwarning [~mwarning@ip-78-94-203-69.unitymediagroup.de] has joined
#go-nuts
20:01 -!- mwarning [~mwarning@ip-78-94-203-69.unitymediagroup.de] has left
#go-nuts ["Leaving"]
20:03 -!- nictuku [~nictuku@cetico.org] has quit [Ping timeout: 240 seconds]
20:03 -!- madari_ [madari@AM.irc.fi] has quit [Ping timeout: 240 seconds]
20:03 -!- nictuku [~nictuku@65.99.215.8] has joined #go-nuts
20:03 -!- atsampson [~ats@94-194-126-16.zone8.bethere.co.uk] has quit [Ping
timeout: 240 seconds]
20:03 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Ping timeout: 240 seconds]
20:03 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Ping timeout: 240
seconds]
20:03 -!- Tv1 [~tv@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts
20:03 -!- Tv [~tv@cpe-76-168-227-45.socal.res.rr.com] has quit [Disconnected by
services]
20:04 -!- i__ [~none@unaffiliated/i--/x-3618442] has quit [Ping timeout: 252
seconds]
20:04 -!- i__ [~none@69.164.206.224] has joined #go-nuts
20:05 -!- Netsplit *.net <-> *.split quits: noktoborus, Fish, clip9,
SRabbelier, deso
20:07 -!- Netsplit over, joins: noktoborus
20:08 -!- XenoPhoenix [~Xeno@cpc5-aztw24-2-0-cust39.aztw.cable.virginmedia.com]
has quit [Remote host closed the connection]
20:08 -!- Adys [~Adys@cpc1-chap8-2-0-cust237.aztw.cable.virginmedia.com] has
joined #go-nuts
20:08 -!- Adys [~Adys@cpc1-chap8-2-0-cust237.aztw.cable.virginmedia.com] has quit
[Changing host]
20:08 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
20:08 -!- virtualsue [~chatzilla@host81-139-116-4.in-addr.btopenworld.com] has
quit [Ping timeout: 240 seconds]
20:09 -!- zyrg_ [~kirill@net089023002246.pskovline.ru] has joined #go-nuts
20:15 -!- virtualsue [~chatzilla@nat/cisco/x-kewwlupzvgaetfgm] has joined #go-nuts
20:17 -!- zozoR [~zozoR@4705ds1-ris.0.fullrate.dk] has quit [Quit: Morten.  Desu~]
20:21 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:d94:51b7:61d3:b19f] has quit
[Quit: Leaving.]
20:26 -!- tav [~tav@92.7.68.158] has quit [Ping timeout: 245 seconds]
20:32 -!- tav [~tav@92.7.155.13] has joined #go-nuts
20:33 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has joined #go-nuts
20:33 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
20:37 -!- HollyRain [~HollyRain@87.223.116.212] has joined #go-nuts
20:39 -!- wjlroe [~will@78-86-14-131.zone2.bethere.co.uk] has quit [Quit: Get
MacIrssi - http://www.sysctl.co.uk/projects/macirssi/]
20:40 < HollyRain> hi!
20:40 < HollyRain> why that regular expression is returning me the last
spaces before of "*/" ?
20:40 < HollyRain> http://www.gopaste.net/?id=1581
20:41 < HollyRain> I use "[ \t]*" before of it to discard them but nothing
20:42 < HollyRain> the output is => "// foo bar $"
20:43 < cbeck> try using ([^ \t]+) instead of (.*) there
20:43 < cbeck> err, (.+)
20:45 < HollyRain> cbeck: nothing
20:46 < cbeck> What are you trying to match exactly?
20:47 < HollyRain> cbeck: it is not valid because there are spaces between
words
20:47 < HollyRain> the C line comments
20:48 < skelterjohn> "^.*(//.*)$"?
20:48 < cbeck> Ahh, I see
20:48 < HollyRain> > /* comment for foo */
20:48 < skelterjohn> oh
20:49 < HollyRain> I've not tested in another languages but it looks me
valid: `^(.+)?/\*[ \t]*(.+)[ \t]*\*/`
20:49 < cbeck> The issue is that Go's regexp lib doesn't support non greedy
matches atm
20:49 -!- tvw [~tv@e176005196.adsl.alicedsl.de] has joined #go-nuts
20:54 < Tv> you could always write a wrapper to call the pcre C lib
20:54 < cbeck> I think someone did a partial but operational port of RE2 as
well
20:54 < uriel> there are already bindings for the PCRE C lib
20:54 < Tv> even betterer
20:54 < uriel> ther is also sre2, wich is a rewrite in pure Go of russ' re2
20:55 < uriel> http://code.google.com/p/sre2/
20:55 < Tonnerre> .oO(Interesting choice of acronym)
20:55 < HollyRain> then, why is not added re2 into the Go core?
20:55 < Namegduf> 1) It isn't done yet.
20:56 < Namegduf> 2) It isn't developed by a core Go dev and hasn't been
submitted.
20:56 < HollyRain> ah ok, thanks to all
20:58 < exch> the PCRE bindings are available, but not recommended for use.
Mostly cos I haven't updated them and PCRE is crap
20:59 < exch> the latter point is mostly the reason for the first point :p
21:04 -!- skelterjohn [~jasmuth@lawn-gw.rutgers.edu] has quit [Quit: skelterjohn]
21:12 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
21:13 -!- virtualsue [~chatzilla@nat/cisco/x-kewwlupzvgaetfgm] has quit [Quit:
ChatZilla 0.9.86 [Firefox 3.5.13/20100914122142]]
21:13 < soul9> anyone know if it is possible to have a guard in an for loop
(something like for str, err := fun(parm); err != 0 { ..
21:13 < soul9> i thought there was a way to do this but i can't find it
21:13 < KirkMcDonald> Stick another semicolon in there.
21:14 < soul9> in the middle?  or at the end?
21:14 < KirkMcDonald> At the end.
21:14 < soul9> ah, at the end right.
21:14 < soul9> ?
21:14 < soul9> makes sense, yea
21:14 < soul9> cool
21:14 < KirkMcDonald> Er, actually.
21:15 < KirkMcDonald> You probably want: for str, err := fun(parm); err !=
nil; str, err = fun(parm) {
21:15 * KirkMcDonald squints.
21:15 < cbeck> Anyone stumbled across any audio libs in go?
21:16 < soul9> ooooh damn
21:16 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
21:17 < soul9> KirkMcDonald: yeap, that got me to an ∞loop :D
21:17 < soul9> thanks
21:30 -!- Guest4872 [~irc@209.17.191.58] has quit [Quit: leaving]
21:31 -!- irc_ [~irc@209.17.191.58] has joined #go-nuts
21:31 < uriel> Namegduf: I think sre2 has been submitted and is being
reviewwed
21:32 < Namegduf> Ah, I see.
21:32 * cbeck hopes so
21:32 < Namegduf> I would like to see it replace the regexp package, but
only once it is superior in efficiency and no longer leaks panics.
21:32 < uriel> cbeck: there are links to some bindings of audio libs in:
http://go-lang.cat-v.org/library-bindings
21:33 < uriel> Namegduf: the regexp package is going to be replaced one way
or another sooner or later
21:33 < Namegduf> uriel: Yeah.
21:35 -!- deso_ [~deso@x0561a.wh30.tu-dresden.de] has quit [Remote host closed the
connection]
21:38 -!- Fish- [~Fish@9fans.fr] has quit [Remote host closed the connection]
21:45 < jnwhiteh> I'm happy with my Lua patterns package
21:45 < jnwhiteh> gives me the speed and features I need =)
21:46 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
21:46 -!- ikaros [~ikaros@188.107.214.200] has quit [Quit: Leave the magic to
Houdini]
21:48 < HollyRain> which is the recommended/best way to create a variable of
any type?
21:48 < HollyRain> b1 := &bytes.Buffer{}
21:48 < HollyRain> var b2 bytes.Buffer // &b2
21:48 < HollyRain> var b3 = new(bytes.Buffer)
21:48 < HollyRain> ?
21:49 < exch> whatever suits the particular situation.  I usually only use
the var approach in global scope and when the var just has to be predeclared.
21:49 < uriel> :=, and either the right hand of 1) or 3),
21:49 < nsf> whatever you like
21:49 < uriel> as exch points out, var is mostly used only in the global
scope
21:49 -!- awidegreen [~quassel@62.176.237.78] has quit [Read error: Connection
reset by peer]
21:50 < nsf> x := bytes.NewBuffer(make([]byte, ...))
21:50 < nsf> :P
21:50 < uriel> (I think rob said at some point that technically one could
get rid of the requirement for 'var' in the global scope, but it doesn't seem
worth doing)
21:54 -!- fenicks [~christian@log77-3-82-243-254-112.fbx.proxad.net] has joined
#go-nuts
21:56 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
21:58 < enferex> So I have a foreign c function declared in a .go package.
I 6c the c-function's source, that builds fine, and the function-name is prefixed
with /middle_dot/.  I compile the .go package with the prototype for that 'c'
function using 6g.  That compiles fine.  My main package, which imports this most
recently cmpiled package with the c-function declaration, fails to link "undefined
mypackage.MyCFunc".  Fundamentally I am doing something wrong, just not sure
21:59 < HollyRain> then, if we need to declare a boolean into a function, is
better to use "use := false" than "var use bool" ?
22:00 -!- jserver [~jserver@pool-71-167-243-229.nycmny.east.verizon.net] has
joined #go-nuts
22:00 < exch> either one works
22:00 -!- mat__ [~mat@mx3.absolight.net] has joined #go-nuts
22:00 < exch> the var thing initializes the bool to it's default nil value.
which is 'false' for a boolean
22:01 < exch> s/initializes/sets/
22:02 < HollyRain> yes, right, but I say it because to use ":=" has better
performance than to use var
22:02 < nsf> enferex: just ask that on the ML, I'm sure you'll get the
answer
22:02 < exch> it does?
22:03 < HollyRain> it generates lesser asm code
22:03 -!- mat_ [~mat@prod2.absolight.net] has quit [Ping timeout: 276 seconds]
22:03 < enferex> nsf: Ok, thanks, im just trying to reverse what some of the
other packages do.  I thought I had it...  but Mr. 6l suggests otherwise ;-)
22:04 < nsf> enferex: I can say that you're doing something wrong, but I
can't say what exactly
22:04 < nsf> I think you shouldn't import .8/.6 file created by 6c
22:04 < nsf> you just need to link it with the .8/.6 go file
22:05 < nsf> wait a sec, I'll check that out
22:06 -!- i__ [~none@69.164.206.224] has quit [Changing host]
22:06 -!- i__ [~none@unaffiliated/i--/x-3618442] has joined #go-nuts
22:08 < nsf> hm..  interesting
22:09 < mpl> is there anything to manipulate bitstreams in go?  or to use
words of arbitrary number of bits?
22:11 < fenicks> hello
22:13 < cbeck> mpl: encoding/binary
22:14 < mpl> cbeck: aah, that might work out, thanks.
22:15 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
22:15 < cbeck> If you find something better, let me know
22:15 < Boney_> enferex: morning!
22:15 < enferex> hi
22:15 < Boney_> I'm here, I'm just hiding in my office.
22:16 < enferex> same here
22:16 < mpl> cbeck: hmm, no that won't do.  it only works with arithmetic
types.
22:17 < cbeck> What are you trying to do?
22:17 < mpl> simple, read say 12 bits by 12 bits from a stream.
22:18 < nsf> enferex: you should definitely ask that on the ML
22:18 < nsf> I mean the C stuff
22:19 < cbeck> Ah, no, that wouldn't work
22:19 < cbeck> A thin wrapper around it might do the job though
22:20 < enferex> nsf: yup
22:20 < enferex> thanks, I was hoping to find a good example of that in the
source, there are tons of similar ones.  I might poke more around there first
22:21 < enferex> its seems most of those are not linking directly to the
main package but just creating a go-library instead
22:23 < nsf> there are also issues with return values
22:23 < nsf> Go can return multiple values from a function
22:23 < nsf> and in C of course you can't do that
22:23 < nsf> so, some kind of trickery should be involved
22:25 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
22:29 -!- jserver [~jserver@pool-71-167-243-229.nycmny.east.verizon.net] has quit
[Quit: jserver]
22:30 -!- tvw [~tv@e176005196.adsl.alicedsl.de] has quit [Remote host closed the
connection]
22:32 -!- Boney_ [~paul@124-149-85-185.dyn.iinet.net.au] has quit [Ping timeout:
255 seconds]
22:34 -!- Boney [~paul@203-217-67-169.dyn.iinet.net.au] has joined #go-nuts
22:49 -!- Boney_ [~paul@124-168-80-178.dyn.iinet.net.au] has joined #go-nuts
22:50 -!- Boney [~paul@203-217-67-169.dyn.iinet.net.au] has quit [Ping timeout:
276 seconds]
22:53 -!- Project_2501 [~Marvin@dynamic-adsl-94-36-177-190.clienti.tiscali.it] has
quit [Quit: E se abbasso questa leva che succ...]
23:07 -!- jserver [~jserver@pool-71-167-243-229.nycmny.east.verizon.net] has
joined #go-nuts
23:10 -!- ExtraSpice [~XtraSpice@88.118.34.223] has quit [Ping timeout: 240
seconds]
23:10 -!- HollyRain [~HollyRain@87.223.116.212] has left #go-nuts []
23:12 -!- jmettraux [~jmettraux@211.19.55.177] has joined #go-nuts
23:23 -!- jserver [~jserver@pool-71-167-243-229.nycmny.east.verizon.net] has quit
[Quit: jserver]
23:25 -!- jserver [~jserver@pool-71-167-243-229.nycmny.east.verizon.net] has
joined #go-nuts
23:27 -!- napsy [~luka@88.200.96.18] has quit [Ping timeout: 260 seconds]
23:28 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping
timeout: 255 seconds]
23:28 -!- photron [~photron@port-92-201-30-121.dynamic.qsc.de] has quit [Ping
timeout: 260 seconds]
23:34 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #go-nuts
23:37 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
23:40 -!- jserver [~jserver@pool-71-167-243-229.nycmny.east.verizon.net] has quit
[Quit: jserver]
23:48 -!- kingless [~kingless@adsl-242-215-95.rmo.bellsouth.net] has joined
#go-nuts
23:54 < nickaugust> is there a way to get the type of the outside struct
from an embeded method?
23:55 <+iant> no
23:55 <+iant> if you need that, you may want to use an interface instead
23:56 -!- skelterjohn [~jasmuth@c-76-124-135-199.hsd1.nj.comcast.net] has joined
#go-nuts
23:57 < nickaugust> iant: ok thanks.  to clairfy, interfaces can only have
embeded interfaces but structs can have embeded structs or interfaces?  or how
does that work?
23:57 -!- kanru [~kanru@118-168-235-106.dynamic.hinet.net] has joined #go-nuts
23:57 <+iant> a struct can have an embedded interface, but that is not what
you want here
23:58 <+iant> you want to make the whole struct satisfy some interface
23:58 -!- kingless [~kingless@adsl-242-215-95.rmo.bellsouth.net] has quit [Quit:
Colloquy for iPad - http://colloquy.mobi]
23:58 <+iant> at least, that is what I would think of first
23:58 <+iant> other approaches are to pass the struct itself (via an
interface) in the call to the method of the embedded field
23:58 < exch> meh.  google's new 'webp' image format relies on libvpx for
the actual image data decoding.  Which basically means a webp parser is going to
be a cgo project.  Either that or one would have to find the needed bits in the
VP8 source and port only those.
--- Log closed Fri Oct 08 00:00:10 2010