Searching-In-An-Infinite-Space-Prolog
lira
Searching-In-An-Infinite-Space-Prolog | lira | |
---|---|---|
1 | 1 | |
1 | 21 | |
- | - | |
0.0 | 0.0 | |
almost 10 years ago | 10 months ago | |
Prolog | Haskell | |
- | MIT License |
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.
Searching-In-An-Infinite-Space-Prolog
-
Why Learn Prolog in 2021?
This brings up memories from 7 years ago. While in Uni, we had a homework: "Searching in an infinite space using Prolog".
Unfortunately, the comments are in my native language, but the assignment was to search for a box in an infinite space and bring it back to (0, 0).
It was fun: https://github.com/mateioprea/Searching-In-An-Infinite-Space...
lira
-
Why Learn Prolog in 2021?
Lira[0] and its readable paper[1] is a good example of abstracting smart contracts into a statically typed, domain-specific language that describes the contract precisely at a high level. It's not Turing complete, which works for a large class of contracts (for instance, see the American and Asian options examples in [1]).
One concern with logic programming is cost of computation, on Ethereum every transaction has a gas associated with it and so you can't run computations that go over the gas available in a block.
Turner's ideas of Total Functional Programming[2] might have application in the smart contract space as well, since you disallow general recursion but allow structural recursion, you can likely precalculate or bound gas costs accurately ahead of time.
As for being statically typed, I completely agree, Solidity's poor design choices contributed to millions of USD in loss (e.g. DAO hack) because the developers were not able to easily reason about the implicit behavior or concurrency model.
[0] https://github.com/etoroxlabs/lira
[1] https://bahr.io/pubs/files/bahr15icfp-paper.pdf
[2] http://www.jucs.org/jucs_10_7/total_functional_programming/j...
What are some alternatives?
awesome-prolog - Curated list of Prolog packages and resources
mercury - The Mercury logic programming system.
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
core.logic - A logic programming library for Clojure & ClojureScript