C# vs alternate C# target

40 views
Skip to first unread message

Raymond Rizzuto

unread,
Oct 18, 2017, 10:19:19 AM10/18/17
to antlr-discussion
Is there a summary of the difference between the two C# target implementations somewhere that would help a developer chose which to use?  I'm not asking for a ranking/rating, but just an understanding of the differences that might allow me to choose which fits the requirements of the project(s) I am looking to use Antlr4 in. 

Sam Harwell

unread,
Oct 18, 2017, 6:44:38 PM10/18/17
to antlr-di...@googlegroups.com

The differences can be broken down into three categories:

 

  1. Updates
  2. Support
  3. Features

 

Here’s what I believe to be an objective breakdown of the differences is these categories:

 

  • Updates
    • The Antlr4.Runtime.Standard package is maintained and published at the same time as the reference Java version. The Antlr4.Runtime package (and related artifacts) are updated and published separately from the reference release, and the delay can range from days to months.
    • The Antlr4.Runtime.Standard package periodically includes breaking changes in order to simplify long-term maintenance, fix bugs, and add features to help users. Code regeneration is typically required. The Antlr4.Runtime package includes a relatively strict breaking changes policy, even if it means more work or avoiding certain new features. While code regeneration is recommended, it maintains support for cases where old code is used (and has for years now).
  • Support
    • The Antlr4.Runtime.Standard package includes support for the “net35” and “netstandard1.3” target frameworks, which supports a wide range of clients/platforms/OS (including almost all that are currently in use).
    • The Antlr4.Runtime package expands support to include net20, net35-client, netstandard1.1, and net35-cf, along with a few other cases. In the remote possibility you are targeting a platform that the standard runtime doesn’t support, Antlr4.Runtime probably supports it, because it supports almost everything in existence.
  • Features
    • The Antlr4.CodeGenerator package provides build support to automatically generate code as part of the build process. This functionality is tightly integrated with the IDE when using Visual Studio (IntelliSense will update as soon as you save your grammar), but the latest releases also work for the dotnet tool. The most recent builds include a code generator written in C#, eliminating the Java dependency for building projects (neither runtime has a Java dependency when executing the compiled code).
    • The Antlr4.Runtime package includes most of the features listed in the Optimized Fork documentation.

 

Sam

--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ray Rizzuto Jr

unread,
Oct 18, 2017, 8:12:50 PM10/18/17
to antlr-di...@googlegroups.com
Are there differences in the generated parse trees that would require code changes to visit the tree?  I.e. what work is required when moving from one C# target to the other?

You received this message because you are subscribed to a topic in the Google Groups "antlr-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/antlr-discussion/Uav1k5AxYhI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to antlr-discussi...@googlegroups.com.

Sam Harwell

unread,
Oct 18, 2017, 9:21:30 PM10/18/17
to antlr-di...@googlegroups.com

Hi Ray,

 

The grammar language should be the same with the exception of embedded actions and maybe semantic predicates. I haven’t looked at the API differences between the targets themselves, as my focus is exclusively on ensuring compatibility between current and future versions of the runtime I maintain.

 

Sam

Ivan Kochurkin

unread,
Oct 25, 2017, 6:50:48 AM10/25/17
to antlr-di...@googlegroups.com
Sam, do you have open source performance comparison benchmarks of standard and your runtimes? I'm curious about it.

Also, I'm curious about comprehensive test data and details for different performance aspects comparison. I and my company (Positive Technologies) wants to research this question and upload different performance benchmarks and article in future.

Sam Harwell

unread,
Oct 26, 2017, 10:56:54 AM10/26/17
to antlr-di...@googlegroups.com
Hi Ivan,

The TestPerformance tests are implemented for the reference Java runtime and for my Java and C# runtimes. I don't do any work with any other C# runtimes so I'm not sure if it offers anything similar.

For pure performance comparisons you'll want to turn off the checksum feature of the test, which is used for accuracy testing.

Thanks,
Sam

Sent from Nine

From: Ivan Kochurkin <ivan.ko...@gmail.com>
Sent: Oct 25, 2017 3:50 AM
To: antlr-discussion

Subject: Re: [antlr-discussion] C# vs alternate C# target
Sam, do you have open source performance comparison benchmarks of standard and your runtimes? I'm curious about it.

четверг, 19 октября 2017 г., 4:21:30 UTC+3 пользователь Sam Harwell написал:

To unsubscribe from this group and all its topics, send an email to antlr-discuss...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Ivan Kochurkin

unread,
Oct 26, 2017, 6:10:32 PM10/26/17
to antlr-discussion
Are these performance tests available on GitHub?

Sam Harwell

unread,
Oct 26, 2017, 7:04:41 PM10/26/17
to antlr-di...@googlegroups.com
Yes, it is in each repository in TestPerformance.java or TestPerformance.cs.

Sent from Nine

From: Ivan Kochurkin <kva...@gmail.com>
Sent: Oct 26, 2017 3:10 PM
Reply all
Reply to author
Forward
0 new messages