Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Elixir 二进制是什么意思?_Elixir - Fatal编程技术网

Elixir 二进制是什么意思?

Elixir 二进制是什么意思?,elixir,Elixir,导入包含以下函数的exs文件时: iex(6)> import_file("mymath.exs") {:module, MyMath, <<70, 79, 82, 49, 0, 0, 4, 212, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 147, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118, 49, 1

导入包含以下函数的exs文件时:

iex(6)> import_file("mymath.exs")
{:module, MyMath,
 <<70, 79, 82, 49, 0, 0, 4, 212, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 147, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118, 49, 108, 0, 0, 0, 4, 104, 2, ...>>,
 {:square, 1}}

二进制文件究竟代表什么?

数字是导入模块的二进制表示

这些数字是导入模块的二进制表示形式

一旦Elixir构建在Erlang之上,提供分布式和容错功能, 这个数字序列表示在Erlang VM束中运行的二进制代码

作为一个实际示例,您可以使用它进行热代码部署。怎样 使用带有load binary的rpc调用,将二进制代码作为参数传递

请阅读一篇非常好的文章,介绍它的工作原理以及如何在erlang节点之间操作字节码。

干杯,
@MC

一旦Elixir构建在Erlang之上,提供分布式和容错功能, 这个数字序列表示在Erlang VM束中运行的二进制代码

作为一个实际示例,您可以使用它进行热代码部署。怎样 使用带有load binary的rpc调用,将二进制代码作为参数传递

请阅读一篇非常好的文章,介绍它的工作原理以及如何在erlang节点之间操作字节码。

干杯, @司仪

{_Module, Binary, Filename} = code:get_object_code(Module).
 rpc:call(Node, code, load_binary, [Module, Filename, Binary]).