python4ply vs a custom rule compiler

Andrew Dalke released python4ply 1.0 today. It might be useful as part of the RuleCompiler since I wouldn't have to constrain the rule syntax to Python's.

One of the main reasons for doing the rule compiler the way I am, is so I wouldn't have to re-implement a parser for Python's syntax but now that Andrew's gone and done just that... I don't know. This is from his announcement:

You might use python4ply to experiment with variations in the Python language. The PLY-based lexer and parser are much easier to change than the C implementation Python itself uses or even the ones written in Python which are part of the standard library.
It would be cool to have support for other syntaxes as well... I'll have to think about it.

5 kommentarer:

woolfel sa...

I bias opinion about supporting different languages is that it's more trouble than a benefit. All you need is one good language, rather than 5 bad ones.

Johan Lindberg sa...


the real question is actually if I benefit anything from having support for, say a Drools-like syntax, instead of trying to force a syntax by (ab)using what's allowed in Python's function definitions.

woolfel sa...

why drl syntax? I'm totally bias. CLIPS syntax is better :)

Johan Lindberg sa...

Well, Drools has a large user community and a lot of mind-share. I prefer a lispy syntax myself but most others have a hard time seeing further than the, many, parenthesis.

I've given this issue some thought though and I think I'll stay with the "forced" Python syntax to start with.

woolfel sa...

I don't think drools has a larger community. JESS community is quite large and so does blaze and jrules. the only difference is that blaze doesn't have a public forum and ilog only started their forum recently. drools has come a long way, but that doesn't necessarily mean they are bigger than the others. as you already know, clips is still rather active :)

honestly, it's probably more fun to stick with your own python syntax.