r/Protos • u/guillermoamolina • 2d ago
A programming language starts parsing itself: Protos now has a lexer written entirely in Protos
Protos, an experimental prototype-based programming language built on GraalVM and Truffle, has reached a new milestone toward self-hosting.
Its new lossless lexer and syntax-highlighting package are implemented entirely in Protos, without adding any production Java code.
The implementation includes:
- Unicode 17 identifier recognition and NFC validation.
- Lossless tokenization and exact source reconstruction.
- Strict and recovering lexical analysis.
- Independent syntax-highlighting classification.
- 100,182 successful NFC conformance checks.
- Differential validation against the existing Java lexer.
- Successful JVM and Native Image validation.
Unlike languages that pursue self-hosting by replacing their entire compiler infrastructure, Protos is exploring an incremental approach while retaining the GraalVM and Truffle execution backend.
The next milestone is a parser written in Protos.
For developers interested in language implementation, compiler design, GraalVM, Python, Ruby and self-hosting: what bootstrap strategy would you choose for replacing the original frontend?
Source code: https://github.com/guillermomolina/protos
Project community: r/ProtosLang