dimitarvp

dimitarvp

Can we run Erlog inside IEx?

This is mostly aimed at @rvirding but anyone who knows Erlang and Prolog well enough can answer, of course.

Here goes: I’d like to dip my toes in logic programming a bit. I don’t want to become an expert in Prolog the programming language, only the logic programming aspect of it.

Can Erlog (Prolog running in Erlang console) can actually run in IEx as well? If not, what exactly must be done so it can run in an Erlang console? Sorry if it’s a naive and dumb question, I don’t aim to become an expert in Erlang and I am looking for a quick-and-easy way.

Any help is appreciated.

Marked As Solved

rvirding

rvirding

Creator of Erlang

Yes, erlog runs without problems in IEx. It is basically just a big library and with some interface modules.

  • The basic interface is in the :erlog module which you can call from programs or from a shell like IEx. The Erlog state is in a structure which you pass around.
  • There is also an Erlog gen_server in the module :erlog_server which you can startup. It manages the state and there is a set of interface functions to access it, basically the same interface as in :erlog.
  • You can also start up a simple prolog-like shell with :erlog_shell.

The interface is standard Erlang but this mainly because no-one has shown any interest in writing one for Elixir. It would not be difficult.

Robert

P.S. Saw your question in the irc but hadn’t got around to answering it.

Also Liked

adammokan

adammokan

A little late to the party here, but I’ve been tinkering with Erlog inside Livebook for a while now.

Example Mix.install/2 within LB is:

Mix.install([
  {:erlog, github: "rvirding/erlog", branch: "develop"}
])
kip

kip

ex_cldr Core Team

I believe Robert is saying you need to install it as a GitHub dependency. ie: {:erlog, githhub: "rvirding/erlog", branch: "develop"}

rvirding

rvirding

Creator of Erlang

No, erlog is a separate system which you will have to down load from github, GitHub - rvirding/erlog: Prolog interpreter in and for Erlang · GitHub , and connect into your application. This can be done with mix (I guess) but I can’t help you there as my knowledge of mix is not great.

Where Next?

Popular in Questions Top

nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41989 114
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31265 143
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement