BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Nitra: Open Source Language Tooling For CLR

by Roopesh Shenoy on May 29, 2014 |

JetBrains recently open sourced Nitra, a set of tooling for working with programming languages on the CLR. Developers can define grammers using Nemerle, which Nitra then uses to build parsers and generate classes to represent and navigate the AST.

An interesting feature in Nitra is the ability to build block grammers and reusing them across languages. Modules such as Whitespaces and CStyleComments ship with Nitra and can easily be reused in defining your own language grammer.

There are three parts to using Nitra -

Once you define the syntax along with AST and parsers, you also get syntax highlighting, code folding and errors higlighting within Visual Studio. Other features such as static analysis, refactoring, navigation and symbol lookup will be available shortly.  

The project is quite ambitious - Nemerle developers (who are also the developers behind Nitra) are planning to rewrite Nemerle using Nitra once it is done. However, Nitra is still in preview, and it will take some time before it is fully ready, especially with features such as compilation currently missing.

JetBrains famously decided against using Roslyn for powering their Resharper features, especially because Resharper supports many other languages, whereas Roslyn is limited to C# and VB. Nitra seems to be a step in making this multi-lingual architecture even more extensible. Enabling language services by just defining the grammer in Nitra will allow JetBrains to support new languages faster, which is one of the key drivers for the project.

You can have a look at the Nitra source code or the documentation to know more. 

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT