| Thread overview | |||||
|---|---|---|---|---|---|
|
May 14, 2016 polymorph.d: polymorphic refcounted wrappers for D structs | ||||
|---|---|---|---|---|
| ||||
Hi, I wrote this small module ( https://github.com/lodo1995/polymorph.d ), taking inspiration from Amaury Sechet's great talk at DConf ( http://dconf.org/2016/talks/sechet.html ). I plan to use it in std.experimental.xml ( https://github.com/lodo1995/experimental.xml ) for the DOM hierarchy, to avoid the use of garbage collected classes. Do you think that somethink like this (maybe done a bit better) may be worth having in the standard library? Thank you in advance, Lodovico Giaretta | ||||
May 15, 2016 Re: polymorph.d: polymorphic refcounted wrappers for D structs | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Lodovico Giaretta | On 15/05/2016 12:25 AM, Lodovico Giaretta wrote: > Hi, > > I wrote this small module ( https://github.com/lodo1995/polymorph.d ), > taking inspiration from Amaury Sechet's great talk at DConf ( > http://dconf.org/2016/talks/sechet.html ). > > I plan to use it in std.experimental.xml ( > https://github.com/lodo1995/experimental.xml ) for the DOM hierarchy, to > avoid the use of garbage collected classes. > > Do you think that somethink like this (maybe done a bit better) may be > worth having in the standard library? > > Thank you in advance, > > Lodovico Giaretta So a little bit like my managed memory[0] concept only with more magic and less extendable. [0] https://github.com/rikkimax/alphaPhobos/blob/master/source/std/experimental/memory/managed.d | |||
May 14, 2016 Re: polymorph.d: polymorphic refcounted wrappers for D structs | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Lodovico Giaretta | On Saturday, 14 May 2016 at 12:25:30 UTC, Lodovico Giaretta wrote: > I wrote this small module ( https://github.com/lodo1995/polymorph.d ), taking inspiration from Amaury Sechet's great talk at DConf ( http://dconf.org/2016/talks/sechet.html ). Somewhat related are my lightweight variant implementations - `WordVariant` at https://github.com/nordlow/phobos-next/blob/master/src/variant_ex.d#L49 and - `VariantPointerTo` at https://github.com/nordlow/phobos-next/blob/master/src/variant_ex.d#L258 They both use the upper bits of a word (currently 64-bit only) for type-information. See the unittest for details on usage. The `WordVariant` was needed in my implementation of a high-performance and memory efficient pure D implementation of prefix-trie at https://github.com/nordlow/phobos-next/blob/master/src/trie.d It will provide flexible use of memory, either using the GC or not. It's also, when possible, always @safe pure nothrow. The trie is very much in development right now, but I will announce its presence as soon as it stabilizes. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply