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

Getting started guide, or some other form of high-level documentation? #548

Open
elenakrittik opened this issue Jan 28, 2024 · 5 comments
Open

Comments

@elenakrittik
Copy link
Contributor

elenakrittik commented Jan 28, 2024

As far as my searching "skills" go, i couldn't find any definitive reference for Trustfall. README links to a few articles and talks, but they all speak mostly in theory. This repository doesn't seem to contain any examples too. Is there a high-level overview of working with Trustfall, or should i look at, e.g., cargo-semver-checks and docs.rs in the meantime?

EDIT: Found HYTRADBOI, but will leave the issue open in case i indeed missed some resources.

@obi1kenobi
Copy link
Owner

The state of our docs is not great, and I'm going to make a major push over the next couple of months to fix that.

There are some examples mentioned in the README that are part of the trustfall crate in this repo.

We also have playgrounds where you can see Trustfall language features in action via example queries over:

The docs on docs.rs are more of a reference than a getting started guide, unfortunately. The most common bits of the API are documented fairly thoroughly on docs.rs, but we can and should do much better still.

To see how Trustfall powers cargo-semver-checks, you'd need to look in a few places:

Trustfall also has bindings that allow writing adapters in Python and JS/TS, but they could use a fair bit of polish. They are fully-working prototypes but have rough edges and are in need of better docs themselves.

@obi1kenobi
Copy link
Owner

I'd love to learn about your use case!

What language are you looking to use?

What data source are you looking to query? What sorts of queries do you have in mind?

@elenakrittik
Copy link
Contributor Author

elenakrittik commented Jan 28, 2024

Thank you very much for a thorough explanation!

I'd love to learn about your use case!

What language are you looking to use?

What data source are you looking to query? What sorts of queries do you have in mind?

I am developing a toolkit for Godot written in Rust, which, among other features, will include a linter for Godot's purpose-made language called GDScript. While looking through Rust tools to improve my toolkit's robustness, i found cargo-semver-checks, and then due to my habit of "hmm noice thing, let's check what else the author made" i found Trustfall, and it happens so that it seems to fit my use case perfectly (as proven by semver-checks with linting Rust code). So, my primary data source will be GDScript source code (and possibly other textual formats Godot uses), and queries will search for "code smells" like "find all variables in this file that are referenced only once" (unused variables) or "find all calls of functions in this file that start with "_" and are defined elsewhere" (private function usage).

@obi1kenobi
Copy link
Owner

That sounds very cool! I think Trustfall is going to be a good fit in such a linter, and I'm happy to answer any questions that come up.

Is the toolkit open-source, or is it proprietary / commercial software? I'd love to check it out!

@elenakrittik
Copy link
Contributor Author

That sounds very cool! I think Trustfall is going to be a good fit in such a linter, and I'm happy to answer any questions that come up.

Is the toolkit open-source, or is it proprietary / commercial software? I'd love to check it out!

Yep, here you go: https://github.com/elenakrittik/gdtk

Thanks for taking interest.

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

No branches or pull requests

2 participants