TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Writing an HTTP server in Prolog

238 pointsby jamesbvaughanover 8 years ago

13 comments

dangoldinover 8 years ago
Pretty cool.<p>I also did a stint messing around with Prolog and it was pretty awesome discovering an entirely new programming paradigm. I ended up doing the Priceonomics puzzle (<a href="https:&#x2F;&#x2F;priceonomics.com&#x2F;jobs&#x2F;puzzle&#x2F;" rel="nofollow">https:&#x2F;&#x2F;priceonomics.com&#x2F;jobs&#x2F;puzzle&#x2F;</a>) in Prolog and wrote up about it here - <a href="http:&#x2F;&#x2F;dangoldin.com&#x2F;2013&#x2F;06&#x2F;07&#x2F;fun-with-prolog-priceonomics-puzzle&#x2F;" rel="nofollow">http:&#x2F;&#x2F;dangoldin.com&#x2F;2013&#x2F;06&#x2F;07&#x2F;fun-with-prolog-priceonomics...</a>
评论 #12941360 未加载
nextosover 8 years ago
There is a revival of Datalog, a subset of Prolog, in relational databases and RAD. E.g., see LogicBlox or Datomic.<p>I always think Datalog should have taken a big chunk of SQL&#x27;s market. And I wish something like Mozart&#x2F;Oz was more mainstream so that we could implement subsystems using logic programming wherever needed.
评论 #12941585 未加载
gnarbarianover 8 years ago
Prolog is extremely different than other programming languages and as a result, learning it and writing a few small programs is very mind expanding.<p>It really drives home how different paradigms are suited to different problems. Prolog is suited toward problems like Einsteins riddle<p><a href="https:&#x2F;&#x2F;udel.edu&#x2F;~os&#x2F;riddle.html" rel="nofollow">https:&#x2F;&#x2F;udel.edu&#x2F;~os&#x2F;riddle.html</a>
评论 #12941984 未加载
评论 #12941037 未加载
Spooky23over 8 years ago
In one of my first jobs out of college, I got assigned to figure out how to make the Tivoli Enterprise Console do something useful. They gave up on the IGS guys and picked me because I took a class that used Prolog in my sophomore year.<p>IBM bundled some ancient prolog dialect (copyright 1991 iirc) and the product was a mess.<p>But it was a great time... a coworker and I came up with a way to persist facts to DB2 and decode&#x2F;standardize all sorts of fubar network device alarms. Good times.
评论 #12941910 未加载
nickpsecurityover 8 years ago
James, check out Mercury next as it&#x27;s a faster, better Prolog with some industrial use.<p><a href="https:&#x2F;&#x2F;mercurylang.org" rel="nofollow">https:&#x2F;&#x2F;mercurylang.org</a>
评论 #12942532 未加载
评论 #12941872 未加载
评论 #12944586 未加载
chatmastaover 8 years ago
Have you learned about definite clause grammar yet? Once you do, you may be tempted to rewrite your parser, because it&#x27;s a much more elegant way of constructing parsing rules.
评论 #12944394 未加载
pizzaover 8 years ago
Machine Learning in Prolog <a href="https:&#x2F;&#x2F;www.cs.unm.edu&#x2F;~luger&#x2F;ai-final2&#x2F;CH7_Machine%20Learning%20Algorithms%20in%20Prolog.pdf" rel="nofollow">https:&#x2F;&#x2F;www.cs.unm.edu&#x2F;~luger&#x2F;ai-final2&#x2F;CH7_Machine%20Learni...</a>
ga2archover 8 years ago
Awesome, one of the most fun i had at university was building a Uri parser with prolog.<p>After i discovered that you could define operators i built a combinatorial parser, something akin to <a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;parsec" rel="nofollow">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;parsec</a> (of course nowhere as powerful) with similar syntax and do notation. <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;ga2arch&#x2F;e8904177f722c6560e37" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;ga2arch&#x2F;e8904177f722c6560e37</a><p>And i didn&#x27;t have to define backtracking because it is handled by prolog itself.
p4bl0over 8 years ago
This is really fun. Thanks for sharing!
评论 #12941041 未加载
sleepproggerover 8 years ago
Site seem to be down. `Error establishing a database connection`
评论 #12946876 未加载
hossbeastover 8 years ago
.pl is perl, use .pg for prolog
评论 #12941615 未加载
评论 #12941439 未加载
评论 #12941569 未加载
评论 #12942992 未加载
MrFeynmannsJokeover 8 years ago
Sometimes, just because you can doesn&#x27;t mean you should..
评论 #12941038 未加载
aibottleover 8 years ago
No! What are you doing?! Let that language die in peace!
评论 #12941033 未加载