D run-time interpretation

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 6 13:02:46 PDT 2015


On Tuesday, 6 October 2015 at 19:42:08 UTC, Jacob wrote:
> There are many programs out there that use some sort of 
> scripting capabilities.
>
> I've been wanting to write an app that exposes a scripting like 
> environment D, lua, or some other fast language to the user.
>
> But there are two requirements:
>
> 1. The user has access to all objects created in app. e.g., if 
> I create a class X in the app then the user can instantiate X 
> in the script without having to recreate it. (the script then, 
> is sort of an extension of the app)
>
> I don't mind actually having to expose X to the script, but it 
> should be easy.
>
> 2. It should be fast. When it is "recompiled" it shouldn't take 
> more than a few seconds. It also shouldn't require a 
> re-initialization of everything.
>
> Can D do this easily?

You know, you can use D as a scripting language. On Linux, you do 
something like put

#!/bin/rdmd

at the beginning of the file, mark it is executable, and then you 
can run it. I don't know what you need to put on the top to make 
it work on Windows.

These days, I write most of my scripts in D.

- Jonathan M Davis


More information about the Digitalmars-d mailing list