lucabol / Forth.Net

Forth for .Net.
MIT License
7 stars 1 forks source link

Come up with syntax to insert snippets of C# in the forth code #11

Open lucabol opened 2 years ago

lucabol commented 2 years ago

It is a bit like the assembler for Forth systems. In case you don't want to re-write the whole world in forth you can reuse some .net library classes.

You also need a way to refer to the stack and data segment in C#, i.e. calling the function in VmExt. Either we rename them to be more friendly, or we inject friendlier methods. This work can then also be used for source generators.

: aWordThatIsImplementedInC# {{
    var a = VmExt.pop(ref vm);
    CallACSharpMethod(a);
}}
lucabol commented 2 years ago

I have now a way to call static methods, but this is still valid. We can use Roslyn.