Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is StringTemplate for C# a dead project? #129

Open
nlyk opened this issue Feb 20, 2021 · 11 comments
Open

Is StringTemplate for C# a dead project? #129

nlyk opened this issue Feb 20, 2021 · 11 comments

Comments

@nlyk
Copy link

nlyk commented Feb 20, 2021

Should I use StringTemplate (C# target) in a new project? Please advise

@lextm
Copy link

lextm commented Feb 20, 2021

ANTLR 4 replaced ANTLR 3 a long while ago, so you should switch to https://github.com/antlr/antlr4/tree/master/runtime/CSharp/src

@nlyk
Copy link
Author

nlyk commented Feb 21, 2021

@lextm Sorry I was not clear - I am particularly interested in the StringTemplate project and specifically in the C# target.

@nlyk nlyk changed the title Is this project dead? Is StringTemplate for C# a dead project? Feb 21, 2021
@lextm
Copy link

lextm commented Feb 21, 2021

StringTemplate remains 4.x, https://www.stringtemplate.org/ So this repo already contains the latest C# port (4.x).

As a library of very specific features, I don't see a need of frequent updates. It will be your own judgement whether to use it in a new project.

@nlyk
Copy link
Author

nlyk commented Feb 22, 2021

Last stable version of ST4 is 4.3.1 (Jun 2020). ST4 C# last stable version is 4.0.8, since Dec 2016 (https://www.nuget.org/packages/StringTemplate4). Are all the fixes and new features after 4.0.8 not relevant to C# port? I doubt that.
Is there any known roadmap?

@kaby76
Copy link

kaby76 commented Mar 8, 2021

I was wondering myself. For my dotnet-antlr project, I create an Antlr driver from grammars and source code. Right now, my tool generates code via Console.WriteLines. I always assumed that I could rewrite it with ST, but when I went to look at it a few days ago, I found that this code doesn't even open or build in VS2019, and it uses ancient framework targets rather than Netstandard2.0. I was able to rip out large sub-projects and get it to compile in a few hours of work. ST is dependent on Antlr3--a liability in this code, and in the Java version--so I will try to use the official Java Antlr3 tool rather than the tool in this repo. I have no idea if any of this will work.

@kaby76
Copy link

kaby76 commented Mar 8, 2021

My fork of ST4 C# is here: https://github.com/kaby76/stringtemplate4cs It builds in VS2019 and is targeted to netstandard2.0. I made a simple "hello world" program that uses it and it works. Much to do in bringing it up to date.

@lextm
Copy link

lextm commented Mar 9, 2021

Related to tunnelvisionlabs/antlr4cs#341

@kaby76
Copy link

kaby76 commented Mar 9, 2021

@lextm Yes, good info. So, this repo is the one to fix. The copy I forked at (https://github.com/kaby76/stringtemplate4cs) is working. It handles everything I need, including "attributes", "properties", "map". I don't use groups, but I assume it will work for that, too. StringTemplate.ST is really StringTemplate.Template in the C# API, so the doc is behind. But, it's really the only way to go. ST is a very useful project.

Yeah, unfortunately, it's dependent on Antlr3. I noticed that it uses the parse tree construction annotation of Antlr3 to get an AST, but it looks like it is then compiled into some kind of byte code for an interpreter. In the long run, the Antlr3 dependency should just be replaced with Antlr4 so as to have one less thing to maintain.

@tdjastrzebski
Copy link

I have been using ANTLR over many, many years on many occasions.
It is very sad to see this extremely valuable project ending up like this - mixed up and confusing versioning, all dumped to a single repo, just two usual contributors, no future. I think, practically speaking, yes - it is dead.
It has not been decided to let it live :/

@kaby76
Copy link

kaby76 commented Jul 25, 2022

Yes, StringTemplate for C# is now mostly unmaintained. That is why I have a fork of the giant code base antlrcs, stripped out StringTemplate, and placed it here https://github.com/kaby76/Domemtech.StringTemplate4 . I have brought that code somewhat up to date with some bug fixes from the Java code base. And I use StringTemplate C# extensively in trgen. I haven't updated the grammar to Antlr4, but it should be. The main sticking point is that the grammar for StringTemplate is stuck in Antlr3 cause Antlr4 doesn't have Ast tree construction. I have been working on a preprocessor for Antlr4 grammars that reintroduce ast tree operators, but I need to first have an Xslt-like rewrite tool for antlr trees (trpiggy).

@tdjastrzebski
Copy link

@kaby76 My sincere thanks for taking the action, although I found no signs the original authors' appreciation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants