Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nickdrozd
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
21 ms
·
211.
▲
by
nickdrozd
8y ago
Maybe it would be clearer if I said Prolog was being used like a "much" more powerful version of Awk / Perl. Consider the server log case I mentioned. A question you might ask of a server log is: Are there any client request
212.
▲
by
nickdrozd
8y ago
Summary: They needed to do some complex queries on data in a SQL database, queries that were clearly better suited for Prolog. So they 1) queried for the relevant data from SQL, 2) formatted the data into the form of Prolog terms and dumped
213.
▲
by
nickdrozd
8y ago
Some background: miniKanren is a logic programming language in the neighborhood of Prolog (they are similar in the way that Python and Javascript are similar). The language is described and implemented in the book The Reasoned Schemer , wh
214.
▲
by
nickdrozd
8y ago
Don't forget about the hyper key! (setq mac-function-modifier 'hyper)
215.
▲
by
nickdrozd
8y ago
You could save a little work by noting that when is a special case of if and then writing when-let as a special case of if-let . Something like: (defmacro when-let (bindings &rest body) `(if-let ,bindings (progn
216.
▲
by
nickdrozd
8y ago
Yeah, the code is all in the book, and it works! Here's the main body of the qawk interpreter: BEGIN { readrel("relfile") } /./ { doquery($0) } where - relfile is a file containing the field attributes us
217.
▲
by
nickdrozd
8y ago
The awk book is a lot of fun. I just finished reading it after seeing it recommended here a few weeks ago. The highlights for me: 1. A simple interpreter for an awk-like language called qawk. qawk is like awk except that it allows for query
218.
▲
by
nickdrozd
8y ago
Here's a story about Andy. Two years ago, I was writing a modest Lisp interpreter in C. The evaluator was more or less working, but I was totally stuck on parsing user input (in other words, I had the E in REPL, but not the R). After s