Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » TTCN-3 Language Server(A universal TTCN-3 language plugin for virtually any editor or IDE)
TTCN-3 Language Server [message #1838278] Sat, 20 February 2021 11:18 Go to next message
Matthias Simon is currently offline Matthias SimonFriend
Messages: 6
Registered: February 2021
Junior Member
I am a software engineer at Nokia, developing TTCN-3 tools for over ten years. We recently begun to open source our newest development, which I like to share with you.

The project is called ntt. Its most interesting piece is probably the TTCN-3 language server:
ntt implements the language server protocol. This makes ntt a universal TTCN-3 language plugin for virtually any editor or IDE.
This is a young project and many features are still missing; but we are getting there. We already provide a convenient Visual Studio Code extension and configurations for Vim.

I believe ntt could be good addition to Titan and I'd love to get your feedback.

Cheers,
Matthias
Re: TTCN-3 Language Server [message #1838299 is a reply to message #1838278] Sun, 21 February 2021 16:10 Go to previous messageGo to next message
Kristof Szabados is currently offline Kristof SzabadosFriend
Messages: 60
Registered: July 2015
Member
Hi Matthias,

This could sound interesting.

Do you have some evaluation on its features:
- what language version is supported (and to what degree)?
- To what target binaries can you compile and how do they perform?
- What is the performance like?
How much of an overhead it would give to the semantic checking or compilation if these processes would not work from data in local memory, but from network storage (if I understand correctly the technology)

Thank you in advance
Kristof
- /* do you support Titan extensions? */
Re: TTCN-3 Language Server [message #1838341 is a reply to message #1838299] Mon, 22 February 2021 16:18 Go to previous messageGo to next message
Matthias Simon is currently offline Matthias SimonFriend
Messages: 6
Registered: February 2021
Junior Member
Quote:

How much of an overhead it would give to the semantic checking

A language server is just a standalone binary, which gets started by the editor as subprocess. They communicate via pipe and exchange only simple messages. So the overhead to semantic checking should be rather small. It depends on the implementation, though.

Writing a TTCN-3 language server is a relatively simple task: Just "out-source" all requests to external tools like ctags or the Titan TTCN-3 compiler and voilà. Language Server.

Writing a performant TTCN-3 language server however is a totally different story. Compared to a classic compiler, a language server has very different requirements. Because a language server is interacting with the user:

  • it must expect incomplete and incorrect input.
  • it must be responsive (<100ms; low latency is more important than high throughput).
  • it should do stuff incrementally, on demand/lazily.

One design goal of ntt is to fulfill those requirements. But we are just at the beginning of our journey.

Quote:

To what target binaries can you compile and how do they perform?

ntt itself is available for various platforms and architectures, but when you speak about target binaries you're probably referring to test executable (TE).
The language server is very much like a compiler indeed, but usually without code generation phase. Also, ntt is very young and only the parsing phase is implemented, yet.

Quote:

what language version is supported?

ntt parses a super-set of TTCN-3 4.10.1 (import-redirections are missing) and it understands most parts of the standardized extensions for documentation comments, performance and
real-time testing, advanced parameterization, behaviour types, as well as most non-standard extensions from Titan.

I plan to update the parser to 4.12.1 as soon as I found some spare time.


Quote:

What is the performance like?

The parser is quite fast. On my laptop, two million lines of TTCN-3 code take about 18 seconds to parse with our old Flex/Bison-based C++ parser. ntt requires only 700ms (two years ago).
The jump to definition feature in the language server takes about 40μs-200ms

I am also in love with the idea to connect this parser with a llvm-generator-plugin to skip Titan's C++ generation completely. But this is a different story and I don't have any numbers yet.
Re: TTCN-3 Language Server [message #1838375 is a reply to message #1838341] Tue, 23 February 2021 16:01 Go to previous messageGo to next message
Kristof Szabados is currently offline Kristof SzabadosFriend
Messages: 82
Registered: July 2009
Member
Hi Matthias,

Yes, I believe, we also have this functionality (although only for eclipse).
Let me just be a bit proud if our achievements for a moment here ;)

- it not only handles incomplete and incorrect input ... but also offers help to correct it, via code completion.
- responsivity is usually on 10^-4 scale, but if your not listening to music through youtube running in the background, it can reach 10^-9 second scale (but usually developers do that)
Keeping the data in the memory of the application, helps a lot here.
Also calling java functions to reach java data structures inside the same application keeps communication/administrative costs quite low.
- incrementality: we have incremental parsing and incremental semantic analysis (actually incremental parsing comes on two levels, in best case scenario we could get away with parsing single characters or words and processing time not noticeable by the user)
+ it also scales well with the core/logical processor count of the machine (that is also kind of expected when developers work on 8 - 64 core machines)
+ jump to definition, outline, code completion, etc...
+ code quality checking, architecture visualization, refactoring plugins available to extend the capabilities.

The parsing + semantic checking for 1 - 1,5 million lines of TTCN-3 and ASN.1 code is usually around 1-2 seconds on modern laptop (using ANTLR for parsing ... and all of the above mentioned features).
Sadly the compilation via Java is not yet complete enough to compile those large projects completely ... but usually we measure around 50* better resource usage, compared to compiling on the C side (it might even beat compiling to llvm internals directly, but that has to be measured ;) ).

Well ... as far as I understand (based on your description) the only limitation on our side might be to support only eclipse.
Re: TTCN-3 Language Server [message #1838467 is a reply to message #1838375] Thu, 25 February 2021 14:39 Go to previous message
Matthias Simon is currently offline Matthias SimonFriend
Messages: 6
Registered: February 2021
Junior Member
You wouldn't get much benefit by using the ntt language server as replacement for your Eclipse extension. The Titan project is pretty advanced, mature and not replaceable.

However, it's hard to drive innovation and keep all the tools up to date at the same time, because TTCN-3 is a niche product and we are not that many open source developers.
If tools like Titan compiler or the Titan Eclipse extension would use a common TTCN-3 compiler library/service like ntt, language support would become cheaper and safer for everyone.

My hope is that one day ntt becomes for TTCN-3 the same thing, what Docker became for Linux Containers: A tool that unburdens developers of nasty details and gives them a solid platform to build on.
I understand it takes time to build that kind of trust. But I believe it's worth the effort, because many would benefit.
Previous Topic:Template evaluation time
Next Topic:TTCN-3 syntax highlighting in gerrit
Goto Forum:
  


Current Time: Sun Oct 06 20:24:35 GMT 2024

Powered by FUDForum. Page generated in 0.03734 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top