Skip to content

feat: DSL parser rewrite #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Feb 20, 2025
Merged

feat: DSL parser rewrite #25

merged 24 commits into from
Feb 20, 2025

Conversation

AlSchlo
Copy link
Collaborator

@AlSchlo AlSchlo commented Feb 11, 2025

Problem

The previous parser was imperative, had poorly defined syntax, was missing the entire physical side, and was not maintainable (essentially a hackathon-like POC). This PR solves all of these problems by designing a better language and using a declarative parser.

Summary of changes

  • Better, more simplistic AST
  • Support for ADTs
  • Parsing with error recovery and useful messages
  • Support map literals
  • Much, much more expressive syntax to model query optimization (see test cases for now, will release a formal specification eventually)

Next steps

  • Front-end: Analyzer, type checker & type-polymorphism.
  • Back-end: Write a HIR prototype and interpreter, linked to the Cascades engine. (<- will focus on this first)

@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2025

@AlSchlo AlSchlo changed the title feat: Operator Codegen from DSL feat: DSL operator codegen from Feb 11, 2025
@AlSchlo AlSchlo changed the title feat: DSL operator codegen from feat: DSL operator codegen Feb 11, 2025
Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this would conflict with #26 and need to decide who merges first

@@ -31,15 +31,6 @@ Logical Join(
schema_len = left.schema_len + right.schema_len
}

Logical Sort(child: Logical, keys: [(Scalar, String)]) derive {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider support block comments in the language?

@skyzh skyzh mentioned this pull request Feb 11, 2025
@AlSchlo AlSchlo changed the title feat: DSL operator codegen feat: DSL parser rewrite Feb 20, 2025
| New with
| Document
| Project
\\ Template
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Consider using raw string, i.e. `r#""# so we don't have to escape things.

@AlSchlo AlSchlo merged commit 621fe8c into main Feb 20, 2025
11 checks passed
@AlSchlo AlSchlo deleted the alexis/dsl-gen branch February 20, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants