erlang 有等效的 ipython 吗?
来自 Python 的我正在寻找一些“易于尝试”的 shell,例如 Python 中的 ipython(最好有 Emacs 支持)。 在 Erlang shell 中,您始终必须首先编译 (c(...)
),这会大大减慢实验阶段的速度。
Coming from Python I am looking for some "easy to try out" shell like Python has with ipython
(preferably with Emacs support). In the Erlang shell you always have to first compile (c(...)
) which slows down the experimental phase very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
IErlang 是 IPython 的 Erlang 语言内核。 它允许用户使用IPython的Notebook前端,除了IPython执行python代码之外,IErlang可以执行erlang代码并编译和执行erlang模块。
https://github.com/robbielynch/ierlang
Elixir 还有一个 IPython 内核:
https://github.com/pminten/ielixir
IErlang is an Erlang language kernel for IPython. It allows users to use IPython's Notebook frontend, except where IPython executes python code, IErlang can execute erlang code and compile and execute erlang modules.
https://github.com/robbielynch/ierlang
There is also an IPython kernel for Elixir:
https://github.com/pminten/ielixir
是的 :)
http://erlang.org/doc/man/escript.html
Yes it is :)
http://erlang.org/doc/man/escript.html
构建一个模块来启动一个将代码更改自动加载到 shell 中的过程应该相当容易。 Erlang 实际上已经内置了对这种事情的支持。 因此,只要您重新编译代码,它就会自动加载到您的 shell 中,从而无需键入 c('module.erl')。 你自己。 您甚至可以让它监视文件更改并自动为您编译。 请参阅:
http://github.com/toddlipcon/mochiweb/blob/ 29d6ffd58aa2cd175f84cadfc1ce1697f366ef62/src/reloader.erl
示例。
目前该模块仅查找重新编译的模块,但让它查找更改的源文件并为您重新编译它们应该很简单。
It should be fairly easy to build a module the starts a process to autoload code changes into your shell. Erlang actually has built in support for this kind of thing. So anytime you have recompiled the code it gets loaded into your shell automatically thus eliminating the need to type c('module.erl'). yourself. You could probably even have it monitor file changes and automatically compile it for you. see:
http://github.com/toddlipcon/mochiweb/blob/29d6ffd58aa2cd175f84cadfc1ce1697f366ef62/src/reloader.erl
for an example in action.
Currently that module just looks for recompiled modules but it should be trivial to have it look for changed source files and recompile them for you.