egraphs-good / egg

egg is a flexible, high-performance e-graph library
https://egraphs-good.github.io
MIT License
1.38k stars 138 forks source link

Standalone CLI #84

Open MostAwesomeDude opened 3 years ago

MostAwesomeDude commented 3 years ago

I would like to use egg in a compiler for a programming language, but the compiler is written in a language without FFI to Rust or C. I wrote a poor version of egg in the meantime, but it would be ideal to be able to call an egg subprocess or similar.

mwillsey commented 3 years ago

This feature is one of the next things I would like to work on. We are planning a text-based interface that should be usable over CLI.

chadbrewbaker commented 3 years ago

https://github.com/uutils/coreutils has a lot of examples. Tell me what features you want and I can write a clap CLI.

mwillsey commented 3 years ago

@chadbrewbaker, the CLI isn't quite the issue, it's the text interface. We need to design a text language (probably some kind of s-expression thing) that can describe programs and commands to optimize them. It will probably look something like SMT-LIB.

brightly-salty commented 3 years ago

Any update on this? I would also like to use egg in a programming language implementation and would prefer not to have to translate the entirety (the project is written in OCaml).

mwillsey commented 3 years ago

Hey @brightly-salty, we are planning to work on this, but it's not at the top of my pile right now. Currently, writing your own interface is still the way to go. You may also be interested in https://github.com/Gopiandcode/ego

brightly-salty commented 3 years ago

Thanks, I hadn't seen that, I think it will suffice for my use case.