www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Have language researchers gotten it all wrong?

Daniel Keep:
 One of the huge advantages of something like Python that a lot of people,
shockingly, seem unable to grasp is the interactive interpreter.<

LDC compiler works on LLVM, so it's probably doable to add a standard built-in interactive shell to LDC (and generally use the compiler at runtime, for example using it as a DLL, or compiling code at runtime, etc). I'd like to start a thread to discuss what's the best way to implement it :-)
 With D, this is much slower and, lacking Python's built-in dir() and help()
functions, harder. (Incidentally, please no one argue that D can do this.  It
can't.  If you think it can, you simply don't understand what I'm talking

D already has ddoc comments, so they can be used as Python docstrings, from a shell too. At compile time __traits is often able to tell you the name of methods of a class. And there's module info too, so the same can be done for the functions/classes of a module. Such interactive D shell can also work with the debugger, so you can stop the running and ask about the classes and methods and ddoc comments. All this isn't the Python shell, but for me it can be enough :-) Note that a very modern language like Scala already has it! http://jonhnny-weslley.blogspot.com/2008/09/scala-shell.html Bye, bearophile
Jul 07 2009