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
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
:erlogmodule 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_serverwhich 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
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
I believe Robert is saying you need to install it as a GitHub dependency. ie: {:erlog, githhub: "rvirding/erlog", branch: "develop"}
rvirding
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.
Popular in Questions
Other popular topics
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
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










