Nitra Open Sourced
Written by Alex Armstrong   
Friday, 30 May 2014

Jetbrains has open sourced a low-level language toolkit called Nitra which comprises a language for describing grammars and a build tool to compile them.

niitrasq

 

In a blog post introducing Nitra back in November 2013 Hadi Hariri explained that is isn't just another parser generator and gave this example of its ability to extend C# with a new .? operator:

At that time Nitra had already been under development for over a year. Now its team, led by  Vlad Chistyakov, has decided that, while it is "still work in progress", it provides a "minimum viable feature set, as well as a good architectural base for future development" and its source has been made available on GitHub, released under the Simplified BSD license.

Its description on GitHub tells us:

Nitra is a language workbench. You can use Nitra for the creation or extend a general-purpose programming language or a domain-specific language (DSL). At present Nitra allows you to create dynamically expanding parsers. In the future, Nitra will allow to create full support for programming languages: compilers, IDE support.

In his blog post announcing its open-sourcing Matt Ellis gives a fuller definition:

Nitra is a language for describing grammars, and the abstract syntax trees to represent them and also a build tool to compile the grammars into parsers, and generate the classes required to represent and navigate the AST. And it’s also a set of language services that use the grammar to provide automatic syntax highlighting, outlining and brace matching.

Creating parsers and ASTs (abstract syntax trees) is something JetBrains is already very good at but, as Ellis explains by taking away some of the gruntwork Nitra will allow the company to

"support more languages, quicker, and to focus on the higher levels in the stack of language tooling, such as analyses and quick fixes".

He also warns that if you want to use Nitra "expect to get your hands dirty" and lists the following as what it currently supports:

  1. Grammars to define lexer-less parsers and ASTs that can be extended at compile time or runtime, supporting composition of languages, or languages with extensible syntax, such as Nemerle

  2. command line tool to compile grammars into an assembly containing the parser and the AST classes (grammars can also be compiled inside Visual Studio)

  3. A Windows application (Nitra.Visualizer.exe)  to load and test grammars

  4. Visual Studio language service that uses Nitra to parse files and provide automatic syntax highlighting, outlining and brace matching. Current work is to increase the automatic support here to include go to declarations, find usages and rename refactorings

niitrasq

More Information

Nitra

Nitra on GitHub

An Introduction to Nitra

Nitra goes Open Source!

Related Articles

Grammar and Torture

Visualizing 40,000 Code Submissions

Understanding Computation

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner

 


Deno 2 Release Candidate Ready
26/09/2024

The Deno team has released the release candidate for Deno 2.0, which includes everything expected in the final release. This is the largest update since 1.0 back in May 2020, with major changes like t [ ... ]



Christie's Make Over $16 Million From Paul Allen's Collections
29/09/2024

The recent Christie's auction sale of historic computers collected for his Living Computer Museum by Paul Allen saw a Cray 1, sell for over $1million, four times higher than its estimate. The computer [ ... ]


More News

kotlin book

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Friday, 30 May 2014 )