-
Notifications
You must be signed in to change notification settings - Fork 9
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
SnakeMake parser #64
Comments
Here is the SnakeMake grammar, from snakemake.readthedocs.io
|
Hmm,
Seems non-trivial, would need to implement a python parser and execution engine; or link into the python API? |
To do it 100% correctly you would need a Python parser, yes. The Python grammar is here, and it wouldn't be impossible. I don't think you need a Python execution engine, other than running the Python executable itself, and that's just equivalent to changing the GNU Make A half-working/subset implementation might be even easier, though. If you look at the examples, it looks like the interweaving of Python with SnakeMake is relatively straightforward in many cases. The input and output are Python parameter lists which can be referenced in the Python rule; that seems like the trickiest thing, on first glance. The demarcation of the Python code itself might not be too hard because you just use indentation. Here are examples of what I mean by the parameter lists being referenced in the rules:
Note that we don't even have full GNU Makefile compatibility (nor are we ever likely to). I think a better target is the proportion of peoples' makefiles in practice that biomake can be used with. And actually I think it's hard to confidently state a lower bound for this number until a prototype is out there and people are giving feedback. Implementing a simplified subset of SnakeMake syntax that covers (say) 10% of SnakeMake files, along with the 80% (or whatever) of GNU Make that we also currently cover, wouldn't be so bad. |
I guess there's also this kind of thing...
I think this could be implemented using |
I think the subset that is within reach is a subset which does not make any use of Python outside of rules and variable assignments (which we can think of as analogous to shell-executed code in Make)... the question is how many SnakeMake users would that satisfy (vs how many would be frustrated) |
Shelving for now. Prolog->Python seems like a stretch... |
Implement a parser to convert SnakeMake rules into prolog rules, as the current GNU makefile parser does for GNU makefiles (and the trivial prolog parser for prolog).
Implement by changing shell to python, via #54
The text was updated successfully, but these errors were encountered: