www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Inside of =?UTF-8?B?ROKAmXM=?= GC in Russian

reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
You never asked for this but I’ve slowly started translating my 
posts to my native tongue.

https://sponsr.ru/glow/31355/Vnutri_sborshchika_musora_D

Hope it could be useful for my fellow citizens and if anything 
rereading my prose gives me new insights.

—
Dmitry Olshansky
CEO   Glowlabs
https://olshansky.me
Apr 21
next sibling parent reply Serg Gini <kornburn yandex.ru> writes:
On Sunday, 21 April 2024 at 15:34:37 UTC, Dmitry Olshansky wrote:
 Hope it could be useful for my fellow citizens and if anything 
 rereading my prose gives me new insights.
Btw how many milestones from this old post were implemented?
Apr 21
parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Sunday, 21 April 2024 at 16:41:07 UTC, Serg Gini wrote:
 On Sunday, 21 April 2024 at 15:34:37 UTC, Dmitry Olshansky 
 wrote:
 Hope it could be useful for my fellow citizens and if anything 
 rereading my prose gives me new insights.
Btw how many milestones from this old post were implemented?
In the upstream, none as far as I know. As to "Raven GC" I had in the works pretty much all of them, but the project got stagnated. I might be able to recover it though. -- Dmitry Olshansky CEO Glowlabs https://olshansky.me
Apr 21
prev sibling next sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Sunday, 21 April 2024 at 15:34:37 UTC, Dmitry Olshansky wrote:
 You never asked for this but I’ve slowly started translating my 
 posts to my native tongue.

 https://sponsr.ru/glow/31355/Vnutri_sborshchika_musora_D

 Hope it could be useful for my fellow citizens and if anything 
 rereading my prose gives me new insights.
And here is the second one: https://sponsr.ru/glow/54932/Samaya_bolshaya_oshibka_D/
 —
 Dmitry Olshansky
 CEO   Glowlabs
 https://olshansky.me
Apr 21
parent reply Kagamin <spam here.lot> writes:

slices. How would you design it without `inout`?

```
Span<T> Shrink<T>(Span<T> s, int length)
{
	if (s.Length > length) return s.Slice(0, length);
	return s;
}

ReadOnlySpan<T> Shrink<T>(ReadOnlySpan<T> s, int length)
{
	if (s.Length > length) return s.Slice(0, length);
	return s;
}

void test(byte[] a)
{
	//var b = Shrink(a, 2); //can't infer type
	var b2 = Shrink<byte>(a, 2);
}
Apr 23
parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Tuesday, 23 April 2024 at 13:38:41 UTC, Kagamin wrote:

 slices. How would you design it without `inout`?
Have Span be a subtype of ReadOnlySpan, either through interfaces and dynamic dispatch or through alias this and implicit conversion.
 ```
 Span<T> Shrink<T>(Span<T> s, int length)
 {
 	if (s.Length > length) return s.Slice(0, length);
 	return s;
 }

 ReadOnlySpan<T> Shrink<T>(ReadOnlySpan<T> s, int length)
 {
 	if (s.Length > length) return s.Slice(0, length);
 	return s;
 }

 void test(byte[] a)
 {
 	//var b = Shrink(a, 2); //can't infer type
 	var b2 = Shrink<byte>(a, 2);
 }
Apr 24
parent reply Kagamin <spam here.lot> writes:
Looks like the compiler here can't simultaneously do template 
inference, overload resolution and implicit conversion. I guess 
C++ somehow copes with that?
Apr 25
parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Thursday, 25 April 2024 at 09:09:10 UTC, Kagamin wrote:
 Looks like the compiler here can't simultaneously do template 
 inference, overload resolution and implicit conversion. I guess 
 C++ somehow copes with that?
inference lacking. Things that are easily deduced by Kotlin converting monadic parser code that uses a variation of Result monad. Lack of bottom type also hurts, plus had to introduce my own unit type. — Dmitry Olshansky CEO Glowlabs https://olshansky.me
Apr 25
parent reply Kagamin <spam here.lot> writes:
Running on jvm, Kotlin presumably handles everything with GC 

such design, this compiles:
```
class A<T> { }
class B<T> : A<T> { }
class C<T> : B<T> { }

void test1<T>(A<T> a, int b) { }
void test1<T>(B<T> a, int b) { }
void test2(A<int> a, B<int> b, C<int> c)
{
	test1(a, 0);
	test1(b, 0);
	test1(c, 0);
}
```

`Memory` doesn't implicitly convert to `Span`, but it's not in D 
tradition and it doesn't look like something prevents it, then 
type hierarchy would look like this:
```
class Memory<T> : ReadOnlyMemory<T>, Span<T>
class ReadOnlyMemory<T> : ReadOnlySpan<T>
class Span<T> : ReadOnlySpan<T>
```
i.e. the diamond pattern with multiple inheritance, I think this 
will be challenging to disambiguate, and it happens merely due to 
proliferation of wrapper types.
Apr 25
parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Thursday, 25 April 2024 at 14:35:17 UTC, Kagamin wrote:
 Running on jvm, Kotlin presumably handles everything with GC 
 allocated classes and single inheritance.
Naturally my code is ported with the same hierarchy, still inference fails at times.
Apr 25
prev sibling next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 4/21/2024 8:34 AM, Dmitry Olshansky wrote:
 You never asked for this but I’ve slowly started translating my posts to my 
 native tongue.
It's a fine thing to do. Thank you!
Apr 21
prev sibling parent Dmitry <dmitry indiedev.ru> writes:
On Sunday, 21 April 2024 at 15:34:37 UTC, Dmitry Olshansky wrote:
 You never asked for this but I’ve slowly started translating my 
 posts to my native tongue.

 https://sponsr.ru/glow/31355/Vnutri_sborshchika_musora_D

 Hope it could be useful for my fellow citizens and if anything 
 rereading my prose gives me new insights.

 —
 Dmitry Olshansky
 CEO   Glowlabs
 https://olshansky.me
Nice! Thank you!
May 02