14

字母 BEA 和 M. 代表什么?我记得看到首字母缩略词“BEAM”的解释,但我没有设法再次找到它。

它出现在错误代码中:

➜  gentoo  iex
Erlang/OTP 17 [erts-6.4.1] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]

Interactive Elixir (1.0.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> import Math

08:05:02.839 [error] Loading of /var/opt/proj/elx/ubuntu/Elixir.Math.beam failed: :badfile

** (CompileError) iex:1: module Math is not loaded and could not be found

08:05:02.846 [error] beam/beam_load.c(1104): Error loading module 'Elixir.Math':
  non-ascii garbage '78705400' instead of chunk type id


    (elixir) src/elixir_exp.erl:123: :elixir_exp.expand/2
iex(1)> 

因此,.beam 文件似乎存在某种问题,可能是由于我使用了 vi。(注意 Elixir 程序员:不要编辑 .beam 文件,这很痛苦。)

这个问题解释了 BEAM 虚拟机什么,而不是字母代表什么。而且似乎很难快速找到关于词源的很多信息,或者在Erlang central上找到重点。据说BEAM 是 Erlang 和 Elixir 的秘方。

4

1 回答 1

27

它代表“Bogdan/Björn's Erlang Abstract Machine”——它只是 VM 的名称,很像 JVM(Java 虚拟机)。

几乎每个人都使用“新 BEAM”,其中 BEAM 代表 Bogdan/Björn 的 Erlang Abstract Machine。这是商业版本中支持的虚拟机。

http://www.erlang.org/faq/implementations.html

这个名字可能是从 Warren Abstract Machine 中找到的——一个 Prolog 的抽象指令集,您可以在以下位置阅读:http ://en.wikipedia.org/wiki/Warren_Abstract_Machine

WAM 影响了 BEAM 的前身 JAM(Joe Abstract Machine - 以 Joe Armstrong 命名)。

您可以在Erlang 网站上的“Erlang 的开发”文章中阅读更多内容。

于 2015-06-05T15:21:03.010 回答