D
D
dollar2019-06-17 18:28:07
Programming languages
dollar, 2019-06-17 18:28:07

Is there a fast programming language with dynamic recompilation capability?

That is, for example, you change something in the code, and in an already running application, the changes are immediately applied and the result is visible.
Theoretically, this is possible. For example, if after the completion of the function and before a new call to it, you replace it, then nothing fatal will happen. In extreme cases, you can even change its place in memory, while simultaneously changing all the addresses where it is accessed.
In scripting languages, there are no particular problems with this, because a function there is often a separate data type. Although it is necessary to send the function code in a separate way (say, to the console). What about fast compiled languages?
Here, by the way, not only the speed of the language will be important, but also the speed of compilation, because it needs to be done on the fly.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny Romashkan, 2019-06-17
@dollar

Actor model mb, Erlang the same?

I
Ivan Shumov, 2019-06-17
@inoise

It's not needed. Blue-green deployment has not been canceled

N
NewDevLab, 2019-06-17
@NewDevLab

for example, on .Net you can do something like this.
the host application:
1. Reads the directory(s) for required assemblies.
2. Copies the found assemblies to the cache folder.
3. Loads the copied assemblies.
4. Fulfills the assembly initialization contract, passing it the saved state (if any).
... then the assembly lives its own life, possibly interacting with the host via certain interfaces.
6. Monitors directories for changes to connected assemblies (you can also see adding / deleting).
7. If the assembly has changed, then asks the current assembly for its current state.
8. Unloads it and copies the new assembly into the cache.
... then go to step 4.
Actually, the classic ASP.NET works like this, thanks to which the application files are not blocked during execution and are available for modification.
There is also .Net MEF.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question