Compiler as dll

grauzone none at example.net
Thu Jan 29 01:04:53 PST 2009


Daniel Keep wrote:
> Personally, I think the best approach is to combine the two; write the
> hot spots in C, D or some other fast language, and all the glue in a
> dynamic language.  For all it's expressiveness, there are just some
> things that are easier to do with a dynamic language like Python or Lua
> than with D.

I agree, but it's hard to link all these languages together. They use 
different types, require bindings to import functions and classes, and 
all that. I heard writing Python modules in C is really hard.

> And as for the compile-time checking thing... I think it's a bit of a
> wash.  There are times that static checking is helpful... and times when
> it's too restrictive.  All I know is that it's so much easier to debug
> something when you can get an interactive interpreter inside the debugger...

Most debuggers seem to support a subset of C for evaluating expressions 
or even calling methods. For example, in gdb, you can write the command 
"print x->y->z".

I don't think there's any substantial difference between dynamic and 
static languages here. It's all a question of effort, and static 
languages are just a bit behind. For example, if you had a compiler as 
library (wow, that's actually the subject of this thread), it wouldn't 
be so hard anymore to implement a read-eval-print-loop for a static 
language. Actually, Scala is a statically typed language, that provides 
such an interactive interpreter.



More information about the Digitalmars-d mailing list