5

I need an interactive environment where i can call d functions on the fly using a good scripting language with decent scientific plotting libraries (e.g. python).

Is there any way to call d functions from a shell (Ipython or similar)? I looked in to pyd but it seems quite out of date.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
John_C
  • 788
  • 5
  • 17

2 Answers2

3

I wholeheartedly recommend the excellent LuaD. It is an active project, the author is StackOverflow user and he is also hanging on the official D IRC channel irc://irc.freenode.org/D .

DejanLekic
  • 18,787
  • 4
  • 46
  • 77
  • Thanks for that, it looks really cool. Unfortunately there doesn't appear to be any documentation for calling d from lua, only the other way around. – John_C Jun 18 '12 at 14:55
  • 2
    @John_C, you just assign to your lua state, lua["myfun"] = someDG; lua now has a myfun() function it can call. – he_the_great Jun 19 '12 at 01:57
  • so how does this work with the require() function for loading a library? Using the c api i'd have a luaopen_*(lua_State) function containing a lua_register call for each function in the library. – John_C Jun 20 '12 at 20:19
  • I believe there is a demo of how to call a D function from your Lua script. – DejanLekic Nov 14 '12 at 15:17
2

Try pyd it's a library for writing extensions for python in D, there is even a distutils extension to help building D extensions for use in python.

scripts
  • 1,452
  • 1
  • 19
  • 24