sym_num
I am creating a Prolog interpreter to learn Elixir. This is not practical. It is a toy program.
https://github.com/sasagawa888/Prolog
Example: (from PAIP, Peter Norvig)
?- assert(likes(kim,robin)).
true
?- assert(likes(sandy,lee)).
true
?- assert(likes(sandy,kim)).
true
?- assert(likes(robin,cats)).
true
?- assert((likes(sandy,X) :- likes(X,cats))).
true
?- assert((likes(kim,X) :- likes(X,lee),likes(X,kim))).
true
?- assert(likes(X,X)).
true
?- listing.
likes(kim,robin)
likes(sandy,lee)
likes(sandy,kim)
likes(robin,cats)
likes(sandy,X) :- likes(X,cats)
likes(kim,X) :- likes(X,lee)likes(X,kim)
likes(X,X)
true
?- likes(sandy,Who).
Who = lee;
Who = kim;
Who = robin;
Who = sandy;
Who = cats;
Who = sandy;
false
?-halt.
goodbye
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
The obligatory hello world thread!
Who are you and where are you from? :stuck_out_tongue:
New
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
Is there a word for the ~> symbol used in Version strings?
Do you also just call it a Squiggle Arrow™ ?!
New
I’m posting this in response to Jose’s recent tweet (Cr. link) :
People are sleeping on Elixir for a coding harness:
Hot-code swappi...
New
AcmeScript — Writing JS hooks as if I were still using Elixir
I’ve been having fun building a little something over the last few days: Ac...
New
Other Trending Topics
Name: Łukasz Niemier
Location: Poznań, Poland
Remote / relocation / travel: Remote, with occasional travel.
Work experience: I am soft...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kip
This super exciting (for me). I’ve been re-reading Prolog with the idea of either implementing a Prolog-like DSL, or maybe an interpreter. I’ve only got as far as starting to research how to write a Horne clause theorem solver (really, just started), So this is going to be a great project for me to follow.
sym_num
Thank you for your reply.
I’m glad to be interested.
Thank you very much.
datadrover
Of tangential relevance because it’s not Elixir, but Erlog might be worth looking at. While it seems not to have been worked on for a few years, it has good pedigree (@rvirding). I also recall that @zkessin had some interest in Prolog on the Beam.
Beyond exploration, I can see a possible use case (actually considered doing it some time ago): As a triage frontend for a Prolog database running something like SWI Prolog.
zkessin
Erlog is pretty cool, but could use some love. If I evere were to be in a position to sponsor someone to work on open source it would be on my list of things to work on (Not happening anytime soon) but I would love to chat about it
datadrover
Likewise. Maybe sometime in the future I will have time and resource to revisit it. The application I was looking at had no business model and would probably have required public funding - unlikely as things stand right now.
sym_num
Thank you for the information of Erlog.
rvirding
Yes, I haven’t worked on Erlog for a while but it is has not died. It has reached a certain level and I have left it there. It does implement a proper subset of standard prolog but of course it could be extended. The next step could be a rework of the interpreter maybe compiling the code a bit to improve speed.
Doing an elixir front-end to it would be relatively simple as the interface and internal data structures are quite straight forward. It is just that no one has asked for one yet.
There was a fork where someone else reworked the database to handle large tables but it used ETS and it wasn’t possible to make the database behave exactly as the prolog standard. Which was one of my requirements. There is a simple ETS interface which could be extended with more features.
mythicalprogrammer
LOL, we’ve come in full circle.
I’ve left Erlang because I was meh with the Prolog’s syntax for Elixir.
And now we have a project for prolog written in Elixir.
sym_num
I appreciate the talent of Jose.
Elixir has given modern syntax to the capabilities of Erlang.
If great talent gives Prolog modern syntax, Prolog may come back.
emacstheviking
Nice! I love Prolog and considered the same idea a few years ago. Recent months have seen me learning Mercury too, I have just about finished wrapping the SDL2 media library with it so I can write games in Mercury.
Creating a clean Prolog in Elixir is my kind of mad idea. I’ll check out the git pages and have a look!
Sean.