←back to thread

389 points kurinikku | 3 comments | | HN request time: 1.428s | source
1. upghost ◴[] No.42171366[source]
Dave is a stellar instructor with a bottomless well of knowledge. One of the few people I go to when I have a Python question I can't figure out. I've taken every course he has available: compilers, lisp, raft, and advanced python salary*. I can say definitively that my salary has doubled twice thanks to his courses, so well worth the effort from my opinion.

That being said... SICP, Compilers, and RAFT all left me with the gnawing feeling that there was more juice to be squeezed from computer science than I was able to understand.

Why were my parsers and compilers not bidirectional? Why am I writing a utilitarian OO parser for an elegant FP language? Why is there no runtime polymorphic isomorphism for my client/server RAFT nodes?[1]

Drowning in my own sorrows, I began binge drinking various languages, drifting from one syntax to the next. CL, Scheme, Java, C#, Haskell, Forth, TypeScript, Clojure... ahh, long love affair with Clojure. But in the end, even Clojure, for all of its elegance, could not solve the original problem I was facing and at the end of the day in many ways was just "a better Python".

I was nearly ready to call it quits and write my own language when all the sudden I discovered... Prolog.

Not just any Prolog-- Scryer Prolog. Built on rust. Uncompromising purity. And Markus Triska's Power of Prolog videos on YouTube.[2]

My God. They should have sent a poet.

Bidirectional parsing? No-- N-dimensional parsing vis definite clause grammars, ships with standard library. First class integer constraint solvers. And it is the first language I have ever worked with that takes the notion of "code is data" seriously.

Scryer is still a young language, but it's going big places. Now is a great time to get involved while the language and community is still small.

I will end this love letter by saying that I owe my career and much of my passion to Dave, and because of him Python is still how I earn my bread and afford expensive toys for my Yorkie.

You rock, Dave!

[*]: this was a typo, should be Advanced Python Mastery, but in my ways advanced python salary is actually more accurate, in my case anyway.

[1]: If issues like this don't bother you, and you haven't been coding for at least 10-15 years, maybe come back later. Learning Prolog and Scryer in particular is really hard at first, even harder than Haskell/Clojure.

[2]: https://youtube.com/@thepowerofprolog

replies(1): >>42192577 #
2. gottacodethem ◴[] No.42192577[source]
What kind of things are you using Prolog for? General purpose computing? How does it fare vs Clojure in regards to libraries?
replies(1): >>42193207 #
3. upghost ◴[] No.42193207[source]
Great questions. What initially attracted me to it was Definite Clause Grammars[1]; easier to use than regular expressions and turing complete. This solves my bidirectional parser problem and my elegance problem.

At first I did not expect that I would find Prolog to be useful for general purpose computing –– it turns out Prolog has some surprising properties that I wish were present in other languages such as Clojure.

Arguments passed to Prolog "predicates" (unit of work similar to functions) as arguments are NOT evaluated UNLESS you use "call" (similar to eval) on them directly. That may seem crazy at first but the implication is that it completely erases the line between code and data. Yes, lisp has macros, but there is a heavy cultural and technical line between a function and a macro. In Prolog, there is no distinction and no stigma around seamless metaprogramming.

Regarding the library story, it depends on how you look at it. Very soon Scryer Prolog will finish being embeddable in other languages so in a sense it had access to every library from every language. But from a vanilla perspective, it has incredibly powerful first class constraint solvers, which I've never seen in any other language that is also a general purpose language.

[1]: https://youtu.be/CvLsVfq6cks