DMD as a library package can now run through all semantic phases

rikki cattermole rikki at cattermole.co.nz
Tue Jan 30 04:31:43 UTC 2018


On 30/01/2018 4:21 AM, EntangledQuanta wrote:
> On Tuesday, 30 January 2018 at 02:04:30 UTC, H. S. Teoh wrote:
>> On Tue, Jan 30, 2018 at 01:20:02AM +0000, Bastiaan Veelo via 
>> Digitalmars-d wrote:
>>> On Tuesday, 30 January 2018 at 00:21:09 UTC, Amorphorious wrote:
>>> > Just curious what the point is and what box it opens.
>>>
>>> Better tooling is what comes to my mind. Imagine your editor to 
>>> understand your code as good as the compiler itself. I assume this is 
>>> the primary motivation.
>>
>> Being able to compile D code in your program (i.e., have an embedded D 
>> compiler) is also nice for JIT applications.  E.g., fill in a code 
>> template with runtime-determined parameters, compile it, and run it at 
>> native execution speed.
>>
>>
>> T
> 
> and can it do this? I didn't see anything in the docs that show that it 
> can be used for "scripting", so to speak. Just seemed to be used for 
> semantic analysis and pretty printing. Are these future plans or are 
> they meant to be used as part of simply compiling D code with externally 
> using a dmd compiler bundled with the app(which can already be done)?

The backend still isn't fully D, so it won't be a goal short-term.
But it should be mostly just hooking up a new target into which it gets 
put into memory instead of an object file.

> It would be really cool to be able to create D scripts in an application 
> directly using a "library" solution. I hope though all can be 
> independent of the GC and OS. I'd like to use it for embedded solutions.

D isn't a scripting language, it is native. It will always matter what 
OS/platform you are compiling to.


More information about the Digitalmars-d mailing list