Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ldc2 vs ldmd2 whats the difference?

Tags:

d

ldc

I recently installed ldc through hombrew on my Mac and was testing out running a code as a script from the D wiki when I noticed that using ldmd2 to compile my program doesn't also run my program after. Whats the difference then since this is the same behavior as running ldc2.

Heres my program

import std.stdio;
void main()
{
    writeln("Hello, world without explicit compilations!");
}

EDIT: The website states "For small projects it's handy to compile and run in a single step. Most (if not all) compiler packages, contain a tool named rdmd/gdmd/ldmd or similar. For instructional purposes we'll call it rdmd." What im taking from this is it depends on which compiler your using but in the case of ldc I should be using ldmd.

like image 379
Jem4687 Avatar asked Feb 19 '16 21:02

Jem4687


1 Answers

ldmd2 is just a wrapper script for ldc2 which converts argument formats from dmd style over to ldc style.

So it does exactly the same thing, just some options and flags on the compile command line have different names and stuff like that.

The link is talking about rdmd which is a separate program that recursively grabs dependencies, compiles, and automatically runs. rdmd works on top of the compiler and might have been packaged with it or might need to be downloaded separately.

Its source lives here: https://github.com/D-Programming-Language/tools/blob/master/rdmd.d

and it is compatible with ldmd2's option formats.

like image 65
Adam D. Ruppe Avatar answered Nov 15 '22 01:11

Adam D. Ruppe