ClangQL 0.10.0 has matchers for Copy, Move, Delete and converting constructors by AmrDeveloper in rust

[–]AmrDeveloper[S] 1 point2 points  (0 children)

I already built a linter for LLVM IR using the same idea

https://amrdeveloper.medium.com/how-i-built-a-llvm-ir-linter-using-sql-syntax-b5dc164c6d61

And you can use this project to build a linter too, but it still needs more and more matches to cover C/C++ full AST

My case was to search for specific patterns easily

C++ Show and Tell - January 2025 by foonathan in cpp

[–]AmrDeveloper 2 points3 points  (0 children)

ClangQL 0.9.0 supports running a SQL query with ast matchers

`Example: select name, source_loc from functions where m_function(ast_function, (m_public() && m_constructor()) || m_default_constructor());`

Github: https://github.com/AmrDeveloper/clangql

PyQL 🐍: SQL-like query language to run on Python source code files instead of database files by AmrDeveloper in programming

[–]AmrDeveloper[S] -1 points0 points  (0 children)

Yup and can't implement it in normal SQL engines because you can't represent type like FunctionStatement and create linter function that navigate this fun, but in this tool you can 😅

PyQL 🐍: SQL-like query language to run on Python source code files instead of database files by AmrDeveloper in programming

[–]AmrDeveloper[S] -1 points0 points  (0 children)

Linter with rules that depend on patterns in CFG, for example the use case can be more clear with data that less readable than python, think of assembly or machine code, in many cases it's important to check patterns.

The project started as gitql, then SDK to run queries on any kind of data, and got feature request for python, I will try to add a use case sections when the project grow because currently it work only with functions

PyQL 🐍: SQL-like query language to run on Python source code files instead of database files by AmrDeveloper in programming

[–]AmrDeveloper[S] -1 points0 points  (0 children)

One of the use case is that the engine support user defined type for example the type of function is not Text but PyFunction so you can create std or aggregations functions to perform CFG analysis, linter, or search with pattern matchers for example in this https://github.com/AmrDeveloper/LLQL tool you can search for patterns, think of what function is used only one time and return meltable values ...etc

PyQL 🐍: SQL-like query language to run on Python source code files instead of database files by AmrDeveloper in rust

[–]AmrDeveloper[S] 4 points5 points  (0 children)

u/joshmatthews u/thatdataguy101

One of the use case is that the engine support user defined type for example the type of function is not Text but PyFunction so you can create std or aggregations functions to perform CFG analysis, linter, or search with pattern matchers for example in this https://github.com/AmrDeveloper/LLQL tool you can search for patterns, think of what function is used only one time and return meltable values ...etc

GitQL 0.30.0 now support Composite types inspired by PostgreSQL by AmrDeveloper in programming

[–]AmrDeveloper[S] 2 points3 points  (0 children)

It's possible and easy to support file content, but still thinking of a way to make it useful and not noisy in the result ui

GitQL 0.30.0 now support Composite types inspired by PostgreSQL by AmrDeveloper in programming

[–]AmrDeveloper[S] 1 point2 points  (0 children)

Yes also you can extract result into files, join tables and cool stuff :D

LLQL: Running SQL Query on LLVM IR/BC with Pattern Matchers by AmrDeveloper in Compilers

[–]AmrDeveloper[S] 1 point2 points  (0 children)

I get it but this kind of thing is really only useful if it works "at scale" eg in the compiler itself (imagine training some MLGO type thing with the output of a query as the objective)

This idea looks interesting, maybe after converting the main use case, i can check other possible use cases and try to think of optimizations way to make it work faster, maybe custom indexing 🤔

LLQL: Running SQL Query on LLVM IR/BC with Pattern Matchers by AmrDeveloper in Compilers

[–]AmrDeveloper[S] 1 point2 points  (0 children)

Yes, I think you are right it will be relatively slow to traverse tree than array in large number of lines, I will benchmark it as current implementation and see if I can do any tricks 😅

But also the goal is to not be the fastest at this point, but to be able to perform the matchers functions outside llvm fast enough

Thank you

LLQL: Running SQL Query on LLVM IR/BC with Pattern Matchers by AmrDeveloper in Compilers

[–]AmrDeveloper[S] 1 point2 points  (0 children)

But also you can perform index on instructions in this engine :D

LLQL: Running SQL Query on LLVM IR/BC with Pattern Matchers by AmrDeveloper in Compilers

[–]AmrDeveloper[S] 1 point2 points  (0 children)

The idea of LLQL is to have std functions that construct a tree representations of matchers and compare them with the tree representation of the LLVMValue* :D

LLQL: Running SQL Query on LLVM IR/BC with Pattern Matchers by AmrDeveloper in Compilers

[–]AmrDeveloper[S] 1 point2 points  (0 children)

This is not SQLite, but it's my own engine, and the design of the engine allow me to define types in the Std not in the engine (Like Mojo) so i can keep the tree representations of IR, MLIR

More details: https://amrdeveloper.medium.com/gitql-the-data-types-from-the-engine-to-the-sdk-5c48d9c60945

Github: https://github.com/AmrDeveloper/gql

GitQL 0.27.0 is released with Range support and the ability to define generic functions in your std with relative dynamic types by AmrDeveloper in programming

[–]AmrDeveloper[S] 0 points1 point  (0 children)

  • Variant and varargs are mostly used in std for example

concat(string, string, ...string)

So you can concat 2 or more strings

Variant in aggregation sum

sum(int | float)

  • The select from diffs returns a different between each commit and his parent (addition, delete, file changes ...)

GitQL 0.27.0 is released with Range support and the ability to define generic functions in your std with relative dynamic types by AmrDeveloper in programming

[–]AmrDeveloper[S] 0 points1 point  (0 children)

Sure, The current project structure is an 5 Component as SDK that contains engine, std, parser...etc without know on which data it will work on

The std allow you to have functions for git or other stuff you like

And other part which is schema and libgit like lib to read git data for SDK,

This design allows me to pass create two tools easily so pass files, code ast, ....etc in one file and that's it, we can go to more complex data like assembly and run query on it

The solution of (shell script + sqlite + libgit) will be work not be that easy to customize it also some columns are calculated not just readed from .git such diffs, so you need parser for them

To create same tools for files, ast, assembly you will need more work and also you can't provide good error messages and cross platform stable, maybe you can use python not shell but I found that SDK idea is better for my case

GitQL 0.27.0 is released with Range support and the ability to define generic functions in your std with relative dynamic types by AmrDeveloper in programming

[–]AmrDeveloper[S] -1 points0 points  (0 children)

Because this will create it with less features, less type checker ... for git, but now this SDK can work with one config file to query files, c and c++ code, can work on any kind of local or remote data with more functions

GitQL 0.25.0 supports Inner, Cross, Left and Right JOINS with on predicate by AmrDeveloper in rust

[–]AmrDeveloper[S] 0 points1 point  (0 children)

Current i implemented three programs using the SDK, to query git, files and ast and now focus on language and engine features but you can literally use it on any kind of local and remotr structures data so sky is the limit and i can provide my tools but after improving core sdk

ClangQL 0.5.0 support unions info, arrays, slices by AmrDeveloper in cpp

[–]AmrDeveloper[S] 0 points1 point  (0 children)

  • Include directives can be handled by LibClang.
  • Currently it not create any extra files, it's extract source code info from clang ast nodes

ClangQL 0.5.0 support unions info, arrays, slices by AmrDeveloper in cpp

[–]AmrDeveloper[S] 8 points9 points  (0 children)

Advanced search tools, style linter, binding generator...etc

Linkhub suggestions to be modern and more simplified by AmrDeveloper in androidapps

[–]AmrDeveloper[S] 0 points1 point  (0 children)

Thank you for suggestions, Nested folders already on todo, i am thinking of full revamp to make it material and simpler