DianaScript is a minimal programming language that aims at interfacing with .NET runtime, especially for game developement in Unity.
System.Reflection
.You should firstly compile the source code of Ch-lang(创创语言) to Diana bytecode using the compiler written in Python:
python -m dianascript runtests/b.ch --out runtests/b.ran
Then you load the bytecode using Diana VM:
public static int Main(String[] args)
{
Console.WriteLine("path: " + args[0]);
var dvm = new DVM();
var loader = new AWorld.CodeLoder(args[0]);
var metaInd = loader.LoadCode();
var global = GlobalNamespace.GetGlonal();
dvm.exec_block(metaInd, global);
return 0;
}
An exception will get raised to .NET side if it is not handled in DianaScript/DVM. The exception type is compatible to both runtime.
You can help us in many aspects:
Implementation for the whole object system.
For instance, if you want to add +
operator support for specific builtin types(bool
, int
, float
, list
, dict
, None
, tuple
...), just like __add__
for diana integers; you should
add "add"
to ExceptionList1["DInt"]
implement the interface at a proper place:
public DObj __add__(DObj a)
Writing tests for the language, just like what I did(of course not enough) at test.ch.
Language design: should we use arbitrary-precision integers? Or, should we use dicts as sets, etc..
绝赞摆烂中