#go-nuts

/

      • danieleB
        not about x := append (s,value)
      • Tv`
        an assignment overwrites a variable with the given value
      • pepper_chico joined the channel
      • ProhtMeyhet joined the channel
      • realrocker
      • Tv`
        realrocker: next up, runtime code is ugly and needs to rewritten
      • dsal
        Nowhere in all this mess has anyone described why any of this actually matters in a program.
      • tomi joined the channel
      • kevinqcs has quit
      • tanema has quit
      • I can contrive some, for sure, but if you're putting stuff (especially pointers) in a slice and getting it back out, it just doesn't matter.
      • aat has quit
      • angasule joined the channel
      • hkeide has quit
      • aat joined the channel
      • realrocker
        Tv` are you volunteering :P
      • dsal
        realrocker: Inside (the sanitarium) joke
      • Tv`
        in soviet #go-nuts, the joke is on you
      • realrocker
        oh is it about people who bitch all the time about stuff they barely know about?
      • Tv`
        realrocker: that's what happened the last time someone pointed danieleB to source code of redirect & cookie handling
      • anyway
      • backing up 150GB over USB2.0 is quite boring
      • marius_k has quit
      • realrocker
        danieleB I hope you are in 1st semester of your university . if that's true, you are doing great
      • fomatin joined the channel
      • stevedomin joined the channel
      • otherwise you are just wasting time
      • hebz0rl has quit
      • dsal
        I do feel a bit bad. The problem is worrying about lots and lots of stuff that doesn't matter. That's been every problem. Want to know how to do something? Ask! Answer arrives, but... [long sad story about how redirects killed your parents]
      • realrocker
        i was just wasting enough time so that the grocery stores open up and I can buy some smokes...
      • smoking deprivation can make you do things
      • i wanted to kill the array type :(
      • dsal
        Yeah, like live longer.
      • realrocker
        that too in small measures
      • danieleB
        I believe having doubts is always a good opportunity to learn something
      • dsal
        I've used arrays at least twice.
      • danieleB
        if you don't have doubts then you never learn anything new
      • tomi has quit
      • dsal
        danieleB: Have you learned anything new in the last four hours of people's time?
      • danieleB
        yes, I have
      • dsal
        I agree with the basis of what you're saying, but you're egregiously inconsiderate of those who try to help you.
      • danieleB
        inconsiderate?
      • dsal
        You still have no statement about why you think moving the location of your pointer variable affects anything. You just assert that you understand pointers really well and that you know it'd be bad.
      • realrocker
        we took turns man
      • danieleB
        dsal, if you use mutex, you don't need to worry about that, for sure
      • dsal
        Same thing.
      • What difference does a mutex make?
      • Anyway, I'm going to cook some dinner. When you get to the right question and problem statement, you will likely make more progress.
      • iant has quit
      • sheki has quit
      • znode has quit
      • realrocker
        probably read more
      • mb0
        yeah read the spec http://golang.org/ref/spec its great!
      • realrocker
        it's well written too. it's the only language spec I refer too all the time.
      • Tv`
        more like a CS intro kind of thing.. a gentler The Art of Computer Programming, if possible
      • realrocker
        to*
      • Rym joined the channel
      • sheki joined the channel
      • pepper_chico has quit
      • I guess not being overtly explicit is one of it's major strengths
      • "a brief truth"
      • mihasya has quit
      • danieleB
        dsal, mutex would make sure you don't access that variable while its address or its value is being changed
      • realrocker
        nice
      • probably interfering with his cooking
      • geomyidae joined the channel
      • ProhtMeyhet has quit
      • ProhtMeyhet joined the channel
      • geomyidae has quit
      • hkeide joined the channel
      • dsal
        I'm slow to start cooking, but I'm trying to ignore that statement because the I can't tie together the relevance.
      • Or even how one could think this is a strategy for safe shared memory concurrent systems.
      • sheki has quit
      • realrocker
        i got nothing
      • danieleB
        dsal, did I at least answer your question?
      • tfm_
        oh cool, this is still going
      • stevedomin has quit
      • Wessie
        Did I miss something fun
      • pepper_chico joined the channel
      • tfm_
        fun might not be the correct description, but i can't look away for some reason
      • Tv` hands tfm_ popcorn
      • mortdeus
        danieleB, What are you trying to understand?
      • Tv`
        or, in modern vernacular, http://i.imgur.com/tCp90.gif
      • danieleB
        mortdeus, I am just being nagged by dsal :-)
      • brettlangdon has quit
      • about not understanding pointers
      • surely it's not the topic I have been dealing with before 2 weeks ago
      • but I think I understand the basic
      • iant joined the channel
      • Wessie
        Pointers really aren't that advanced as some people try to make them out to be
      • mannyt joined the channel
      • danieleB
        I think I have some doubts, I understand how to use them
      • Wessie
        I see my english sentences still have the same quality at night
      • danieleB
        I think I have some doubts, but I understand how to use them
      • dancannon joined the channel
      • dsal
        danieleB: You didn't say anything remotely related to my question, so no, you didn't answer it.
      • mortdeus: Somehow, having a slice that never reallocates internally means you don't have to use mutexes.
      • pepper_chico
        danieleB, just repeating myself… are you learning programming with Go as first language?
      • danieleB
        dsal, you said "What difference does a mutex make?"
      • darkgray
        He's coming from Python, etc.
      • danieleB
        and I answered
      • darkgray
        Go seems a lot clearer coming in from C.
      • realrocker
        I can probably emulate daneileB's responses by now
      • mannyt has quit
      • Wessie
        I've been mainly coming from Python as well. There are no real differences when it comes to concurrent access
      • darkgray
        Python doesn't have the same fiddling with pointers, though.
      • pepper_chico
        I was not at the channel when you said your background
      • dsal
        realrocker: cool, I'll direct my questions to you. "You still have no statement about why you think moving the location of your pointer variable affects anything."
      • jd^ joined the channel
      • ajhager_ joined the channel
      • darkgray
        I think Go should implement hyperslices that allow you to piece together slice views.
      • dsal
        realrocker: and the answer to that one is something something mutex
      • mannyt joined the channel
      • Tv`
        darkgray: ask bsd networking people about how nice that mbuf plan ended up being..
      • darkgray
        I've no idea what mbuf is.
      • Wessie
        The concept is nice of that darkgray, it's impossible to actually implement sanely
      • so it's a horrible idea in conclusion
      • Tv`
        darkgray: bsd kernels have something very similar to what you said, it.. ahem.. does not perform well
      • hkeide_ joined the channel
      • darkgray
        Oh. It was a joke. ._.
      • danieleB
        dsal, if that variable is global and you are accessing it from a goroutine and you are not using mutex, you could have troubles
      • realrocker
        well dsal. I think I have an incorrect opinion due to my limited knowledge of programming in general. I will go back to my books and study hard. I will make you proud dsal
      • darkgray
        Semi-joke, anyway. Although there have been times when I wanted the feature.
      • Tv`
        darkgray: not a joke, a pointer to a previous incarnation of that idea that is being deprecated
      • Wessie
        Can I bash him for using a global variable now
      • |Craig| has quit
      • dsal
        danieleB: Well yes. So you need a mutex. How is that in any way related to what I asked?
      • Tv`
        darkgray: transparently concatenating slices hides costs; hidden costs tend to pile up
      • mortdeus
        danieleB, The reason why you shouldnt read and write to memory shared between goroutines has to do with the fact that goroutines are preemptible and it causes racy behavior.
      • Tv`
        darkgray: but you could definitely write a little slice-of-slices type that has utility functions for accessing the items
      • dsal
        mortdeus: The topic is still "why it'd be really bad if append created a new underlying array"
      • pepper_chico
        also, share by communicating, not communicate by sharing
      • darkgray
        Tv`: I pretty much mean something that just wraps a slice of pointers to positions in other slices.
      • pepper_chico
        as they say
      • realrocker
        ok change of shift I guess mortdeus is the guy now
      • Tv`
        share organization memory by communicating on irc
      • err
      • share organizational memory by communicating on irc
      • hkeide has quit
      • realrocker: popcorn refills are free
      • realrocker
        heh
      • mortdeus
        append(os, ns) allocates a new slice when (len(os) + len(ns)) > cap(os))
      • danieleB
        dsal, I hope at least you get some pleasure by your behaviour
      • dsal
        mortdeus: and then all hell breaks loose.
      • Wessie
        isn't it (len(os) + 1) > cap(os))
      • dsal
        Wessie: you can append more than one thing at a time
      • Wessie
        I forget that too often
      • darkgray
        It's ns..., though.
      • dsal
        And ignored
      • darkgray
        Ah well.