PortingOverview

From D Wiki
Revision as of 11:55, 26 April 2015 by Laeeth (talk | contribs)
Jump to: navigation, search

This page is under community development.

Porting from C



Interfacing D with an existing codebase


D calling embedded Python

void main() {
    auto context = new InterpContext();
    context.a = 2;
    context.py_stmts("print ('1 + %s' % a)");
}
 

Lua D example

import luad.all;

void main()
{
    auto lua = new LuaState;
    lua.openLibs();

    auto print = lua.get!LuaFunction("print");
    print("hello, world!");
}