[erlang-questions] Compile Question

Michał Muskała michal@REDACTED
Tue Dec 4 20:14:05 CET 2018


The issue seems to be that the compile-time function created by the module is huge and tries to allocate a compile-time list with 1555 elements. The lists:foreach call is probably misleading - that's just somewhere on the compiler stack. The good thing is that it's probably just a matter of refactoring  macros in the Absinthe.Phase.Schema.Compile module. It shouldn't need to build such huge lists (I've reviewed the module briefly).

Michał.
On 4 Dec 2018, 19:44 +0100, Michael Schmidt <Michael.K.Schmidt@REDACTED>, wrote:
> I have been chasing a compile error:
> ** (CompileError) elixir_compiler_1: function '__MODULE__'/1+17:
>   An implementation limit was reached.
>   Try reducing the complexity of this function.
>
>   Instruction: {move,{x,0},{y,1555}}
>
>     (stdlib) lists.erl:1338: :lists.foreach/2
>     lib/absinthe/phase/schema/compile.ex:51: Absinthe.Phase.Schema.Compile.run/2
>     lib/absinthe/pipeline.ex:283: Absinthe.Pipeline.run_phase/3
>     lib/absinthe/schema.ex:214: Absinthe.Schema.__after_compile__/2
>     (stdlib) lists.erl:1263: :lists.foldl/3
>     (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
>     (elixir) lib/kernel/parallel_compiler.ex:206: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
>
> I realize this is an Elixir / Absinthe issue, but my question is this:  How is lists:foreach() able to trigger this?
> https://github.com/erlang/otp/blob/master/lib/stdlib/src/lists.erl#L1332
>
> Poking around, there is indeed a list of 776 items that generates 2 function defs each, which gives us a final AST list of approx 1552.  I assume this is related to the {y,1555} in Error.
>
> Can lists:each() not handle lists longer than 1024?  What am I missing?
>
> Thanks!
> Mike
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181204/47ed1997/attachment.htm>


More information about the erlang-questions mailing list