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

--- Log opened Sun Feb 20 00:00:29 2011
00:04 < exch> Submitting bogus packages may not work.  It seems the
dahsboard loads the repo's info to find description info.  Not sure if it refuses
to add the rpo if it doesnt exist though
00:04 < exch> Would make sense and makes it a bit more difficult to submit
stuff like viagra promotions
00:05 -!- Natch| [~natch@c-6dcde155.25-4-64736c10.cust.bredbandsbolaget.se] has
joined #go-nuts
00:08 -!- spreadsheet [~spreadshe@unaffiliated/spreadsheet] has left #go-nuts []
00:10 < n___> http://code.google.com/p/gosnmp/
00:10 < n___> there we go
00:10 < n___> rest tomorrow, im off to bed
00:11 -!- n___ [~n____@5ad54238.bb.sky.com] has quit [Quit: n___]
00:17 -!- n___ [~n____@5ad54238.bb.sky.com] has joined #go-nuts
00:26 -!- nettok [~quassel@200.119.185.223] has quit [Ping timeout: 240 seconds]
00:37 -!- ShadowIce` [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
00:37 < tarrant> I have a table of static keys and values.  Is there anyway
to create a constant map between these?
00:38 < Namegduf> You can make a map between them, yes.
00:39 < Namegduf> I'm not sure about map constants.
00:44 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-169-69.clienti.tiscali.it]
has joined #go-nuts
00:47 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-182-95.clienti.tiscali.it] has
quit [Ping timeout: 276 seconds]
00:49 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
00:56 < tarrant> According to effective go maps can't be constants.  Thats
alight I'll just use a init function to initialize the map and store it in a
global.
01:02 -!- foocraft [~dsc@89.211.71.208] has quit [Quit: Leaving]
01:03 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-169-69.clienti.tiscali.it]
has quit [Quit: E se abbasso questa leva che succ...]
01:24 < KirkMcDonald> tarrant: You should be able to say e.g.  var foo =
map[string]string{"foo": "bar"}
01:24 < KirkMcDonald> (At the global scope.)
01:24 -!- qwesda [~qwesda@91-64-38-12-dynip.superkabel.de] has joined #go-nuts
01:34 -!- aho [~nya@fuld-4d00d079.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
01:43 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has quit [Remote host closed the connection]
01:48 -!- qwesda [~qwesda@91-64-38-12-dynip.superkabel.de] has quit [Quit: qwesda]
01:54 < emet> what IDE / editor do you guys use for Go
01:54 -!- tav_ [~tav@92.7.74.27] has joined #go-nuts
01:54 < Sgeo_> Why is make() magical?
01:54 < KirkMcDonald> emet: vim
01:54 -!- tav [~tav@92.7.107.196] has quit [Ping timeout: 240 seconds]
01:55 < emet> okay
02:06 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
02:09 < tarrant> KirkMcDonald: You are correct.  Thanks.
02:11 -!- niemeyer [~niemeyer@189-10-154-99.pltce701.dsl.brasiltelecom.net.br] has
joined #go-nuts
02:18 -!- niemeyer [~niemeyer@189-10-154-99.pltce701.dsl.brasiltelecom.net.br] has
quit [Ping timeout: 240 seconds]
02:32 -!- emet [~kvirc@unaffiliated/emet] has quit [Quit: KVIrc 4.0.2 Insomnia
http://www.kvirc.net/]
02:38 <@nf_> i think we'll be able to send channels over rpc/netchan soon
02:38 <@nf_> this is a pretty interesting idea
02:40 -!- foocraft [~dsc@dyn-86-36-42-96.wv.qatar.cmu.edu] has joined #go-nuts
02:41 -!- ssalbiz [~ssalbiz@taurine.csclub.uwaterloo.ca] has quit [Remote host
closed the connection]
02:45 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has joined #go-nuts
02:45 < zzing> Is there a way to get switch to fall through from one case to
another or how the behaviour would work in C without the break statement?
02:47 < exch> zzing: 'fallthrough'
02:49 -!- boscop [~boscop@g227002235.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
02:59 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
03:07 < zzing> exch: Thank you, worked great
03:10 < zzing> If I have a package that is being compiled by a Makefile in
., and I have a file that uses that package in the same directory, how can I get
it to find the import?
03:10 < zzing> (it says 'can't find import: ...'
03:13 < fzzbt> say i have a foo []byte slice and i want to get a partial
slice of it and thrash the rest, eg.  foo = foo[:(len(foo)-1)/2].  does the GC
know to free that unused part itself or should i use just use copy/append instead
of slice expression?
03:17 -!- amacleod [~amacleod@pool-96-252-93-11.bstnma.fios.verizon.net] has quit
[Ping timeout: 240 seconds]
03:19 < exch> zzing: you can either 'make install' the package to have to
put in the Go pkg tree, or add the -L flag to the Go linker, followed by the path
you want it to search in (eg -L .)
03:20 < zzing> exch: The package is an experimental package that isn't read
for anything so bold, so I will try the -L
03:21 < zzing> exch: What should I modify in the makefile so that it takes
this flag?  I am using the make.inc and make.pkg stuff
03:22 < exch> good quesiton.  I usually omit the last Make.pkg and
substitute my own calls to $(GC) and $(LD), but I would assume there is a variable
you can use like TARG and GOFILES
03:23 < zzing> I am using cgo as well
03:23 < zzing> That is why I need this special stuff
03:24 < exch> CGO_LDFLAGS and CGO_CFLAGS are used to pass custom stuff to
GCC in that case.  I do see a 'LIBS' variable in Make.inc.  You could try
appending the -L bits to that one and see what it yields
03:25 < zzing> nope
03:25 < exch> $CFLAGS and $LDFLAGS also seem to exist
03:27 < zzing> exch: Just trying this on its own this is not working: 6g -L.
-o _go_.6 glfwtest.go glfw.cgo1.go _cgo_gotypes.go
03:27 < zzing> glfwtest.go:4: can't find import: glfw
03:28 < zzing> Is there a different structure I should use for having a
package and samples?
03:30 < zzing> I stole something from gmp example, and I am further
03:33 < zzing> I need to link m file with a libglfw.a Cocoa.frameowkr, and
OpenGL.framework, if I was dealing with gcc I would just do -lglfw -framework
Cocoa -framework OpenGL is there another way I can do this?
04:02 -!- Arafangion [~arafangio@60-241-250-19.static.tpgi.com.au] has joined
#go-nuts
04:20 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
04:35 < skelterjohn> zzing: CGO_LDFLAGS:=-framework OpenGL
04:37 < zzing> skelterjohn: I already do that in the cgo stuff
04:37 < zzing> https://github.com/iaefai/glfw-go/blob/master/Makefile
04:37 < skelterjohn> ah
04:37 < skelterjohn> what's going wrong
04:37 < zzing> It is the final linking of my test program
04:37 < skelterjohn> too much backscroll :)
04:38 < zzing> give me a moment
04:38 < zzing> https://gist.github.com/bf1c6233c1f80388fe01
04:38 < zzing> Basically it needs to link with libglfw.a, Cocoa.framework,
and OpenGL.framework
04:38 < zzing> Because this isn't using cgo, I don't know how to do this
04:39 < skelterjohn> i imagine that you need to link in glfw.a
04:39 < skelterjohn> oh, it should do that, right
04:39 < zzing> It already links in the glfw.a file, it needs the external
04:39 < skelterjohn> is there a go version of nm?
04:39 < zzing> stuff
04:39 < zzing> What is nm
04:40 < skelterjohn> tells you what symbols are defined in a particular
object file
04:40 < zzing> yes there is
04:40 < skelterjohn> useful for debugging link errors
04:41 < zzing> output of the .a file:
https://gist.github.com/df527a0f8931f1d87709
04:41 < skelterjohn> zzing: what did it look like when you build glfw.a?
04:41 < zzing> https://gist.github.com/38798fad4a03a5721a1d
04:42 < skelterjohn> and i suppose glfwTerminate, etc come from -lglfw?
04:43 < zzing> yes
04:43 < zzing> and -lglfw depends on the two other frameworks
04:44 < skelterjohn> i can't remember, what is "T" for a symbol in nm?
04:45 < skelterjohn> anyway, uh, i don't think i know how to help you
04:45 < zzing> Text symbol: http://plan9.bell-labs.com/magic/man2html/1/nm
04:45 < zzing> skelterjohn: can you think of anyone that might?
04:45 < zzing> Is there a way of using ld instead of 6l?
04:45 < skelterjohn> i bet your post on go-nuts will get someone
04:45 < skelterjohn> you don't want to do that
04:45 < zzing> I posted there already about twenty minutes go, hoping for a
reply :p
04:45 < skelterjohn> go uses a different kind of stack/runtime
04:45 < zzing> Why is that?
04:46 < zzing> lovely
04:46 < skelterjohn> so it needs to be linked differently
04:46 < zzing> Because 6l is extremely limited
04:46 < zzing> I just need to tell it to link to additional things, and it
doesn't like that :-(
04:47 < zzing> The other way I can think of would be to tell this thing that
glfwtest needs cgo as well
04:47 < skelterjohn> shouldn't
04:47 < zzing> That seems how stdio example does it
04:47 < skelterjohn> you should be able to include everything in glfw
04:47 < zzing> If there was a way to integrate everything into glfw, then
you are right, but that isn't how linking normally works
04:48 < skelterjohn> no dynamic linking for go (yet)
04:48 < skelterjohn> everything is static
04:48 < zzing> What about external libraries that are dynamic?
04:48 < zzing> such as linking to an .so file in linux
04:48 < skelterjohn> i'm not sure how it all works
04:48 < skelterjohn> not an expect on linking
04:50 < Arafangion> zzing: From memory, dynamic libraries can be linked in
either one of two ways - via the linker, or truely dynamically via the C runtime
libraries.  In both cases, the dynamic loader is used.
04:50 < Namegduf> Dynamic linking == The linker does it.
04:51 < Namegduf> Dynamic loading refers to the wider class of things
04:52 < skelterjohn> zzing: is the thing you're trying to build
downloadable?  I'm on os x as well
04:52 < zzing> skelterjohn: yes
04:53 < zzing> This is the updated source: https://github.com/iaefai/glfw-go
just do a git clone on it, and also install glfw which can be had from the
homebrew utility (brew install glfw)
04:53 < zzing> I am trying to figure out if there is something that I am not
doing that the SDL port is doing, because it seems similar in idea
04:55 < skelterjohn> i'll give it a shot tomorrow morning and let you know
how it goes
04:55 < zzing> merci
04:56 < skelterjohn> night all
05:09 -!- nettok [~quassel@200.119.151.244] has joined #go-nuts
05:14 < zzing> hmm, I have now copied everything that I see the SDL port
doing and yet its test still compiles and mine doesn't :-(
05:34 -!- shvntr [~shvntr@113.84.147.13] has joined #go-nuts
05:45 -!- rbraley [~rbraley@ip72-222-134-229.ph.ph.cox.net] has joined #go-nuts
05:57 -!- tarrant [~tarrant@69.169.141.202.provo.static.broadweavenetworks.net]
has quit [Quit: Linkinus - http://linkinus.com]
06:13 -!- illya77 [~illya77@38-211-133-95.pool.ukrtel.net] has joined #go-nuts
06:35 -!- PJOX [~PJOX@cable201-233-74-40.epm.net.co] has joined #go-nuts
06:35 < PJOX> Hello?
06:35 < PJOX> is some one there?
06:36 < zzing> I try to be
06:37 < PJOX> can I ask you for some help?
06:37 < cbeck> It's entirely possible
06:37 < zzing> You can try, I might not have the answer
06:38 < zzing> My main experience is trying to thrash something into serving
me on the mac, and I haven't managed to subdue it yet.
06:39 < PJOX> I recently downloaded go, and I need some help with the
environment variables
06:39 < PJOX> I just don't know hot to set up that
06:40 < PJOX> can you help me?
06:41 < cbeck> What OS?
06:41 < PJOX> linux
06:41 < zzing> GOOS=linux
06:42 < cbeck> Don't really need to set any of them besides GOROOT
06:42 < PJOX> wait, I'm new to all of this
06:43 < PJOX> I opened the terminal and wrote :
06:43 < PJOX> export GOROOT=$HOME/go
06:43 < PJOX> export GOARCH=386
06:43 < PJOX> export GOOS=linux
06:44 < PJOX> it didn't work
06:45 < PJOX> when I type 8g, l8 or gofmt none of them work
06:47 < zzing> PJOX: What do you mean 'none of them work'?
06:47 < Namegduf> 86
06:47 < PJOX> 8g: command not found
06:47 < Namegduf> Er, sorry, typo.
06:47 < PJOX> that's what I mean
06:49 < PJOX> so, how do I set up them?
06:55 < PJOX> ...
06:58 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has joined #go-nuts
07:03 -!- tensai_cirno [~cirno@77.232.15.216] has quit [Ping timeout: 246 seconds]
07:05 < zzing> PJOX: Have you tried ~/go/bin/8g
07:05 < PJOX> ho?
07:05 < PJOX> how?
07:05 < zzing> umm, running it?
07:06 < PJOX> ummm, how?
07:07 < str1ngs> PJOX: you need to add $GOOROOT/bin to your PATH
07:07 < str1ngs> GOROOT even
07:07 < PJOX> yes I know, but that's my question, I don't know how to do
that
07:07 < str1ngs> PATH=$GOROOT/bin:$PATH
07:08 < PJOX> ok wait a second
07:08 < zzing> PJOX: do you have enough experience on the command line to be
playing around with something like this?
07:10 < PJOX> no, so it will be helpful if you tell me exactly what I have
to do
07:11 < str1ngs> provided you used GOROOT=$HOME/go then if you ls ~/go/bin
8g should be there
07:11 < PJOX> I've never set up environment variables before
07:12 < str1ngs> well first off is 8g where it should be?
07:13 < PJOX> yes
07:13 < PJOX> 8g, 8l and gofmt are in ~/go/bin 8g
07:14 < str1ngs> ok so now you need to add ~/go/bin to your PATH
07:15 < PJOX> ok, now tell me what to type in the terminal please in order
to add ~/go/bin to my PATH
07:15 < str1ngs> it depends on your shell
07:16 < str1ngs> export PATH=$GOROOT/bin:$PATH
07:16 < PJOX> well, tell me more
07:16 < PJOX> wait
07:17 < str1ngs> but you will have to set GOROOT and PATH in a your bash
profile
07:17 < PJOX> how?
07:17 < str1ngs> ~/.bashrc for non interactive logins
07:17 < str1ngs> this is assuming you are using bash
07:17 < PJOX> and wait, what's that smile?
07:18 < PJOX> :$
07:18 < zzing> PJOX: turn smilies off in your irc client if they are enabled
07:18 < str1ngs> :(
07:19 < str1ngs> PJOX: I really suggest taking a bash primer or something
07:20 < zzing> str1ngs is absolutely correct.  Go appears to me to be rather
unstable and/or experimental and you definitely don't want to be fumbling with the
terminal as well.
07:21 < str1ngs> go is not that unstable if you use release
07:21 < PJOX> I dont have ~/.bashrc
07:21 < zzing> str1ngs: The number of things that change from release to
release would indicate otherwise
07:21 < str1ngs> but you should have some basic understanding of bash to get
anywhere
07:21 < zzing> PJOX: Do you have ~/.bash_profile
07:21 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
07:22 < str1ngs> zzing: true but thats not the issue here
07:22 < PJOX> wait
07:23 < PJOX> I found .bashrc
07:23 < PJOX> now what?
07:24 < str1ngs> you need to add GOROOT.  and PATH.  but PATH should really
get set in .bash_profile
07:25 < PJOX> I have .bash_history and .bash_logout
07:26 < PJOX> but I don't have .bash_profile
07:26 < str1ngs> lets keep it simple . put it in .bashrc for now
07:26 < PJOX> ok where and how
07:26 < PJOX> ?
07:27 < str1ngs> at the end with what ever you choose to edit files
07:27 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
07:27 < str1ngs> make sure GOROOT is set first
07:28 < PJOX> wait, remember I don't know what I'm doing right now, so tell
me what to write please
07:28 < str1ngs> PJOX: but I highly recommend you take a bash primer.  and a
linux command line primer of some sorts
07:28 < str1ngs> PJOX: I cant keep just tell you want to write . your not
learning anything :P
07:30 < PJOX> ok, I give up, this is harder than I thought
07:31 < str1ngs> you need to set GOROOT to ~/go and and GOROOT/bin to your
PATH
07:31 < str1ngs> find a bash primer or ask in #bash for a url to learn some
basics about bash
07:32 < PJOX> ok I'll try
07:32 < PJOX> thank you for your help
07:32 < str1ngs> your welcome.  if you still have problem you'll atleast
know what questions to ask
07:36 < PJOX> the question was simple, I needed a simple set of steps to
make this work, things like 'type these 3 commands on your terminal' or 'add this
to line # in this file'
07:36 < PJOX> but is harder than I thought
07:37 < PJOX> I don't really know why it isn't described in the
documentation step by step...
07:37 < zzing> PJOX: They assume a certain knowledge
07:38 < str1ngs> PJOX: you must walk before you an run
07:38 < zzing> A jar of jam or a loaf of bread doesn't include instructions
on how to make a sandwich.
07:38 < str1ngs> if you dont know what PATH is how will you no what
os.Getenv does?
07:38 < Namegduf> It's aimed at programmers who already know how to use
their computer.
07:38 < str1ngs> know*
07:39 < PJOX> I know how to use my computer
07:39 < str1ngs> most end users do
07:39 < Namegduf> Then you'll know how to configure your shell.
07:41 < PJOX> no, I know how to use my computer, not how to configure my
shell
07:41 < zozoR> well
07:41 < Namegduf> Then "programmers who already know how to configure their
computer"
07:41 < zozoR> the part where you
07:41 < zozoR> add gobin to your path
07:42 < Namegduf> Not "end users who know how to take a computer that
already works and open IE and Outlook"
07:42 < zozoR> has only caused problems for me, so i just copy the damn
thing into ~/bin
07:42 < zozoR> PJOX, system?
07:42 < Namegduf> Knowing how to configure crap is generally a prereq to
being able to program things.
07:42 < PJOX> and if I could install Go is because I have some knowledge,
let me tell you
07:42 < zozoR> ubuntu?
07:43 < PJOX> and no, I cannot use IE and Outlook because I'm using linux
and I don't like IE
07:44 < PJOX> and I'm using debian
07:44 < zozoR> well, almost same thing
07:44 < PJOX> and I don't know what's the problem here, what type of
"community" is this?
07:45 < zozoR> http://codepaste.appspot.com/show?id=462123 type this into
the .bashrc in your home directory
07:46 < zozoR> ofcourse, change the path, goarch and whatever to fit your
computer
07:46 < KirkMcDonald> PJOX: If you're doing development on Linux, it is
entirely reasonable to assume you know how to operate a shell.
07:46 < PJOX> you ask a question, because you never installed a programming
language before and everything you get is "go and use IE and Outlook you enuser"
07:46 < zozoR> true, you are being dicks people
07:46 < KirkMcDonald> PJOX: And this is doubly true for a shiny new language
like Go.
07:46 < Namegduf> And yes, shell operation includes shell configuration
07:47 < KirkMcDonald> PJOX: In any case, usually you just edit your .bashrc
07:47 < Namegduf> The solution to ignorance of a topic is to learn about it,
not to complain you are expected to know what you're doing
07:47 < zozoR> am i on ignore or something?
07:47 -!- Arafangion [~arafangio@60-241-250-19.static.tpgi.com.au] has quit [Ping
timeout: 240 seconds]
07:47 < Namegduf> You *are* going to need to know how to use and configure
your shell to dev on Linux, and holding your hand in the installation instructions
would accomplish nothing in the longrun
07:47 < PJOX> wait, I'm trying zozoR suggestion
07:48 < zozoR> Namegduf, wrongs
07:48 < zozoR> you dont need to know how to configure your shell
07:48 < Namegduf> Right.  If you can't use a terminal you can't use gdb, you
can't use valgrind, you can't use arbitrary tools, you can't use version control
systems...  you can't even compile software
07:48 < zozoR> cause thats not very important
07:49 < KirkMcDonald> PJOX: Note that editing the .bashrc won't instantly
update existing shells.
07:49 < zozoR> its not that hard to type make youknow
07:49 < KirkMcDonald> PJOX: It only changes new shells.
07:49 < Namegduf> zozoR: Unless they involve environmental changes which,
what do you know, Go does.
07:49 -!- Arafangion [~arafangio@60-241-250-19.static.tpgi.com.au] has joined
#go-nuts
07:49 < Namegduf> It's not the only thing tht does, either.
07:50 < zozoR> PJOX, after adding those lines, and opened a new shell, the
other things to install go seems pretty basic
07:51 < zozoR> but Namegduf , after setting up those environmental
variables, goroot and whatnot, you really dont need it to get going
07:52 < Namegduf> Yes, after configuring it you don't need to configure it
again, until the next time you do.
07:52 < Namegduf> Holding your hand one time doesn't help next time.
07:52 < zozoR> then he can look in his .bashrc and say OH THAT HOW IT WORKS
07:52 < zozoR> its the best way to do that!  :o
07:53 < zozoR> unless the person learning things is just mindlessly
following along
07:54 < zozoR> but in a learning position, one would not do that : |
07:54 < Namegduf> Ah, okay.  So the Go installation instructions should
include instructions for everything that could conceivably not be known.
07:54 < PJOX> YES
07:54 < Namegduf> Let's start with sarcasm detection.
07:55 < PJOX> I know is sarcasm but it should be as that
07:56 < Namegduf> Okay, why don't you write it all up and put it up online
somewhere, starting with a diagram of what a mouse looks like and what those keys
on the keybaord are, and an explanation of what programming is.
07:56 < Namegduf> After all, you're a programmer so you should be as
qualified as anyone to do it.
07:56 < zzing> Namegduf: I believe you are assuming they have a keyboard and
mouse.  You should start with the fabrication of the parts surely.
07:57 < str1ngs> give a man a fish and you feed him for a day.  teach him to
fish and you feed him for a life time.
07:58 < zzing> str1ngs: The fish might need to evolve first.
07:58 < zozoR> how would you teach hime without showing him :P
07:58 < str1ngs> I told him where and what to set.  how he does it is up to
him
07:59 < zozoR> the only thing that is wrong with the website, is that it the
environmental variables arent named in the top of the GETTING STARTED page
07:59 < str1ngs> but if you dont know what PATH your in alot of trouble
07:59 < zozoR> that is true
07:59 < zozoR> but you can google that : |
07:59 < zzing> Are any of you guys really good with Go on the mac?  I have
been fighting with trying to get my glfw bindings to link with an example without
success.
08:00 < str1ngs> zzing: what are the glfw bindings?
08:00 < Namegduf> zozoR: If they don't know how to use their shell, they can
look up a tutorial to that.
08:00 < Namegduf> Including examples, if that's what helps them.
08:00 < zozoR> but if you just want to get started you dont want to do that
08:00 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
08:01 < str1ngs> but thats a basic requirement to useing make etc
08:01 < Namegduf> zozoR: Too bad, they need to know it to do it anyway.
08:01 < PJOX> ok, I did what zozoR told me to do but it didn't work
08:01 < zzing> str1ngs: A library called glfw that provides something
similar to what glut did for opengl.  I have made a basic set of bindings for
testing, which compiles.  But the small test I have doesn't link.  I need to get
it to link to libglfw.a and Cocoa.framework and OpenGL.framework.  This is where
it fails.
08:01 < PJOX> anyway, I thank him
08:01 < zozoR> PJOX, you need to describe what went wrong : |
08:01 < zzing> I have tried to copy what GO-SDL and Go-OpenGL do, but still
have a problem.
08:02 -!- nettok [~quassel@200.119.151.244] has quit [Ping timeout: 264 seconds]
08:02 < str1ngs> zzing: ya that sounds messy if it was something other then
cocoa I'd say it was doable
08:02 < str1ngs> zzing: are you using brew?
08:02 < zzing> str1ngs: yes
08:02 < zzing> That is how glfw is installed
08:03 < zzing> It just occurs to me that I should remember how to check for
the architechure
08:03 < PJOX> I added
08:04 < PJOX> "export GOROOT=$HOME/main/programmer/go
08:04 < PJOX> export GOARCH=386
08:04 < PJOX> export GOOS=linux
08:04 < PJOX> export GOBIN=$GOROOT/bin
08:04 < PJOX> PATH=$PATH:$HOME/bin
08:04 < PJOX> export PATH"
08:04 < PJOX> at the end of .bashrc
08:04 < PJOX> but I still get this when I run 8g: 8g: command not found
08:04 < zzing> libglfw is the right architecture, so that isn't it
08:04 < cbeck> Do you understand what the PATH variable is?
08:04 -!- mimustafa [~steve@92.62.119.57] has joined #go-nuts
08:05 < str1ngs> PJOX: you still need to add $GOROOT/bin to $PATH
08:05 < zzing> str1ngs: This thing shouldn't really have much to do with
Cocoa because it is only the glfw library that uses it, I don't use it directly.
08:05 -!- tensai_cirno [~cirno@91.188.174.130] has joined #go-nuts
08:05 < zozoR> PJOX, i told you to edit the paths
08:05 < str1ngs> zzing: yep so any cgo examples should get you going
08:06 < zzing> str1ngs: I use cgo in my bindings
08:06 < str1ngs> zzing: and when you build?
08:06 < zzing> The package uses cgo, the samples do not (exactly how SDL and
opengl do it)
08:06 < zzing> https://github.com/iaefai/glfw-go has the code
08:07 < zzing> You can see in the makefile how it uses it for the package,
and the makefiles in the two folders show the simple build
08:07 < zzing> I have tried to copy almost to the letter what SDL and opengl
do, and their samples seem to build, so I don't know why mine don't.
08:08 < str1ngs> zzing: let me try it on my mac
08:08 < zzing> str1ngs: thank you
08:09 < zzing> str1ngs: build instructions are in the readme for specifics
08:09 < PJOX> zozoR: just forget it, it won't work anyway, thank you, but
I'm just tired of people telling me things like "make a manual to use your mouse",
so I'm leaving
08:10 < zozoR> true that
08:10 < zozoR> fundamentalistic programmers are rarly nice :)
08:10 < Namegduf> All I said was that if you felt it should exist, YOU
should write it.  :P
08:11 < PJOX> ok, teach me how, and I'll write it
08:11 < cbeck> They're being internet blowhards, sure, but expecting some
level of familiarity with your environment doesn't seem excessive.
08:11 < zzing> PJOX: Your level of expectation is just a little too high.
08:12 < PJOX> cbeck: agree
08:12 < Namegduf> http://lmgtfy.com/?q=bash+tutorial <- This demonstrates
the basic operation of Google.
08:13 < zzing> harsh
08:13 < cbeck> Namegduf: Harsh
08:13 < zozoR> i never learned how bash :P
08:13 < Namegduf> To the point, rather.  You need to learn to teach
yourself, you can't be walked through *everything*.
08:13 -!- tensai_cirno [~cirno@91.188.174.130] has quit [Ping timeout: 268
seconds]
08:14 < Namegduf> "How to do" that, is, well...  that link.
08:14 < cbeck> I'mma go practice my sleeping, only way to get better I hear.
08:14 < zzing> I remember before I had the internet what it is was like...
08:14 < zozoR> when we had to go to the school library :3
08:15 < zzing> I never had an equipped library
08:15 < cbeck> http://i.imgur.com/DKmLc.jpg
08:15 < zzing> I *remember* when the library inventory was on cards...
08:15 < zozoR> xD
08:15 < zozoR> well shopping times
08:16 < zzing> I also remember when information was condensed on little
pieces of film and you enlarged it with a special viewer
08:16 < zzing> hmm, I should write a little short story with some archaic
stuff, it would amuse me
08:16 < str1ngs> zzing: need to update go install glfw
08:16 < zzing> str1ngs: Are you saying I need to, or you need to?
08:16 < PJOX> look I know how google works, and I don't think I need to know
everything about bash at this moment
08:17 < str1ngs> zzing: no ment I need to in order to test
08:17 < zzing> str1ngs: ok, it is getting late but I really want to know if
this works for you
08:17 < PJOX> I just need to solve this: "8g: command not found"
08:18 -!- tensai_cirno [~cirno@91.188.174.130] has joined #go-nuts
08:18 < zzing> PJOX: may I try to assist privately for a few minutes?  I
won't guarantee anything but an attempt.
08:20 < str1ngs> zzing: _cgo_flags: No such file or directory
08:20 < zzing> str1ngs: I have not seen that error before
08:20 < PJOX> zzing: thank you, but I'm leaving now its 3:20 AM here, I you
still want to help me later I'll really appreciate that
08:20 < PJOX> if
08:20 < str1ngs> zzing: are you using go release?
08:21 < zzing> PJOX: Tomorrow afternoon or evening, same time zone hit me up
08:21 < zzing> str1ngs: yes, I ensured it
08:21 < str1ngs> zzing: ah ok
08:21 < zzing> 6g version release.2011-02-15 7463
08:21 < str1ngs> zzing: I live on the bleeding edge
08:21 < zzing> I have also tried the head and 02-01
08:21 < zzing> Same problems
08:22 < PJOX> zzing: thank you.
08:23 -!- PJOX [~PJOX@cable201-233-74-40.epm.net.co] has left #go-nuts []
08:26 < str1ngs> zzing: 6g right?
08:26 < zzing> yes
08:31 < zzing> To make it absolutely clear what my system outputs:
https://gist.github.com/d21602f25e51303f7ea5
08:32 -!- adu [~ajr@softbank220043139062.bbtec.net] has joined #go-nuts
08:38 < str1ngs> zzing: I'm having a tough time replicating your error.  my
go install seems messed up right now
08:38 < zzing> str1ngs: does your system compile the test?
08:39 < zzing> or link rather
08:39 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
08:39 < zzing> Sometimes it is necessary to reinstall the operating system
every so often...  if this problem does not present itself to others I might have
to investigate that option.
08:40 < str1ngs> well been awhile since I've dont some go work on my mac
08:41 < zzing> Did you put it back to release and all the associated stuff?
08:44 < zzing> I think I will reinstall xcode tomorrow (download the 3.5gb
now) and rebuild everything involved.
08:44 < str1ngs> yes just building with all the tests
08:44 < zzing> I have posted to the mailing list, I might be able to elicit
some feedback there
08:44 < zzing> str1ngs: so it is still building just now?
08:45 < str1ngs> just finshed..  all test passed for go
08:46 < taruti> Has anyone got experience of crosscompiling Go?
08:46 < taruti> gc in this case
08:46 < zzing> str1ngs: ok
08:48 < str1ngs> zzing: ahh ok think I found my issue
08:48 < zzing> str1ngs: ok, is it something unique to yours?
08:48 < str1ngs> naw still getting _cgo_flags: No such file or directory
08:50 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|]
08:51 < str1ngs> ok
08:51 < str1ngs> fixed my go install
08:52 < str1ngs> you should make a glfw_test.go there easy to do
08:52 < str1ngs> so you can just make test
08:52 < zzing> hmm, I can probably steal something fromt he opengl make file
that does that
08:53 -!- tensai_cirno [~cirno@91.188.174.130] has quit [Ping timeout: 276
seconds]
08:53 < str1ngs> any go pkg will have some you can look at
08:54 < str1ngs> there pretty simple and nice
08:54 -!- tensai_cirno [~cirno@91.188.174.130] has joined #go-nuts
08:54 < str1ngs> saves you from having to make install also
08:54 < zzing> I think I would have to move the package stuff into a glfw
folder
08:55 < zzing> I will put it on my list for tomorrow
08:55 < str1ngs> ya not a big deal just a fyi
08:55 < zzing> Do you get the same linking error?
08:55 < str1ngs> ok so ya I replicated the rror
08:55 < zzing> ok
08:55 < str1ngs> error*
08:55 < zzing> nice or rather not so nice :p
08:55 < zzing> Now I wonder how to fix it
08:55 < zzing> Considering OpenGL and SDL don't have this issue but they
link to OpenGL.framework
08:56 < str1ngs> that my guess is the problem
08:57 < zzing> Although it doesn't sound like it would make any difference -
they both do one other thing different - what I have put on my list for tomrrow
08:57 < str1ngs> I barely know C never my apples framework stuff lol
08:57 < str1ngs> never mind*
08:57 < zzing> They have their packages in their own folder like their tests
08:57 < zzing> str1ngs: Does SDL stuff actually run for you?  On my system
they crash hard, but they do link.
08:58 < zzing> I didn't see any problem listed on the issue track for SDL so
I wasn't sure if it was just me or not.
08:58 < str1ngs> havent done any SDL stuff on mac
08:58 < zzing> ok
08:58 < str1ngs> I'm not actually a C programmer myself
08:58 < zzing> I cover many languages
08:59 < zzing> Not that I master any in particular, but I can deal with C
and Objective C fairly well
08:59 < str1ngs> well what I do when I'm doing cgo stuff is make it work
first in C
08:59 < zzing> In my case everything is already working in C because it is
an external library
09:01 -!- tensai_cirno [~cirno@91.188.174.130] has quit [Ping timeout: 276
seconds]
09:03 < zzing> str1ngs: I apprecaite your help.  But I must sleep now.
09:03 < zzing> Computer will be on for a while though
09:03 < str1ngs> segfaults on linux
09:04 < zzing> My friend found it worked fine on the one linux he had
(ubuntu older)
09:05 -!- skejoe [~skejoe@188.114.142.162] has quit [Quit: Lost terminal]
09:07 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
09:19 -!- skejoe [~skejoe@188.114.142.162] has joined #go-nuts
09:21 -!- youngsterxyf [~xyf@202.120.40.100] has joined #go-nuts
09:23 -!- youngsterxyf [~xyf@202.120.40.100] has left #go-nuts []
09:23 -!- youngsterxyf [~xyf@202.120.40.100] has joined #go-nuts
09:23 -!- youngsterxyf [~xyf@202.120.40.100] has left #go-nuts []
09:24 -!- ExtraSpice [XtraSpice@78-62-101-194.static.zebra.lt] has joined #go-nuts
09:26 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has quit [Ping timeout: 240 seconds]
09:26 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has joined #go-nuts
09:28 -!- youngsterxyf [~xyf@202.120.40.100] has joined #go-nuts
09:28 -!- youngsterxyf [~xyf@202.120.40.100] has left #go-nuts []
09:30 < adu> hi all
09:31 -!- gits [~gits@77.94.219.158] has joined #go-nuts
09:38 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
09:38 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has joined #go-nuts
10:04 -!- n___ [~n____@5ad54238.bb.sky.com] has quit [Quit: n___]
10:08 -!- youngsterxyf [~xyf@202.120.40.100] has joined #go-nuts
10:09 -!- youngsterxyf [~xyf@202.120.40.100] has left #go-nuts []
10:18 -!- Fish- [~Fish@bus77-2-82-244-150-190.fbx.proxad.net] has joined #go-nuts
10:25 < nsf>
http://www.dalkescientific.com/writings/diary/archive/2009/11/15/100000_tasklets.html
10:25 < nsf> hehe
10:27 < adu> nsf: sounds like a thread-ring to me
10:28 < nsf> I'm just trolling
10:28 < adu> I'm fine with that
10:28 < nsf> :)
10:28 < nsf> this guy should try GOMAXPROCS > 1
10:28 < nsf> :D
10:28 < adu> heh
10:29 < aiju> hahaha
10:30 < aiju> gosh
10:30 < aiju> he assumes a linear relationship between LOC and compile time?
10:31 < adu> I've been pondering how Go and OpenCL could work together
10:31 < nsf> in Go, it should be pretty much linear
10:31 < nsf> as well as in C
10:31 < aiju> could someone smack him?
10:31 < aiju> not for small N
10:31 < aiju> (N = 1000 *is* small)
10:31 < vegai> also, can one really use spython for anything?
10:31 < aiju> vegai: there is a MMO server written in it
10:32 < nsf> aiju: but I mean in terms of cpu cycles required to compile N
lines of code
10:32 < vegai> ok..
10:32 < nsf> minus IO, etc.
10:32 < vegai> aiju: which one?
10:32 < nsf> vegai: EVE Online is written in spython
10:32 < aiju> nsf: initialization code (lol dynamic linking) and what not
10:32 < nsf> the server part of course
10:32 < vegai> impressive
10:32 < nsf> client is C++ most likely
10:33 < adu> what is the go community's beef with dynamic linking?
10:33 < nsf> adu: they don't like it
10:34 < adu> why?
10:34 < nsf> and there are fair reasons for that
10:34 < aiju> adu: take ANY serious piece of software
10:34 < aiju> you will find they ship ALL the libraries
10:34 < nsf> 1.  distribution problems
10:34 < nsf> I have small (5-10k lines of code) open source project
10:34 < aiju> just do find -name '*.so' on openoffice or something
10:34 < nsf> and I had problems because of libraries mismatch
10:34 < aiju> you can run still 15 year old static linked *bsd binaries
10:34 -!- femtoo [~femto@95-89-196-229-dynip.superkabel.de] has joined #go-nuts
10:34 < aiju> *still run
10:34 < nsf> well, I guess it's the main problem
10:35 < nsf> so called DLL hell
10:35 < nsf> some people think there is no such thing on linux
10:35 < nsf> they are wrong
10:35 < aiju> Linux has a really terrible dependency hell
10:35 < nsf> exactly
10:35 < nsf> + a lot of open source libraries are buggy
10:36 < aiju> i wish most programs would just ship static linked versions
10:36 < aiju> i installed mplayer yesterday, it's so stupid
10:36 < adu> to summarize, they avoid them altogether because they SOMETIMES
don't work?
10:36 < nsf> and I'm talking about things like pango for instance
10:36 < aiju> adu: dynamic linking works fine if and only if you control
EVERYTHING
10:36 < nsf> adu: they avoid them, because life without shared libraries is
much easier
10:36 < taruti> mkenam: line 31: ed: command not found
10:36 * taruti loves arch linux...
10:36 < aiju> taruti: what the fuck
10:37 < nsf> adu: how often do you see cross-distribution binaries that
actually work?
10:37 < Namegduf> Fairly often
10:37 < taruti> nsf: opera.
10:37 < aiju> hahahah
10:37 < adu> aiju, nsf, well I'm sure life w/o SO/DLL is also faster, but
I'm surprised that's not the primary reason
10:38 < aiju> opera linkes Qt STATICALLY
10:38 < Namegduf> Opera, the various Linux-supporting gamses out there...
10:38 < Namegduf> Skype
10:38 < Namegduf> Flash.
10:38 < aiju> Skype and Opera are stupid examples
10:38 < aiju> they both link critical libraries statically
10:38 < zozoR> skype has static libraries :D
10:38 < aiju> and actually PROVE our point
10:38 < Namegduf> Only partially static.
10:38 < taruti> aiju: that is a good example on how to do it good :)
10:38 < Namegduf> They statically link things that are practical problems.
10:38 < Namegduf> And demonstrate working practically with the rest.
10:39 < aiju> aiju@toshiba ~ $ ldd =opera not a dynamic executable
10:39 < nsf> most binary packages work in two ways: 1.  include all .so into
the package, 2.  link statically
10:39 < adu> nsf: about 90% of the time
10:39 < Namegduf> aiju: Is it a shell script?
10:39 < nsf> /usr/lib/opera/opera
10:39 < nsf> is the binary
10:39 < aiju> oops :P
10:39 < nsf> it's dinamically linked, yes
10:39 < aiju> ldd is a POS
10:39 < nsf> but most of the libs are X and friends
10:39 < Namegduf> If Skype were static that'd be awesome
10:40 < Namegduf> I remember trying to get it working on a previously pure
64bit system
10:40 < Namegduf> It was non-trivial
10:40 < aiju> see
10:41 < aiju> http://aiju.phicode.de/rant/dynamic-linking i tried to sum up
some points here
10:41 < Namegduf> I do think static is much nicer for most distributed
software, though, I just think the assertion that dynamic is not usable is false,
and that it is never good requires better reasoning.
10:41 < adu> my counter-beef would be to ask: if DLL/SO works for some
people, then why would you prevent people from using it?
10:41 < nsf> adu: they don't
10:41 < Namegduf> If nothing else, package management means that a lot of
the time on real Linux systems, you DO control everything.
10:41 < nsf> but those people have to implement support for .so by
themselves
10:41 * taruti just wishes the people wanting to dynamically link go code would go
away
10:42 < adu> nsf: that's the same thing...  "don't allow" == "prevent"
10:42 < Namegduf> There are significant times when it is helpful to be able
to load modules at runtime
10:42 < Namegduf> At present, if you want to have a program support
optionally something, you have to provide builds with and without
10:42 < Namegduf> Or require every user to have a build setup
10:42 < Namegduf> Which is not good.
10:43 < taruti> or just provide a plugin interface without dynamic loading
10:43 < Namegduf> That's not a cure all.
10:43 < taruti> forkexec + pipe
10:43 < Namegduf> In fact, it's often not a cure at all, because it only
works when you really, really don't care about performance.
10:43 < taruti> like browsers?
10:43 < Namegduf> Yes, like browsers.
10:43 < taruti> just don't make too many calls over the bridge
10:44 < nsf> I hate plugins
10:44 < adu> taruti: "the bridge"?
10:44 < taruti> adu: pipe
10:44 < Namegduf> That's not always possible within the contraints of
needing to have all code linked into the optional thing in the separate process.
10:44 < adu> taruti: "pipe"?
10:44 < Namegduf> Let's say you want multiple storage backends.
10:44 < Namegduf> You HAVE to send large amounts to the backend and back.
10:45 < taruti> so why not simply link them in?
10:45 < taruti> dll aproach makes for a fragile interface
10:45 < aiju> db performance won't got much worse due to the pipe
10:45 < Namegduf> Which is totally irrelevant much of the time.
10:45 < nsf> although I know at least one use of dll/so
10:45 < Namegduf> The dll approach/"dynamic linking" is not the be all and
end all of uses of dynamic loading
10:46 < nsf> for a scripting language it's nice to have such technology
10:46 < nsf> but by that I mean real dynamic linking
10:46 < nsf> like dlopen
10:46 < aiju> that's dynamic loading
10:46 < Namegduf> That's dynamic loading
10:46 < nsf> ok, loading and linking
10:46 < nsf> :)
10:46 < Namegduf> Dynamic linking is the thing ld does
10:47 < adu> Namegduf: not on macosx
10:47 < Namegduf> And is a specific case of dynamic loading
10:47 < Namegduf> I don't care about Mac OS X
10:47 < adu> Namegduf: on macosx, dynamic linking is done by dyld
10:47 < Namegduf> Good for them.
10:47 < aiju> on mac os x <here be dragons<
10:47 < aiju> *>
10:47 < nsf> Mac OS x is a big freebsd/gnu hack
10:47 < nsf> :\
10:47 < adu> aiju: no, 99% of macosx is BSD, not dragons
10:48 < aiju> by /Libraries/Dynamic Linking/urgh/1.2.3.4.5/bin/dyld i
suppose
10:48 < Namegduf> Anyways, a program with modules is a significant other
case, and the only way to support one at present is to use separate processes,
which is very bad when the optional functionality is something that needs to be
called into a LOT.
10:48 < Namegduf> The only alternative is to require users to have a build
setup.
10:48 < Namegduf> Unless you're proposing static linking X and Qt or GTK+ or
another graphical library, an optional graphical frontend could be an example.
10:49 < Namegduf> Fragile interfaces is utterly irrelevant to pretty much
every application except dynamic linking
10:51 < Namegduf> Permission hooks are another case, perhaps to integrate
with PAM, because permission stuff can need to be called into for things which
happen very very often.
10:51 < aiju> haha PAM
10:51 < adu> "Dynamic linking is more compatible with <insert license
here>." lol
10:51 < Namegduf> PAM, SQL users...
10:51 < aiju> PAM is a POS
10:51 < Namegduf> LDAP, even.
10:51 < aiju> Namegduf: can you say "factotum"?
10:53 < taruti> Is there better profiling than 6prof available?
10:54 -!- sauerbraten [~sauerbrat@p508CF086.dip.t-dialin.net] has joined #go-nuts
10:55 < adu> aiju: I think the 1st, 2nd, and 4th bullets on your DL page are
very good, all others should be on a "jokes about DL" page
10:56 < nsf> oh, btw, there are also crazy distros like gentoo
10:56 < nsf> where no one knows what config user has regarding some
particular library
10:56 < nsf> binary distribution in that kind of environment is simply
impossible
10:57 < nsf> unless there is no dynamic linking
10:57 < adu> anyways, for the record, I think the only reason I'll ever get
fed up over is speed, the idea of turning a "CALL" instruction into 500
instructions every time I want to make an external call is pretty rediculous,
which is what macosx does
10:57 < nsf> hm..
10:58 < nsf> I wasn't ever conserned about speed
10:58 < aiju> 11:55 < taruti> Is there better profiling than 6prof
available?
10:58 < aiju> there is valgrind
10:58 < nsf> adu: just try to create a middle-sized open source project
which uses tons of libraries (e.g.  GUI something for X11)
10:59 < nsf> you'll have tons of problems with users complaining about
misbehaviour on their PCs
10:59 < adu> nsf: I used to work with CrystalSpace, so I know the story
10:59 -!- tensai_cirno [~cirno@79.104.4.218] has joined #go-nuts
10:59 < nsf> and it will turn out that libraries mismatch is the reason
10:59 < adu> CrystalSpace depends on around 30 libraries
10:59 < nsf> ah, I see
10:59 < adu> and to make matters even worse...  one of them was boost!
10:59 < aiju> tensai_cirno: http://h-2.abload.de/img/cirno_systems39kg.png
10:59 < nsf> well, to me it's management hell :)
11:00 < aiju> hahahaaha boost
11:00 < nsf> adu: but still, crystalspace is a development library
11:00 < adu> I hate boost with a passion
11:00 < nsf> so..  you don't have a lot of "average" users
11:00 < adu> but it's the primary dependancy of PlaneShift, which does
11:00 < nsf> hehe
11:01 -!- ampleyfly [ampleyfly@gateway/shell/blinkenshell.org/x-vwttvdghqwsozmwa]
has quit [Remote host closed the connection]
11:01 < nsf> well, true then
11:01 < aiju> the planets need to properly aligned to get anything
moderately complex working on gentoo
11:01 < taruti> meh, my app is mysteriously slow on FreeBSD and no 6prof on
FreeBSD :(
11:01 -!- aho [~nya@fuld-590c7cc9.pool.mediaWays.net] has joined #go-nuts
11:01 < taruti> valgrind works on Go code?
11:01 < aiju> jo
11:02 < tensai_cirno> aiju, lol
11:02 < nsf> a gentoo user
11:02 < nsf> here
11:02 < nsf> lol
11:02 < nsf> :)
11:03 < taruti> meh no stable valgrind on FreeBSD either
11:03 < nsf> tensai_cirno: he's totally right
11:03 < aiju> i ran gentoo for years, then i noticed how much better i could
spend all the time i spend configuring packages
11:04 * taruti wonders about gprof
11:04 < taruti> "gprof: ./8.out has no symbol table" <3
11:04 < aiju> gprof only works with GNU ld
11:05 < Namegduf> I remember hearing that valgrind gets angry with Go code
11:05 < Namegduf> But I could be wrong.
11:05 < aiju> Namegduf: callgrind works fine
11:05 < aiju> i profiled my emulator with it
11:05 -!- tensai_cirno [~cirno@79.104.4.218] has quit [Read error: Connection
reset by peer]
11:06 -!- tensai_cirno [~cirno@79.104.4.218] has joined #go-nuts
11:11 -!- fabled [~fabled@83.145.235.194] has joined #go-nuts
11:14 < adu> does anyone here know much about OpenCL?
11:14 < aiju> doesn't opencl require a special compiler?
11:15 < adu> yes
11:15 < aiju> so it won't work easily with Go
11:15 < nsf> in a big sense it's not that different from OpenGL
11:16 < nsf> just a different "shading" language and different API
11:16 < nsf> I don't think there will be any problems with that
11:16 * aiju would like an APL-like language for GPGPU
11:16 < adu> nsf: well, that was kinda the point of OpenCL, so be an OpenGL
for things other than graphics
11:17 < aiju> nsf: don't you need to compile kernels?
11:17 < nsf> aiju: of course you need to
11:17 < nsf> but library does that for you
11:17 < adu> I was thinking of using OpenCL for lambdas, is that overkill?
11:17 < nsf> adu: I think you know nothing about GPU architecture
11:18 < nsf> :)
11:18 < adu> no i do
11:18 < aiju> GPU (n.): here be dragons
11:18 < nsf> GPU has a very limited use
11:18 < nsf> aside from graphics
11:18 < adu> but also know about how OpenCL can be used to execute things on
the CPU or GPU
11:18 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-169-69.clienti.tiscali.it] has
joined #go-nuts
11:19 < adu> aiju: yes
11:19 < nsf> OpenCL is just a specification, a special language than can be
used for expressing GPU-based code
11:19 < nsf> like C, but for GPUs
11:20 < nsf> as for integrating it with Go
11:20 < adu> OpenCL is an API, OpenCL-C is the language
11:20 < nsf> well..  you have data exchange, you have an ability to compile
code and call functions
11:20 < nsf> what else do you need
11:21 < adu> something that compiles Go to C
11:21 < adu> i would need that
11:21 < nsf> why do you need that for OpenCL?
11:21 < adu> I don't, I'm just doing a cost/benefit analysis
11:21 < adu> it seems to not be beneficial
11:22 < nsf> why can't you just use C?
11:22 < adu> I can
11:22 < nsf> I'm writing C code for the last month or so, it's not that
different from Go to me
11:22 < aiju> because C has measles
11:23 < nsf> and now I have super cool autocompletion for vim for C as well
:P
11:23 < nsf> works very nicely
11:23 < Arafangion> nsf: which one do you use?  (autocompletion for C)
11:23 < nsf> https://github.com/nsf/ccode
11:23 < nsf> Arafangion: I wrote my own, uses libclang
11:24 < nsf> http://nsf.github.com/images/ccode2.png <- screenie
11:25 < aiju> initializing auto-variables?  Pike will kill your family
11:25 < Arafangion> nsf: Looks good, I might check it out when I have time.
(On Mac OS X...)
11:25 < nsf> Arafangion: it was written without portability in mind
11:25 < adu> nsf: does it work in emacs?
11:25 < nsf> so..  maybe there will be some problems with that
11:25 < nsf> adu: it can be ported to emacs in a day
11:25 < nsf> I just don't use emacs
11:26 < Arafangion> I'm also considering
http://www.vim.org/scripts/script.php?script_id=3302
11:26 < nsf> (about Mac OS X) although I have a friend that says it works on
Mac
11:26 < nsf> Arafangion: it's slower than ccode
11:27 < nsf> clang_complete uses python bindings for libclang and on big
completions especially (few thousands of results) it's much slower than ccode
11:27 < nsf> well, anyway, try it and see the difference
11:27 < Arafangion> nsf: Doesn't it filter the results according to context?
11:27 < nsf> it is
11:28 < Arafangion> I hope it's not the equivalent of word completion.
11:28 < nsf> but sometimes you want global results
11:28 < nsf> you see clang doesn't do partial autocompletions
11:28 < nsf> for example when you write: SDL_<and autocompletion here>
11:28 < nsf> clang can't do that
11:28 < Arafangion> Ugh, that's exactly what I want.  :(
11:28 < aiju> huh
11:28 < nsf> it says that you have to move cursor to the beginning of the
'SDL_'
11:28 < nsf> and get all the results
11:29 < nsf> and then filter them by yourself
11:29 < aiju> what *does* it do, then?
11:29 < nsf> clang_complete does it in python
11:29 < nsf> I do it in C
11:29 < aiju> nsf: if it doesn't do SDL_<complete>
11:29 < nsf> but the problem is, that you have to filter a lot of results
(over 9000 :D)
11:29 < aiju> what can you do with it?
11:29 < nsf> aiju: ugh..
11:29 < nsf> I said libclang can't do that
11:29 < aiju> oic
11:29 < nsf> autocompletion plugins do the filtering
11:30 < nsf> I'm explaining why making such plugin in python is a bad idea
11:30 < Arafangion> Still, 9k isn't something that would stress python.
11:30 < aiju> s/making such plugin/anything/
11:30 < nsf> filtering 9k results in python isn't fast
11:30 < Arafangion> Depends on how you organise your data structures.
11:30 < Arafangion> (And how much memory you can spare...  I can spare a GB
easily)
11:30 < nsf> Arafangion: the problem is that to format a result you need to
do a lot of C API function calls
11:31 < nsf> but that's just my guess
11:31 < aiju> Arafangion: wtf are you talking about?
11:31 < nsf> I think it's a bottleneck
11:31 < nsf> never tried it though
11:31 < aiju> how does python get faster if you spare a GB for it?
11:31 < nsf> I also have different approach for user interaction
11:31 < nsf> clang_complete has a lot of options
11:31 < nsf> ccode has zero options :)
11:31 < Arafangion> aiju: You can pre-compute all the possibilities, load it
in RAM, etcetera.
11:31 < nsf> it is supposed to just work
11:32 < aiju> options are for wimps
11:32 < aiju> real men can edit code
11:32 < Arafangion> nsf: But it sounds like I certainly want to give ccode a
go.  :)
11:32 < nsf> yeah, just try it
11:32 < nsf> but I'm afraid it won't work without modifications on Mac :)
11:32 < Arafangion> What's it like for ObjC?
11:32 < Arafangion> nsf: I'm curious about that...  Do you happen to have a
mac branch?
11:32 < aiju> Arafangion: read the page
11:33 < Arafangion> (Given that your friend says it works on the mac)
11:33 < aiju> "objc might work, i don't support it"
11:33 < aiju> "mac might work, i don't support it"
11:33 < nsf> Arafangion: no, I did the app in 3 days and only that friend
tested it on mac
11:33 < nsf> but his mac is kind of not very usual :)
11:33 < aiju> in my experience you need to be deliberate to write code which
doesn't work on OS X :P
11:33 < Arafangion> He must have fink installed and all that.  :)
11:33 < nsf> well..  anyway, it should work
11:33 < nsf> or not
11:33 < aiju> you might just need over 9000 compiler and linker flags for it
to build
11:34 < nsf> Arafangion: as for ObjC autocompletion
11:34 < nsf> as README says..  libclang supports it
11:34 < nsf> I don't
11:34 < nsf> :P
11:34 < nsf> it may work or may not
11:34 < nsf> I checked C++, it works
11:34 < nsf> kind of
11:34 < Arafangion> nsf: Awesome.  :)
11:35 < aiju> i'd rather want a plugin to look up manpages :P
11:35 < Arafangion> aiju: Isn't that ^k?
11:35 < nsf> ok, I've checked only one thing: #include <string> int
main() { std::string s; s.<autocomplete here> }
11:35 < nsf> it worked :P
11:35 < aiju> Arafangion: in which editor?
11:35 < Arafangion> aiju: vim.  :)
11:35 < aiju> not here
11:35 < Arafangion> c
11:35 < aiju> ^K is "enter digraph"
11:36 < aiju> it's K
11:36 < Arafangion> Oh, it's shift-k.
11:36 < aiju> but then again ..  i can just open another console and do man
:P
11:37 < aiju> Well over half of the time you spend working on a project (on
the order of 70 percent) is spent thinking, and no tool, no matter how advanced,
can think for you.  Consequently, even if a tool did everything except the
thinking for you -- if it wrote 100 percent of the code, wrote 100 percent of the
documentation, did 100 percent of the testing, burned the CD-ROMs, put them in
boxes, and mailed them to your customers -- the best you could hope for would be a
3
11:37 < aiju> this sums up my view on all those "tools"
11:37 < Arafangion> That reminds me.  My *ideal* "code completion" system
would display a list in a separate window, which keeps itself up-to-date as I
type.
11:37 < nsf> aiju: a good point
11:37 < Arafangion> aiju: That's infact, what we end up doing.  :) Having
all that crap done for you leaves you time to think.  :)
11:38 < nsf> but autocompletion helps a bit, especially in C case
11:38 < Arafangion> Why especially C?
11:38 < aiju> fuck, how do you spell open again?  :P
11:38 < Arafangion> It's the object-oriented languages that make me want it
more, especially as I often want to open the file where the function's defined.
11:38 < nsf> well, a cost of an error (let's say misspelling function) in C
is a bit higher
11:38 < nsf> compilation takes longer
11:39 < nsf> autocompletion reduces that kind of errors
11:39 < aiju> nsf: looks like you never used verilog lol
11:39 < Arafangion> Not if you useu incremental compilation.
11:39 < nsf> Arafangion: it depends
11:39 < aiju> after using verilog even g++ seems lightning fast
11:39 < nsf> on a project you're working on
11:39 < nsf> if it's big enough
11:39 < Arafangion> And the cost of misspelling a Python function is worse.
While 'compiling' is virtually instantanious, you only see the typo once your unit
tests fail.
11:39 < nsf> empty build can take up to a minute
11:39 < Arafangion> (Assuming you have unit tests)
11:40 < aiju> Arafangion: or javascript, things just get undefined hahahaha
11:40 < nsf> yeah, python is horrible for any kind of big apps
11:40 < aiju> nsf: there is this tool called make ....
11:40 < Arafangion> Not that horrible.
11:40 < nsf> I don't know how people live with that
11:40 < nsf> aiju: it's slow for some big projects as well
11:40 < nsf> aiju: and it's recursive variant has problems with tracking
dependencies correctly
11:41 < nsf> especially in C case :) again
11:41 < nsf> where you have to generate dependencies via external tool
11:41 < Arafangion> nsf: C is fast and easy.  C++ is where that pain begins.
:)
11:41 * Arafangion actually likes C++, keep that in mind!
11:41 < nsf> well, keep then in mind, that I'm a C++ hater
11:41 < nsf> :)
11:41 < aiju> HAHAHAHAHAHA
11:41 < Arafangion> nsf: That's fine, so am I. :)
11:41 < aiju> C++ is pure pain
11:42 < kimelto> if only we had methods in struct in C :)
11:42 < aiju> everytime i write C++ it feels UTTERLY good to write C
11:43 < Arafangion> Then again, having RAII and exception handlign is
nice...  But wow, the cost is huge.
11:43 < aiju> exception handling?
11:43 < nsf> it's funny actually that most complex apps are in C++ these
days, but when you see something like blender 2.5 and its source code
11:43 < aiju> there is setjmp/longjmp
11:43 < nsf> it tells you pretty much that C is not dead
11:43 < kimelto> I'm tired of writing function like
namespace_name_typethefunctiontakes
11:43 < nsf> kimelto: use autocompletion :)
11:43 < aiju> kimelto: then don't :P
11:43 < Arafangion> aiju: In C, exception handling pretty much has to be
done in eveyr stack frame if you dont' want to leak resources.
11:43 < nsf> btw, libclang's autocompletion is very good
11:43 -!- tensai_cirno [~cirno@79.104.4.218] has quit [Read error: Connection
reset by peer]
11:43 < nsf> for example:
11:44 < aiju> Arafangion: if "exceptions" can lead to leak ressources,
you're doing something wrong
11:44 < nsf> struct MyMegaStruct x = <an here autocompletion>
11:44 < aiju> exceptions are HOLY SHIT STOP THE FUCKING THING
11:44 < nsf> it will propose all functions returning that structs in a first
place
11:44 < aiju> not "oh lol someone typed a char and we wanted an int"
11:44 < nsf> really awesome
11:44 -!- tensai_cirno [~cirno@79.104.4.218] has joined #go-nuts
11:44 < Arafangion> aiju: There are those different schools of thought.  :)
Mind you, exceptions in C++ are expensive.
11:45 < aiju> i don't know what problem people have with error handling
11:45 < aiju> if(rc == -1) return -1; ...
11:45 < Arafangion> aiju: And sometimes you want a "CRAP!  STOP!  (But show
a nice window to the user so that they can see what's happened and send logs to
the company)"
11:45 < aiju> Arafangion: setjmp/longjmp
11:46 < Arafangion> Anyway, there's different schools of thought.  I've seen
that Go doesn't have exceptions, and I'm not entirely concerned.
11:46 < aiju> it does have exceptions, they're just used more like what i
just described
11:47 < kimelto> return codes?
11:47 < Arafangion> That's good.
11:47 < aiju> no, real exceptions
11:47 < aiju> see panic/recover
11:47 < kimelto> it is so exceptional that I never had to write code with
recover :)
11:48 < Arafangion> In C++ I use exceptions whenever something "unexpected"
happens, even if it is known that it could happen from time to time once in a blue
moon.
11:48 < aiju> i have a panic function for that
11:48 < nsf> I have a die function for that
11:48 < nsf> :D
11:48 < aiju> the gofy function is called fuck
11:48 < kimelto> Arafangion: like "you don't have perms to open this file in
write mode" ?
11:48 < Arafangion> kimelto: No, I'd use return codes for that.  :)
11:49 < Arafangion> kimelto: An exception would be "You don't have an audio
device...  But I'm a freaking audio program!"
11:49 < kimelto> haha :)
11:49 < aiju> nah
11:49 < aiju> an exception would be "out of memory" or "this number REALLY
shouldn't be negative"
11:50 -!- tensai_cirno [~cirno@79.104.4.218] has quit [Ping timeout: 264 seconds]
11:50 < Arafangion> aiju: Very well.  "The number of audio devices REALLY
shouldn't be zero".
11:50 < aiju> hahahaha
11:50 < aiju> no, something which can't be (or is unlikely to be) attributed
to user error
11:50 < Arafangion> aiju: The meaning of the term 'exception' has very
different meanings in different languages.
11:51 < aiju> mostly actual programmer errors
11:51 < aiju> division by zero, etc.
11:51 < kimelto> EINVAL
11:51 < Arafangion> aiju: In Python, for example, you run an exception
simply by reaching the end of an iteration.  (StopIteration exception, to be
precise)
11:51 < aiju> in python you create a list simply to count
11:52 < aiju> (yes i know of xrange and python 3.0 and what not)
11:52 < Arafangion> And reaching the end of that list raises the exception.
11:52 < aiju> python is a collection of worst practices
11:52 < Arafangion> Java is similiarly very happy with raising exceptions,
although not THAT happy.
11:52 < Arafangion> aiju: Python's not that bad, there's worse languages out
there.
11:52 < aiju> yeah, python is not as bad as python programmers
11:53 < Arafangion> aiju: Ouch.  That's a subtle comment.  :)
11:53 < aiju> and there is always worse ...
11:53 < kimelto> for programmers error I tend to use assert() rahter than
exceptions.  funnier.
11:53 < aiju> python feels like heaven compared to ruby
11:53 < Arafangion> Anyway, I think python is one of the better "mainstream"
languages out there.
11:53 < Arafangion> kimelto: And what do you do in release code?
11:54 < aiju> assert is evil
11:54 < Arafangion> aiju: I agree...  Yet I prefer Rake as my build script.
11:54 * kimelto is too
11:54 < Namegduf> Java's exceptions are okay
11:55 < aiju> Java's exceptions are THE WORST
11:55 < Arafangion> Namegduf: Sorry, I'm going to have to agree with aiju on
that.
11:55 < Arafangion> Although for different reasons.
11:55 < aiju> they combine the disadvantages of error codes and exceptions
11:55 < Namegduf> I prefer it being annoying to use but easy to know you're
being safe, to being easy to use by way of having nothing stopping you getting
them wrong.
11:55 < Arafangion> Namegduf: Ha!
11:56 < kimelto> Arafangion: I the software is tested it should be fixed
before production.  I'm talking about stuff like "this struct should be
initialized" and so on.
11:56 < Arafangion> Namegduf: It's surprisingly difficult to ensure that you
don't leak resources in Java.
11:56 < Arafangion> Namegduf: Most people don't bother.
11:56 < kimelto> if*
11:56 < nsf> the only thing I like in python is reference counting instead
of a GC
11:56 < nsf> well..  frankly it's not the only thing
11:56 < Namegduf> That's true, exceptions have that problem in general if
you don't use RAIA or whatever it was.
11:56 < nsf> but that's very important to me :)
11:56 < Arafangion> nsf: Python's ref counting is terrible, and
inconsistent.  :(
11:56 < aiju> Namegduf: defer!
11:56 < aiju> RIAA or whatever it was sucks
11:56 < kimelto> defer is ingenious!
11:57 < Arafangion> Namegduf: And you can't use RAII in Java!  Java has no
language support for it.
11:57 < Namegduf> aiju: Not having panics from outside the package makes it
much easier
11:57 < Namegduf> Arafangion: Right.
11:57 < aiju> doing OS operations in ressource allocation code?
11:57 < aiju> you're doing it wrong
11:57 < aiju> (sbrk doesn't count :P)
11:58 < Arafangion> aiju: Suppose you open a database connection, then you
do an operation, and you test something and realise that something is Badly Wrong,
so you throw an exception.  WHat happens to the database connection?
11:58 < aiju> Arafangion: i have defer'd the close operation and it is
closed haha
11:58 < Namegduf> aiju: Trying to remember to use defer for every kind of
possible thing you need to ensure is done is painful
11:58 < Namegduf> Lack of external panics is much, much nicer
11:58 < Arafangion> aiju: That's the smart way to do it, but that's rarely
how it's done, isn't it?
11:58 < aiju> do you expect most programmers to be smart?
11:59 < Arafangion> aiju: Infact, that tactic is very, very recent in
Java/C#/C++.
11:59 < Namegduf> You just need to apply that rule when calling your own
internal functions which you know may panic because you know about your own
package
11:59 < Namegduf> defer is the Go way to handle that kind of thing
11:59 < aiju> if it is REALLY important, i install a atexit function /
signal handler
11:59 < Arafangion> Yeah, that's why I don't miss exceptions in Go.
(Although...  I haven't actually written a line of Go code.  :( )
11:59 < aiju> like serial port in Windows
11:59 < aiju> (AHAHHAHAHAHAHAHAHHHAHAHAHA it's like you're really using
CP/M)
11:59 < Arafangion> aiju: WIn32 is painful, indeed.
12:00 * Arafangion is a windows programmer, although he mostly stays in the
higher-level languages.
12:00 < aiju> i tend to prefer staying low-level
12:00 < aiju> but this seems to be the wrong way with Windows …
12:00 < kimelto> what doesnt?
12:01 < Arafangion> aiju: I like all the levels - they each have their own
facinating design problems...  But it's indeed painful on windows.
12:01 < aiju> the only problem i encounter on low-level with UNIX is
premature end of read/write
12:01 < Arafangion> aiju: heck, even doing Winforms C# dev is painful.
Heaven help you if you nest TWO slider controls.
12:01 < aiju> and i have a wrapper for that one
12:01 < kimelto> you mean short writes?
12:02 < aiju> int really(void(*)(int,char*,size_t), char*, size_t) i think
it's funny
12:02 < aiju> really(read, buf, 512)
12:02 < aiju> eh fd argument
12:02 < aiju> w/e :P
12:03 -!- ildorn [~ildorn@dslb-188-099-195-088.pools.arcor-ip.net] has joined
#go-nuts
12:03 < Arafangion> aiju: Correct me if I'm wrong, but isn't the win32
equivalent of that problem /even worse/?
12:03 < aiju> you can even do EINTR handling there, it's amazing the library
doesn't provide such a function
12:03 < aiju> Arafangion: probably, i wasn't stating anything like that
12:03 < kimelto> "hey, write(), write 512 bytes" "ok its done I've
successfully written 120bytes!"
12:03 < aiju> my point was "low-level on UNIX is nice, except for ..."
12:03 < aiju> kimelto: premature end of read/write is understandable in the
context of the syscall interface
12:04 < aiju> the only problem is the lack of a library function to
compensate
12:04 < aiju> but it's just ten lines to write, so meh
12:04 < Arafangion> Fair enough, lets leave it at that.  :) I did find it
was interesting when I started learning ObjC (fairly recently), and realised that
ObjC exceptions were *completely* different to C++ or C# exceptions.  (I was
originally planning on using them...  I then realised I couldn't)
12:04 < aiju> hahaha
12:05 < Arafangion> I was wrapping a C++ library that would send an
exception in extreme situations.  (eg, the user unplugged the hardware
mid-operation).
12:05 < aiju> i once had to write reliable software
12:05 < aiju> it got down to: log the error, wait, repeat
12:06 < Arafangion> Like the good boy that I am, I was writing the wrapper
so that it would transform that exception into an ObjC exception...  Then I
realised that the semantics were completely different.
12:06 < Arafangion> Well, the UI may need to respond to the exception.
12:06 < aiju> there was no UI in that case
12:07 < Arafangion> (Not the UI, no...  The controller does, the controller
then tells teh UI what to do!)
12:07 < Arafangion> aiju: Arguably, yoru log was the UI. :)
12:07 < aiju> obj-c seems truly terrible
12:07 < aiju> i am the UI
12:07 < aiju> the endluser comes to me if there is a problem :P
12:07 < Arafangion> ObjC is nice, at least, in that it's a pure superset of
C, and the Obj system itself is quite nice - actually reminds me of Python.
Unfortunately, it's a strict superset of C. :(
12:08 < aiju> "strict superset?"
12:08 < aiju> does that mean you have K&R style functions?
12:08 < aiju> :P
12:08 < Arafangion> aiju: It's actually C99, minus /one/ or two features of
C99.
12:08 < Arafangion> (And that's only because the compiler isn't /quite/ 100%
supported for C99 yet)
12:09 < Arafangion> Something to do with float type pragmas or something.
12:09 < aiju> so what about K&R style functions?
12:09 < aiju> foo(a, b) int a, b; {...}
12:09 < Arafangion> That was pre-ANSI, wasn't it?
12:10 < nsf> afaik clang doesn't support float pragmas only because LLVM has
no support for that
12:10 < nsf> although maybe I'm wrong
12:10 -!- fenicks [~christian@log77-3-82-243-254-112.fbx.proxad.net] has joined
#go-nuts
12:10 < Arafangion> nsf: It's scary how much about C you guys know!
12:10 * Arafangion is a jack of all trades...  And poossibly, master of none.
12:10 < nsf> gcc is much farther from C99 btw
12:11 < Arafangion> Anyway, what standard of C the compiler supports...
That's what ObjC uses.
12:11 < Arafangion> C++, on the other hand, is not a strict superset of C.
12:12 < Arafangion> (Once upon a time, it may have been, but it's not now)
12:12 < Arafangion> (Which is why I find ObjC++ code a monstrosity)
12:12 < nsf> I think they will never be compatible after C99
12:12 < nsf> although I'm not a specialist in C++'s syntax
12:13 < Arafangion> They weren't compatible even with C89, although there
are apparently attempts at realigning the two.
12:13 < nsf> well, I was talking about syntax mostly
12:13 < nsf> semantically they are different yes
12:13 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
12:13 < nsf> static keyword behaves differently for sure
12:13 < Arafangion> That's really what it boils down to.
12:13 < Arafangion> The syntax.
12:14 -!- Scorchin [~Scorchin@host109-156-10-102.range109-156.btcentralplus.com]
has joined #go-nuts
12:14 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has joined #go-nuts
12:14 < Arafangion> ObjC to me feels like a nice extension to C. C++ feels
like a totally different language, which happens to mostly support C.
12:16 * Arafangion *really* wants to learn Go, it's on his list of langauges to
learn!
12:16 < adu> Arafangion: can I help?
12:17 < adu> Arafangion: the most different parts of Go (compared to C) are:
methods and interfaces
12:17 < Arafangion> adu: Alas, no - currently learning ObjC, and its
frameworks.
12:17 -!- visof_ [~visof@41.233.120.88] has joined #go-nuts
12:17 * Arafangion rarely struggles with learning syntax, it's the concepts that
are more difficult, and Go doesn't really seem that hard.
12:18 < adu> well, after learning ObjC, learning Smalltalk should be easy
for you ;)
12:18 < Arafangion> I'll want to move on to either Perl, Scheme, Haskell,
Erlang, or Go.
12:19 < adu> learn Perl6 first ;)
12:19 < zozoR> perl?  O.o
12:19 < Arafangion> What's the point?  THe only point of learning perl is
that perl5 is *everywhere*.
12:19 < aiju> hahahahahahhahaha Perl
12:19 < adu> then Perl5 will seem like a pile of garbage
12:19 < aiju> i remember the hierarchy diagram of Perl6
12:19 < zozoR> isnt perl just garbage or someone who bangs his head to the
keyboard?
12:20 < Arafangion> aiju: You should look for the 'periodic table of the
elements' for perl.  :)
12:20 < zozoR> cat /dev/urandom > script.pl
12:20 < aiju> 13:16 < Arafangion> ObjC to me feels like a nice
extension to C. C++ feels like a totally different language, which happens to
mostly support C.
12:20 < Arafangion>
http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html
12:20 < aiju> funny, i think of ObjC as an unholy mating of Smalltalk and C
12:20 -!- visof [~visof@unaffiliated/visof] has quit [Ping timeout: 246 seconds]
12:20 < aiju> and of C++ as an unholy extension of C
12:21 < aiju> Arafangion: i think that was it
12:21 < Arafangion> aiju: You are essentially writing two different
langauges simultaniously in ObjC.
12:21 < aiju>
http://images.encyclopediadramatica.com/images/1/17/P6_cover.gif
12:22 < Arafangion> Anyway, I refuse to like perl...  But I'd like to know
how to code in it.
12:22 < Arafangion> (And to read it!)
12:22 < taruti> just use awk+sed ;P
12:22 < Arafangion> *awesome!*
12:22 < Arafangion> aiju: Love that book, I have to buy it just for the
cover!
12:22 < Arafangion> aiju: Where can I get it...  I doubt I'd find it in a
"classic" bookstore.
12:22 < aiju> haha :P
12:23 < Arafangion> aiju: (I hope the contents are in klingon)
12:23 < aiju> i don't mind the "Perl is obfuscated" thing too much
12:23 < aiju> after all, i code K
12:23 < adu> Arafangion: fascinating
12:23 < aiju> sp:({x,/:\:x}@,:'states)
12:23 < aiju> start:~/''sp@\:\:\:1
12:23 < aiju> sel:{(2*~0=x)#''+:''sp@\:\:\:0}
12:23 < aiju> step:{{&/(#x),x}'' #:''' (x@/)'''x} sel@
12:24 < aiju> finite state machine minimization in four lines of code
12:24 * Arafangion wishes he was a computer scientist...
12:27 -!- illya77 [~illya77@38-211-133-95.pool.ukrtel.net] has quit [Ping timeout:
268 seconds]
12:29 -!- illya77 [~illya77@100-93-133-95.pool.ukrtel.net] has joined #go-nuts
12:29 < adu> Arafangion: why do you think you're not?
12:30 < Arafangion> adu: I've never actually studied algorithms, although I
know enough how to make them efficient, although I usually don't bother.  (Heck, I
use linq)
12:31 < Arafangion> In my mind, computer scientists are usually concerned
with the efficient implementation of algorithms.
12:31 -!- boscop [~boscop@g227128066.adsl.alicedsl.de] has joined #go-nuts
12:31 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has quit [Ping
timeout: 246 seconds]
12:33 < adu> Arafangion: i think Donald Knuth said it best, when he said
that efficiency can only be discussed with respect to a given platform
12:36 < Arafangion> Not so sure about that.
12:36 < Arafangion> Efficiency can only be discussed with respect to a given
*situation*.
12:36 < adu> Arafangion: can you ellaborate?
12:37 < Arafangion> adu: What is the platform for a win32 C# project?
12:37 < adu> CIL
12:37 < Arafangion> Which implementation, on which hardware?
12:37 < adu> i dunno
12:37 < Arafangion> For what data, and what network?  :)
12:37 < adu> i dunno
12:38 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: Quit]
12:38 < adu> OK, so sometimes the platform is the network, point taken
12:38 < Arafangion> There was something sensible when the unix programming
guide came out, "Design for the simplest algorithm, because for small N, the
constant is usually small, and N is usually small".
12:39 < Arafangion> (Not quoted word for word!)
12:40 < adu> I personally think that algorithms should be chosen based on
slog(N)
12:40 < hokapoka> I'm having a mental block trying to get the string value
of [12]byte
12:40 < Namegduf> string(thing)
12:40 < Namegduf> Or string(thing[:]) if the first doesn't work.
12:40 < hokapoka> Namegduf: that's what I thought.
12:40 < hokapoka> oh
12:41 < Namegduf> If you can't directly stringify a byte array, you can
stringify a slice that points at it.
12:41 < adu> sounds like a hack
12:42 < Arafangion> adu: I once coded up a quick sort algorithm, without
referring to any existing code.  I think it was N^2.
12:42 < Arafangion> adu: However, N was at /most/, 8.
12:42 < Arafangion> 30 minutes later, I was already working on the next
task.
12:42 < Namegduf> With an N of eight, you can literally just randomly swap
items
12:42 < Namegduf> And test for sortedness
12:42 < adu> Arafangion: that works
12:42 < Namegduf> And it will finish "quickly enough" on modern computers
12:42 < Namegduf> Hail the modern CPU!
12:42 < kimelto> bubble sort!
12:43 < Namegduf> No, randomly
12:43 < Arafangion> Well, for kicks, I added a note saying "This sort will
work in constant time".
12:43 < Namegduf> As in, test for sorted, pick two random numbers, swap the
corresponding items, go to start
12:43 < Arafangion> Because it didn't matter how well sorted the array
already was.  :)
12:43 < hokapoka> Namegduf: great many thanks
12:43 < Namegduf> I'm just saying, "it worked well enough with small N"
doesn't say much
12:43 < Namegduf> No problem.
12:44 < Arafangion> Namegduf: I couldn't be bothered to figure out how to
use random numbers in the language I was using at the time.  IT was quicker to
just sort it, even if inefficiently.  :)
12:44 < Arafangion> Namegduf: It's not that it worked well with small N. It
will ONLY be done with small N, so it doesn't matter.
12:45 < Namegduf> I like "Simplicity first, when performance doesn't matter,
small N speed and not unnecessarily awful O() next, because N is often small and
thus performance in terms of operations per second of actual applications tends to
depend more on that, THEN O() as a goal in itself."
12:45 < Arafangion> (For the record...  Delphi is a horrible language to
implement algorithms).
12:45 < Namegduf> Well, correctness first.
12:45 < Arafangion> For the specific types in question.
12:45 < Namegduf> Which is why I like Go more than Python for even the
"performance doesn't matter" case.
12:46 < Namegduf> Which can produce code faster is up for debate, but Go
will produce code you can feel sure works much faster, because being sure a Python
program works is very hard.
12:46 < Arafangion> I'm a TDD guy...  It'd be the same in either language.
12:47 < Namegduf> I've never seen an explanation for a practical application
of TDD which didn't have insane overheads in a non-trivial project
12:47 < Arafangion> Namegduf: Insane overheads?
12:48 < Arafangion> The best use for TDD is to ensure that your design is
easy to test, and that any accidental regressions created during refactoring are
caught early.
12:48 < adu> like compiling 100 binaries with a statically linked libgo,
where each binary is just a wrapper to call a function you're testing?
12:48 < Namegduf> I'm not wondering about best use.
12:48 < Arafangion> If your design is easy to test...  Then TDD isn't much
of an overhead.  It goes hand-in-hand.
12:49 < Namegduf> Yes, it is.
12:49 < Arafangion> adu: Meh, that's a detraction...  It's pretty good in C#
and the like where you have thousands of test in a single executable.
12:49 < Namegduf> You need to do it at least twice.
12:50 < Namegduf> TDD does not blend well with anything other than the
discredited waterfall model of development.
12:50 < Arafangion> I find it works extremely well with Agile methodologies.
12:50 < Namegduf> It makes the flawed assumption that you know your design
ahead of time.
12:50 < Arafangion> Namegduf: Do you mean to say that the one test tests the
entire application?  IF so, then you're NOT doing a unit test, you're doing a
system test.
12:50 < Namegduf> Which while hopefully true for the grand scheme of things
12:50 < Namegduf> No.
12:50 < Arafangion> Changing a feature should change a minimum of tests,
ideally one.
12:51 < Namegduf> I'm saying that individual tests do not test the grand
design you should hopefully know.
12:51 < Namegduf> They test *details*.
12:51 < Arafangion> That's not really the point of TDD>
12:51 < Namegduf> Tests require knowledge of the details (at least, the
external API) in order to write.
12:51 < Arafangion> TDD does little to ensure that integration tests will
work, it just gives an assurance that the unit that they test are still working.
12:52 < Namegduf> That's not related to what I'm saying.
12:52 < Arafangion> In C#, they're often testing ONE object.  Not two, ONE.
12:52 < Namegduf> I never said otherwise.  You may be misunderstanding me.
12:53 < Arafangion> Possible.  You may well also be misunderstanding how I
apply TDD.
12:53 < Namegduf> I'm saying that defining your API in full detail for
testing before you write it introduces additional delays to try to get the API
perfect in advance, instead of doing the details as you go along.
12:53 < Arafangion> Tests in TDD actually define the API.
12:53 < Namegduf> Then you define your API in your tests.
12:54 < Arafangion> You're effectively writing little examples, which should
then work once the api's implemented.
12:54 < Namegduf> I'm aware.
12:54 < Namegduf> That doesn't change my point.
12:54 < Arafangion> So, write the tests for the first 30 minutes.  The write
the implementation in the second 30 minutes.
12:55 < Namegduf> Or you could write the implementation in 30 minutes and go
get a coffee.
12:55 < Namegduf> 100% overhead is quite a lot, and I've not seen evidence
that it brings as much gain for that 100% as other options could.
12:55 < Arafangion> So now you have a 1mloc application, and you refactor
some code.  How do you know the ramifications of that refactoring?
12:55 < Arafangion> (Without doing system or expensive user testing)
12:56 < Namegduf> What does that have to do with doing tests before you
write the code?
12:56 < Namegduf> It's afterwards.
12:56 < Arafangion> The best value of the unit tests obtained with TDD is
that the design is trivial, and that you have some assurance that your refactoring
doesn't break any features that your code depends on.
12:57 < Arafangion> It doesn't, however, ensure that there are no bugs.
12:57 < Arafangion> (That's a fools dream)
12:57 < Namegduf> The design is trivial in all the examples I've seen
because the *design is trivial*
12:57 < Namegduf> Not because TDD was applied to something complicated and
it somehow became simple
12:57 < Arafangion> It does tend to encourage orthogonal design, though.
12:57 < Arafangion> And it does tend to encourage clean separation of
concerns.
12:58 < Namegduf> 100% overhead to "encourage" things would probably be
better swapped out for 50% overhead during which I just repeat those things to
myself.
12:58 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
12:58 < Namegduf> You understand the idea of examining costs, examining
benefits, comparing them, figuring out what options are better?
12:59 < Namegduf> I've not seen a reasoned argument that the specific
amounts involved are impressive for typical projects.
12:59 < Arafangion> I do, but I suspect that we examine and weigh the costs
differently.
12:59 < Namegduf> What I'm trying to say is that I'd like some explanation
for how your benefits are found.
13:00 < Namegduf> Costs are fairly easy to analyse when you have time
figures, because time is the main unit (complexity is kinda another)
13:01 < Arafangion> Objective measurements are very difficult, however, I've
noticed that in large projects where I may want to change the implementaiton of a
critical unit, it helps greatly to have existing tests that help give some
assurance that the new code is working correctly.
13:01 < Arafangion> Also, costs are higher in some types of software than
others.  Medical software, for example.
13:01 < Namegduf> I think unit tests are kinda neat
13:01 < Namegduf> I think you mean benefits
13:01 < Arafangion> I mean benefits?  For what word?
13:02 < Namegduf> Instead of costs.
13:02 < Namegduf> Reliability is more important, so the gain in reliability
is a bigger benefit.
13:02 < Namegduf> Right?
13:02 < Arafangion> Actually, /correctness/ is possibly more important.
13:02 < Namegduf> Okay.
13:03 < Arafangion> You don't want to accidentially prescribe someone the
wrong amount of medicine, even if the program was still running well enough to do
the prescription.
13:03 < Namegduf> I think you're giving reliability a too specific meaning
13:03 < Namegduf> It includes both lack of errors and uptime
13:03 < Namegduf> But that's just terminology.
13:03 < Arafangion> Very well, lets take the broad meaning.
13:04 < Arafangion> (I have to get to bed soon...  It's past midnight)
13:04 < Namegduf> I think unit tests are kinda neat, and useful.  I'm just
not convinced writing them first helps.
13:04 < Arafangion> In practice, I find I tend to write them simultaniously.
13:05 < Namegduf> Prototyping is useful, and if you can adapt a prototype
into a working design (you often can, but need to be prepared for when you should
throw it away) it's very fast.
13:05 < Arafangion> For certain problems, where the spec is well defined,
writing them first helps for sure.
13:05 < Namegduf> When the spec is well defined, I think most other problems
of design become trivial.
13:05 < Namegduf> Well, perhaps too strong.
13:05 < Namegduf> But I think it's an easy case.
13:05 < Arafangion> You're right, but the funny thing is...  So do the
tests, so I would argue that you might as well have them.
13:06 < Arafangion> There are some things I dont' bother writing unit tests
for, though.  UI code is *horrible* to unit test...  So I don't.
13:06 < Namegduf> UI code is horrible.
13:06 < Namegduf> I once tried.
13:06 < Namegduf> Not worth it.
13:06 < Namegduf> It isn't high-reliability code except in special cases, so
it's dubious that it deserves the cost in the first place.
13:07 < Namegduf> When accounting for the cost being higher...  I'm not
writing medical software.
13:07 < Arafangion> If high reliability is required, you can always decouple
the gui, anyway.
13:07 < Arafangion> Namegduf: You're not writing firmware, either.  :)
13:07 < Namegduf> I was thinking that in cases of high reliability showing
the wrong information could be Very Bad.
13:08 < Namegduf> So you might in certain circumstances have enough benefit
to justify unit testing a GUI.  I think browsers do, just because they have the
resources and their huge userbase gives them high costs to failures (also it's...
most of what they are)
13:08 < Namegduf> I don't think it's a good idea for an average little
personal project, though.
13:08 < adu> like your heart rate is 20.000000000001 beats per min
13:08 < Arafangion> The problem with unit testing a GUI is that such tests
are /fragile/.  I haven't found a way to write good GUI unit tests.
13:08 < Namegduf> Yeah.
13:09 < Arafangion> And fragile unit tests are a PITA.  You have to change
your tests for almost every change.  You've multiplied the cost of development by
a large number.
13:09 < Namegduf> Yeah.
13:09 < Arafangion> (And the more UI tests you have, the higher that number
gets)
13:09 < Namegduf> Higher costs- not just harder to write but harder to
maintain.
13:09 < Arafangion> They're often harder to write, as well.
13:10 < Namegduf> My preferred approach to design is to get an overview
sufficient to fit units together (not with formal APIs defined, but such that
responsibilities and how their designs will work together, then to start
prototyping.
13:10 < Namegduf> If the prototype works out neatly, whoo.  If not, throw it
away, use what's learned to make a good design and then implement that.
13:11 < Arafangion> That's a good solution...  My hope is that the moment
your program outgrows the prototype stage, it starts getting unit tests.
13:11 < Namegduf> Writing tests first would require a fairly significant
change, much more upfront design.
13:11 < Namegduf> That's what I'd want.
13:11 < Arafangion> I don't bother doing any automated unit tests for my
short scripts, for example.  The individualunit test quickly outgrows the size of
the entire project.
13:11 < Namegduf> I am biased towards small projects, which are hurt by
overhead but due to trivial design usually see little benfit.
13:11 < Namegduf> Yeah.
13:12 < Arafangion> And I'm biased towards large projects, that have
maintenance lives of years.
13:12 < Arafangion> "
13:12 < Namegduf> Those are the tricky cases.
13:12 < Arafangion> "large", anwyay.  Some of those programs are small.  :)
THey just live long.
13:12 < Namegduf> The classic example is large, long-lived projects
developed by people who know nothing about the domain.
13:13 < Arafangion> By inept programmers!
13:13 < Arafangion> THey're nasty.
13:13 < Namegduf> Yes!
13:13 < Arafangion> TDD helps teach good practices, as well.
13:13 < Namegduf> I can agree there.
13:13 < Namegduf> Being unit testable is kinda the opposite of a design
smell.
13:14 < Arafangion> For sure.  And it beats manually testing the latest
change you've done every time you change something in a legacy application.
(WHere legacy == no tests)
13:14 < Namegduf> The design separating concerns well enough that individual
bits can be tested independently is good.
13:14 < Arafangion> Yep.  Mind you, I do tend to go to an extreme there.
13:14 < Namegduf> I like that Go shoves you towards that by forbidding
circular references.
13:14 < Namegduf> You *cannot* have your packages depend on main, assuming
main calls into them somehow.
13:14 < Namegduf> It won't let you.
13:15 < Arafangion> Nice.
13:15 < Namegduf> Well, not without some horrible intermediary package with
function pointers.
13:15 < Namegduf> (Which you could always hijack in tests, I guess)
13:16 < Arafangion> I tend to rely heavily on dependency injection,
actually.
13:16 < Namegduf> Hmm, how does that work?
13:16 < Arafangion> Well, the trivial example is that you write a function
that parses a file.
13:16 < Namegduf> And yeah, I think Go's packages are better for separation
of concerns than object modeling things.
13:17 < Arafangion> Oh, object oriented systems are *fantastic*, it's just
that people often abuse subclassing too damn much.
13:17 -!- tensorpudding [~user@99.23.127.179] has quit [Remote host closed the
connection]
13:17 < Arafangion> Anwyay, so you have your function that parses a file.
13:17 < Namegduf> Yeah.
13:17 < Arafangion> If you don't use dependency injection, you might
hard-code the name of the file in the function, and that function will construct
everything neccessary to parse the file.
13:18 < Arafangion> Slightly better is to send it the name of the file.
13:18 < Arafangion> But it still has to open the file, and that's a
dependency it isn't really responsible for, so you'd be better off sending in a
file handle.
13:18 < Arafangion> Even better would be a stream, to make it generic.
13:19 < Namegduf> Right.
13:19 < Arafangion> Essentially, you should provide everything it needs so
that the function can do its core task - parsing the file.
13:19 < Namegduf> But nothing else.
13:19 < Arafangion> Indeed.
13:19 < Namegduf> That's what I like most about Go's interfaces.
13:19 < Arafangion> The concept works well in most mainstream languages,
especially C# and ObjC.
13:20 < Namegduf> In OO, you need to organise your subsets of things
provided into superclasses which are generally strict subsets of each other.
13:20 < Arafangion> *especially C#!
13:20 < Namegduf> In Go?
13:20 < Arafangion> I haven't honestly tried Go yet.  :(
13:20 < Namegduf> "I need something that reads.  io.Reader"
13:20 < Arafangion> I want to, though.
13:20 < Namegduf> "I need something that reads and closes.  io.ReadCloser"
13:21 < Namegduf> An interface is literally just a set of required methods,
and the type doesn't need to declare it meets it, so you can define your own after
the fact when writing the function.
13:21 < Arafangion> Namegduf: It's often confused with a service locator,
where the function will ask for the required provider...  That's better than
nothing, but I prefer explicitly passing things in.
13:22 < Namegduf> You get all the benefit you have to spend ages designing a
neat hierarchy in OO in, and either doing horrible things to hopefully mitigate
against future changes, or else reworking your hierarchy.
13:22 < Namegduf> Plus in OO to do the last you need access to where the
type was defined.
13:22 < Arafangion> Namegduf: I hate deeply nested hierachies.
13:22 < Namegduf> I really hate them.
13:23 < Arafangion> I do make extensive use of interfaces, but only because
in languages such as C#, it's the easiest way to let a type be re-implemented.
13:23 < Namegduf> The problem OO has is that to define a new subset of a
type you need access to where the type was defined.
13:24 < Arafangion> To its interface, you mean?
13:24 < Namegduf> Well, talking inheritance rather than interface usage.
13:24 < Arafangion> (And strictly speaking...  That's a problem that
statically-typed OO systems have...  Python and ObjC don't really have the same
issue, although Python, annoyingly, is trending to do the same)
13:24 < Namegduf> To change it (although it should be backwards compatible),
you need to change the type.
13:25 < Namegduf> Interface usage doesn't have the problem, IF you can
define that a type meets an interface outside the type'ss own package, or it "just
meets it", ala Go.
13:25 < Arafangion> As I said, it's a terrible way to do it.  You're not
going to convince me of anything new.  :)
13:25 < Namegduf> What do you consider OO design, then?
13:26 < Arafangion> Well, defining a class with a specific set of methods
that conforms to a particular interface, implied or otherwise.
13:26 < Namegduf> Hmm.
13:26 < Namegduf> That's interesting.
13:26 < Arafangion> And being able to define replacements for that
interface, if you so choose.
13:26 < Namegduf> So basically any use of interfaces.
13:27 < Arafangion> Inheritance is sometimes very useful, but it leads to
high coupling, which is bad.
13:27 < Namegduf> Of any sort.
13:27 < Arafangion> So I prefer composition.
13:27 < Namegduf> I'm not sure what Go's approach is considered as.
13:27 < Namegduf> "Not inheritance"
13:27 < Arafangion> (If I need to do 'inheritance').  I usually just
implement interfaces, but sometimes, more usually in GUI code, inherit GUI
controls.
13:28 < Namegduf> The closest thing I've ever come to "inheritance" being
needed was extending a type.  Some special instances of the type needed more data.
13:28 < Namegduf> And methods.
13:28 < Arafangion> But it should be important to realise that if you
inherit from /both/ an existing class, /and/ an existing implementation, you at
least get to keep a very flat heirachy, which is good.
13:28 < Namegduf> Locally attached servers vs ones further than one hop
away.
13:29 < Arafangion> Well, lately I've been doing a lot of inheritance in
order to redefine doPaint(), which changes what's painted to teh screen for that
control.
13:30 < Arafangion> (It should be mentioned that in some systems, such as
python or ObjC, inheritance isn't quite as closely coupled as say, C++ or C# is)
13:31 < Namegduf> In that case, I used Go's type embedding, which is
basically syntactic sugar for including the inner type in the outer, and defining
methods on the outer which just forward to the inner.
13:31 < Arafangion> In idiomatic python, I could 'inherit' from a given
class, simply by doing nothing more than implementing all the methods that the
code expects.  It doesn't need to actually say "I implement IFoo", nor "My
superclass is Foo".
13:31 < Namegduf> It has no dynamic dispatch.
13:31 < Arafangion> Namegduf: Dynamic dispatch is a nice feature...
Unfortunate Go doesn't have it, but it's understandable if it doesn't.
13:31 < Namegduf> Dynamic dispatch is through interfaces.
13:32 < Arafangion> Namegduf: It does, however, sound like that Go's type
'embedding' is effectively composition.
13:32 < Namegduf> Type embedding isn't interfaces.
13:32 < Arafangion> What I've found really nice, is ObjC's "target-action"
pattern.
13:32 < Namegduf> It does let the outer type match interfaces that the union
of its methods and the inner type's mthods meet.
13:32 < Namegduf> The problem I have with the way Python works there is that
basically it's very sensitive to changes in Foo.
13:33 < Arafangion> Basically makes it nearly pointless to inherit
something, you can just say "Hey you!  When the user clicks on you, that's an
UserClicked event!  Send that event to me!"
13:33 < Namegduf> If Foo has a feature added and then the code expecting Foo
changes to use it, things implementing Foo's stuff break.
13:33 < Arafangion> Which is neat, means you don't have to pass in a
function pointer, nor do you have to inherit it.
13:34 < Arafangion> Namegduf: Python code, practically speaking, *relies* on
TDD.  :(
13:34 < Namegduf> Function pointers are not bad in languages with good
closure support
13:34 < Namegduf> Yeah, I noticed that.
13:34 < Arafangion> ObjC has "blocks", now, although I've yet to use them.
13:34 < Namegduf> Python programs will run with half their code missing so
long as you don't touch it.
13:34 < Namegduf> Go can ALMOST do what Python does.
13:34 < Namegduf> It's very close.
13:34 < Namegduf> Just...  typed.
13:34 < Arafangion> Ha...  Nah, Python programs can run with *all* their
code missing, as long as it's been compiled.
13:34 < Arafangion> Python programs are strongly typed.
13:35 < Arafangion> (Type systems don't seem to mean what peopel think they
mean)
13:35 < Namegduf> Statically typed, then, rather.
13:35 < Arafangion> Ahh, very well.  :)
13:35 < Arafangion> Sounds like I'd really like Go.
13:35 < Namegduf> (I suppose "typed" didn't say very much...  they're all
variants using the word "typed" with rare exceptions)
13:36 < Namegduf> To do that kind of thing, a function would be written like
this:
13:36 < Arafangion> Well, "typed" implies "has types"...  C, and therefore
ObjC, for instance, are weakly typed.
13:36 < Namegduf> Go is strongly.
13:36 < Namegduf> No implicit casts.
13:36 < Arafangion> Does it have type inferrence?
13:36 < Namegduf> In *one* form.
13:37 < Namegduf> x := f() derives x's type from f.
13:37 < Arafangion> That's the most useful form.  :)
13:37 < Namegduf> Yeah.
13:37 < Arafangion> Does it have generic typing?
13:37 < Namegduf> The idea is that that's redundant, but if you start
removing more you start taking away information that's useful to the programmer
and helps the compiler produce useful error messages.
13:37 < Namegduf> No generics.
13:38 < Arafangion> That's unfortunate.  :(
13:38 < Namegduf> "Not yet"
13:38 < Namegduf> interface{} can be used kind of like you would use Object
in Java
13:38 < Arafangion> Ahh, hope it gets implemented "eventually" - perhaps
even real templates.  :)
13:38 < Arafangion> That's poor man's generic typing.
13:38 < Namegduf> Yes, it is.
13:38 < Arafangion> And horrible, to boot.
13:38 < Namegduf> Go suffers from being low level
13:38 < Arafangion> Java is even worse in that the basic types aren't even
object.
13:38 < Namegduf> Types are not all inherently pointers
13:39 < Namegduf> And thus cannot work with a single compiled instance of
the code
13:39 < Namegduf> So you would need C++-style instantiation but that has
other disadvantages...
13:39 < Arafangion> That just makes it non-absolutely-trivial.
13:39 -!- saturnfive [~saturnfiv@219.144.192.109] has joined #go-nuts
13:39 -!- saturnfive [~saturnfiv@219.144.192.109] has left #go-nuts []
13:39 < Arafangion> There are algorithms out there that can determine the
types.
13:40 < Namegduf> A Go function using interfaces might look like: func
someblah (x interface{ Foo(int) }) { ...; x.Foo(y); ...  }
13:40 < Namegduf> Interfaces with 1 or 2 methods are idiomatic and probably
most common.
13:41 < Namegduf> io.Reader has Read.  io.Writer has Write.
13:41 < Arafangion> Sounds like I'd really like Go, with the exception of no
generics.
13:41 < Namegduf> Any type defining the methods in the interface works.
13:41 < Namegduf> The type does not need to declare anything.
13:41 < Namegduf> interfaces don't model relationships, they declare what it
does.
13:41 < Arafangion> Hmm, that sounds intruging.
13:42 < Namegduf> type Fooer interface { Foo(int } <- idiomatic name for
the above interface.
13:42 < Arafangion> So, a type that implements, say, a given interface,
simply implemetns its given methods?  It doesn't explicitly say "I support IFoo"?
13:42 < Namegduf> Yes.
13:42 < Namegduf> The result of this is that the type does not have to be
defined for this in advantage.
13:42 < Arafangion> It's effectively strongly duck-typed?  (If that term
makes sense...)
13:42 < Namegduf> Yes.
13:43 < Arafangion> Now, that's neat.
13:43 < Namegduf> Duck-typed but with compile-time safety.
13:43 < Arafangion> What if you want to actually check for a given type?
13:43 < Arafangion> Or is that just non-idiometic Go code?
13:44 < Namegduf> Code smell, but so long as your code handles a failure
case okay it's safe (fmt.Printf works this way, and does)
13:44 < Namegduf> v, ok := x.(type)
13:44 < Namegduf> v has the type "type"
13:44 < Namegduf> ok indicates success
13:44 < Arafangion> Hmm.  I'm just wondering how autowiring would be
performed.
13:44 < Namegduf> v is the zero value if ok is false
13:44 < Arafangion> (Which is a concept in dependency injection)
13:44 < Namegduf> v := x.(type) also works.
13:45 < Namegduf> If x is not of (type), your program panics.
13:45 < Namegduf> You don't use that form unless you are very sure you know
what you're doing.
13:45 < Arafangion> At runtime?
13:45 < Namegduf> Yes.
13:45 < Arafangion> I want compile time.  :(
13:45 < Arafangion> Perhaps that could be solved using generics, if/when
it's added.
13:45 < Namegduf> If you want compile time, you don't want to write code
that tries to get types out of interfaces.
13:46 < Namegduf> Unless you use interface{} for generic purposes
13:46 < Namegduf> In which case yeah, it's unsafe.
13:46 < Namegduf> You can do reflection magic, but that's slow at runtime.
13:46 < Arafangion> In C#, the interface /is/ the type.
13:47 < Namegduf> The neat thing about Go's stuff, in my view, is that let's
say you need more than io.Reader.  You need special stuff that only os.File has.
13:47 < Arafangion> It's nifty in autowiring if you have a convention that
'IFoo is implemented by Foo", so your autowiring module will provide a Foo
whenever you need an IFoo.  (Only the main entry point uses the autowiring
module...  Otherwise the rest of the code would depend on that, and htat'd be a
huge code smell!)
13:48 < Namegduf> But you also want your own implementation, potentially.
13:48 < Namegduf> Or others.
13:48 < Arafangion> If, you want to provide an alternative implementation of
IFoo, you'd simply add that as a special case, which is no big deal because ONLY
the main entry point uses the autowiring routines!
13:48 < Namegduf> You can define your own interface which includes the
necessary bits of os.File
13:48 < Namegduf> Without needing to change or look at the implementation of
os.File
13:48 < Namegduf> And unlike Python, the compiler will check this and your
defined interface type will document it.
13:49 < Arafangion> How would you, using reflection, identify the type that
implements your new interface, assuming that you only write one implementation?
(Which is /usually/ the case)
13:49 < Arafangion> In C#, I use name matching, as a project-specific
convention, not only type matching, by the way.
13:50 < Namegduf> You can't.
13:50 < Arafangion> That's a big limitation imho, for large-scale Go.
13:50 < Namegduf> You just can't use the autowiring model.
13:50 < Namegduf> Need to move on.
13:50 < Arafangion> (Autowiring isn't a big deal in small projects)
13:50 < Namegduf> Perhaps a simple global factory function?
13:50 < Namegduf> If you really really really have to use it?
13:50 < Namegduf> First class functions.
13:51 < Arafangion> Hmm, yeah, I'd probably have to do something similar to
the solution I've implemented in python.  (Python provides woefully inadequate
reflection, ironically)
13:51 < Arafangion> Neat.
13:51 < Arafangion> Anyway, I really must get some sleep.
13:51 < Arafangion> I work in 8 hours.  :)
13:51 < Arafangion> Thanks for the chat!
13:51 < Namegduf> The problem in Go is that because interfaces are met by
any implementing type
13:52 < Namegduf> Is that it's very hard to predict which types will end up
in what interfaces
13:52 < Arafangion> Well, yes...
13:52 < Namegduf> Dynamic dispatch tables are generated at runtime for only
cases that are actually used
13:52 < Arafangion> But can you, however, determine a list of names and
interface names?
13:52 < Namegduf> There's a horribly huge number of possibilities.
13:53 < Namegduf> What you're suggesting is kinda unidiomatic for other
reasons, though.
13:53 < Namegduf> Instead of defining a huge thing and a huge interface
13:53 < Namegduf> Define a huge thing and have stuff expect just the
interfaces they need
13:53 < Namegduf> One or two methods is common
13:53 < Arafangion> The only code intrusion, is that your names are
unusually consistant, nothing else.
13:54 < Namegduf> Go names are namespaced, they can pretty much be whatever.
13:54 < Namegduf> A package is a namespace.
13:54 < Arafangion> Likewise in C#.
13:55 < Arafangion> Any name that doesn't match the convention, simply has
to be added to the autowiring explicitly.  It's still an advantage because your
dependencies are declarative, rather than imperative.
13:55 < Namegduf> There's one other very nice idiom, which is lowercase is
private and uppercase is public, so you can instantly tell when you're calling a
fucntion that's allowed to do Internal Stuff or not.
13:55 < Arafangion> So everything is public?
13:55 < Namegduf> No.
13:55 < Arafangion> I mean technically.
13:55 < Namegduf> Internal functions are lowercase, as are internal types
and internal fields.
13:55 < Namegduf> You can't access them from outside the package.
13:55 < Namegduf> It's compiler-enforced.
13:55 < Arafangion> Ahh, fair enough.  that /is/ a nice convention.
13:56 < Arafangion> I'll make Go the next language on my list, rather than
somewhere around #4.  :)
13:56 < Arafangion> G'night.  :)
13:56 < Namegduf> foo(x) <- foo is internal, I should know what this
does, and it can tiner with private bits
13:56 < Namegduf> Foo(x) <- This can't do anything to me I don't expose
13:56 < Namegduf> Anyways, sorry for keeping you up.
13:56 < Namegduf> Night.
13:56 < Namegduf> And thanks for the discussion.
13:56 < Arafangion> Heh, it was my choice...  It was a very interesting
discussion.  :)
13:57 < Namegduf> (Actually, it'd be pkg.Foo, but bleh.  Foo is same
package, public, which is still allowed to tinker with *this* package inside
itself)
14:01 -!- TheMue [~TheMue@p5DDF4AB4.dip.t-dialin.net] has joined #go-nuts
14:05 < adu> hi TheMue
14:05 < TheMue> hi adu
14:05 < TheMue> Quiet silent here, ,aybe still too early
14:07 < adu> TheMue: there was just a very long discussion
14:07 < adu> a comparison of Go and C#
14:07 < zozoR> who won?
14:07 < TheMue> ok, I came in too late *smile*
14:07 < zozoR> epic rap battle between C# and go?  :D
14:07 < Namegduf> Sure.
14:07 < Namegduf> Let's Go with that.
14:07 < TheMue> zozoR: Smalltalk
14:08 < adu> no epic battle, that would be *contrast*
14:11 < TheMue> so, now continue extend my supervision package
14:11 < adu> supervision?
14:14 < Namegduf> A superpower first mentioned in the little known
SuperOptician comic.
14:14 < TheMue> yep, inspired by erlang
14:14 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has quit [Ping timeout: 240 seconds]
14:14 < TheMue> restart a goroutine if it crashes
14:15 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has joined #go-nuts
14:15 < TheMue> second step will now be a heartbeat, for active monitoring
14:15 < TheMue> the first part work passive, using defer and a helper
function
14:18 -!- ildorn [~ildorn@dslb-188-099-195-088.pools.arcor-ip.net] has quit [Quit:
Leaving.]
14:23 < adu> fascinating
14:24 -!- visof_ [~visof@41.233.120.88] has quit [Changing host]
14:24 -!- visof_ [~visof@unaffiliated/visof] has joined #go-nuts
14:25 < Namegduf> TheMue: Why not put a defer that does it at the start of
the goroutine?
14:26 < Namegduf> Or are you planning to deal with "stuck" ones, too?
14:26 < TheMue> Namegduf: so it works, but the mechanism realizes a
controlled restart (even of multiple instances)
14:27 < TheMue> Namegduf: Heartbeat will be for the stuck ones
14:27 < TheMue> Look at
http://code.google.com/p/tideland-cgl/source/browse/#hg%2Fcglsup
14:34 < adu> WTF: func (ps *Points) Sort() { sort.Sort(ps) }
14:36 < TheMue> adu: Convenience ;)
14:52 -!- Fish- [~Fish@bus77-2-82-244-150-190.fbx.proxad.net] has quit [Quit: So
Long, and Thanks for All the Fish]
14:56 -!- Urtie [~urtie@90-227-159-22-no57.tbcn.telia.com] has joined #go-nuts
15:01 -!- photron [~photron@port-92-201-36-58.dynamic.qsc.de] has joined #go-nuts
15:02 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
15:02 -!- sauerbraten [~sauerbrat@p508CF086.dip.t-dialin.net] has quit [Remote
host closed the connection]
15:13 -!- visof_ [~visof@unaffiliated/visof] has quit [Quit: Leaving]
15:17 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:fdd6:f649:2d94:8023] has joined
#go-nuts
15:20 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has joined #go-nuts
15:23 -!- sauerbraten [~sauerbrat@p508CF086.dip.t-dialin.net] has joined #go-nuts
15:30 < zzing> skelterjohn: Good morning
15:33 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
15:35 < zzing> Can anyone tell me what causes 6l to know what to link in for
an executable, when a package being used needs a certain library or framework
(mac)?
15:37 < aiju> 16:38 < adu> [15:36:39] WTF: func (ps *Points) Sort() {
sort.Sort(ps) }
15:37 < aiju> oh my god
15:39 < adu> what?
15:39 < aiju> what's the point in this definition
15:39 < aiju> +?
15:39 < aiju> s/in/of
15:39 < adu> aiju: that's what I was trying to figure out
15:39 < aiju> are people *that* lazy?
15:39 < adu> TheMue is
15:40 < TheMue> no, as the developer of this code I'm not lazy.  I'm only
provide convenience for lazy people
15:41 < Namegduf> Simpler APIs are more convenient than shortcuts
15:41 < Namegduf> It's Go's style and it's a good one.
15:41 < TheMue> no need to import sort, shorter method call, and maybe later
more stuff inside but hidden for users
15:41 < Namegduf> (Of course, an API that makes its use elegant and pretty
is good too)
15:42 < aiju> paraphrasing Coco Chanel "if you designed a library, before
you leave the house, take one function out"
15:42 < TheMue> no one is forced to use it, but if Points itself once will
not implement the sortable interface the code won't break
15:43 < Namegduf> Retaining the ability to stop implementing an interface is
the WORST "future proofing" excuse ever
15:43 < TheMue> it's just alpha, so changes still happen
15:43 < aiju> futureproofing in alpha is evil
15:43 -!- sven__ [~sven@mnhm-590e7236.pool.mediaWays.net] has joined #go-nuts
15:43 < Namegduf> Especially since people can still use sort.Sort, for
consistency with *every other type they sort*
15:43 -!- sven__ [~sven@mnhm-590e7236.pool.mediaWays.net] has quit [Read error:
Connection reset by peer]
15:44 < Namegduf> And should, even.
15:44 < Namegduf> One consistent way of doing something > convenience
methods bloating an API
15:44 < aiju> futureproofing without a crystal ball is generally useless
15:44 < Namegduf> Futureproofing as an excuse to do something is awful
15:44 < Namegduf> The benefit in this case calculates to basically nothing
15:45 < jumzi> Looks cool tough!
15:45 < Namegduf> Any decision can be justified as leaving certain options
open, the question is whether they're USEFUL, and more useful than alternatives.
15:46 < TheMue> OMG, once again debating on principles instead of just use
it or leave it
15:46 -!- shvntr [~shvntr@113.84.147.13] has quit [Quit: leaving]
15:46 < Namegduf> No, discussing quality.
15:46 < TheMue> why it's every time and for every lang the same?  *sigh*
15:46 < Namegduf> Because discussing quality and design techniques is a
perfectly fine thing to do.
15:46 < aiju> 16:48 < TheMue> OMG, once again debating on principles
instead of just use it or leave it
15:46 < aiju> yay through programming
15:46 < aiju> let's just hit the keys until it works
15:47 < Namegduf> And not invalidated at all by the fact you can choose not
to use it.
15:47 < jumzi> Actually he has a point, if you have a problem with it go
implement a sane alternative
15:47 < Namegduf> Why?
15:47 < Namegduf> I don't even know what it does and doubt I want one
15:47 < aiju> can't you apply "listen to it or ignore it" to our discussion?
15:47 < aiju> gosh, always those principle debates
15:47 < Namegduf> Heh, yeah, go with that.
15:48 < adu> composition may not be important to users, but it important to
developers, because composition is directly proportional to everything else:
matinainability, usefulness, refactorability, agileness, simplicity, readability,
clarity, manipulexity, and whipuptitude
15:48 < Namegduf> Why are you talking to other human beings if your stance
on everything is "take it or leave it"?
15:48 < jumzi> aiju: No its impossible, that would be rude
15:48 < Namegduf> Anyways, the reason a discussion happens is that the
people involved are interested in it.
15:49 < TheMue> Namegduf: Never put it into discussion here.
15:49 < Namegduf> Then you don't have to be involved.
15:49 < TheMue> Namegduf: But nice if people are interested.
15:49 < adu> I'm fascinated by software composition
15:50 < TheMue> adu: I'm fascinated by working software
15:50 < Namegduf> I like to see something and figure out what I can learn
from it
15:50 < Namegduf> If it makes me go ew I want to know why
15:50 < Namegduf> And I then like to share these views and see what others
think to further improve my knowledge
15:50 < Namegduf> This is called a "conversation"
15:51 -!- sven__ [~sven@mnhm-590e7236.pool.mediaWays.net] has joined #go-nuts
15:51 < adu> what bothers me about current software is the numerous
inner-platforms
15:51 < aiju> what bothers me about current software is the MASSIVE
OVERENGINEERING ALL OVER THE PLAE
15:51 < aiju> +C
15:52 < Namegduf> You could have just said OO
15:52 < Namegduf> We all would have understood
15:52 < aiju> it's not limited to OO
15:52 < Namegduf> Hmm.
15:52 < aiju> you can just put a list of names in a plain text file
15:52 < Namegduf> I guess not, although the last time I saw a non-OO major
piece of software was a while ago.
15:52 < aiju> but NOOOO it has to be SQL in an ORACLE server connected via
JSON
15:52 < aiju> s/SQL/XML
15:52 < Namegduf> SQL is good for concurrent access
15:52 < Namegduf> XML is good for basically nothing
15:52 < adu> aiju: I like binary too
15:52 < TheMue> aiju: Why so loud?
15:52 < Urtie> it heats datacenters
15:52 < Namegduf> Concurrent access with multiple writers, I maan
15:53 < aiju> adu: binary is usually evil
15:53 < adu> aiju: I used binary for my game save files
15:53 < Namegduf> Binary is good if you want to preserve special characters
15:53 < Namegduf> Like line breaks and such.
15:53 < aiju> text files are manipulable by common tools like sed/awk/grep
15:53 < Namegduf> Text files are good if you are *strictly* storing textual
information.
15:53 < aiju> and most importantly, text editors :D
15:54 < Namegduf> You could represent everything as text (convert to base
64) but it isn't very useful.
15:54 < aiju> reading binary in a platform independent way
15:54 < Namegduf> Is trivially implementable
15:54 < aiju> Namegduf: *please*, i'm not going in that discussion
15:54 < Namegduf> You just need to actually implement it
15:54 < aiju> +is difficult
15:54 < Namegduf> 1) Use encoding/binary 2) Profit
15:54 < kimelto> "you *just* need"
15:54 < Namegduf> In Go it's already implemented anyway
15:55 < aiju> go is cheating
15:55 < Namegduf> But you could do it much simpler if all you need is a
fairly well defined subset of things.
15:55 < aiju> try doing it with Javascript lol
15:55 < kimelto> is there someting similar to gob in C?
15:55 < aiju> i'm not saying binary is completely useless
15:55 < aiju> i'm not saying everything should be text
15:55 < adu> kimelto: yes, it's called fread/fwrite
15:55 < kimelto> protobuf-c seems overkill for my needs
15:55 < aiju> 16:55 < adu> aiju: I used binary for my game save files
15:55 < aiju> seems perfectly reasonable
15:55 < aiju> 16:57 < adu> kimelto: yes, it's called fread/fwrite
15:55 < Namegduf> aiju: I'm just saying I'm tired of protocols that shit
themselves on line breaks and NULs and require bizarre encoding tricks
15:56 < aiju> hahahahah seriously?
15:56 < Namegduf> aiju: Just so they can be textual
15:56 < Namegduf> Like, say, email
15:56 < Namegduf> SMTP, more specifically
15:56 < aiju> Namegduf: you can use a pseudo-textual format for that
15:56 < aiju> see HTTP
15:56 < Namegduf> Or you could *not*
15:56 < jumzi> http must die
15:56 < aiju> everything has a price and everything needs a cost/value
estimation
15:56 < jumzi> It's killing my buffers
15:56 < Namegduf> Since you already have to implement binary transfer of
stuff.
15:57 < adu> http would be so fantastic if it used ISO dates
15:57 < kimelto> adu: something more "high" level.  bsom seemed interesting
but there are no lib to my liking out there for C.
15:57 < aiju> Namegduf: enjoy debugging your binary format, i don't
15:57 < kimelto> bson*
15:57 < Namegduf> aiju: 1) encoding/binary 2) Profit
15:57 < Namegduf> There is no debugging
15:57 < aiju> hahaha
15:57 < aiju> there are no bugs
15:57 < jumzi> aiju: You write software with bugs?
15:57 < jumzi> looser
15:57 < kimelto> that's how clever you are!
15:57 < adu> kimelto: you mean bson?  try
https://github.com/mongodb/mongo-c-driver/
15:57 < Namegduf> "debugging binary formats" is for people who do it weirdly
or do complicated ones.
15:57 < kimelto> adu: yes
15:57 < Urtie> If performance and data allows for it, text-based protocols
are easy to debug, sniff and test.  So what?  There are cases where that doesn't
matter.  See memcache and their reasons for switching FROM text to binary, for
example.
15:58 < aiju> Namegduf: you never debug networks at all?
15:58 < Namegduf> aiju: Not in a text editor.
15:58 < adu> kimelto: I'm writing something like that actualy, it's called
libdson
15:58 < Namegduf> And those protocols can't be text-based.
15:58 < aiju> i like my sniffer not having to implement all formats in
existence
15:58 < kimelto> adu: for C?
15:58 < adu> kimelto: yes
15:59 < aiju> (or me providing them in a config or w/e)
15:59 < adu> kimelto: I've got it to compile under mac/linux/android/iphone
15:59 < Namegduf> aiju: You're right, everything should serialise to a
standard linebroken list of key: value pairs, regardless of protocol
16:00 < kimelto> adu: cool.  do you have a public repo or something so I can
see what it looks like?
16:00 < Namegduf> Or what they're transferring, encoding binary stuff as
appropriate
16:00 < aiju> that's completely not my point
16:00 < Namegduf> JUST so you can debug it in vim
16:00 < adu> kimelto: yes, but it's empty
16:00 < kimelto> eh!  :)
16:00 < adu> kimelto: drosera.co.cc for my design docs
16:00 < aiju> try reading IP headers by hand
16:01 < aiju> compare that to trying to reading a HTTP header
16:01 < Namegduf> My point is that binary data is binary data and storing it
otherwise or having a half/half format is horrible.
16:01 < aiju> (i'm not saying IP should be textual)
16:01 < kimelto> adu: "drosera.co.cc has expired"
16:01 < adu> oops
16:01 < Namegduf> aiju: I'll read one fine.
16:02 < Namegduf> 1) Open Wireshark or any other app.  2) Read it.
16:02 < Namegduf> Yes, if it's human readable as well as ASCII there are
advantages in that you don't need such an application.
16:02 < aiju> i said "by hand", because Wireshark doesn't implement any
fucking protocol in existance
16:02 < Namegduf> This advantage has a low benefit value assigned.
16:02 < Namegduf> Because this is a rare event.
16:03 < Namegduf> "low" in the same way that "XML can be parsed by anything"
is low.
16:03 < Namegduf> It's basically the same argument.
16:03 < aiju> hahahhaha
16:03 < aiju> no, it's not
16:03 < Namegduf> Pure text protocols are fine.
16:04 < Namegduf> Half text, binary-encoded-specially mashups are horribly
ugly in behaviour
16:04 < Namegduf> And the text parts being easier to read do not make it
better.
16:04 < aiju> yes it does
16:04 < jumzi> Namegduf: But how else will i be able to have the cookie AND
eat it?
16:04 < aiju> in cases like HTTP the text part tends to be the most
important in debugging
16:04 < adu> kimelto: I have a version of what I had a year ago:
http://andydude.5gigs.net/up/
16:04 < Namegduf> They might be an advantage but they're pretty small next
to the option of not having horrible encoding tricks in the protcol as used every
day.
16:05 < aiju> "horrible encoding tricks" like just putting a fucking length
in front of it
16:05 < aiju> is it that hard?
16:05 < TheMue> For the fans of pure interface usage (what's a good
paradigm): where do you document it for godoc, so that a package user don't has to
scan all methods and compare it to interfaces?
16:05 < Namegduf> More like base64 encoding.
16:05 < Namegduf> Or whatever it is email uses.
16:05 < TheMue> Here Go is less explicit than Java
16:05 < aiju> i'm not advertizing 7-bit compatibility or similar turds
16:05 < Namegduf> You don't.
16:06 < TheMue> Do you put it in the package header?
16:06 < aiju> e-mail is horrible for that
16:06 -!- n___ [~n____@5ad54238.bb.sky.com] has joined #go-nuts
16:06 < Namegduf> You can put it there, yeah, if it's designed to implement
a specific one
16:06 < Namegduf> aiju: HTTP uses base64 encoding here and there
16:06 < aiju> huh?  where?
16:06 < aiju> last time i looked all it had was Content-length and be done
16:07 < adu> kimelto: so what's your beef with bson, mongodb (the C++ bson
lib) and mongo-c-driver (the C bson lib)?
16:07 < Namegduf> Oh god, URL encoding
16:07 < Namegduf> URL encoding is another hugee offender
16:07 < aiju> you want to put fucking binary in URLs?
16:08 < Namegduf> If they contain binary.
16:08 < TheMue> Hehe, pure rpc based on HTTP GET *lol*
16:08 < Namegduf> If a URL has a special character in it it should be sent
as said special character.
16:08 < Namegduf> It isn't.
16:08 < aiju> URL encoding is a POS
16:09 < Namegduf> URL encoding happens, because HTTP can't handle it because
it wants to be textual
16:09 < kimelto> adu: I don't know...  seems too big for my little use
16:09 < Namegduf> It isn't length-prefixed, so it has other delimiters, so
those other delimiters need to become illegal, so they need some way to represent
them...
16:09 < kimelto> I found tpl, but again the usage is not very friendly.
16:11 < adu> kimelto: mongo-c-driver is tiny
16:11 < adu> kimelto: what's your usecase?
16:13 < aiju> Namegduf: there are also simple ways of escaping
16:13 < kimelto> adu: cache datas between executions.
16:14 < adu> ya, I'd just use read/write
16:14 < kimelto> in binary?
16:14 < adu> aiju: btw, why were you laughing earlier?
16:14 < Namegduf> aiju: I tend to think escaping is worse than just
designing a protocol that could carry binary data to carry it from the start.
16:15 < Namegduf> I mean, even if you must have text parts you can at least
length-prefix the parts which could have arbitrary stuff in it.
16:15 < aiju> but URLs are supposed to be TEXT
16:15 < aiju> adu: when?
16:15 < Namegduf> aiju: Everything you can encode into one is legal in one.
16:16 < adu> <aiju> hahahahah seriously?
16:16 < Namegduf> aiju: If that means no delimiters are reserved, then it
should be length-prefixed
16:16 < Namegduf> And sent raw
16:16 < Namegduf> Far simpler and more elegant than horrible encoding and
escaping
16:16 < aiju> i have yet to understand why you put binary into URLs after
all
16:17 < aiju> adu: are you using fread/fwrite for reading/writing into
structs?
16:17 < adu> aiju: yes
16:17 < Namegduf> aiju: It isn't about what "I" do.  It's about whether it's
legal or not.
16:17 < Namegduf> aiju: If you feel that certain things should not be
encodable in URLs and should thus be used as a end-of-URL marker
16:17 < Namegduf> Then that's fine.
16:17 < Namegduf> They still don't need horrible encoding tricks.
16:18 < kimelto> adu: I'll have to implement arrays in my format, and
prepend the lenght of strings so I know how much to read.  sound like fun but
sounds also like re-doing stuff that someone has already done.
16:18 < aiju> adu: that's a BAD BAD BAD BAD idea
16:18 < Namegduf> But if things can be put in a field, said field should be
designed so it doesn't need horrible encoding rules defined to fit it
16:18 < adu> aiju: why?
16:18 < aiju> it breaks if you switch (1) the architecture (2) the compiler
(3) the compiler version (4) the phase of the moon
16:19 < jumzi> Orange?
16:19 -!- rlab_ [~Miranda@91.200.158.34] has joined #go-nuts
16:19 < Namegduf> Yeah, directly doing that is non-portable.  Use
encoding/binary or your own thing (which can be as simple as writing out the
members, bearing in mind endianness)
16:19 < kimelto> It's bad to write sizeof(struct) but if you write for each
member then refill the struct its ok I guess
16:19 < Namegduf> Endianness is relevant to all variables bigger than a byte
16:19 < aiju> no, there's endianness
16:19 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Operation timed out]
16:19 < Namegduf> And it means that new code reading old data has issues
16:20 < aiju> big endian is luckily almost dead but some machines still use
it
16:20 < adu> Namegduf: I'm really not worried about it, since the file is
deleted during the update processs
16:20 < kimelto> aiju: again, it depends of the use case.  for a local cache
I don't care to read a file written on another arch.
16:20 < Namegduf> adu: It's temporary and local to the current machine?
16:21 < adu> yes
16:21 < aiju> kimelto: can you say "heterogenous network"?
16:21 < Namegduf> Okay then.
16:21 < Namegduf> aiju: Restricting cache files to being readable on the
same arch is not so bad
16:22 < kimelto> aiju: the data will not leave the machine.
16:22 < Namegduf> I think he might be thinking of that insane UNIX idea
where random parts of the file system are actually on other machines because some
reason
16:23 < aiju> "insane UNIX idea"?
16:23 < aiju> oh you mean "distributed systems"?
16:23 < Namegduf> At that level, yes.
16:23 < aiju> UNIX was actually pretty centralized
16:23 < vegai> insane as in genius?
16:23 < Namegduf> vegai: It presently has pretty few advantages...
16:23 < jumzi> Well its insane to think in terms of distributed computing
16:23 -!- illya77 [~illya77@100-93-133-95.pool.ukrtel.net] has quit [Read error:
Connection reset by peer]
16:24 < Namegduf> It's like OS-wide dynamic linking!  :P
16:24 < jumzi> its slow among other things
16:24 < aiju> could people please stop attributing random thinking to UNIX?
16:24 < aiju> s/thinking/things
16:24 < Namegduf> Sorry.
16:24 < kimelto> local cache is local :)
16:24 < Namegduf> I just assumed it being completely crack and all it was
UNIX
16:24 < Namegduf> :P
16:25 < Namegduf> Just joking around, 's all.
16:25 < aiju> it tends to be a bad idea to think "this file will only be
read on this arch"
16:25 -!- mimustafa [~steve@92.62.119.57] has left #go-nuts []
16:25 < jumzi> worked for windows?
16:25 < aiju> you end up having arch-dependent compiler intermediate files
16:26 < Namegduf> jumzi: Technically Windows had it, and Windows worked.
16:27 < Namegduf> (Well, it sold)
16:28 < jumzi> Well if the consumers liked it, it must be doing something
right
16:28 < aiju> "if we asked the costumers what they wanted they would have
said: 'faster horses'" henry ford
16:28 < kimelto> so I guess I'll use
http://tpl.sourceforge.net/userguide.html :p
16:28 < aiju> the costumer is always wrong
16:29 < Namegduf> jumzi: Technically it just has to not be wrong enough to
completely render a product in a very strong market position unsellable
16:29 < kimelto> but, heck, he has money!
16:29 < Namegduf> Which says very little.
16:31 < Namegduf> aiju: Also I'll concede, I can't find any mention of
base64 IRT HTTP.  I suppose I must have been thinking of typical cookies, which
suffer from this syndrome horrificially but I'm not going to assign blame there.
16:31 < jumzi> Namegduf: pfft, weakling
16:31 < aiju> well, the last good thing called cookies was meant to be eaten
16:32 < adu> mmmm
16:32 < jumzi> what about pies?
16:32 < jumzi> i like them both as menus and food
16:33 < adu> since when are pies menus?
16:33 -!- DerHorst [~Horst@e176098194.adsl.alicedsl.de] has joined #go-nuts
16:33 < Namegduf> http://live.gnome.org/ScratchPad/CircularMenus
16:34 < jumzi> I'm thinking snes
16:34 < aiju> there are no circles on SNES
16:34 < jumzi> Well given your age i reckon you haven't played many SNES
games
16:35 < aiju> i played Zelda III in an emulator
16:35 < adu> Namegduf: that sounds like vapormenus
16:35 < jumzi> (i shouldn't have either, but freaky parents)
16:35 < aiju> gnome is full of vapour
16:35 < Namegduf> adu: I think I happened across that discussion or one like
it
16:35 < aiju> highly acidic vapour, to be precise
16:35 < Namegduf> They were not restricting their proposals to mobile
devices, but suggesting it for apps in general, on the same grounds in that
article.
16:35 < Namegduf> It was pretty amusing.
16:36 < adu> heh
16:36 < aiju> GNOME is a mistake, carried from perfection as far as possible
16:36 < Namegduf> "Have input devices that fit to the menus?" <-
Introducing the new Macbook Wheel!
16:36 < aiju> just like VP8 GNOME is something which only exists because of
people getting butthurt over licensing
16:37 < Namegduf> aiju: I think "Please pay us thousands of pounds and once
it's become dominant in say five years or so, let's renegotiate" is reasonable
reason to be "butthurt"
16:37 < adu> what's VP8?
16:37 < Namegduf> Google's video format
16:38 < adu> what does VP8 have anything to do with Gnome?
16:38 < Namegduf> Nothing.
16:38 < adu> then what is "VP8 GNOME"?
16:38 < Namegduf> I parsed that with a comma in the middle.
16:38 < Namegduf> Was a guess, I could habe been wrong
16:39 < aiju> adu: "just like VP8, GNOME"
16:40 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts
16:40 < aiju> VP8 is a free video format about which i haven't heard too
much good things except "it's free!"
16:41 < adu> people do that, get butthurt that is
16:41 < aiju> there seem to be some patent issues involved so it might not
even be free after all
16:42 < Namegduf> aiju: Free in a money sense
16:42 < adu> wtf
http://code.google.com/p/circular-application-menu/source/browse/#svn%2Ftrunk%2Fimages
16:42 < Namegduf> aiju: That's why.
16:42 < aiju> H.264 is free for non-commercial usage as well
16:43 < Namegduf> No, it isn't.
16:43 < aiju> yes it is :P
16:43 < Namegduf> Not for all non-commercial use.
16:43 < Namegduf> It's free to encode.
16:43 -!- foocraft [~dsc@dyn-86-36-42-96.wv.qatar.cmu.edu] has quit [Remote host
closed the connection]
16:43 < Namegduf> Browsers who want to support it have to pay fees.
16:43 < adu> WHAT?!?
16:44 < aiju> not if they are free
16:44 < Namegduf> aiju: Also they reserve the right to expire all the
current terms in 2015, I think
16:44 < adu> kimelto: you still here?
16:44 < kimelto> adu: yup
16:44 < Namegduf> aiju: Which means they can wait until it's popular and the
standard then set prices to whatever they like, and the MPEG-LA includes MS,
Apple, and various other evils.
16:44 < Namegduf> They *will* do it.
16:48 < Namegduf> aiju: The portrayal of it as "free-obsessed idiots" is
mostly people who can't tell the difference between FOSS fanatics and people who
think that basing Internet video around a standard that a single entity can set
the price on is somewhat...  concerning.
16:48 < Namegduf> So, basically crappy tech "journalism".
16:49 -!- nettok [~quassel@200.119.154.190] has joined #go-nuts
16:50 < Namegduf> Mozilla support claim Google and Apple are paying "a large
annual fee" right now.
16:51 -!- wrtp [~rog@212.183.128.1] has joined #go-nuts
16:55 < TheMue> So, heartbeat implementation looks good, now stress it with
unit tests.
16:55 < kimelto> when we have patents for medications, patents for a video
format seems...  futil
16:55 < aiju> god, patents for medication have to die ASAP
16:56 < adu> aiju: why?
16:56 < adu> aiju: most medications are deadly
16:56 < aiju> everything is deadly in high quantities
16:56 < adu> that doesn't answer my question
16:56 < aiju> patents, along with regulations, push the prices for
medication unnecessarily high
16:57 < aiju> making them inaccesible for e.g.  people in third world
countries
16:57 < kimelto> because business in the health area is generally a bad
thing.
16:57 < adu> exactly
16:57 < aiju> no it isn't
16:58 < adu> the cure for cancer was discovered in 1946, but since it wasn't
profitable, no one cared
16:58 < aiju> "profitable"?
16:58 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping
timeout: 260 seconds]
16:58 < aiju> a cure for cancer would be damn well profitable
16:59 < kimelto> "Would you patent the sun?" :)
16:59 < adu> aiju: then you should read up on the cure that Dr. Max Gerson
developed
16:59 < adu> you'll be rich!
17:00 < aiju> it's like those eternal light bulb rumours
17:00 < aiju> about some conspiracy in the light bulb industries putting
down eternal light bulbs
17:00 < kimelto> a woman in portugal did, iirc :)
17:00 < aiju> while, in fact, those things have a ridiculous efficiency
17:01 < aiju> according to wikipedia (yes lol wikipedia) that gerson therapy
works has yet to be proven
17:01 < adu> aiju: it's proven
17:02 < adu> aiju: it's just that any time a reputable doctor *proves* it,
the pharmaceutical companies put pressure on their employers to fire them
17:02 < aiju> yes, just like it's "proven" that US never went to moon
17:02 < aiju> and all that conspiracy crap
17:02 < kimelto> what?  they went to the moon?  :)
17:02 < adu> I can give you a list of at least 5 doctors who have proven the
Gerson Therapy, and all of them have lost their jobs
17:03 < aiju> homeopathy "works" as well
17:03 < adu> aiju: no
17:03 < adu> stop making poor inferences
17:03 < Namegduf> adu: I'm pretty sure the NHS would love to save that kind
of budget money.
17:03 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #go-nuts
17:03 < Namegduf> adu: The world is not the US and we have doctors too, and
they are not all motivated in the same way.
17:04 < adu> BigPharma is not limited to the US, you know
17:05 < kimelto> we are going to solve the health care deficit in go-nuts
\o/
17:05 < aiju> kimelto: we simply let the GC handle it
17:06 < adu> btw, homeopathy is just water
17:06 < kimelto> placebo works!
17:06 < kimelto> to some extent
17:06 < adu> kimelto: Gerson therapy is not placebo
17:06 < Namegduf> adu: Sssh.  it's the only way to get people to drink
anything other than soda.
17:07 < Namegduf> :P
17:07 < aiju> Gerson's therapy required the patient to consume a raw plant
based diet and to drink an 8-ounce glass of fresh organic juices every waking
hour.  Coffee and castor oil enemas were among several types of prescribed enemas,
and some patients were given hydrogen peroxide orally and rectally.  Rectal ozone
was also applied.  Dietary supplements include vitamin C and iodine.  The diet
prohibited the drinking of water and consumption of berries and nuts, as well as
us
17:07 -!- sven__ [~sven@mnhm-590e7236.pool.mediaWays.net] has left #go-nuts
["Ex-Chat"]
17:07 < Namegduf> Rectal ozone.  I'm scared to look this up now.
17:07 < aiju> Gerson believed it would be effective against most chronic
diseases including tuberculosis, most forms of advanced cancer, arthritis (both
osteoarthritis and rheumatoid arthritis), and diabetes.
17:07 < adu> Namegduf: now you see why people are still "looking" for a cure
17:07 < aiju> thinks which "work" for a broad spectrum like this tend to be
hoaxes/placebos
17:07 < aiju> *g
17:08 < Namegduf> adu: We're all too scared of rectal ozone?
17:08 < aiju> the only thing proven about Gerson therapy is that it kills
people
17:08 < adu> Namegduf: but the basics of the Gerson Therapy are 3 fold: (1)
high potasium, (2) low sodium, (3) fresh
17:08 < kimelto> rectal zone?
17:09 < adu> the coffee enemas are to stimulate the liver
17:09 < aiju> and by stimulate the liver you mean killing people?
17:09 < Namegduf> I didn't realise my liver responded to caffeine that way.
17:09 < kimelto> alcool stimulate the liver too!  :)
17:09 < Namegduf> Or through that route.
17:09 < adu> Namegduf: it does
17:10 < adu> Namegduf: when you get coffee that close to the liver, it
cleans your body more than it usually does
17:10 < adu> aiju: where did you get that from?
17:10 < kimelto> a liver on steroids?  ^W caffein?
17:11 < aiju> adu: wikipedia
17:11 < jumzi> lol, best troll ever
17:12 < Namegduf> So are you having coffee enemas?
17:12 < adu> Namegduf: who, me?
17:12 < Namegduf> Yeah.
17:12 < jumzi> I sure cured his cancer!
17:12 < jumzi> it*
17:13 < adu> Namegduf: no, but I do maintain a high potassium diet, avoid
sodium, and take iodine supplements
17:13 < adu> also, I don't have cancer, yet
17:13 < jumzi> Myself I'm a vegan
17:13 < aiju> jumzi: you only eat oranges
17:13 < jumzi> And I don't have cancer, yet
17:13 < jumzi> must be the oranges
17:13 < Namegduf> Way I figure it, if I eat enough unhealthy food the
cancers from the later food will kill the earlier cancers.
17:13 < jumzi> no doubt
17:15 < adu> aiju: aha!  i found the page you were talking about:
http://info-junction.net/wp/the-gerson-therapy-the-proven-nutritional-program-for-cancer-and-other-illnesses/
17:15 < Namegduf> adu: Maybe the doctors get fired because people refuse to
take coffee enemas seriously.
17:15 < adu> aiju: what she's describing sounds like normal detox symptoms
17:17 < jumzi> Please, science with explanation or atleast backed with
deacent studies = good
17:17 < jumzi> rest = very bad
17:18 < adu> anyways, there are some dubious parts, but I know 2 people who
would be dead if it wasn't for the Gerson Therapy
17:19 < Namegduf> Next up on PBS: Rectal ozone: The disgusting hero of the
nation.
17:19 < aiju> there are hundreds of people who would have died without
placebos
17:19 < jumzi> And if A came before B, doesn't mean that A caused B
17:19 < jumzi> It's easy for our humans to see patterns like that as a truth
17:20 < kimelto> it means that B happened after A ;)
17:21 < jumzi> Placebo is not to be underestimated tough, it can be very
strong
17:22 -!- ampleyfly [ampleyfly@gateway/shell/blinkenshell.org/x-hiitmqbrghdoafhz]
has joined #go-nuts
17:23 < kimelto> you give water with sugar to someone who can't sleep
telling him it contains a sleeping tablet he will sleep like a baby!
17:23 < Namegduf> kimelto: You know what works better?
17:23 < kimelto> nop
17:23 < kimelto> hit on the head?
17:23 < Namegduf> kimelto: Medicine that does nothing but have slight
negative side effects.
17:24 < Namegduf> "I can feel something working!"
17:24 < adu> *vomit*
17:25 < adu> kimelto: anyways, I uploaded that site to
http://andydude.5gigs.net/drosera.co.cc/htdocs/
17:26 < kimelto> adu: thanks!
17:28 -!- wrtp [~rog@212.183.128.1] has quit [Ping timeout: 268 seconds]
17:29 < adu> kimelto:
http://andydude.5gigs.net/drosera.co.cc/htdocs/drospecs/dson.html is the most
detailed docs of DSON I have
17:40 < aiju> oh wow
17:40 < aiju> what's this?
17:40 < aiju> some kind of contest entry for the most baroque language?
17:42 < adu> aiju: could you be more specific?
17:42 < aiju> it supports JSON, XML, YAML and what not
17:42 < exch> Only one question comes to my mind: Why?  :p
17:42 < jumzi> metadata
17:43 < aiju> it even has its very own encoding
17:43 < adu> exch: why what?
17:44 < exch> why the need for that 'language'?
17:44 < adu> it's not a language
17:44 < exch> ok then, why the need for that 'not-language'?  :p
17:45 < adu> it's an object model
17:45 < exch> Seems a little complicated for that
17:46 < adu> exch: how does it seem complicated?
17:46 < exch> from the quick look I did through that document.  Granted
though I barely read it
17:46 < exch> But still, json works
17:47 < adu> it does, but there wasn't any obvious mappings from QNames to
JSON objects, so I had to write my ideas down somewhere, and it turned into that^
17:47 < exch> fair enough
17:49 -!- perdix [~mkhl@sxemacs/devel/perdix] has joined #go-nuts
17:49 < adu> also, if you want to skip complicated parts, just read "Formal
DSO Definition" that's the object model
17:49 < adu> which, IMHO, is too complicated
17:50 < Namegduf> This is significantly longer than the JSON RFC.  :(
17:54 < kimelto> http://bsonspec.org/#/specification :)
18:00 -!- tvw [~tv@e176009246.adsl.alicedsl.de] has joined #go-nuts
18:02 < plexdev> http://is.gd/TIGwJS by [Luuk van Dijk] in
go/src/pkg/runtime/ -- runtime-gdb.py: gdb pretty printer for go strings properly
handles length.
18:06 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
18:08 < aiju> kimelto: fucking hashbangs in URLs
18:09 < adu> lol
18:09 < adu> I was just reading about how twitter did that
18:10 < aiju> webpages with # in URLs are probably not worth visiting
18:13 -!- visof [~visof@unaffiliated/visof] has quit [Ping timeout: 246 seconds]
18:13 -!- foocraft [~dsc@89.211.71.208] has joined #go-nuts
18:14 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts
18:15 < adu> so are you ppl saying I should make DSON shorter?
18:18 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
18:18 < aiju> i don't even know what an "object model" is supposed to be
18:20 < adu> aiju: Go has objects
18:20 < aiju> no it does not
18:21 < adu> yes, it does, maybe not OOP objects, but it has C objects
18:21 < adu> objects are what variables denote
18:22 < adu> my point is that every language has its own definition of
"object"
18:23 < jumzi> thus making an "object model" abit fussy
18:23 < Namegduf> What about languages which do not define the word
"object"?
18:23 < adu> jumzi: no
18:23 < aiju> yay definition mess
18:23 < aiju> if i say object
18:23 < aiju> i mean orange
18:23 < Namegduf> If you want to get to what the language defines as object,
as the definition of object
18:24 < adu> jumzi: an "object model" is the artifact/document which defines
"object"
18:24 < aiju> so why the fuck write the object model in a computer language
18:24 < aiju> why write it in XML
18:24 < Namegduf> Then Go, as defined by the language specification, has no
definition of the word "object"
18:24 < Namegduf> And thus has no objects
18:24 < Namegduf> It's a fairly strict definition of OO more concerned with
terminology then semantics, though
18:24 < adu> Namegduf: no, but it does describe an object model
18:25 < aiju> yeah, so what the fuck is an object model?
18:25 < aiju> a magical woo-woo XML file?
18:25 * adu thinks
18:25 < adu> no
18:25 < Namegduf> An object model is a model of a problem domain made using
OO techniques
18:25 < Namegduf> Which is used as a design step in writing an OO program
18:25 < Namegduf> UML can be used to make one, there are probably other
tools
18:26 < adu> Namegduf: where did you get that definition?
18:26 < aiju> for me, a model (in programming) is a concretization of an
abstract concept
18:26 < aiju> like a memory model
18:27 < adu> for me a model is an abstraction of concrete implementations
18:27 < Namegduf> http://en.wikipedia.org/wiki/Object-modeling_technique
<- Here's one example of an approach to it.
18:28 < Namegduf> As used in reference to OO objects, I feel the OO design
methodlogy is the appropriate usage of the term
18:28 < adu> well, if you really want to be technical, I guess it's an
"Object Metamodel"
18:28 < jumzi> see, this is why i like the language of the computer
18:28 -!- gmilleramilar [~gmiller@38.104.67.234] has joined #go-nuts
18:28 < aiju> "meta" is a prefix which triggers my bullshit sensors
18:28 < adu> which is why I didn't use it
18:28 < Namegduf> It seems to be used roughly as you described it as well,
but again it's a definition that leads to no meaning or information
18:29 -!- gmilleramilar1 [~gmiller@38.104.67.234] has quit [Ping timeout: 240
seconds]
18:29 < Namegduf> You show Go has an "object model" by showing that for a
given definition of object model everything has one.
18:29 < Namegduf> The appropriate conclusion is that that was not what they
meant
18:29 < aiju> this all goes to the UML direction
18:29 < aiju> cute diagrams without any actual purpose
18:30 < aiju> real programmers can read code
18:30 < aiju> (or comments, but those tend to be wrong)
18:30 < adu> no
18:30 < adu> I hate UML
18:30 < Namegduf> aiju: They make managers happy, and many people will write
books about how awesome OO is
18:30 < adu> aiju: can you please stop with the poor inferences
18:30 < Namegduf> aiju: So its usage makes them happy
18:31 < jumzi> aiju: glibc?
18:31 < jumzi> Is that the "real programmer" test?
18:32 < Namegduf> Real programmers can read the executable.
18:32 < aiju> jumzi: glibc can't be read without taking drugs
18:32 < jumzi> I have no problems with that
18:32 < aiju> real programmers read core dumps without a calculator, but
that's another story
18:33 < mpl> real programmers write code instead of arguing what a real
programmer is?
18:33 * mpl hides
18:33 < aiju> mpl: also that one
18:33 < Namegduf> That too.
18:33 < Namegduf> :P
18:34 * jumzi shoots an orange on mpl
18:34 < jumzi> here i go with my grammar again w/e
18:34 -!- ymasory_ [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has quit [Quit:
Leaving]
18:34 -!- ymasory [~ymasory@c-76-99-55-224.hsd1.pa.comcast.net] has joined
#go-nuts
18:34 < aiju> jumzi: why's your grammar that bad, aren't you from orange
county?  :D
18:34 < mpl> I'm probably a real programmer but apparently a bad one, I
doubt that's better than a "non-real" programmer.
18:35 < jumzi> Why are you a bad one?
18:35 < adu> I think we're all quiche eaters ;)
18:35 -!- visof [~visof@unaffiliated/visof] has quit [Quit: Leaving]
18:35 < aiju> Go is for sissies
18:36 < aiju> real programmers write FORTRAN IV
18:36 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
18:36 < aiju> (i love that essay)
18:36 < adu> http://www.nrao.edu/~ckutz/The%20Story%20of%20Mel.pdf
18:36 < mpl> jumzi: because it takes me so long to get a codereview one,
that a go dev got impatient submitted an alternative one to mine :(
18:37 < mpl> s/one/done/
18:37 < mpl> *impatient and
18:37 < mpl> sorry, sore fingers.
18:38 < mpl> aiju: I write f77/90, does that count?
18:38 < aiju> no
18:38 < mpl> meh
18:38 < aiju> F90 doesn't even to fit on a punch cards
18:38 < aiju> fucking heretics
18:38 < aiju> +have
18:38 < aiju> -a
18:39 -!- n___ [~n____@5ad54238.bb.sky.com] has quit [Quit: n___]
18:39 < mpl> to make things worse, it's mixed with c++ and python and the
whole thing is built with cmake and ccmtools (but that horrible mix is not my
fault at least).
18:39 < aiju> wow
18:39 < aiju> rm -rf *
18:39 < mpl> still more fun than my previous java project though.
18:39 -!- fenicks [~christian@log77-3-82-243-254-112.fbx.proxad.net] has quit
[Read error: Connection reset by peer]
18:40 < aiju> mpl: are you getting paid for this or being masochistic?
18:40 < mpl> paid.
18:40 < mpl> (barely?) :)
18:43 * aiju would love to just quit school and get a fucking job
18:46 -!- foocraft [~dsc@89.211.71.208] has quit [Quit: Leaving]
18:50 -!- adu [~ajr@softbank220043139062.bbtec.net] has quit [Quit: adu]
18:52 -!- femtoo [~femto@95-89-196-229-dynip.superkabel.de] has quit [Read error:
Connection reset by peer]
18:53 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-148-127.clienti.tiscali.it]
has joined #go-nuts
18:53 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
18:56 -!- Ultali [~matt@kali.vm.bytemark.co.uk] has joined #go-nuts
18:56 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-169-69.clienti.tiscali.it] has
quit [Ping timeout: 260 seconds]
18:58 -!- Sgeo_ [~Sgeo@ool-18bf618a.dyn.optonline.net] has quit [Ping timeout: 240
seconds]
18:59 -!- visof [~visof@unaffiliated/visof] has quit [Ping timeout: 276 seconds]
19:01 -!- Ultali [~matt@kali.vm.bytemark.co.uk] has left #go-nuts []
19:01 -!- DerHorst [~Horst@e176098194.adsl.alicedsl.de] has quit [Remote host
closed the connection]
19:05 -!- gits [~gits@77.94.219.158] has quit [Ping timeout: 264 seconds]
19:07 -!- gmilleramilar [~gmiller@38.104.67.234] has quit [Ping timeout: 240
seconds]
19:09 -!- PortatoreSanoDiI [~Marvin@dynamic-adsl-94-36-148-127.clienti.tiscali.it]
has quit [Quit: E se abbasso questa leva che succ...]
19:10 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-148-127.clienti.tiscali.it] has
joined #go-nuts
19:25 -!- gmilleramilar [~gmiller@38.104.67.234] has joined #go-nuts
19:30 < TheMue> So, heartbeats done with first unit testing.
19:33 < TheMue> Now continuing the translation of my Go book toc into
English.
19:35 -!- aho [~nya@fuld-590c7cc9.pool.mediaWays.net] has quit [Quit:
EXEC_over.METHOD_SUBLIMATION]
19:49 -!- sukuri [~dont_worr@c0c1c03c748b.click-network.com] has joined #go-nuts
19:51 -!- tensai_cirno [~cirno@77.232.15.216] has joined #go-nuts
19:51 -!- sukuri [~dont_worr@c0c1c03c748b.click-network.com] has left #go-nuts []
20:06 -!- meanburrito920 [~john@192.5.109.49] has joined #go-nuts
20:06 -!- meanburrito920 [~john@192.5.109.49] has quit [Changing host]
20:06 -!- meanburrito920 [~john@unaffiliated/meanburrito920] has joined #go-nuts
20:10 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
20:10 -!- meanburrito920 [~john@unaffiliated/meanburrito920] has quit [Client
Quit]
20:12 -!- gits [~gits@77.94.219.158] has joined #go-nuts
20:13 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
20:14 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has joined #go-nuts
20:18 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
20:19 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has joined #go-nuts
20:20 -!- PortatoreSanoDiI [~Marvin@82.84.76.112] has joined #go-nuts
20:24 -!- Project-2501 [~Marvin@dynamic-adsl-94-36-148-127.clienti.tiscali.it] has
quit [Ping timeout: 272 seconds]
20:29 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has quit [Read
error: Connection reset by peer]
20:29 -!- vsayer [~vivek@c-76-102-205-58.hsd1.ca.comcast.net] has joined #go-nuts
20:43 -!- sauerbraten [~sauerbrat@p508CF086.dip.t-dialin.net] has quit [Remote
host closed the connection]
20:46 -!- tensai_cirno [~cirno@77.232.15.216] has quit [Ping timeout: 260 seconds]
20:46 -!- tensai_cirno [~cirno@77.232.15.216] has joined #go-nuts
20:48 -!- tarrant [~tarrant@69.169.141.202.provo.static.broadweavenetworks.net]
has joined #go-nuts
20:49 < zzing>
/Users/jdrake/.work/go/pkg/darwin_amd64/glfw.a(glfw.cgo2.o)(__TEXT/ __text):
glfwOpenWindow: not defined
20:49 < zzing> Is it possible that a linking error such as this could be
actually caused by the real symbol having an underscore before it in the C
library?
20:49 < zzing> Such as _glfwOpenWindow
20:50 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has joined
#go-nuts
20:57 -!- fabled [~fabled@83.145.235.194] has quit [Quit: Ex-Chat]
21:07 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has quit [Ping timeout: 240 seconds]
21:07 -!- zzing [~zzing@CPE0024369fd268-CM0012254195d6.cpe.net.cable.rogers.com]
has joined #go-nuts
21:14 -!- xash [~xash@d170084.adsl.hansenet.de] has joined #go-nuts
21:14 < tarrant> Why is the if statement valid without a brace block in:
http://pastie.org/1587021
21:15 < zzing> tarrant: does that output 5 or 6?
21:15 < zzing> I am guessing it always outputs 6
21:16 < tarrant> In this case it outputs 6.  If you join the braces onto the
"if blah()" line then it outputs 5.
21:16 < exch> that seems like a bug
21:16 < zzing> yes, so what is happening is if (false); { x++ }
21:16 < exch> the if statement is not complete and a compiler erorr should
be thrown
21:17 < aiju> i don't see the problem with this
21:17 < tarrant> aiju: try reloading.  I edited the document thinking it
would create another url.
21:17 < tarrant> changed it back
21:17 < aiju> oic
21:17 < zzing> Anyone familiar with some of the subtleties of Go? I have
narrowed my previous issue I thought was an issue linking with frameworks and it
appears more likely it is an issue with underscores.
21:18 < aiju> doesn't seem like a bug
21:18 < exch> the problem is not the bahaviour of { x++ }, but the fact that
the incomplete if statement compiles without error
21:18 < aiju> oh yeah
21:20 -!- exch [~exch@h78233.upc-h.chello.nl] has quit [Read error: Operation
timed out]
21:20 < jumzi> zzing: shouldn't that allrdy be typedeffed and is this
consistent with other function calls?
21:20 < zzing> jumzi: Can you be more explicit
21:21 -!- tensorpudding [~user@99.23.127.179] has joined #go-nuts
21:22 < jumzi> Well i haven't linked c and go together, but a c library that
defines something with an underscore i tought where typedef:ed into a functionname
without underscore
21:22 < jumzi> And you could test if this is a problem with changing the
function name
21:22 < aiju> i think that underscore thing is something many C compiler
have
21:23 < zzing> jumzi: It appears that the C ABI requires an underscore
21:23 < jumzi> hmm right
21:23 < jumzi> Does any other function work?
21:23 < jumzi> that begins with a _?
21:23 < zzing> no, all of them from this library are not found
21:24 < zzing> I believe that what is happening is that some how the output
from go/cgo is dropping it, so when it tries to link it tries to find 'name' when
it should be trying to find '_name'
21:24 < aiju> zzing: sounds like a compiler incompatbility story
21:24 < aiju> clang-gcc clash perhaps?
21:24 < zzing> aiju: good call
21:25 < aiju> the V6 compiler seems to put _ in front of all symbols :P
21:25 -!- zozoR [~Morten@56346ed3.rev.stofanet.dk] has quit [Remote host closed
the connection]
21:25 < zzing> How can I elminate the possibility of clang-gcc being used?
21:26 < aiju> you're the one using Mac OS X P:
21:26 < aiju> *:P
21:26 < zzing> What I do know is that SDL stuff links (it all crashes on
run, but that is another issue).
21:26 -!- exch [~exch@h78233.upc-h.chello.nl] has joined #go-nuts
21:26 < zzing> So I wonder if it might be something in the building of glfw
possibly
21:27 < aiju> what's glfw after all?
21:27 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has quit [Ping
timeout: 250 seconds]
21:27 < zzing> glfw is basically a modern glut
21:27 < zzing> It doesn't have all the baggage of SDL, and I prefer it
21:28 < zzing> and SDL crashes, so that is why I decided just to jump
straight to glfw
21:28 < zzing> I shouldn't be having these issues...  but i am
21:29 -!- bortzmeyer [~stephane@2a01:e35:8bd9:8bb0:fdd6:f649:2d94:8023] has quit
[Quit: Leaving.]
21:29 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has joined
#go-nuts
21:29 < tarrant> I wrote a regexp version of Split and SplitAfter.  I
wouldn't mind someone looking over it and critiquing my code.  As a warning I'm a
pretty noob developer in general and go in particular.  http://pastie.org/1587055
21:30 < zzing> aiju: I think I will try to remove glfw, and compile the
previous version, least I can do is try
21:31 < aiju> tarrant: too many comments :P
21:32 < jumzi> yup, to much comment
21:33 -!- ww [~ww@river.styx.org] has joined #go-nuts
21:33 < ww> hi all, quick question - the easiest way to get a uint64 as
[]bytes?
21:33 < aiju> ww: encoding/binary
21:33 < aiju> at least, if you want a specific endianness
21:36 < ww> aiju: don't think that that necessarily matters - context:
https://bitbucket.org/ww/fnv/src
21:36 < ww> it's not a cryptographic hash...  and things like crc64 are
better for checksums on the wire...
21:36 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has quit [Quit:
fenicks]
21:37 < ww> so encoding/binary would be fine if i had a way to find out the
host endianness...
21:37 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has joined
#go-nuts
21:37 < ww> just need it to implement Hash.Sum()
21:37 < aiju> if you're feeling evil you can also use reflect/unsafe, but
you will be skinned for that
21:38 < aiju> or just extract the bytes using shift operation
21:38 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
21:39 < aiju> might even be faster, given that it can be done in a register
21:40 < ww> aiju: right.  ok, thanks...
21:40 < ww> i guess what i really want is (unsigned char *)&hash64 ;P
21:40 < aiju> that can be done with reflect/unsafe
21:40 < ww> but shift it is
21:42 < ww> i guess i should have asked here before going down this path...
but it was a nice exercise...  is there a go moral equivalent of python's __hash__
special method?
21:42 < aiju> http://pastebin.com/N8y7BKSv something along that …
21:42 < aiju> ww: you can just use a normal method + interface
21:43 < ww> i wrote this fnv thing basically to make a convenient way to use
structs as keys in a map
21:43 < zzing> Would this be normal to compile something in C that will be
used with go with these flags?  CFLAGS = -c -I.  -I..  -Wall -O2 -fno-common -g
21:43 -!- TheMue [~TheMue@p5DDF4AB4.dip.t-dialin.net] has quit [Quit: TheMue]
21:44 < ww> aiju: right, exactly, and the interface i have in mind defines
exactly one method, Hash() that is supposed to give a key suitable for using in a
map.  The FNV stuff is for strings
21:45 < ww> so then the rest of the code just does m[foo.Hash()] by
convention
21:45 < ww> no matter what type of a thing foo is
21:45 < aiju> ww: you can already use structs as hashes
21:46 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has quit [Remote host
closed the connection]
21:46 < ww> aiju: really?  someone should update
http://golang.org/doc/go_faq.html#map_keys then
21:46 < aiju> oh wait you can't
21:47 < aiju> i must have been imagining things
21:47 < aiju> hm i have yet to understand why slices are considered
reference types
21:49 < exch> zzing: glfw seems to be quite compact.  Wouldn't it be worth
it to try amd write a Go port instead of binding the C lib?
21:50 < ww> something like: type Hashable interface { Hash() uint64 }
21:50 < zzing> exch: No, because there are a lot of work being done on the
multiplatform end in it.  To do that would be a *lot of work*
21:50 -!- ExtraSpice [XtraSpice@78-62-101-194.static.zebra.lt] has quit [Read
error: Connection reset by peer]
21:50 < ww> and then let Hashables be map keys....  would be very convenient
and would sidestep the problem they talk about in the FAQ
21:51 -!- perdix [~mkhl@sxemacs/devel/perdix] has quit [Remote host closed the
connection]
21:55 -!- Fish- [~Fish@9fans.fr] has quit [Quit: So Long, and Thanks for All the
Fish]
21:57 < zzing> I think I have to give up on this.  I can't narrow the
problem down, it looks like it should be so simple.
22:05 -!- rlab_ [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
22:17 < jumzi> A good nights sleep does wonders sometimes
22:17 < zzing> jumzi: normally I would agree
22:20 < jumzi> ...But?
22:21 < zzing> But it isn't helping me too much ;p
22:25 -!- gits [~gits@77.94.219.158] has quit [Ping timeout: 240 seconds]
22:26 < jumzi> :P
22:28 < zzing> Although I have narrowed the problem to some kind of
linker/underscore issue, it hasn't helped because nobody so far has known anything
that can help the issue.  Probably at the end of my possibilities on my own now.
:-(
22:29 -!- awidegreen [~quassel@c-eacae555.08-2-73746f39.cust.bredbandsbolaget.se]
has quit [Remote host closed the connection]
22:29 < ww> aiju: thanks, now i think i have a complete fnv1/fnv1a hash
implementation up
22:31 < ww> heh...  goinstall phones home
22:33 -!- cde [~cde@2a01:e0b:1:134:ca0a:a9ff:fec8:eedb] has joined #go-nuts
22:33 -!- cde [~cde@2a01:e0b:1:134:ca0a:a9ff:fec8:eedb] has quit [Changing host]
22:33 -!- cde [~cde@unaffiliated/cde] has joined #go-nuts
22:33 < jumzi> zzing: I still feel native go would be nice *puppy eyes*
22:39 < mpl> jumzi: you know, bambi eyes usually works even better.
22:39 < zzing> jumzi: gccgo?
22:41 < aiju> gccgo killed bambi
22:41 < zzing> Actually I was wondering if gccgo is practical
22:42 * jumzi just got a revalation induced by mpl
22:42 < jumzi> eh...  gccgo seem to been met with mixed responses, i myself
never used it tough
22:43 < zzing> I have to wonder why plan9 was chosen for compiler chain...
22:44 < tarrant> zzing: I'm assuming your joking?  If not most of the go
core developers where the major developers on plan9.
22:44 < tarrant> zzing:
https://secure.wikimedia.org/wikipedia/en/wiki/Rob_Pike for example.
22:45 < zzing> tarrant: There is no way for me to have known that :p
22:46 < zzing> It seems that my problem is in some way an incompatibility
somewhere, with gcc or llvm I don't think I would have had this issue for the last
24 hours
22:48 -!- dfr|mac [~dfr|work@ool-182e3fca.dyn.optonline.net] has joined #go-nuts
22:50 < rm445> zzing: have you posted to the mailing list?  I think it has a
bigger readership, and lasts longer than lines in an IRC channel
22:52 < rm445> I haven't really followed what you've been posting, but it
seems to be something complicated regarding cgo, which is already complicated.
22:52 < mpl> jumzi: wat
22:52 < rm445> if it's any comfort, the Go team seem to mostly use macs so
there's at least a chance someone has seen your problem before
22:56 -!- jumzi [~none@c-89-233-234-125.cust.bredband2.com] has quit [Remote host
closed the connection]
22:57 < mpl> tarrant: to be exact, I don't think either Griesemer or Taylor
had anything to do with plan 9, and that's almost half of the initial team, afaik.
22:57 -!- PortatoreSanoDiI [~Marvin@82.84.76.112] has quit [Quit: E se abbasso
questa leva che succ...]
22:59 -!- vegai [vegai@archlinux/developer/vegai] has quit [Read error: Operation
timed out]
22:59 -!- vegai [vegai@archlinux/developer/vegai] has joined #go-nuts
23:01 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.4]
23:03 -!- skejoe [~skejoe@188.114.142.162] has quit [Quit: Lost terminal]
23:05 -!- photron [~photron@port-92-201-36-58.dynamic.qsc.de] has quit [Ping
timeout: 240 seconds]
23:07 -!- tvw [~tv@e176009246.adsl.alicedsl.de] has quit [Remote host closed the
connection]
23:10 < zzing> rm445: sorry for my delay in replying.  Yes, I have posted to
the mailing list - twice - no replies to each.  But my understanding of the
problem has changed since those postings so they aren't exactly up to date.
23:15 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has left
#go-nuts []
23:16 -!- piranha [~piranha@5ED4B890.cm-7-5c.dynamic.ziggo.nl] has quit [Quit:
Computer has gone to sleep.]
23:17 -!- fenicks [~fenicks@log77-3-82-243-254-112.fbx.proxad.net] has joined
#go-nuts
23:29 < rm445> :-( that's a shame
23:30 < rm445> btw, you *can* compile (a) suitably trivial cgo programs, and
(b) suitably trivial C programs linking the library you're trying to wrap, right?
23:30 < rm445> (sorry, that's as much help as I can give, and probably
patronising, but sometimes people forget these things)
23:32 -!- g0bl1n [~irc_g0bl1@unaffiliated/g0bl1n] has joined #go-nuts
23:35 < zzing> rm445: b) has examples that are quite impressive that work
with the library, and a) I have in the past
23:36 < zzing> rm445: Something related - Go-SDL compiles and links fine
(the samples crash mind you, but that isn't quite the point) and it uses a method
exactly the same as mine.
23:38 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
23:39 < exch> Can you call other functions in the lib without problems?
23:39 < exch> eg: it only bogs out when you use the _foo reference?
23:40 < zzing> exch: Every function I created a binding for reports error
23:41 < exch> mm
23:41 < exch> I'm trying it out now.  I haven't buond any functions yet, but
referencing types defined in the lib seems to work so far
23:42 < zzing> This is only doing this on the mac afaik, linux seemed to
work for my friend
23:42 < exch> ah
23:42 < exch> I won't be much help then as I'm also on linux
23:42 < zzing> I almost wonder if I should find a way to try the 386 setup
23:43 < zzing> Maybe I should make a new mailing list post with this new
information considering it seems to be a different problem then I thought
23:44 < exch> might be worth it
23:47 -!- g0bl1n [~irc_g0bl1@unaffiliated/g0bl1n] has quit [Ping timeout: 272
seconds]
23:48 -!- nettok [~quassel@200.119.154.190] has quit [Ping timeout: 250 seconds]
23:51 -!- xash [~xash@d170084.adsl.hansenet.de] has quit [Ping timeout: 240
seconds]
23:52 -!- exch [~exch@h78233.upc-h.chello.nl] has quit [Quit: leaving]
23:55 -!- exch [~exch@h78233.upc-h.chello.nl] has joined #go-nuts
23:56 < zzing> exch, can you tell if me this sounds related?
http://groups.google.com/group/golang-nuts/browse_thread/thread/218fdb0beddf2ffe/d324ff4542ac3c45?#d324ff4542ac3c45
23:59 -!- dju__ [dju@fsf/member/dju] has joined #go-nuts
--- Log closed Mon Feb 21 00:00:29 2011