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

[Request] TTCN-3 language support #2999

Closed
laf0rge opened this issue Feb 12, 2021 · 10 comments
Closed

[Request] TTCN-3 language support #2999

laf0rge opened this issue Feb 12, 2021 · 10 comments
Labels
3rd_party autoclose Flag things to future autoclose. enhancement An enhancement or new feature language

Comments

@laf0rge
Copy link

laf0rge commented Feb 12, 2021

TTCN-3 is a domain specific programming language used particularly (but not only) in the telecom domain.

For more information see www.ttcn-3.org/

There are open source imlpementations of a TTCN3 compiler (https://projects.eclipse.org/projects/tools.titan) as well as a language server (https://github.com/nokia/vscode-ttcn3), and tools like the Eclipse IDE support syntax highlighting for it.

It would be great if highlight.js would get TTCN-3 language support, as plenty of TTCN-3 projects use gerrit for code review, and gerrit in turn uses highlight.js for its syntax highlighting.

As a FOSS developer for 25+ years, I know I should submit a patch. Unfortuantely I have zero to no knowledge about Javascript, so I really don't think I would be efficient doing it.

In case anyone is interested in implementing this, I might even be able to provide some funding.

@laf0rge laf0rge added the enhancement An enhancement or new feature label Feb 12, 2021
@joshgoebel
Copy link
Member

joshgoebel commented Feb 12, 2021

It would be great if highlight.js would get TTCN-3 language support, as plenty of TTCN-3 projects use gerrit for code review, and gerrit in turn uses highlight.js for its syntax highlighting.

Just FYI, this is often a false assumption:

Project A uses Highlight.js. Add grammar to Highlight.js and project A will magically support grammar.

Many projects purposely use a subset of grammars (for size, speed, etc)... just adding a new grammar to core does not magically make it work with every tool that users our engine - many tools still have to decide to opt-in of their own accord.

Also we don't merge new languages into core currently (back story). So if someone was to develop a grammar, it would need to be done as a 3rd party grammar module - and then Gerrit would need to decide to manually add support for it.

I might even be able to provide some funding.

If you were serious about this mentioning an amount might help. $30 is quite different than $300, etc...


As a policy we typically auto-close such requests, as the core team does not implement new languages and generally language requests die a slow death unless the person doing the requesting finds someone directly to do the work. https://github.com/highlightjs/highlight.js/blob/master/docs/language-requests.rst

I will leave this open briefly (because of the mention of funding), but please clarify your offer of funding.

You can also add this issue to the Wiki also (https://github.com/highlightjs/highlight.js/wiki/Grammar-Requests)

@joshgoebel joshgoebel added autoclose Flag things to future autoclose. language labels Feb 12, 2021
@laf0rge
Copy link
Author

laf0rge commented Feb 13, 2021

It would be great if highlight.js would get TTCN-3 language support, as plenty of TTCN-3 projects use gerrit for code review, and gerrit in turn uses highlight.js for its syntax highlighting.

Just FYI, this is often a false assumption:

Project A uses Highlight.js. Add grammar to Highlight.js and project A will magically support grammar.

I'm not saying it will magically work. For sure, gerrit upstream wold have to select support for that language/grammar. And until they do (or if they wouldn't do), it's relatively easy for anyone operating their own gerrit instance to simply replace/patch the highlight.js file in their gerrit instance.

Also we don't merge new languages into core currently (back story).

That's sad to hear, but definitely thanks for the heads-up.

I might even be able to provide some funding.

If you were serious about this mentioning an amount might help. $30 is quite different than $300, etc...

As I'm not sure what the effort estimate would be, it's hard to put a figure at it. Ideally somebody who understands the required work would make a proposal. For sure we don't have to talk about a two-digit USD amount here ;) It will certainly be multiple hours of work, and I have no illusions about hourly rates in the IT industry. So a few hundred bucks should certainly be a realistic order of magnitude.

As a policy we typically auto-close such requests, as the core team does not implement new languages and generally language requests die a slow death unless the person doing the requesting finds someone directly to do the work. https://github.com/highlightjs/highlight.js/blob/master/docs/language-requests.rst

Understood.

You can also add this issue to the Wiki also (https://github.com/highlightjs/highlight.js/wiki/Grammar-Requests)

Thanks, will do.

@joshgoebel
Copy link
Member

it's relatively easy for anyone operating their own gerrit instance to simply replace/patch the highlight.js file in their gerrit instance.

Or to add an extra JS script tag... although patching with our CDN distributable files is truly just a concat operation. But yeah if it's self-hosted should be pretty trivial.

From the snippet here it doesn't look like a super complex language (but perhaps that's a simple snippet). I see now its' the same snippet use on Wikipedia. Is there a LOT more to the language than what is shown syntactically?

For sure we don't have to talk about a two-digit USD amount here ;)

Ah, well that's helpful to know. I've found when someone offers to pay for time online in a vague sense it can mean almost anything. :-)

@laf0rge
Copy link
Author

laf0rge commented Feb 13, 2021

From the snippet here it doesn't look like a super complex language (but perhaps that's a simple snippet). I see now its' the same snippet use on Wikipedia. Is there a LOT more to the language than what is shown syntactically?

The full BNF definition of the syntax can be found in Annex A of https://www.etsi.org/deliver/etsi_es/201800_201899/20187301/04.12.01_60/es_20187301v041201p.pdf

if you want to look at a reasonably large set of code written in TTCN-3, have a look at https://git.osmocom.org/osmo-ttcn3-hacks/tree/library

For sure we don't have to talk about a two-digit USD amount here ;)

Ah, well that's helpful to know. I've found when someone offers to pay for time online in a vague sense it can mean almost anything. :-)

In the Eclipse TITAN Forum at https://www.eclipse.org/forums/index.php?t=msg&th=1106951&goto=1838021&#msg_1838021, Gabor (from the TITAN developer team at Ericsson) has stated that their internal gerrit has syntax highlighting for TTCN-3. So it looks like somebody may already have done the work but not bothered to release it. I'm keeping my fingers crossed.

@joshgoebel
Copy link
Member

it looks like somebody may already have done the work but not bothered to release it. I

Well it might be simpler to follow up that lead and see if that code could simply be released OSS. :-)

@joshgoebel
Copy link
Member

Does anyone on your team use the VS Code support? It's syntax grammar file looks pretty simple overall, which is a good sign IF TTCN-3 users would consider VS Code to have "good" highlighting support for TTCN-3.

@joshgoebel joshgoebel pinned this issue Feb 14, 2021
@joshgoebel
Copy link
Member

@laf0rge You should shoot me an email in mid-March if you get no other traction on this and still would like to pursue it.

@joshgoebel
Copy link
Member

@laf0rge Does anyone on your team use the VS Code support? Is it's support good?

(auto-closing)

@joshgoebel joshgoebel unpinned this issue Mar 18, 2021
@laf0rge
Copy link
Author

laf0rge commented Nov 15, 2021

@laf0rge Does anyone on your team use the VS Code support? Is it's support good?

I don't think anyone in our team uses VS Code, sorry.

@pespin
Copy link

pespin commented Apr 5, 2022

I'm using this highlighter for Atom editor and it works well for me, in case it's useful:
https://atom.io/packages/language-ttcn-3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd_party autoclose Flag things to future autoclose. enhancement An enhancement or new feature language
Projects
None yet
Development

No branches or pull requests

3 participants