Questions tagged [runtime-compilation]

Use this tag for questions related to Runtime Compilation, i.e. the compilation of a program during Runtime.

is used in its general meaning, and is usually accompanied by Java, C based languages, Scala, ASP.NET, etc. .

123 questions
1
vote
1 answer

How to compile c#-6.0+ code at runtime?

I'm trying to compile a code at runtime and create an instance of one of the classes in it, but I get some errors when using c# 6+ features like string interpolation. Here is the code I'm using to compile: using (var cs = new…
Shaked Dahan
  • 402
  • 5
  • 22
1
vote
3 answers

C# Runtime Compilation error: Type 'Double' and 'Math' could not be found/does not exist in current context

I have added "System.dll" to the compiler parameter referenced assemblies.I also noticed that adding to "Using System" to the codeToCompile OR using "System.Math" or "System.Double" works fine.Not sure what's wrong. using Microsoft.CSharp; …
1
vote
1 answer

Incomplete Pattern Matching in f#

Consider the following code: let list1 = [1; 2; 3; 4; 5];; let getThird3 = function |[] ->[]; | _::_::l3::t -> t;; getThird3 list1; When pasted on terminal running fsharpi it gives me this error > let list1 = [1; 2; 3; 4; 5];; val list1 : int…
1
vote
1 answer

Compiling at runtime and #include custom header in C++

I need to compile and link some code at runtime. I am using the approach suggested here: https://stackoverflow.com/a/10565120/3038460 Basically I am writing my code into a .cpp file and then compiling with /usr/bin/g++ -shared mysource.cpp -o…
Marco Ancona
  • 2,073
  • 3
  • 22
  • 37
1
vote
1 answer

ToolProvider.getSystemJavaCompiler() returning null

I'm currently trying to compile and execute code at runtime. Everything worked perfectly fine in my IDE (Netbeans), but as soon as I exported my code as a .jar file ToolProvider.getSystemJavaCompiler() returned null. Is there a reason why this is…
Joba
  • 777
  • 7
  • 24
1
vote
3 answers

What is the time complexity?

What is the time complexity for the following function? for(int i = 0; i < a.size; i++) { for(int j = i; j < a.size; i++) { // } } I think it is less than big O n^2 because we arent iterating over all of the…
user2158382
  • 4,430
  • 12
  • 55
  • 97
1
vote
1 answer

passing class types to runtime compiled code C#

I am trying to read and compile an external file (it's in a string constant for now) I can use basic primitives in the external code but I can't seem to figure out how to pass it a class type without it getting angry -heres what I have (excluding…
1
vote
1 answer

How to compile CIFilter at runtime?

I would like to do at runtime in a program, what Quartz Composer does with the Core Image Filter patch: Compiling a CIFilter inside Quartz Composer. Quartz Composer has a patch that takes the text of the CIFilter kernel, with which it creates the…
alecail
  • 3,993
  • 4
  • 33
  • 52
1
vote
4 answers

Making assemblies internals visible to another assembly at runtime

So I have been looking for a way to do this for a while and every time I find something, it leads to a different problem. Basically, I have a game console. The console runs snippets of C# code. The compiled assembly needs to be a friend of the…
Luka Horvat
  • 4,283
  • 3
  • 30
  • 48
0
votes
1 answer

Blocking operator==() at compile time

I have an ID-Record class and I want to block callers / users from using the operator== since it is ambiguous (user may want to compare only data field for equality). Here's my class: #include #include class ID_Record { …
Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154
0
votes
0 answers

java: java.lang.RuntimeException: java.io.IOException: in Intellij

During code compilation in Intellij, getting the Java: "java.lang.RuntimeException: "No additional logs are forthcoming. Since I started using Java 11 version, this problem has been occurring. Tried deleting the file…
0
votes
0 answers

Unable to Access Types from Compiled WPF Project Loaded as DLL using Roslyn Compile

I have a WPF project that I need to compile, load as a DLL file, and access its components programmatically. I'm currently using the Roslyn Compiler in my function, but I'm open to alternative solutions if they can help resolve my issue. The problem…
0
votes
1 answer

How to runtime compile with reflection for a class being used within another class

My code: import scala.reflect.runtime import scala.reflect.runtime.universe import scala.reflect.runtime.universe._ import scala.tools.reflect.ToolBox object Stuff { val rm: universe.Mirror = runtime.currentMirror val tb: ToolBox[universe.type]…
0
votes
2 answers

Missing dependency ‘object scala.native in compiler mirror’

I used scala-compiler.jar to compile an embedded Scala program This scala program imports a class written using jni The code is as follows class test{ def test(ctx: ContractContext): ActionResult = { val s = new DllTest s.loadLibrary() …
0
votes
0 answers

How to get the properties name, type and other info from a class gotton through CSharpCompilation.Create()?

I've previously asked a question "How to get the Type of an Array of Nullable Primitive?" How to get the Type of an Array of Nullable Primitive?. In that question, I have a class in my c# program and I was able to use reflection to find out the…
EBDS
  • 1,244
  • 5
  • 16
1 2 3
8 9