[Mono-list] Javascript and Mono

Miguel de Icaza miguel@ximian.com
06 Jan 2003 16:37:17 -0500


Hello,

> Microsoft.CSharp has the following classes:
> * Compiler : Managed wrapper for the C# compiler.
> * CompilerError : Represents an error or diagnostic message reported by 
> the compiler.
> * CSharpCodeProvider : Provides access to instances of the C# code 
> generator and code compiler.

Yep.  We have those classes implemented in the System assembly.

> Microsoft.VisualBasic contains
> * VBCodeProvider : Provides access to instances of the Visual Basic code 
> generator and code compiler.

We should do the same.  Maybe some magic copy/pasting will help ;-)

> So I was wondering if/how mcs and mbas use 'their' *CodeProvider classes
> (but this might be my misunderstanding - since I just noticed the 
> documentation doesn't have all Microsoft.* documentation in the same 
> place - the VisualBasic 'runtime' is documented in a different space 
> compared to the CodeProviders)

The *CodeProvider classes are just factories to create an object that
can generate source code from your program.  They are just a nice
wrapper that lets you in a language independent fashion "write code".

This is used mostly by ASP.NET, and never ever talks to mcs or mbas
directly.  Those interfaces will generate a temporary file on disk, and
the invoke the compiler to compile the temporary file.

As far as JavaScript is concerned, the same will happen: these are two
different problems.

> Hmm.. will jsc conflict with the already present jsc (on Windows)
> I thought the 'leading' m was common practice for the 'mono' compilers :)

The story is a bit more complex than that.  When I started writing mcs,
this was long before it became serious, it stood for "miguel's
c-sharp".  This is obviously far from a serious name, so officially we
call it the `mono c# compiler'.

I do not particularly care about the name of the compiler (for both jsc
and csc).  There are pros and cons in both cases.  Pros for using the
same names and same arguments as the Microsoft counterparts: existing
scripts and makefiles are easier to "port".  The con is that in Windows
you dont know what compiler you are invoking ;-)

Miguel