Comparing Rust and D As Better C

Dibyendu Majumdar mobile at majumdar.org.uk
Thu Dec 24 13:32:22 UTC 2020


On Thursday, 24 December 2020 at 03:58:57 UTC, welkam wrote:
> On Thursday, 24 December 2020 at 00:41:35 UTC, Dibyendu 
> Majumdar wrote:
>> At the moment I am struggling to implement the memory 
>> allocator scheme in Rust
>
> The easiest way to port C to Rust is trough D.
>
> D is so close to C that if you just copy pasted C code to D 
> file it might just work without changes or very minimum 
> changes. Furthermore D`s code plasticity together with language 
> features allow to iteratively massage code base to more closely 
> resemble Rust code making transition to Rust easier.

The point of my project is to compare what a current C project 
would look like in Rust vs D as Better C subset. Each port should 
exploit strengths of the language else it would not be a 
meaningful comparison.

In this particular case, using an allocator makes sense because 
it is not useful to manage memory at object level (the project is 
a language implementation - so lots of objects are created but 
they all get thrown away at once).


More information about the Digitalmars-d mailing list