C plus Prolog

29 points by KnorrFG


hwj

By convention, C Plus Prolog files end in the extension .c+p.

To bad they don’t end with “.cpp”…

rrampage

OT: Is there a tag we can add for logic programming like prolog/datalog?

KnorrFG

I found this pretty interesting. I kinda hate C with a passion, but half of what annoys me about it could be fixed with some good meta programming, which this seems to provide. And C undeniably has its advantages, e.g. it runs about everywhere and compiles super fast.

If the author himself wouldn’t explicitly advise you not to use this, I’d definitely toy around with it. Non the less it’s a very cool idea that’s worth being seen.

4ad

Cute project.

Some more serious work of integrating logic programming with something else: https://curry-lang.org

olliej

I really wish they went for .cpp as the extension

That said who’s up for adding objc and c++ support so we can get objc++p?

xonix

Long time ago I was obsessed with Prolog. I found that if you bend it enough you could implement imperative code (a-la JavaScript) evaluation, still being valid Prolog:

https://github.com/xonixx/prolog-experiments/blob/main/Prolog/interp/interp4.pro#L275

This was super funny, but obviously absolutely useless 🙂