3 ms·
Most of it written in OCaml, cool! What made you pick OCaml as the primary language to use for the business logic?
by frellus 5y ago
Most of it written in OCaml, cool! What made you pick OCaml as the primary language to use for the business logic?
- underyx 5y agoTechnically, OCaml only applies to Semgrep, as the app which is the subject of this post uses a more neo-traditional Python & TypeScript stack :) I don't have full context on the parser core, but I do know that a major thing we've got going for OCaml is a translation layer we wrote for getting OCaml code generated based on tree-sitter grammars: https://github.com/returntocorp/ocaml-tree-sitter-semgrep https://github.com/returntocorp/ocaml-tree-sitter-semgrep
- padator 5y agoWhy OCaml? It's a great language to write programs that works on complex data structures, e.g. ASTs. This choice was actually not very original: people in academia at stanford, berkeley, Microsoft research used OCaml for program analysis (CCured, Saturn, CIL, SLAM). And now and now the industry is also using it (Facebook Infer, Facebook Hack/Flow/Pyre, MS Static Device Verifier, etc.)
- underyx 5y agoTo add some context, padator is on the Semgrep team; he’s the person I referenced as > One of our team members at r2c came up with a novel approach to this problem: he suggested reusing some of his old work on Coccinelle[3] and later Sgrep[4]