C has it fully, and it's even a common strategy for C programs
then how do you explain languages like erlang was implemented ? , i suppose their is some technical limitations
Hmmm does erlang support compiling to dynamic library?
can you explain how to swap a hello world program written in C , to a sorting algo in C using a dynamic library ?
hello world is a short-running program
inb4 while true hello world
But in general you can imagine: lib = dlopen("./lib.so"); func = dlsym(lib, "func"); while (1) { func(); // run lib code if (file_changed("./lib.so"); dlclose(lib); lib = dlopen("./lib.so"); func = dlsym(lib, "func"); } }
Обсуждают сегодня