C to D

Imperatorn johan_forsberg_86 at hotmail.com
Fri Oct 20 07:18:57 UTC 2023


On Wednesday, 18 October 2023 at 23:09:11 UTC, Walter Bright 
wrote:
> On 10/18/2023 11:25 AM, bachmeier wrote:
>> On the other hand, there's no reason to manually convert C to 
>> D.
>
> I manually converted the D backend from C to D. It didn't take 
> long - mostly because:
>
> 1. I'd already removed my oh-so-brilliant C preprocessor 
> metaprogramming
>
> 2. A bit of global search/replace handles quite a lot
>
> Of course, the result still looks and acts like C code.

I just want to say. I'm quite impressed by how easy it was to 
port C to D manually.

For example a hashmap, I found, took 15 minutes. And another 
library took about 30 minutes.

The only friction was strings, but it wasn't a show stopper.

Also btw, I'm very curious, about if ImportC could handle 
dependencies?

If all files are present, could it compile those as well? Sorry 
for my ignorance


More information about the Digitalmars-d mailing list