FAQ
Is anyone aware of open source golang implementation(s) of the data
structures underlying clojure's persistent vectors and trees; e.g. Phil
Bagwell's data structures?

Thanks.

J

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Dmitry Vyukov at Oct 14, 2014 at 7:20 am

    On Mon, Oct 13, 2014 at 9:27 PM, Jason E. Aten wrote:
    Is anyone aware of open source golang implementation(s) of the data
    structures underlying clojure's persistent vectors and trees; e.g. Phil
    Bagwell's data structures?

    Do you need exactly persistent data structures (like the ones used in
    computational geometry)? Or just efficient concurrent data structures?
    The latter are usually much simpler, faster and consume less memory.
    The simplest example in Go is:
    http://tip.golang.org/pkg/sync/atomic/#example_Value_readMostly

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jason E. Aten at Oct 14, 2014 at 7:54 am

    On Tuesday, October 14, 2014 12:21:02 AM UTC-7, Dmitry Vyukov wrote:
    On Mon, Oct 13, 2014 at 9:27 PM, Jason E. Aten <j.e....@gmail.com
    <javascript:>> wrote:
    Is anyone aware of open source golang implementation(s) of the data
    structures underlying clojure's persistent vectors and trees; e.g. Phil
    Bagwell's data structures?

    Do you need exactly persistent data structures (like the ones used in
    computational geometry)? Or just efficient concurrent data structures?
    The latter are usually much simpler, faster and consume less memory.
    The simplest example in Go is:
    http://tip.golang.org/pkg/sync/atomic/#example_Value_readMostly
    Thank you, Dmitry. I just need efficient concurrent data structures. The
    atomic.Value example is a perfect example, as I wasn't aware of Value. I
    see how this can be used to construct Bagwell structures.

    One slightly unclear part is the prohibition on copying a Value after it
    has been loaded. Suppose I have do

    // make a data structure that contains an atomic.Value
    var treeOfLife map[string]atomic.Value
    treeOfLife["protozoa"].Store("eukaryote")
    // and then copy it
    truffula := treeOfLife // is this illegal/destined to crash?

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Caleb Spare at Oct 14, 2014 at 7:59 am
    Be aware that atomic.Value is not yet in any released version of Go.
    On Tue, Oct 14, 2014 at 12:54 AM, Jason E. Aten wrote:


    On Tuesday, October 14, 2014 12:21:02 AM UTC-7, Dmitry Vyukov wrote:

    On Mon, Oct 13, 2014 at 9:27 PM, Jason E. Aten <j.e....@gmail.com>
    wrote:
    Is anyone aware of open source golang implementation(s) of the data
    structures underlying clojure's persistent vectors and trees; e.g. Phil
    Bagwell's data structures?

    Do you need exactly persistent data structures (like the ones used in
    computational geometry)? Or just efficient concurrent data structures?
    The latter are usually much simpler, faster and consume less memory.
    The simplest example in Go is:
    http://tip.golang.org/pkg/sync/atomic/#example_Value_readMostly
    Thank you, Dmitry. I just need efficient concurrent data structures. The
    atomic.Value example is a perfect example, as I wasn't aware of Value. I
    see how this can be used to construct Bagwell structures.

    One slightly unclear part is the prohibition on copying a Value after it
    has been loaded. Suppose I have do

    // make a data structure that contains an atomic.Value
    var treeOfLife map[string]atomic.Value
    treeOfLife["protozoa"].Store("eukaryote")
    // and then copy it
    truffula := treeOfLife // is this illegal/destined to crash?

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dmitry Vyukov at Oct 14, 2014 at 8:01 am

    On Tue, Oct 14, 2014 at 11:54 AM, Jason E. Aten wrote:
    On Tuesday, October 14, 2014 12:21:02 AM UTC-7, Dmitry Vyukov wrote:
    On Mon, Oct 13, 2014 at 9:27 PM, Jason E. Aten wrote:
    Is anyone aware of open source golang implementation(s) of the data
    structures underlying clojure's persistent vectors and trees; e.g. Phil
    Bagwell's data structures?

    Do you need exactly persistent data structures (like the ones used in
    computational geometry)? Or just efficient concurrent data structures?
    The latter are usually much simpler, faster and consume less memory.
    The simplest example in Go is:
    http://tip.golang.org/pkg/sync/atomic/#example_Value_readMostly

    Thank you, Dmitry. I just need efficient concurrent data structures. The
    atomic.Value example is a perfect example, as I wasn't aware of Value. I
    see how this can be used to construct Bagwell structures.

    One slightly unclear part is the prohibition on copying a Value after it has
    been loaded. Suppose I have do

    // make a data structure that contains an atomic.Value
    var treeOfLife map[string]atomic.Value
    treeOfLife["protozoa"].Store("eukaryote")
    // and then copy it
    truffula := treeOfLife // is this illegal/destined to crash?

    It was illegal even before the map copy. Map copy is a simple single
    pointer copy, it does not copy the contents of the map. However,
    insertion into map can copy elements to grow the table.
    But I don't understand what you are trying to do as map itself is not
    thread-safe. So it looks pointless to put thread-safe objects into a
    map.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Jason E. Aten at Oct 14, 2014 at 8:17 am

    On Tue, Oct 14, 2014 at 1:01 AM, Dmitry Vyukov wrote:
    On Tue, Oct 14, 2014 at 11:54 AM, Jason E. Aten wrote:

    On Tuesday, October 14, 2014 12:21:02 AM UTC-7, Dmitry Vyukov wrote:
    On Mon, Oct 13, 2014 at 9:27 PM, Jason E. Aten wrote:
    Is anyone aware of open source golang implementation(s) of the data
    structures underlying clojure's persistent vectors and trees; e.g.
    Phil
    Bagwell's data structures?

    Do you need exactly persistent data structures (like the ones used in
    computational geometry)? Or just efficient concurrent data structures?
    The latter are usually much simpler, faster and consume less memory.
    The simplest example in Go is:
    http://tip.golang.org/pkg/sync/atomic/#example_Value_readMostly

    Thank you, Dmitry. I just need efficient concurrent data structures. The
    atomic.Value example is a perfect example, as I wasn't aware of Value. I
    see how this can be used to construct Bagwell structures.

    One slightly unclear part is the prohibition on copying a Value after it has
    been loaded. Suppose I have do

    // make a data structure that contains an atomic.Value
    var treeOfLife map[string]atomic.Value
    treeOfLife["protozoa"].Store("eukaryote")
    // and then copy it
    truffula := treeOfLife // is this illegal/destined to crash?

    It was illegal even before the map copy. Map copy is a simple single
    pointer copy, it does not copy the contents of the map. However,
    insertion into map can copy elements to grow the table.
    But I don't understand what you are trying to do as map itself is not
    thread-safe. So it looks pointless to put thread-safe objects into a
    map.
    Ah. Thank you very kindly for pointing that out, Dmitry.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tahir at Oct 14, 2014 at 5:33 pm
    I have code for Ctries in Go (but without snapshot hence not open sourced
    yet and I need to write some more test first anyway). But I've realized
    that the algorithm is more interesting than the implementation, namely the
    use of indirection nodes (could probably be used to have more granular
    locks on some objects too).

    The thing is that you always have to tread cautiously when you nest lock
    free structures. The result of a naive composition is not thread safe in
    general.
    Typically when you deal with concurrent inserts/deletes in the lock free
    container and the lock free object.
    On Monday, October 13, 2014 6:27:52 PM UTC+1, Jason E. Aten wrote:

    Is anyone aware of open source golang implementation(s) of the data
    structures underlying clojure's persistent vectors and trees; e.g. Phil
    Bagwell's data structures?

    Thanks.

    J
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 13, '14 at 5:27p
activeOct 14, '14 at 5:33p
posts7
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase