Google's take on memory safety

Dodobird doseiai at gmail.com
Mon Mar 18 01:26:27 UTC 2024


On Wednesday, 13 March 2024 at 21:13:31 UTC, bachmeier wrote:
> On Wednesday, 13 March 2024 at 20:49:01 UTC, jmh530 wrote:
>> On Wednesday, 13 March 2024 at 19:18:20 UTC, bachmeier wrote:
>>> On Sunday, 10 March 2024 at 09:34:28 UTC, Emmanuel Danso 
>>> Nyarko wrote:
>>>> On Sunday, 10 March 2024 at 04:24:15 UTC, Walter Bright 
>>>> wrote:
>>>>> On 3/9/2024 3:32 PM, Lance Bachmeier wrote:
>>>>>> I "ported" a few thousand lines of C to D in a couple 
>>>>>> hours this afternoon. That includes the time it took to 
>>>>>> put all C memory allocation inside SafeRefCounted. With 
>>>>>> the overhead out of the way (setting up the SafeRefCounted 
>>>>>> structs, testing, and some minor other things) I bet I 
>>>>>> could easily port 20,000 lines in an 8-hour day. Working 
>>>>>> directly with C macros was the last thing needed to make 
>>>>>> this go fast.
>>>>>
>>>>> Thanks for posting that, I enjoy such testimonials!
>>>>
>>>> What about we build maybe a strategy to send D out there! We 
>>>> must let the world see the power of D.
>>>
>>> Show them working code. This is a separate project I did 
>>> after the one I posted about in my previous comment.
>>>
>>> https://github.com/bachmeil/d-gslrng
>>>
>>> It took only a few hours and there's over 7000 lines of C. 
>>> There are some nice features of this project:
>>>
>>> - I made zero changes to the C code. Now that we have macro 
>>> support, every line in the C files was copied and pasted. 
>>> That means I get to reuse the decades of testing done on this 
>>> popular library.
>>> - I was able to strip out a small part of a much larger 
>>> library. If I were calling into a C library, I'd be stuck 
>>> with whatever they give me.
>>
>> [snip]
>>
>> Cool!
>>
>> So this proves that importC works on a limited subset of gsl. 
>> Do you have any reason to believe it wouldn’t work on the 
>> whole library?
>
> I'd be surprised if there's anything it can't compile. I've 
> compiled lots of other parts, but split this one out because I 
> don't want to add hundreds of unnecessary files if all I want 
> to do is generate random draws in parallel.

Yes, a strategy. Without it business will say 不靠谱 (boo cow poo, 
aka unreliable) and flee.  You never wanna hear that from 
customers, and when you do, bust your ass to build trust that was 
lost.

If you don't know where you are going, and road will get you 
there.

(lyrics) But she wants everything
(He can pretend to give her everything)
Or there's nothing she wants
(She don't want to sort it out)
He's crazy for this girl
(But she don't know what she's looking for)
If she knew what she wants
He'd be giving it to her
Giving it to her
I'd say her values are corrupted
But she's open to change
Then one day she's satisfied
And the next I'll find her crying
And it's nothing she can explain  ------

If She Knew What She Wants
Song by The Bangles 1986
https://www.youtube.com/watch?v=mu_pNeqAQ-U



More information about the Digitalmars-d mailing list