compiler-construction - elixir:eval_forms 和 elixir_compiler 中 compile 的区别
问题描述
在elixir_compiler.erl
(和其他一些地方)代码的编译以两种不同的方式完成。以下代码在两者之间切换:
eval_forms(Forms, Args, E) ->
case (?key(E, module) == nil) andalso allows_fast_compilation(Forms) of
true ->
{Result, _Binding, EE} = elixir:eval_forms(Forms, [], E),
{Result, EE};
false ->
compile(Forms, Args, E)
end.
据我了解,一个通过构建编译模块并执行“编译功能”来编译代码,另一个使用作为erl_eval
某种解释器的模块。我想知道的是为什么编译代码有两种不同的方式以及如何选择方式。
解决方案
推荐阅读
- php - laravel 作业未执行 - 尝试次数过多或运行时间过长
- mongodb - 我正在 Meteor 中做一些项目,并想在 mongodb 中插入一些图像以及其他信息,如流派、固定评级等
- mysql - MySQL在不使用表列的情况下选择两列之间的范围日期
- c# - 如何防止第三方应用检测到用户空闲?
- laravel - Laravel live wire 手风琴在输入更改时崩溃
- angular - 正确使用 Angular Material 和 mat-tables 的虚拟滚动?
- javascript - 我可以在 bitmovin 视频播放器的视频元素中添加标题属性吗?
- python - 更改参数编号的 Python argparse
- function - 如何设置限制或只注意函数参数的提示
- java - 运行 wsimport 时出现错误“重复“消息”实体”