2 ms·
DCGs are an awesome way to specify a format but a poor way to implement it?
by 082349872349872 4y ago
DCGs are an awesome way to specify a format but a poor way to implement it?
- mark_l_watson 4y agoI agree and the code itself is awesome also. Around 30 years ago I was really into Prolog but recently I have tried getting back into it and I am having a rough go at it. I still have the old Art of Prolog book, so that might be a good reentry point.
- philjohn 4y agoI still maintain that learning Prolog 25 years ago as part of my degree (AI + Comp Sci) made me a better programmer.
- mncharity 4y ago> recently I have tried getting back into it and I am having a rough go at it Fwiw, doing problem setup and result processing in another language can avoid much pain. So prolog only where it excels, and a mainstream ecosystem for the rest. I've liked batch mode "write a prolog file, run it, read result (eg json, or wrapper-language code to eval)", but was recently thinking of trying PySwip[1]. [1] https://github.com/yuce/pyswip https://github.com/yuce/pyswip
- riesenheim 4y agoI had the same troubles until I encountered Markus Triska's modern perspective on revitalizing Prolog: https://www.metalevel.at/prolog https://www.metalevel.at/prolog. His video 'Preparing Prolog' may be the best place to (re)start: https://youtu.be/kGQNeeRp4sM https://youtu.be/kGQNeeRp4sM
- nmadden 4y agoThat's been my experience, and chimes with what the author writes at the end about performance. I remember trying to stream a few hundred MB of CSV data with Prolog a few years ago and giving up after not being able to either write or find a library that could cope with even that kind of size (which I wouldn't consider particularly big). (In the end, I managed to bulk import the data into SQLite, which took a few seconds, then used SQL instead). I should give Scryer Prolog a go to see if it is any better, and I'm by no means an expert Prolog programmer so YMMV.
- richard_todd 4y agoIt’s all mind-bending fun until the interpreter starts blowing one of its internal stacks. Then it’s hours of tedium tracing through queries looking for ways to contain the computation.