unity allow player to script a object or compile and run a code in runtime

Hi!

I am working on a game in which the player needs to code a cube, now I have asked this question before but I didn’t get a clear answer, I have tried many approaches such as:
using lua moon sharp(but I couldn’t figure out how to tell the object to goForward() for exp),
compiling the script(C#) on the fly(but couldn’t figure out what to do with the assembly, I don’t even know what an assembly is).
I have also tried codeDom, and I have a script that compiles string but I don’t know what to do with it.

so can somebody tell what is the simplest way to let a player write his own code(C# or lua or python) and then compiling it and applying it to a game Object (for now lets assume that there are no error or security problems) .

BTW I have already made a program that allow the player to write his source code and save it, and I do know how to take the source code and turn it in to a string.

It would be great if you will give a clear and detailed answer. and if can someone explain to me what is dll it would be great too

thanks for the help

I have not tried any of this, but this blog post seems to explain how to do this really well. You will just need to rewrite the code so that it loads not from the URL, but from the file instead.

The only problem I see is compiling actual code. This looks like an excelent post.

Now what is dll? Windows calls it Aaplication Extension. Dll is a compiled library (any kind), which can be loaded to application to make use of. In dlls you can store scripts or some low level code. Usually, unity builds few dlls for all of your scripts, but you can add more at any time you want. This is very useful when you need to update your game so people would not need to redownload everything again or when you want to do things what unity engine can not provide by itself.

Note: dlls usually have to be compiled for each operating system separately.