[Mono-dev] C# source-to-source compiler
Andreas Nahr
ClassDevelopment at A-SoftTech.com
Thu Nov 4 05:15:42 EDT 2010
Hi Mark,
either I'm misunderstanding your idea or you are misunderstanding some of
the .Net architecture.
1) C# has no own runtime library, it is practically a runtime-library-free
implementation on top of the CLR base class libraries/VM.
2) I don't understand why you ever wanted to change the virtual machine in
your situation. IF the runtime support you need can even be expressed in C#
code (and that's what I'm understanding from your post) then there is surely
no need to modify the VM at all.
The next question is why you want a source-to-source compiler. It is the
usual and good practice to compile source to IL and I don't see any reason
why you shouldn't.
If you want to be your language an extention of C# why not just take one
existing C# Compiler (e.g. dmcs) and add the constructs you need?
Happy hacking
Andreas
> -----Ursprüngliche Nachricht-----
> Von: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-
> bounces at lists.ximian.com] Im Auftrag von Mark Farnell
> Gesendet: Donnerstag, 4. November 2010 05:54
> An: mono-devel-list at lists.ximian.com
> Betreff: [Mono-dev] C# source-to-source compiler
>
> Hi,
>
> I plan to design a language based on an extention of C#, and I would
> like to use the mono compiler and abstract syntax tree.
>
> The language extension would require some runtime feature, which can
> be implemented by:
>
> - modifying the virtual machine, or
> - C# runtime library
>
> In the former case, it can be time consuming for me to navigate
> through the virtual machine.
>
> In the latter case, I would need a source to source compiler reading
> code written for the extended language and output pure C# code that
> links to my runtime library.
>
> For the latter option, I would like to modify the dmcs compiler to
> read the code written in the extended language and output pure C# code
> (rather than CIL bytecde).
>
> Is this possible? Are there other better ways?
>
> Thanks!
>
> Mark
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list