Add streamed self-hosted lexer experiment - #371
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
julia-script
force-pushed
the
julia/self-hosted-stream-lexer
branch
from
September 7, 2026 03:30
3935b68 to
45280be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Add an experimental self-hosted lexer under
compiler/. It reads one normalized relative Silk source path, borrows the file bytes, and exposes tokenization throughStream<Token, never ? never>.takewithout retaining a token vector.The lexer follows the current bootstrap compiler for keywords, trivia, longest-match punctuation including
..., lifetimes, numeric and duration literals, static and character literals, invalid regions, focusedLEX0001–LEX0012diagnostics, and one-shot EOF behavior. The CLI prints each token and diagnostic directly to stdout.The application edge uses the current source-owned
OsFileSystemandStdoutWriterproviders. With the JUL-152 repair now onmain, the host-input, filesystem, and writer operations remain in one sequentialprogrambody without the earlier helper-splitting workaround.For example:
prints:
The project includes focused fixtures, usage documentation, and the compiler limitations found while writing real Silk code. Follow-up work is tracked in JUL-153, JUL-154, and JUL-155; JUL-152 is recorded as resolved on current
main.Validation
dd4510fasilk check --manifest-path compiler/silk.tomlpnpm check