The compiler has a number of phases:
- * Lexical analizer: hand-coded lexical analizer that
- provides token to the parser.
+ * Lexical analyzer: hand-coded lexical analyzer that
+ provides tokens to the parser.
* The Parser: the parser is implemented using Jay (A
Berkeley Yacc port to Java, that I ported to C#).
- The parser does minimal work and checking, and only
- constructs a parsed tree.
+ The parser does minimal work and syntax checking,
+ and only constructs a parsed tree.
Each language element gets its own class. The code
convention is to use an uppercase name for the
from the "Statement" class, and Expressions from the
Expr class.
- * Parent class resolution: before process can happen
- on the actual code generation, we need to resolve
- the parents for interfaces, classes and structs.
+ * Parent class resolution: before the actual code
+ generation, we need to resolve the parents and
+ interfaces for interface, classe and struct
+ definitions.
* Semantic analysis: since C# can not resolve in a
top-down pass what identifiers actually mean, we
** Current pending tasks
- Arrays declarations are currently being ignored,
+ Array declarations are currently being ignored,
PInvoke is not supported.
Pre-processing is not supported.
- Attribute declarations and passing is currently ignored.
+ Attribute declarations and passing currently ignored.
Compiler does not pass around line/col information from tokenizer for error reporting.
Q: Why not write a C# front-end for GCC?
-A: I wanted to learn about C#, and this was an excercise in this
+A: I wanted to learn about C#, and this was an exercise in this
task. The resulting compiler is highly object-oriented, which has
lead to a very nice, easy to follow and simple implementation of
the compiler.
I found that the design of this compiler is very similar to
Guavac's implementation.
- Targeting the CIL/MSIL byte codes would require to re-architect
+ Targeting the CIL/MSIL byte codes would require to re-architecting
GCC, as GCC is mostly designed to be used for register machines.
- The GCC Java engine that generates java byte codes cheats: it does
- not use the GCC backend, it has a special backend just for Java, so
+ The GCC Java engine that generates Java byte codes cheats: it does
+ not use the GCC backend; it has a special backend just for Java, so
you can not really generate Java bytecodes from the other languages
supported by GCC.
this working on a non-Microsoft environment.
The compiler will have two output mechanisms: IL code or C code.
- A compiled version of the compiler could be ran on Unix by just
+ A compiled version of the compiler could be run on Unix
using the JIT runtime.
The C output generation bit is just intended to be a temporary
measure to allow Unix hackers to contribute to the effort without
requiring Windows and Microsoft's .NET implementation to work on
the compiler. So the MCS C# compiler will compile itself to C,
- this code then compiled on Unix and voila! We have a native
- compiler for GNU/Linux.
+ this code then compiled to an executable on Unix and voila! We
+ have a native compiler for GNU/Linux.
Q: Do you use Bison?
A: No, currently I am using Jay which is a port of Berkeley Yacc to
Java that I later ported to C#. This means that error recovery is
not as nice as I would like to, and for some reason error
- productions are not being catched.
+ productions are not being caught.
In the future I want to port one of the Bison/Java ports to C# for
the parser.
The Class Library should be compatible with Microsoft's .NET
implementation.
- Ideally as much code as possible should be written using C#,
- in some cases we might either need to interface with code
+ Ideally as much code as possible should be written using C#.
+ In some cases we might either need to interface with code
written in C for large chunks of functionality (libart and
Gtk+ for example) or we would need to interface to the system
libraries (libc on Unix for networking functions for
** Class Library and Win32 dependencies.
There are a few spots where the Win32 foundation is exposed to
- the class library (the HDC and HWND properties in the GDI+),
- it seems from casual inspection that these can be safely
+ the class library (the HDC and HWND properties in the GDI+).
+ It seems from casual inspection that these can be safely
mapped to Gdk's GC and GdkWindow pointers without breaking anything.
- The only drawback is that, we will not support PInvoke
- invocations of Win32 code. This could be possible in the
- future by reusing pieces of Wine, and probably using Wine as
- our toolkit, but we think this is not as important as most
- people will always be isolated from the Win32 system.
+ The only drawback is that support for PInvoke of Win32 code
+ wont be available. If this is necessary it could be possible
+ in the future by reusing pieces of Wine, and probably using
+ Wine as our toolkit, but we think that this is not as
+ important as we will wrap GNOME elements in the meantime.
*** Initial GDI+ and WinForms implementation
The initial implementation will use Gtk+ as the underlying
toolkit, but implementations for other windowing systems
- should be possible (specially thinking about PDA devices
+ should be possible (particularly thinking about PDA devices
here).
Since Gtk+ 2.0 has been ported to other windowing systems
** Licensing
The class library will be licensed under the terms of the GNU
- GPL, with the special provision that linking to this library
- does not cause your application to be covered by the GNU GPL.
-
- This is a stop gap measure, I am using this until we can
- figure out why not use the laxer GNU LGPL license. We do
- request that contributors allow us to relicense the code under
- a GNU LGPL like license in the future for inclussion in the
- code base at any point in the future.
+ LGPL.
+
+ We suggest that you assign the copyright of your work to the
+ GNOME Foundation or the Free Software Foundation to simplify
+ defending the code in case it is used inappropiately.
+
+** Contributing
+
+ We welcome contributions to the the Class Library, you can
+ check the status page. Our status page describes which APIs
+ are being worked on and the contact information for the
+ contributor.
+
+
This will allow pre-compilation and full optimization to take
place before a program is executed.
-
desktop applications. We also realized early on that language
independence was important, and that is why GNOME APIs were
coded using a standard that allowed the APIs to be easily
- wrapper for other languages. Our APIs are available on most
+ wrapped for other languages. Our APIs are available on most
programming languages on Unix (Perl, Python, Scheme, C++,
Objective-C, Ada).
Later on we decided to use better methods for encapsulating
our APIs, and we started to use CORBA to define interfaces to
- components, and we complemented it policy and a set of
+ components we complemented it with policy and a set of
standard GNOME interfaces for easily creating reusable and
language independent components, controls and compound
documents. This technology is known as <a
user applications.
Depending who you ask, you will probably get a different
- answer on what .NET is, .NET is a branding name that has been
- applied to:
+ answer on what .NET is, as .NET is a branding formative that
+ has been applied to:
* The .NET development platform, a new platform for
writing software.
* The .NET development platform.
- Microsoft has created a new development platform, the
+ Microsoft has created a new development platform. The
highlights of this new development platform are:
* A runtime environment that provides garbage
* A comprehensive class library.
- * A new language, C#. Very similar to Java, that
+ * A new language, C#. Very similar to Java. C#
allows programmers to use all the features available
on the .NET runtime.
runtime on the CIL byte codes ensures that it is possible to
do a good job at optimizing the code in a JIT compiler.
- There is not really a lot of innovation in this platform, we
+ There is not really a lot of innovation in this platform: we
have seen all of these concepts before, and we are all
familiar with how these things work.
The .NET development platform is essentially a new foundation
for program development that gives Microsoft a room to grow
- for the next years.
+ for the coming years.
* ECMA standards.
The compiler has a number of phases:
- * Lexical analizer: hand-coded lexical analizer that
- provides token to the parser.
+ * Lexical analyzer: hand-coded lexical analyzer that
+ provides tokens to the parser.
* The Parser: the parser is implemented using Jay (A
Berkeley Yacc port to Java, that I ported to C#).
- The parser does minimal work and checking, and only
- constructs a parsed tree.
+ The parser does minimal work and syntax checking,
+ and only constructs a parsed tree.
Each language element gets its own class. The code
convention is to use an uppercase name for the
from the "Statement" class, and Expressions from the
Expr class.
- * Parent class resolution: before process can happen
- on the actual code generation, we need to resolve
- the parents for interfaces, classes and structs.
+ * Parent class resolution: before the actual code
+ generation, we need to resolve the parents and
+ interfaces for interface, classe and struct
+ definitions.
* Semantic analysis: since C# can not resolve in a
top-down pass what identifiers actually mean, we
** Current pending tasks
- Arrays declarations are currently being ignored,
+ Array declarations are currently being ignored,
PInvoke is not supported.
Pre-processing is not supported.
- Attribute declarations and passing is currently ignored.
+ Attribute declarations and passing currently ignored.
Compiler does not pass around line/col information from tokenizer for error reporting.
Q: Why not write a C# front-end for GCC?
-A: I wanted to learn about C#, and this was an excercise in this
+A: I wanted to learn about C#, and this was an exercise in this
task. The resulting compiler is highly object-oriented, which has
lead to a very nice, easy to follow and simple implementation of
the compiler.
I found that the design of this compiler is very similar to
Guavac's implementation.
- Targeting the CIL/MSIL byte codes would require to re-architect
+ Targeting the CIL/MSIL byte codes would require to re-architecting
GCC, as GCC is mostly designed to be used for register machines.
- The GCC Java engine that generates java byte codes cheats: it does
- not use the GCC backend, it has a special backend just for Java, so
+ The GCC Java engine that generates Java byte codes cheats: it does
+ not use the GCC backend; it has a special backend just for Java, so
you can not really generate Java bytecodes from the other languages
supported by GCC.
this working on a non-Microsoft environment.
The compiler will have two output mechanisms: IL code or C code.
- A compiled version of the compiler could be ran on Unix by just
+ A compiled version of the compiler could be run on Unix
using the JIT runtime.
The C output generation bit is just intended to be a temporary
measure to allow Unix hackers to contribute to the effort without
requiring Windows and Microsoft's .NET implementation to work on
the compiler. So the MCS C# compiler will compile itself to C,
- this code then compiled on Unix and voila! We have a native
- compiler for GNU/Linux.
+ this code then compiled to an executable on Unix and voila! We
+ have a native compiler for GNU/Linux.
Q: Do you use Bison?
A: No, currently I am using Jay which is a port of Berkeley Yacc to
Java that I later ported to C#. This means that error recovery is
not as nice as I would like to, and for some reason error
- productions are not being catched.
+ productions are not being caught.
In the future I want to port one of the Bison/Java ports to C# for
the parser.
The Class Library should be compatible with Microsoft's .NET
implementation.
- Ideally as much code as possible should be written using C#,
- in some cases we might either need to interface with code
+ Ideally as much code as possible should be written using C#.
+ In some cases we might either need to interface with code
written in C for large chunks of functionality (libart and
Gtk+ for example) or we would need to interface to the system
libraries (libc on Unix for networking functions for
** Class Library and Win32 dependencies.
There are a few spots where the Win32 foundation is exposed to
- the class library (the HDC and HWND properties in the GDI+),
- it seems from casual inspection that these can be safely
+ the class library (the HDC and HWND properties in the GDI+).
+ It seems from casual inspection that these can be safely
mapped to Gdk's GC and GdkWindow pointers without breaking anything.
- The only drawback is that, we will not support PInvoke
- invocations of Win32 code. This could be possible in the
- future by reusing pieces of Wine, and probably using Wine as
- our toolkit, but we think this is not as important as most
- people will always be isolated from the Win32 system.
+ The only drawback is that support for PInvoke of Win32 code
+ wont be available. If this is necessary it could be possible
+ in the future by reusing pieces of Wine, and probably using
+ Wine as our toolkit, but we think that this is not as
+ important as we will wrap GNOME elements in the meantime.
*** Initial GDI+ and WinForms implementation
The initial implementation will use Gtk+ as the underlying
toolkit, but implementations for other windowing systems
- should be possible (specially thinking about PDA devices
+ should be possible (particularly thinking about PDA devices
here).
Since Gtk+ 2.0 has been ported to other windowing systems
** Licensing
The class library will be licensed under the terms of the GNU
- GPL, with the special provision that linking to this library
- does not cause your application to be covered by the GNU GPL.
-
- This is a stop gap measure, I am using this until we can
- figure out why not use the laxer GNU LGPL license. We do
- request that contributors allow us to relicense the code under
- a GNU LGPL like license in the future for inclussion in the
- code base at any point in the future.
+ LGPL.
+
+ We suggest that you assign the copyright of your work to the
+ GNOME Foundation or the Free Software Foundation to simplify
+ defending the code in case it is used inappropiately.
+
+** Contributing
+
+ We welcome contributions to the the Class Library, you can
+ check the status page. Our status page describes which APIs
+ are being worked on and the contact information for the
+ contributor.
+
+
This will allow pre-compilation and full optimization to take
place before a program is executed.
-
desktop applications. We also realized early on that language
independence was important, and that is why GNOME APIs were
coded using a standard that allowed the APIs to be easily
- wrapper for other languages. Our APIs are available on most
+ wrapped for other languages. Our APIs are available on most
programming languages on Unix (Perl, Python, Scheme, C++,
Objective-C, Ada).
Later on we decided to use better methods for encapsulating
our APIs, and we started to use CORBA to define interfaces to
- components, and we complemented it policy and a set of
+ components we complemented it with policy and a set of
standard GNOME interfaces for easily creating reusable and
language independent components, controls and compound
documents. This technology is known as <a
user applications.
Depending who you ask, you will probably get a different
- answer on what .NET is, .NET is a branding name that has been
- applied to:
+ answer on what .NET is, as .NET is a branding formative that
+ has been applied to:
* The .NET development platform, a new platform for
writing software.
* The .NET development platform.
- Microsoft has created a new development platform, the
+ Microsoft has created a new development platform. The
highlights of this new development platform are:
* A runtime environment that provides garbage
* A comprehensive class library.
- * A new language, C#. Very similar to Java, that
+ * A new language, C#. Very similar to Java. C#
allows programmers to use all the features available
on the .NET runtime.
runtime on the CIL byte codes ensures that it is possible to
do a good job at optimizing the code in a JIT compiler.
- There is not really a lot of innovation in this platform, we
+ There is not really a lot of innovation in this platform: we
have seen all of these concepts before, and we are all
familiar with how these things work.
The .NET development platform is essentially a new foundation
for program development that gives Microsoft a room to grow
- for the next years.
+ for the coming years.
* ECMA standards.