I love Rust for tokenising and parsing
The author develops a Rust-based static analysis tool for SQL, sqleibniz, focusing on syntax checks and validation, utilizing macros for code efficiency, and plans to implement an LSP server.
Read original articleThe blog post discusses the author's experience using Rust for developing a static analysis tool for SQL, named sqleibniz, specifically targeting the SQLite dialect. The tool aims to perform syntax checks and validate the existence of tables, columns, and functions in SQL input. The author highlights the importance of creating a tokenizer and parser for SQL, emphasizing Rust's features that facilitate code deduplication through macros. The post details the implementation of an Abstract Syntax Tree (AST) and the use of traits to define nodes, which helps in managing code complexity. The author also shares insights on testing strategies, particularly the use of table-driven tests, which are adapted from Go to Rust. The testing framework includes macros for both passing and failing test cases, ensuring comprehensive coverage of the lexer and parser functionalities. The author expresses enthusiasm for Rust's capabilities in building robust software and plans to extend the project with a Language Server Protocol (LSP) server for SQL in the future.
- The author is developing a static analysis tool for SQL called sqleibniz using Rust.
- The tool focuses on syntax checks and validating SQL constructs against SQLite documentation.
- Rust's macros are utilized for code deduplication and simplifying the implementation of AST nodes.
- The author adapts table-driven testing from Go to Rust for effective testing of the lexer and parser.
- Future plans include creating an LSP server for SQL to enhance the development experience.
Related
I Hope Rust Does Not Oxidize Everything
The author expresses concerns about Rust's widespread adoption in programming, citing issues with syntax, async features, complexity, and long compile times. They advocate for language diversity to prevent monoculture, contrasting Rust with their language Yao.
Rust's Ugly Syntax (2023)
The blog post addresses complaints about Rust's syntax, attributing them to misunderstandings of its semantics. It suggests simplifying semantics for readability while maintaining performance and safety features.
Build a quick Local code intelligence using Ollama with Rust
Bosun developed Swiftide, a Rust-based tool for efficient code indexing and querying, utilizing Qdrant and FastEmbed. It enhances performance with OpenTelemetry, integrating various language models for improved response times.
Audioscrape: Building in Rust When Everyone Said I Shouldn't
Audioscrape is a Rust-based podcast platform focusing on cost-efficiency and performance, featuring transcription browsing and community interactions. It has 500 users and plans API development and paid features.
Parsing arguments in Rust with no dependencies
The author developed a command-line argument parser in Rust without external dependencies, focusing on simplicity and minimalism, supporting various argument types, and inviting contributions under MIT and Apache licenses.
Related
I Hope Rust Does Not Oxidize Everything
The author expresses concerns about Rust's widespread adoption in programming, citing issues with syntax, async features, complexity, and long compile times. They advocate for language diversity to prevent monoculture, contrasting Rust with their language Yao.
Rust's Ugly Syntax (2023)
The blog post addresses complaints about Rust's syntax, attributing them to misunderstandings of its semantics. It suggests simplifying semantics for readability while maintaining performance and safety features.
Build a quick Local code intelligence using Ollama with Rust
Bosun developed Swiftide, a Rust-based tool for efficient code indexing and querying, utilizing Qdrant and FastEmbed. It enhances performance with OpenTelemetry, integrating various language models for improved response times.
Audioscrape: Building in Rust When Everyone Said I Shouldn't
Audioscrape is a Rust-based podcast platform focusing on cost-efficiency and performance, featuring transcription browsing and community interactions. It has 500 users and plans API development and paid features.
Parsing arguments in Rust with no dependencies
The author developed a command-line argument parser in Rust without external dependencies, focusing on simplicity and minimalism, supporting various argument types, and inviting contributions under MIT and Apache licenses.