[{"data":1,"prerenderedAt":229},["ShallowReactive",2],{"project-19398932":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":40,"post_text":42,"what":43,"said":59,"maker_in_thread":135,"shape":147,"grid":151,"attempts":190,"same_week":191,"maker_shows":31,"maker_hidden":221,"reader_version":222,"card":223},"19398932","Python-Prolog-Interpreter","A simple Prolog Interpreter written in a few lines of Python 3","title","Show HN: A simple Prolog Interpreter written in a few lines of Python 3","https:\u002F\u002Fgithub.com\u002Fphotonlines\u002FPython-Prolog-Interpreter","github.com","photon_lines",1552652062,2019,149,20,290,2195,14,"notable","languages","prolog interpreter","library",[24,25,26,27],"prolog","python interpreter","logic programming","unification","debated",-0.059,{"positive":31,"neutral":31,"mixed":32,"critical":33},2,0,3,7,{"idea":36,"docs":38,"performance":39},{"positive":37,"critical":37},1,{"positive":32,"critical":31},{"positive":32,"critical":32},[32,32,32,32,32,32,37,41,37,37,32,32,32,32,32,33,32,33,32,41],5,null,{"problem":42,"audience":42,"pricing":42,"motivation":44,"time_to_build":42,"stack":51,"openness":57,"stage":58,"team_size":58},{"value":45,"source":46,"evidence":47},"Maker refreshed Prolog knowledge by porting an existing JavaScript implementation","maker",[48],{"id":49,"by":11,"text":50},"19410902","I didn't grok anything at first actually. I had familiarity with Prolog and wanted a refresher, so I decided to take a look at implementation attempts done in other languages. I…",[52],{"value":53,"source":46,"evidence":54},"Python 3",[55],{"id":56},"post","open_source","unknown",{"praise":60,"objections":88,"requests":104,"questions":105,"alternatives":113},[61,77],{"value":62,"source":63,"evidence":64},"Interesting or impressive for its size","commenter",[65,69,73],{"id":66,"by":67,"text":68},"19406831","tluyben2","Nicely done! I have been trying to implement actual usable (as in, they can be used as a scripting language for instance to build anything) languages in as few lines as I can…",{"id":70,"by":71,"text":72},"19407385","MrOxiMoron","still way less lines then I would have thought, especially because it has no dependencies.",{"id":74,"by":75,"text":76},"19409205","peter_d_sherman","Absolutely Brilliant!",{"value":78,"source":63,"evidence":79},"Useful for logic programming and Prolog-style tasks",[80,84],{"id":81,"by":82,"text":83},"19408044","tannhaeuser","I've used ad-hoc test case generation using Prolog (MC\u002FDC, all-permutations and other combinatorials) which is a quite natural application for Prolog. Around 2005 I've also used…",{"id":85,"by":86,"text":87},"19408664","jifu","I wrote a simple date extractor (parsing stuff like \"two days ago\" from strings) for my hobby website project in prolog [0]. It was great fun to write, and prolog really shines…",[89],{"value":90,"source":63,"evidence":91},"Title says 'a few lines' but the code is much longer",[92,96,100],{"id":93,"by":94,"text":95},"19406929","etaioinshrdlu","This is about 10x larger than i would call a few lines :)",{"id":97,"by":98,"text":99},"19418188","bhargav","But the title does not mention that. It says few lines. Maybe 100, 200, 300 lines are few. Its misleading and otherwise discredits a good project. This project even has a…",{"id":101,"by":102,"text":103},"19421177","ghusbands","It's worse than that - the title says \"a few\", which is basically always less than ten. If it said \"quite a few\", it would certainly be accurate. If it actually said \"few\", it…",[],[106],{"value":107,"source":63,"evidence":108},"How unification works and how long it takes to learn",[109],{"id":110,"by":111,"text":112},"19408213","timClicks","How long did it take you to grok unification? It has always seemed quite mindbending to me and I don't think that I have ever properly understood what's happening",[114,121,128],{"value":115,"source":63,"evidence":116},"YieldProlog",[117],{"id":118,"by":119,"text":120},"19406919","sanxiyn","FYI, there is a mature implementation of this idea called YieldProlog.",{"value":122,"source":63,"evidence":123},"PyDatalog",[124],{"id":125,"by":126,"text":127},"19407170","westurner","Cool tests! PyDatalog does Datalog (which is ~Prolog, but similar and very capable) logic programming with SQLAlchemy (and database indexes) and apparently NoSQL support.…",{"value":129,"source":63,"evidence":130},"Racklog",[131],{"id":132,"by":133,"text":134},"19407979","inetsee","Racket also has a Prolog-Style Logic Programming DSL named Racklog.",{"comments":136,"answered":37,"key":137},4,[138,141,144],{"id":139,"text":140},"19407734","Thanks for the feedback :) I'll definitely check out Datalog - I didn't realize they had logic programming integrated with SQLAlchemy, so it definitely sounds interesting!",{"id":142,"text":143},"19407680","Thank you :) If you want real power for implementing things in as few lines as possible, F# is definitely worth taking a look at as well!",{"id":145,"text":146},"19407716","Thanks :) Yup, there are also constraint programming libraries in Python which can be used for providing similar functionality, and they're definitely worth checking out!",{"commenters":148,"max_depth":136,"maker_replies":136,"first_comment_mins":149,"lifespan_hours":150},16,1173,74,[152,154,156,157,160,162,165,167,169,171,172,173,174,177,178,179,180,181,186,187],[125,32,32,153,126,32],"other\u002Fneutral\u002Fidea",[139,32,32,155,11,37],"maker\u002Fpositive\u002Fnone",[66,37,32,153,67,32],[158,37,32,159,119,32],"19406979","other\u002Fneutral\u002Fnone",[142,37,32,161,11,37],"maker\u002Fneutral\u002Fnone",[163,37,32,159,164,32],"19407759","agumonkey",[93,31,37,166,94,32],"project\u002Fcritical\u002Fidea",[70,31,41,168,71,32],"project\u002Fpositive\u002Fidea",[97,31,37,170,98,32],"project\u002Fcritical\u002Fdocs",[101,31,37,170,102,32],[118,33,32,159,119,32],[145,33,32,161,11,37],[175,136,32,153,176,32],"19407458","garganzol",[81,136,32,159,82,32],[85,136,32,159,86,32],[110,41,33,161,111,32],[49,41,32,161,11,37],[182,183,33,184,185,32],"19407436",6,"project\u002Fneutral\u002Fperformance","truth_seeker",[132,34,32,159,133,32],[74,188,41,189,75,32],8,"project\u002Fpositive\u002Fnone",[],[192,197,202,207,211,216],{"id":193,"name":194,"points":195,"category":196},"19393279","2019",2690,"hardware",{"id":198,"name":199,"points":200,"category":201},"19408329","Hello Goodbye",510,"security_privacy",{"id":203,"name":204,"points":205,"category":206},"19386093","Stackroboflow",274,"ai",{"id":208,"name":209,"points":210,"category":20},"19427332","Drogon",189,{"id":212,"name":213,"points":214,"category":215},"19444960","RemoteHub",171,"learning_science",{"id":217,"name":218,"points":219,"category":220},"19443733","Songcraft",152,"creative",false,"v2",{"id":224,"name":5,"line":6,"ai":221,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":225,"top":18,"kw":226,"maker":11,"domain":10,"tier":19,"attempts":32,"strip":227,"url":9,"mix":228,"praise":62,"objection":90,"sub":21},19398932,-0.06,[24,25,26,27],"00000015110000030305",[31,31,32,33],1794036575803]