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, https://github.com/rvirding/erlog , 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.

rvirding

rvirding

Creator of Erlang

If you are using rebar3 with erlang you can specify it as a dependency and it will be downloaded and put in a suitable place. Pretty much what mix does. If you are not using rebar3 then you need to download it by hand and put it somewhere that erlang can find it, the easiest is by either using the -pa <dir> flag when starting erlang or by setting ERL_LIBS environment variable, http://erlang.org/doc/man/code.html . With mix you can also give it as a dependency but you need to tell mix that it is erlang which it must compile and not elixir. i don’t know how you do that.

rvirding

rvirding

Creator of Erlang

No worries, just ask if have more questions about running it. Seriously.

Where Next?

Popular in Questions Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
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
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement