How prl-prg/r-compile-server works
Project type and purpose
• This is a distributed R-compiler system:
• A thin R “client” (an R package + C++ shim) that submits R code to be compiled.
• A Java-based “server” that implements a gRPC service to compile or JIT R code through multiple internal stages (bytecode, FIR, C, native code).
• An external R interpreter (submodule) that the server invokes when needed.
• Its purpose is to allow remote or embedded compilation of R code (e.g. for benchmarking, JIT, or ahead-of-time compilation) in a reproducible containerized environment.
File structure
• Top-level directories:
• client/ ⇒ R package “rsh” + C++ code + Rbenchmarks + tests
• proto/ ⇒ .proto definitions for messages & services
• server/ ⇒ Java + Maven multi-module project implementing gRPC compile server
• external/ ⇒ R source tree submodule for embedding/interfacing
• tools/, .devcontainer/ ⇒ build scripts, container config
• Within server/src/main/java: many packages implementing a compiler pipeline (bc, bc2c, bc2fir, fir, fir/analyze, fir/opt, parseprint, sexp, rds, session, service).
• Configuration & build: Makefile, Maven (“pom.xml”), Dockerfile, devcontainer.json, git hooks, CI workflow (maven.yml).
README for additional insights
• Describes dev workflows (devcontainer, IntelliJ, Maven), dependency on Java-24, R submodule, code formatting, etc.
Details
• Every major module from the file tree (client/src, proto, server/src/main/java org.prlprg.* packages, external/R).
• How protocol buffers definitions under proto/ propagate into both client and server folders.
• Compile pipeline order (bytecode → intermediate → native) is visually clear.