obi1kenobi / trustfall

A query engine for any combination of data sources. Query your files and APIs as if they were databases!
Apache License 2.0
2.3k stars 66 forks source link

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

Open elenakrittik opened 5 months ago

elenakrittik commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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.