oxc-project / oxc-project/backlog
Provide API for reading source text from disk into a buffer
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 7
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
The most common use case for Oxc is reading a file from disk and parsing it.
Currently the parser takes a &str. We could add an API to read a file from disk into a SourceText buffer which is then passed to parser. Possibly SourceText would store the data in the arena.
There's a few advantages to this:
- If you reuse the same
SourceTextbuffer over and over when parsing many files, that'd likely be a perf gain, as source text would always be in a block of memory which is warm in the cache. - It'd remove the cost of string copying for #20.
- It'd be useful for AST transfer for the source text to be in the arena - could make for more efficient code for extracting strings from the serialized buffer.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the parser API that currently accepts a &str and the proposed SourceText buffer described in the issue. Determine how disk input, buffer reuse, arena storage, and AST transfer should fit together; done requires an agreed API and implementation plan that addresses these goals.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100