Erlang Core syntax for utf8 binaries?

What’s the syntax for utf8 binaries in erlang core?

The output that to_core gives, with one of these per utf8 byte:

#<111>(8, 1, 'integer', ['unsigned', 'big'])

generates huge exprs for each binary which take forever to parse:

 parse_core                    :      4.613 s     695.1 kB

How should I generate erlang core exprs for utf8 binaries so that they compile (parse) quickly?

1 Like

Your input Core Erlang file must be truly enormous for parsing to take that much time.

One trick that should help is to combine characters to reduce the total number of segments. For example, the three segments in the following binary:

	  #{#<97>(8,1,'integer',['unsigned'|['big']]),
	    #<98>(8,1,'integer',['unsigned'|['big']]),
	    #<99>(8,1,'integer',['unsigned'|['big']])}#

can be combined into a single segment:

	  #{#<6382179>(24,1,'integer',['unsigned'|['big']])}#
4 Likes