runtime-compilation

Where would you use C# Runtime Compilation?

▼魔方 西西 提交于 2019-12-04 01:40:51
I happened upon a brief discussion recently on another site about C# runtime compilation recently while searching for something else and thought the idea was interesting. Have you ever used this? I'm trying to determine how/when one might use this and what problem it solves. I'd be very interested in hearing how you've used it or in what context it makes sense. Thanks much. Typically, I see this used in cases where you are currently using Reflection and need to optimize for performance. For example, instead of using reflection to call method X, you generate a Dynamic Method at runtime to do

Online c# interpreter security issues

一世执手 提交于 2019-11-30 09:25:45
I am toying around with the idea of building an online C# interpreter, a bit like Codepad . Now there are obvious security issues: Infinite loops System.Diagnostics.Process.Start Pretty much the whole System.IO namespace My knowledge of C# isn't exactly insignificant, but I'm sure there are a lot that know much more about it, plus the stuff I didn't think about. What would you be careful about? A few precisions, I plan on running this on a small Linux VPS using Mono. Use Mono's Compiler as service capability. It can be compiled to a Silverlight compatible DLL (client profile), and has been

Is there any way to compile additional code at runtime in C or C++?

三世轮回 提交于 2019-11-30 00:30:12
Here is what I want to do: Run a program and initialize some data structures. Then compile additional code that can access/modify the existing data structures. Repeat step 2 as needed. I want to be able to do this with both C and C++ using gcc (and eventually Java ) on Unix-like systems (especially Linux and Mac OS X). The idea is to basically implement a read-eval-print loop for these languages that compiles expressions and statements as they are entered and uses them to modify existing data structures (something that is done all the time in scripting languages). I am writing this tool in

scala as scripting language [duplicate]

。_饼干妹妹 提交于 2019-11-29 13:40:16
Possible Duplicate: “eval” in Scala I know scala is a compiled language, but I do also know that I can dynamically load classes into the jvm, and I can call the scala compiler at runtime, last but not least I do also have an awesome repl, so having scala as a scripting language should be possible. so there are some tasks I need to get to run: simple interpret: val src = """ println("Hello World") """ interpret(src) call external functions: object A{ def foo = println("Hello World") } val src = """ A.foo """ interpret(src) implement functionality: trait T{ def foo:String } val src = """ class A

Loading external source code and using them internally (by re-compiling or something)

ε祈祈猫儿з 提交于 2019-11-29 11:57:52
Is there a way in using externally stored sourcecode and loading it into a Java programm, so that it can be used by it? I would like to have a program that can be altered without editing the complete source code and that this is even possible without compiling this every time. Another advantage is, that I can change parts of the code like I want. Of course I have to have interfaces so that it is possible to send data into this and getting it back into the fixed source program again. And of course it should be faster than a pure interpreting system. So is there a way in doing this like an

Is there any way to compile additional code at runtime in C or C++?

放肆的年华 提交于 2019-11-28 21:24:54
问题 Here is what I want to do: Run a program and initialize some data structures. Then compile additional code that can access/modify the existing data structures. Repeat step 2 as needed. I want to be able to do this with both C and C++ using gcc (and eventually Java ) on Unix-like systems (especially Linux and Mac OS X). The idea is to basically implement a read-eval-print loop for these languages that compiles expressions and statements as they are entered and uses them to modify existing data

Defining a class while a Java application is running

有些话、适合烂在心里 提交于 2019-11-28 20:35:22
In Java, is it possible to create a class definition on the fly while an application is running, and then create an object of that class? For example, a running application would read in a text file that contains a list of class members to include in the new class. The application would then define a class definition based on the list of members, and then insantiate it. Yes its possible to do so in theory your class file is byte code which is at the end a byte array! you can then use the method defineClass(String, byte[], int, int) to get a Class instance that can be used to instantiate

scala as scripting language [duplicate]

孤街醉人 提交于 2019-11-28 07:17:28
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: “eval” in Scala I know scala is a compiled language, but I do also know that I can dynamically load classes into the jvm, and I can call the scala compiler at runtime, last but not least I do also have an awesome repl, so having scala as a scripting language should be possible. so there are some tasks I need to get to run: simple interpret: val src = """ println("Hello World") """ interpret(src) call external

Loading external source code and using them internally (by re-compiling or something)

岁酱吖の 提交于 2019-11-28 05:25:48
问题 Is there a way in using externally stored sourcecode and loading it into a Java programm, so that it can be used by it? I would like to have a program that can be altered without editing the complete source code and that this is even possible without compiling this every time. Another advantage is, that I can change parts of the code like I want. Of course I have to have interfaces so that it is possible to send data into this and getting it back into the fixed source program again. And of

Compile and run dynamic code, without generating EXE?

大憨熊 提交于 2019-11-26 19:47:40
I was wondering if it was possible to compile, and run stored code, without generating an exe or any type of other files, basically run the file from memory. Basically, the Main application, will have some stored code (code that will potentially be changed), and it will need to compile the code, and execute it. without creating any files. creating the files, running the program, and then deleting the files is not an option. the compiled code will need to be ran from memory. code examples, or pointers, or pretty much anything is welcome :) using (Microsoft.CSharp.CSharpCodeProvider foo = new