facebook / facebook/infer

[Question] Recommended approach for building an external language frontend

Open
#2,045 4 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
OCaml
Stars
15.7k
Forks
2.1k
Avg merge
19h 36m
Merged PRs (30d)
13

Description

Hello, I'm building an Infer frontend for an OCaml-based DSL and want to make sure I'm following the intended architecture.
 
I have currently built this out-of-tree (not within an infer fork) with the parser and type-checker, and I want to integrate this frontend with infer. I understand that one way to integrate the frontend is to emit `.sil` files as text (using `textuallib`) and then invoke infer with the `--capture-textual` flag. This flow however has performance implications for my use-case and I was wondering if there was a more direct way to run the infer capture on the emitted SIL.

Since my DSL is written in OCaml, I was interested in a way to convert to the SIL datatype in Ocaml directly without having to write out as text, and then use infer as a library so that I can run the full infer capture on the SIL datatype.

Further, Is there any existing documentation on frontend creation? The closest references I used were the Rust frontend PR ([#1945](https://github.com/facebook/infer/pull/1945)), the `infer/tests/codetoanalyze/sil/` test files, and the `TextualMenhir.mly` grammar.

#### The current setup
**Frontend language:** OCaml (our DSL's reference implementation is already in OCaml)
**Output:** Textual .sil files, analysed via --capture-textual
**Infer version:** v1.2.0

Thanks for any guidance. I'd like to align with the intended architecture rather than discover later that I chose the wrong path.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.