mercury
core.logic
Our great sponsors
mercury | core.logic | |
---|---|---|
2 | 8 | |
864 | 1,431 | |
1.4% | 0.3% | |
9.8 | 5.2 | |
about 8 hours ago | about 1 month ago | |
Mercury | Clojure | |
GNU General Public License v3.0 or later | Eclipse Public License 1.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
mercury
-
Why Learn Prolog in 2021?
I'm not convinced there's great utility in smart contracts, but if there is, I think there's a huge utility in contracts being declarative and statically typed, to avoid many of the problems we've seen with existing contracts. In that case, a statically typed Prolog dialect would be a good starting point. The contract would be a set of declarative rules describing acceptable next states of the contract. To make the contracts verifiable in linear time, the submitter would submit the next state of the contract, plus a compact binary representation of the path taken through the rules set, so no backtracking would occur in the verifier. You could allow recursion, as verification time would still be linear in the size of the submitted compact path representation, just not linear in the size of the contract. If you disallow recursion, then verification would also be linear in the size of the contract.
Granted, many of the problems with Ethereum Solidity contracts are more to do with all of its use of implicit behavior (in a misguided attempt to hide the complexity of contracts) rather than directly consequences of Solidity being imperative.
Here's a quick plug for Mercury[0], a statically typed dialect of Prolog with an optimizing native code compiler. Supposedly it's 5 to 10 times faster than commercial Prolog compilers or available interpreters.
core.logic
-
A Tour of Lisps
It's also available in Clojure: https://github.com/clojure/core.logic
If you want to write one yourself, it's pretty easy: https://www.youtube.com/watch?v=y1bVJOAfhKY
- Logic programming is overrated, at least for logic puzzles (2013)
-
Common Lisp language extensions wish list?
Something like Clojure's core.logic would be pretty nice too. As I understand it, this is one of those features that has been re-invented time and again in the Lisp world over the years. Although the CL standard is already fairly large, it would probably be a bit controversial to make that a required part of a CL implementation. Still, it would be cool to have the option of using dependent types in the macro system to generate formerly verified Lisp code at compile time.
- Kotlin + Prolog
-
Need help choosing my first Lisp
It also has core.logic which is minikanren. There are other logic programming options as well. Some libraries like core.typed use core.logic for the type checker.
-
The birth of Prolog (1992) [pdf]
You could study core.logic: https://github.com/clojure/core.logic/tree/master/src/main/c...
I swear I'd bookmarked a resource that was more analogous to #2, but you may want to have a look at The Little Prover: https://mitpress.mit.edu/books/little-prover
- Why Learn Prolog in 2021?
What are some alternatives?
awesome-prolog - Curated list of Prolog packages and resources
clojure-graph-resources - A curated list of Clojure resources for dealing with graph-like data.
Searching-In-An-Infinite-Space-Prolog - PP2014 Prolog Homework
paip-lisp - Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"
pyswip - PySwip is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your Python programs. It features an (incomplete) SWI-Prolog foreign language interface, a utility class that makes it easy querying with Prolog and also a Pythonic interface.
hatlog - custom type systems for python in prolog: http://alehander42.me/prolog_type_systems
clpz - Constraint Logic Programming over Integers
racket - The Racket repository