Skip to content

Transforming Semgrep Playground: Our Journey to Enhanced Speed

Original Post: How we made the Semgrep Playground Fast

The content describes the development and implementation of "Turbo Mode" for Semgrep, an open-source static analysis tool for detecting code vulnerabilities and enforcing standards. Initially, Semgrep’s Playground, used for testing Semgrep rules, experienced a one-second delay in running code, which was deemed too slow for power users. Inspired by Authzed’s approach to running SpiceDB in the browser, the Semgrep team embarked on a project to bring similar functionality to the Semgrep Playground. They used various tools and techniques, including OCaml compilation to JavaScript via js_of_ocaml, converting C libraries to WebAssembly with Emscripten, and extensive debugging and coding. The result was a faster, seamless experience that runs Semgrep directly in the browser and eliminates the need for a Run button by automatically re-scanning after each keystroke, branded as "Turbo Mode." The final implementation involved resolving issues related to differing 32/64-bit architectures and intricate inter-language integrations between JavaScript and WebAssembly. The improved system significantly enhanced the user experience, allowing real-time feedback during code editing directly in the browser.

Go here to read the Original Post

Leave a Reply

Your email address will not be published. Required fields are marked *