Questions tagged [dynamic-compilation]

Questions about code compilation in runtime. Alternatively, "Just-in-time compilation", "dynamic translation" or "runtime compilation". Used mostly by the runtime environment of tokenizing or interpreted languages.

Questions about code compilation in runtime.

Advantages

  • Compilation can be optimized for the current runtime system. This information is normally unavailable in compilation time.
  • Compilation to binary code is possible even independently from the CPU architecture.
  • Compilation can happen into memory, resulting platform-independent code combined with nearly binary code performance.

Disadvantages

  • Compiler must be part of the runtime environment.
  • Slow startup time.
  • Compile-time errors might appear only in runtime.

References

121 questions
2
votes
0 answers

How to compile ASP.NET in-place for real?

I have a problem where going into production for my ASP.NET site without pre-compiling causes more than slow initial-startup - the server actually thrashes with memory and SQL connections going thru the roof. What I think is happening is, as pages…
n8wrl
  • 19,439
  • 4
  • 63
  • 103
2
votes
1 answer

Possible to get native performance for dynamically compiled code that can be unloaded?

In .Net, it seems you cannot dynamically compile code call the compiled code directly (i.e. w/o "remoting", marshaling, etc) and remove (only) the compiled code from memory You have to decide between 2. (by generating the code into the calling…
Evgeniy Berezovsky
  • 18,571
  • 13
  • 82
  • 156
2
votes
2 answers

How to dynamically load aspx code from a database?

I have content like this stored in a database

This a sample text. <%= Html.ActionLink("test", "myaction", "mycontroller") %>

The content is part of my data repository, that is the reason I want to keep it inside the database. I would like to…
labilbe
  • 3,501
  • 2
  • 29
  • 34
2
votes
1 answer

Implementing custom script types in the browser?

When a script for some custom language appears in a webpage how are these scripts executed? I would guess it would be something like this: Mighty Mouse…
Mario
  • 6,572
  • 3
  • 42
  • 74
2
votes
1 answer

what does "-Bdynamic" compilation flag does?

I was reading Intel Inspector XE 2013 documentation, and they have mentioned setting of flag "-Bdynamic". Can anyone please tell me what does this flag do ? I have searched the gnu compilation options but have not seen this. Thanks, Sheeri
Monku
  • 2,440
  • 4
  • 33
  • 57
2
votes
4 answers

Dynamic compilation for performance

I have an idea of how I can improve the performance with dynamic code generation, but I'm not sure which is the best way to approach this problem. Suppose I have a class class Calculator { int Value1; int Value2; //.......... int ValueN; …
Max
  • 19,654
  • 13
  • 84
  • 122
2
votes
0 answers

Why does CompilerOptions.EmbeddedResources not attach the resource file to the assembly

I am trying to generate an exe with CSharpCodeProvider, exe that will be a windows forms project. The exe has to have a resource which will be accessed at runtime by the generated assembly. Now to generate that resource I am using ResourceWriter…
Cristi M
  • 446
  • 4
  • 13
1
vote
0 answers

dynamic compilation failure due to spring-mobile plugin for grails

I am using the spring mobile plugin 0.3 for grails and since using it in any controller, if I make any modification in that controller and refresh the application url in browser, the compilation fails with error groovy.lang.MissingMethodException:…
pri_dev
  • 11,315
  • 15
  • 70
  • 122
1
vote
1 answer

Compiled a class, but where is it?

I'm not an expert in Java and I'm pretty new to the whole concept of compiling and running dynamic generated code, which is so simple in other languages, expecially script languages like Javascript and PHP. I'm following this snippet of…
MaxArt
  • 22,200
  • 10
  • 82
  • 81
1
vote
1 answer

Dynamic Compilation in .NET Core 6

I have been experimenting with the C# dynamic compilation as described in Laurent's excellent blog: https://laurentkempe.com/2019/02/18/dynamically-compile-and-run-code-using-dotNET-Core-3.0/ (Merci Laurent!!) I copied and pasted the code into a…
pengu1n
  • 471
  • 6
  • 15
1
vote
1 answer

Are there any AppDomain/"Dynamically compiled Code" limits?

I'm planning to write a game, where the user has to write his own C# code to play it. Since I can't trust the user submitted code I want to create an AppDomain for each user. Each user can write several classes so I need to dynamically compile and…
Arokh
  • 614
  • 1
  • 10
  • 18
1
vote
2 answers

How can I tell which defines are missing in a C file, not via compilation failure?

I have a C file (for simplicity, assume it includes nothing). This C files requires several definitions of literal numbers to compile properly - and I want to figure out which definitions these are. Naturally, one can try to compile the file, and at…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
1 answer

Can't load System.ValueTuple in dynamically compiled code

I want to use Tuple in dynamically compiled code on .net 4.6.1 . Below is a minimum test case. Any help would be appreciated. Thanks! // First, install System.ValueTuple 4.5 package via nuget into test Project. using System; using…
Ben
  • 1,133
  • 1
  • 15
  • 30
1
vote
2 answers

C# code at runtime?

How can I compile raw C# code at runtime? So if I want to add security by removing important pieces of code and downloading it via a server, and then execute it from within my application?
Nahydrin
  • 13,197
  • 12
  • 59
  • 101
1
vote
1 answer

C# Create object from a value in a string variable

I want to get the type of the value stored in the 'result' variable. Assume I dont know the 'result' value and the value comes during runtime. string result="System.IO.Directory"; MetadataReference[] references = { …
Emily Wong
  • 297
  • 3
  • 10
1 2 3
8 9