Is there any extra overhead when using D instead of C if I write code to extend interpreted languages?

Maybe D runtime / GC should initialize and exit every time the function is called, so that it doesn’t help to add small do-very-little functions like string to lower, urlencode, etc. I don't know how this works, but I wrote several extensions in C.

+5
source share
2 answers

Yes, the D runtime should be initialized when the D program starts, and (depending on which libraries you use), static constructors must be called. This is minimal, but as you said, it would be inefficient for small functions.

. druntime main.

C ( extern(C)) , , GC .., .

+4

.

D, %, , .. , #!/Usr/bin/env rdmd .

script , 2-3 , .

, , , . ( GC, .)

, . , . , , Python. Python , D. , C ++.

, .

+2

All Articles