Skip to content
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

tool: Add Rust port 🦀 #148

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

tool: Add Rust port 🦀 #148

wants to merge 15 commits into from

Conversation

jtojnar
Copy link
Owner

@jtojnar jtojnar commented Jun 2, 2024

I initially wrote this in Python to avoid the need to compile anything. But since we have rust-checks now, compilation is unavoidable, so we might as well go all in on Rust.

This is just a naïve, mostly 1:1 port. More cleanups might happen later.

The main motivation is to be able to use cargo’s test framework, which is slightly better than what we have now. Hopefully, this will fix CI.

jtojnar added 14 commits June 1, 2024 23:49
The former will conflict with rnix 0.11.
This is just a naïve port – we should probably make use of the now provide
typed AST nodes instead of using `AstNode::syntax()` to convert
everything to back to `SyntaxNode`.
Make it consistent with `getLocation` from our `lib`.
This will be needed for Rust port, since the compiled binary can be in different locations.
It will also allow us to move the files to a more conventional path.
This is naïve, mostly 1:1 port.
The AST checks remain in separate crate.
This will allow us to use it directly from the main crate.
This is slightly shorter and we are now doing more than just checking AST.
Next step in unifying the architecture.
@jtojnar jtojnar force-pushed the rust branch 3 times, most recently from 2e1e886 to 21773d6 Compare June 2, 2024 20:49
let mut child = Command::new(program)
.args(args)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
Copy link
Owner Author

Choose a reason for hiding this comment

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

We should probably do something with stderr too.

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.

1 participant