To execute a D source file as one would do with a Python script, you can use rdmd. On Linux, you can make your can directly execute D source file by changing its mode (chmod u+x file.d) and adding a "shebang" first line like:
#!/usr/bin/rdmd --shebang -I/path/to/libs -L-L/path/to/libs -L-lyourLibName

Don't forget to add the "--shebang" option or your file won't be executed properly.

There also have been several projects to make a D REPL, the most recent one being dabble: https://github.com/callumenator/dabble but it only works on Windows. The principle is to compile the code one enter on the REPL line and dynamically load it.

Burton Radons had written an article on how to dynamically load some Windows executable code, if you are interested in how this works: http://members.shaw.ca/burton-radons/The%20Joy%20and%20Gibbering%20Terror%20of%20Custom-Loading%20Executables.html

On 12/26/2013 07:50 PM, Jeroen Bollen wrote:
Are there any programs allowing to interpret D and run it similarly to
how you would run a Python application? It doesn't need to have the
whole Window support, just console application using just the standard
Phobos library is more than enough.

Reply via email to