Careers > Generic compiler architecture based on tree rewriting
Last modified 12/5/2024 12:51:05 PM

Generic compiler architecture based on tree rewriting

Internship
AdaCore
Paris, France

AdaCore: Helping Developers Build Software that Matters

Everything we do at AdaCore is centered around helping developers build safe, secure and reliable software.

For 30 years, we've partnered with global leaders in aerospace & defense, air traffic management, space, railway and financial services. We've developed tools and services simplifying high-integrity software development through a subscription-based model. As demand for secure applications grows in industries like automotive, medical, energy, and IoT, we're adapting our proven technologies to assist a new generation of developers.

Our 150 global experts based in the US, France, Germany, the UK, and Estonia, collectively develop cutting-edge technologies to address the challenges of high-grade software development.

Joining AdaCore is about joining a culture of innovation, openness, collaboration and dependability, which defines how we work together, with our customers and partners.

 

Context

Langkit (nickname for language kit) is a tool whose purpose is to make it easy to create syntactic and semantic analysis engines for any language. Write the language specification in the Langkit DSL, and Langkit will generate a library, with bindings to multiple languages, including C, Ada, Python, OCaml and Java.

The generated library is meant to provide a basis to write tooling, such as static analyzers/linters, pretty-printers, refactoring tools, or language servers.

Currently, the main Langkit user is Libadalang, a high performance semantic engine for the Ada programming language. Libadalang is the main building brick for many tools developed by AdaCore, including The Ada language server.

Langkit provides the tools to declaratively build several stages of a compiler already:

  • Syntax analysis

  • Scoping

  • Typing and name resolution

  • Legality rules via the LKQL query language

The next step is to add a language to allow term-rewriting, also known as tree rewriting, to allow the expression of passes that will transform the syntax tree into subsequent intermediate representations.

 

Goals

  • Implement a term rewriting DSL on top of LKQL, that allows expressing transformation of syntax trees into new trees.

  • Implement the capacity to specify new node types in the Langkit DSL, that are not directly derived from syntax, but will instead be generated by a rewriting pass

  • Use the above DSL to express a pipeline that will rewrite the Libadalang Ada syntax tree from the concrete syntax tree to an intermediate representation more amenable to compilation, including:

    • Disambiguating syntactic nodes that could be several things (in Ada an array element access has the same syntax as a function call for example, and those are not distinct in the syntax tree)

    • Reifying cross-references and typing information

 

Skills required

  • A strong interest in compiler and language analysis technologies

  • Some knowledge of how a compiler pipeline works

  • Side projects in compilation or serious school projects would be a big plus

  • Any language background is welcome, but the team uses Python/Ada, and a lot of custom DSLs, so ability to learn new languages/technologies is required

 

Timeframe & Location

During 2025 - 6 months - Paris office

 

Beyond the job

We're a global organization driven by diverse backgrounds, fostering innovation through an open exchange of ideas. We welcome applicants of all backgrounds, celebrating diversity in ethnicity, nationality, gender, age, religion, abilities, sexual orientation, veteran or marital status. 

Our commitment is to help our teammates, wherever they are based, feel comfortable and satisfied, by encouraging flexibility to ensure them a healthy work-life balance. Additionally, we prioritize individual development by offering continuous training from day one with a personalized onboarding plan.

Powered by Hello Talent