I couldn't find any public project that does this, so this is about why someone might. The short answer: B4X itself works well, and most of the reasons are about the tooling around it.
1. Run on any platform, as one binary. The official B4X IDE and compiler are Windows/.NET programs, so Mac and Linux users rely on Wine, a VM, or the remote Mac builder for B4i. A Rust compiler builds to one self-contained executable for Windows, macOS (Intel and ARM) and Linux, with no runtime to install. This is probably the strongest reason.
2. Support in other editors. Rust is very good for writing a Language Server, using crates like tower-lsp and salsa, which rust-analyzer is built on. A B4X language server would give you autocomplete, go-to-definition, inline errors and refactoring in VS Code, Zed, Neovim or JetBrains. You'd no longer be tied to the B4X IDE.
3. Rust is well suited to writing compilers. Rust's enums and pattern matching fit syntax trees and code-generation passes naturally. Mature libraries cover each stage: logos for tokenising, chumsky and lalrpop for parsing, inkwell for LLVM, and Cranelift for generating native code. There's a precedent too: a Rust project called elderheim is building a compiler for legacy languages, starting with BASIC, using Cranelift for native code generation.
4. New output targets. Today B4X transpiles to Java, Objective-C, C++ (B4R) and, through BANano, JavaScript. A new compiler could add:
- native executables with no JVM, such as fast-starting B4X command-line tools or B4X on AWS Lambda with Rust-level cold starts
- WebAssembly output
- a compiler that itself runs in the browser as WASM, for an online B4X playground
5. Independence from one maintainer. The B4X compiler is closed source and depends heavily on one person, Erel. An open, community-owned implementation protects existing B4X code if that ever changes. Languages like Python, Ruby and JavaScript have alternative implementations partly for this reason.
6. Learning. Writing a compiler for a language you know well is a classic way to learn both Rust and compilers. A VB-like language like B4X is a manageable size for that.
Why it would be hard
- The libraries are the real work. B4X's value comes from its wrapped libraries (Views, Camera, Http and so on) and the runtime glue for each platform. A new parser and code generator would be maybe 20% of the job. Matching every platform library would be the other 80%.
- The visual designer. The designer files would also need supporting, or rebuilding.
- Keeping up with changes. A second implementation is always catching up with the official one.
- Rust isn't the only option. .NET now runs on all three platforms too, so cross-platform alone doesn't require Rust. The real draws are single-binary distribution, the language-server tooling and WASM.
In practice the realistic version is a Rust-based B4X language server plus a transpiler for a subset of the language. Reproducing the whole B4X stack would be far bigger.