Jump to page: 1 25  
Page
Thread overview
Our Sister
May 26, 2016
Adam D. Ruppe
May 26, 2016
ixid
May 26, 2016
Joakim
Re: Our Sister [i.e. RCStr/RCString]
May 26, 2016
Jonathan M Davis
these are nOT the sisters you're looking for
May 27, 2016
Pete
May 27, 2016
Jack Stouffer
May 27, 2016
Pete
May 27, 2016
Jack Stouffer
May 26, 2016
Gary Willoughby
May 26, 2016
Jack Stouffer
May 26, 2016
Adam D. Ruppe
May 26, 2016
Jack Stouffer
May 26, 2016
Jonathan M Davis
May 27, 2016
Nordlöw
May 26, 2016
Xinok
May 26, 2016
Seb
May 26, 2016
jmh530
May 26, 2016
jmh530
May 26, 2016
Seb
May 29, 2016
Dicebot
May 26, 2016
H. S. Teoh
May 26, 2016
Vladimir Panteleev
May 26, 2016
Bastiaan Veelo
May 27, 2016
Nordlöw
May 27, 2016
Marc Schütz
May 27, 2016
Era Scarecrow
May 27, 2016
Seb
May 28, 2016
Adam D. Ruppe
May 28, 2016
Manu
May 28, 2016
Adam D. Ruppe
May 30, 2016
Marco Leise
May 31, 2016
Manu
May 31, 2016
Marco Leise
May 27, 2016
tsbockman
May 28, 2016
Adam D. Ruppe
May 31, 2016
Nick Treleaven
May 28, 2016
Manu
May 28, 2016
Marc Schütz
May 28, 2016
Marc Schütz
May 28, 2016
Manu
May 28, 2016
ZombineDev
May 28, 2016
ZombineDev
May 26, 2016
I've been working on RCStr (endearingly pronounced "Our Sister"), D's up-and-coming reference counted string type. The goals are:

* Reference counted, shouldn't leak if all instances destroyed; even if not, use the GC as a last-resort reclamation mechanism.

* Entirely @safe.

* Support UTF 100% by means of RCStr!char, RCStr!wchar etc. but also raw manipulation and custom encodings via RCStr!ubyte, RCStr!ushort etc.

* Support several views of the same string, e.g. given s of type RCStr!char, it can be iterated byte-wise, code point-wise, code unit-wise etc. by using s.by!ubyte, s.by!char, s.by!dchar etc.

* Support const and immutable qualifiers for the character type.

* Work well with const and immutable when they qualify the entire RCStr type.

* Fast: use the small string optimization and various other layout and algorithms to make it a good choice for high performance strings

RFC: what primitives should RCStr have?


Thanks,

Andrei
May 26, 2016
On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote:
> I've been working on RCStr (endearingly pronounced "Our Sister")

You really should actually mention RCStr in the subject line so people overwhelmed with the staggering amount of off topic chatter on this forum don't disregard this thread too.
May 26, 2016
On Thursday, 26 May 2016 at 16:20:37 UTC, Adam D. Ruppe wrote:
> On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote:
>> I've been working on RCStr (endearingly pronounced "Our Sister")
>
> You really should actually mention RCStr in the subject line so people overwhelmed with the staggering amount of off topic chatter on this forum don't disregard this thread too.

To be fair using a forum called 'General' for technical discussion is asking for trouble. We will be able to tell when D actually starts to become popular because this part of the forum will cease to function as it's inundated with newbies who expect it to mean general questions or something similar.
May 26, 2016
On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote:
> * Support several views of the same string, e.g. given s of type RCStr!char, it can be iterated byte-wise, code point-wise, code unit-wise etc. by using s.by!ubyte, s.by!char, s.by!dchar etc.

Will s.by!Grapheme be supported too?
May 26, 2016
On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote:
> * Support const and immutable qualifiers for the character type.

How is that going BTW. Last I heard you were having problems with inout/const.

> * Support several views of the same string, e.g. given s of type RCStr!char, it can be iterated byte-wise, code point-wise, code unit-wise etc. by using s.by!ubyte, s.by!char, s.by!dchar etc.
>
> [snip]
>
> RFC: what primitives should RCStr have?

Well, because we already have the standard library functions representation, byUTF, byCodePoint, byCodeUnit, and byGrapheme, I think RCStr should provide these names as methods which all return ranges. If possible, these would all work regardless of character or integer type of the data. So in effect, RCStr would have completely encapsulated data. Let's not make the same mistake that we made with string et al. by providing a default.

If at all possible, it would be great if it was also an output range.

> RCStr

*bikeshedding*: How about RCString, because the convention for D names is to be explicit most of the time.
May 26, 2016
On 05/26/2016 12:58 PM, Gary Willoughby wrote:
> On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote:
>> * Support several views of the same string, e.g. given s of type
>> RCStr!char, it can be iterated byte-wise, code point-wise, code
>> unit-wise etc. by using s.by!ubyte, s.by!char, s.by!dchar etc.
>
> Will s.by!Grapheme be supported too?

Yes. -- Andrei
May 26, 2016
On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote:
> I've been working on RCStr (endearingly pronounced "Our Sister"), D's up-and-coming reference counted string type. The goals are:
> ...

I don't know how practical this would be, but if at all feasible, I think one of the goals should be to have a common interface/primitives with regular strings so we can write generic functions which accept both native strings and RCStr.

Otherwise, I second Jack's points.

> * Reference counted, shouldn't leak if all instances destroyed; even if not, use the GC as a last-resort reclamation mechanism.

Could you (or somebody) elaborate a little on how this could work from a technical standpoint? The only way I see this working is if the GC always scans for RCStr-allocated memory, in which case, why even bother with RC?
May 26, 2016
On Thursday, 26 May 2016 at 17:32:33 UTC, Jack Stouffer wrote:
> Well, because we already have the standard library functions representation, byUTF


That would be templated so like byUTF!char and byUTF!wchar right?

Then byCodePoint can just be another name for byUTF!dchar. I kinda like that.

Ideally, the string type would also use lazy imports for any conversion table. So if you never call byGrapheme, it never imports the std.uni tables. (Heck, std.uni could be the one to provide that type, of course.)


Would an RCStr pass isSomeString? I kinda think it shouldn't. Actually, isSomeString probably shouldn't often be used - instead checking for string-like range capabilities is likely better for algorithms. Then doing some_algorithm(my_rcstr) fails - you must do some_algorithm(my_rcstr.some_range)
May 26, 2016
On Thursday, 26 May 2016 at 17:50:36 UTC, Adam D. Ruppe wrote:
> That would be templated so like byUTF!char and byUTF!wchar right?
>
> Then byCodePoint can just be another name for byUTF!dchar. I kinda like that.
>
> Ideally, the string type would also use lazy imports for any conversion table. So if you never call byGrapheme, it never imports the std.uni tables. (Heck, std.uni could be the one to provide that type, of course.)

This has the added benefit that it would automatically work with a lot of generic code that uses those functions.

> Would an RCStr pass isSomeString? I kinda think it shouldn't.

I agree, it shouldn't. isSomeString should only test for one of the language provided string types.

May 26, 2016
On Thursday, 26 May 2016 at 16:20:37 UTC, Adam D. Ruppe wrote:
> On Thursday, 26 May 2016 at 16:11:22 UTC, Andrei Alexandrescu wrote:
>> I've been working on RCStr (endearingly pronounced "Our Sister")
>
> You really should actually mention RCStr in the subject line so people overwhelmed with the staggering amount of off topic chatter on this forum don't disregard this thread too.

Where do you see all this "chatter?"  Looking at the topics for the last 10 days, I only see one not about D generally, and it's labeled OT.
« First   ‹ Prev
1 2 3 4 5