[Mono-dev] C# source-to-source compiler
Rafael Teixeira
monoman at gmail.com
Thu Nov 4 20:14:13 EDT 2010
It all depends on the extensions you want to add, and which parser you can
reuse for that. If you have mainly some kind of template expansion things,
even some regex may be able to convert from C#+Your Extensions to C#, but
probably you'll need to delegate syntax verification to the final compiler
so tracking error locations may become impracticable.
As I said it all depends on what specifically you want to add to the
language. If you can give more details of what you intend to do, we can try
to help you better.
About Boo, it is simply that it is a language that is already very
extensible, so things are orders of magnitude easier, and you can use Boo's
secondary parser (the WSA whitespace agnostic parser) to approximate the
language more to look like C#, if you like.
Fun,
Rafael "Monoman" Teixeira
---------------------------------------
"We live in a world operated by science and technology. We have also
arranged things so that almost no one understands science and technology.
This is a prescription for disaster. We might get away with it for a while,
but sooner or later this combustible mixture of ignorance and power is going
to blow up in our faces."
-Carl Sagan
2010/11/4 Liang, Qichang (梁启昌) <kcleung.sourceforge at gmail.com>
> I am also looking for developing C#-based language extension, which
> the compiler will compile to C# 4.0 code that calls *my* runtime
> library. The emitted C# 4.0 code will then go to the original dmcs
> compiler, which will then produce CLI bytecode.
>
> Are you suggesting that it is difficult for me to add keywords to the
> C# system,
>
> or it is difficult to make the dmcs compiler to emit C# 4.0 code
> (rather than CLI code)?
>
>
> Also are you suggesting that my language should base on extension of
> the Boo language rather than C# language?
>
> However C# is much more popular than Boo.............
>
> Thanks!
>
> Qichang
>
> On Fri, Nov 5, 2010 at 1:02 AM, Rafael Teixeira <monoman at gmail.com> wrote:
> > Plugins for compilers in the syntax tree part, aren't easy to make it
> work,
> > because the tree segments need to coalesce into a single consistent tree,
> > without cycles or disjoints segments.
> > That said, there is already a compiler for .NET/Mono that has a pipelined
> > design where you can add or substitute stages, it is the Boo compiler.
> > Also Boo already support Macros what make it easy to extend it's syntax,
> > without having to change the compiler itself.
> > Give it a look:
> > http://boo.codehaus.org/
> > https://github.com/languages/Boo
> > https://github.com/bamboo/boo
> >
> > Rafael "Monoman" Teixeira
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20101104/0e0a08f1/attachment.html
More information about the Mono-devel-list
mailing list