[antlr-interest] C# Target Poll

Johannes Luber JALuber at gmx.de
Sat May 17 10:09:08 PDT 2008


> I think for a small runtime like Antlr, the best move would be:
> 
> - Minimize dependencies

Theoretically, extra libraries can be included in a single assembly via the inclusion of its source code in the build process or the use of the Mono linker. This is independent of the actual library.

> - Minimize size

While the Mono linker can help there, there is the option of only to include the required classes. The question is which one is easier in the long run here.

> - Maximize it's "feel" compared to the .NET framework (best practices,
> conventions, etc.).

This is something I have been working on already. Takes times, though, to find all issues. And the suggested FxCop doesn't help with template changes nor with the changes in user code.
> 
> There is a tremendous amount of work that could be done to improve the
> runtime as we move to .NET 2.0. If I had any suggestion at this point, it'd be
> to have a runtime dll built that doesn't include the debug-only classes.

Funny that you mention this. It isn't possible because of a language limitation/improvement of C# compared to Java. The DFA classes, I believe, have always a dependency with the debugging part. I didn't found another way to solve the issue, which is still repeatable in ANTLR 3.0.1 with the -debug option (You can also use ANTLRworks 1.1.x). Just look for the variable dbg if you want to try it on your own. :) Speaking of debug dependencies, I've been thinking about making the interfaces for normal and debug versions identical (even if normal doesn't do anything with the extra parameters), so the driver program can be the same. Minimizing can be done with the Mono linker. What do you think?

Johannes
> 
> Sam
> 
> -----Original Message-----
> From: antlr-interest-bounces at antlr.org
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Johannes Luber
> Sent: Friday, May 16, 2008 6:27 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] C# Target Poll
> 
> Hi!
> 
> While thinking about future improvements, I came across over the switch of
> the used collections from the .NET versions to the one supplied by C5
> <http://www.itu.dk/research/c5/>. The C5 library has more functionality and
> more types of collections than the .NET. Instead replicating text from the PDF
> please read at least the introduction yourself:
> <http://www.itu.dk/research/c5/Release1.1/ITU-TR-2006-76.pdf>
> 
> My motivation to consider C5 is simply that I prefer to use
> state-of-the-art tools, and to a certain extent .NET falls short. I have used it in a few
> projects so far and will use it again. It is easy to use. I had no
> problems besides non-binary-serializing of a dictionary, which was caused by .NET
> bugs, so I wouldn't hold that against C5. Also, serializing seems to be an
> unusual need for compilers anyway and can be circumvented by own designs
> anyway, as it probably would have been anyway. Please correct if I'm wrong
> and C5 would prevent doing from something what you can do now.
> 
> Still, I can't simply switch the engines as I'd enforce the same change
> for all C# target users. As I can see, the use of C5 has the following
> disadvantages:
> 
> -The inclusion of another assembly, thus increasing the application size
> -C5 may be fast, but the .NET classes are speedier as they sacrifice some
> of the extended functionality. How much exactly, I don't know, but if you
> care about nano-seconds, then C5 might be the wrong choice. Compiler
> builders care about the speed of their software after all.
> 
> Not problematic is:
> 
> -C5 can be used like ANTLR in (non)commercial projects as it uses a
> BSD-like license.
> -It can be integrated with .NET classes as it is based on interface
> programming.
> 
> In case, I have overlooked important points, please shout them. I haven't
> done any work to switch to C5 yet, so voting down my suggestion won't waste
> any effort from my side.
> 
> Johannes
> -- 
> Psssst! Schon vom neuen GMX MultiMessenger gehört?
> Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

-- 
249 Spiele für nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro.
Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de


More information about the antlr-interest mailing list