|.NET compiler email@example.com (ajk) (2008-09-15)|
|.NET compiler firstname.lastname@example.org (Felipe Angriman) (2008-09-16)|
|Re: .NET compiler email@example.com (Stephen Horne) (2008-09-16)|
|Re: .NET compiler firstname.lastname@example.org (Aaron Gray) (2008-09-18)|
|From:||"Felipe Angriman" <email@example.com>|
|Date:||Tue, 16 Sep 2008 11:37:43 -0300|
|Posted-Date:||16 Sep 2008 11:02:47 EDT|
On Mon, Sep 15, 2008 at 10:14 PM, ajk <firstname.lastname@example.org> wrote:
> If I was contemplating doing a .NET compiler for a language, would it
> be better to generate ILAsm or some other higher-level .NET language?
First you should consider whether your language is using a subset of the CLR
or the full CLR.
If it is a Subset of the CLR then any Language which implements a
superset of your
Language Functionality should be fine. IMO C# would be the best choice
since there are mature compilers on the Mono .NET platform
as well in the Microsoft .NET Platform.
If you intented to target the full CLR then you should generate IL.
> By creating ILAsm there is more control but I suppose one would have
> to put more effort in optimisation.
True, generating IL always gives you more control. While it is true that
you might need to do some extra effort to generate "Good" IL sequences
for yor assemblies, I would generate IL that "just works" for the moment.
Applications that are long lived are optimized by the NGen Service on the
Microsoft .NET Platform (I don't recall if there is such service on
the mono Platform)
Anyway, if you are in desperate needs for performance you can precompile
an assembly to a native image, and Let the Native Image Compiler
do the optimizations for you
> Any other benefits of doing ILAsm compared to say C# and then
> compiling C# using the std compiler?
Yes, if you generate IL you wouldn't be creating a dependency to
a software which you DON'T Control. The compiler might evolve and
introduce semantics which are different than those of your language,
although this is very unlikely.
Besides if you intend that your compiler is used in environments that you
do not control, then generating IL is almost a MUST DO
Hope it Helps,
Return to the
Search the comp.compilers archives again.