D in action

bachmeier no at spam.net
Mon May 8 16:40:34 UTC 2023


On Monday, 8 May 2023 at 15:17:05 UTC, bachmeier wrote:
> On Monday, 8 May 2023 at 14:51:44 UTC, Sergey wrote:
>> On Monday, 8 May 2023 at 14:31:16 UTC, bachmeier wrote:
>>> To my surprise, a paper I wrote quite a while ago was on the 
>>> front page of Hacker News this morning:
>>>
>>> https://news.ycombinator.com/item?id=35854369
>>>
>>> I started using D while writing that paper. My coauthor was a 
>>> grad student having difficulty programming the simulations in 
>>> R. I looked around and settled on D because the 
>>> interoperability with R was so easy - we only wanted to 
>>> rewrite the bottleneck, not the whole thing. D wasn't just 
>>> fast, it made it easy to convert my thoughts into code. That 
>>> was ten years ago.
>>
>> Interesting! Thanks for sharing
>>
>> Unfortunately there is no approved and mature instrument to 
>> use D for R package creation that will be accepted for CRAN
>
> That's correct. I doubt there ever will be, though now that D 
> is part of GCC, I suppose it's possible.
>
> I don't know that this is a big constraint. You can add a 
> Makefile to your package that compiles the D code into a shared 
> library. If you install using devtools, it will build a shared 
> library that is installed as part of the package. That is 
> actually what I did for this paper - I wrote a package with D 
> code and the grad student installed it/used it as a regular R 
> package without knowing anything about D.

I created a Github repo with the simplest possible example to 
show how to do this.

https://github.com/bachmeil/d-in-r-package


More information about the Digitalmars-d mailing list