@kornel
C++ actually does support dynamic linking. On POSIX systems it does this by encoding the argument types into the symbol name. Not sure how it works on Windows but most of Windows is C++ and it does have DLLs so clearly it's possible.
Dynamic linking is really just mmap() plus a lookup table of symbol name to compiled code. It's not rocket science and absolutely not C specific, but it does require a reasonably stable ABI to make it work.
@hrw
C++ actually does support dynamic linking. On POSIX systems it does this by encoding the argument types into the symbol name. Not sure how it works on Windows but most of Windows is C++ and it does have DLLs so clearly it's possible.
Dynamic linking is really just mmap() plus a lookup table of symbol name to compiled code. It's not rocket science and absolutely not C specific, but it does require a reasonably stable ABI to make it work.
@hrw
@kornel
Oh, I see now what you mean.
Yes, if you want to do any type of code generation, be that C++ templating, C preprocessor macros, or eval-type stuff in scripting languages, you can't do dynamic libraries for those parts of your language. In C++, the STL is typically header-only for that reason, but C++ still has a substantial standard library that is dynamic.
@hrw
Oh, I see now what you mean.
Yes, if you want to do any type of code generation, be that C++ templating, C preprocessor macros, or eval-type stuff in scripting languages, you can't do dynamic libraries for those parts of your language. In C++, the STL is typically header-only for that reason, but C++ still has a substantial standard library that is dynamic.
@hrw
IOW, having part of your language that can't be dynamically linked doesn't mean that's true for all of it, nor that there is no benefit at all.
I don't know though about rust to have a meaningful discussion about its ability to benefit from dynamic linking but if it relies on code generation to a large extent then yes obviously it becomes complicated.
@hrw @kornel
I don't know though about rust to have a meaningful discussion about its ability to benefit from dynamic linking but if it relies on code generation to a large extent then yes obviously it becomes complicated.
@hrw @kornel
- replies
- 1
- announces
- 0
- likes
- 1