[erlang-questions] Representation of a map in bytecode?

Ulf Wiger ulf@REDACTED
Tue Sep 18 01:10:36 CEST 2007

2007/9/17, Robert Virding <rvirding@REDACTED>:
> There is another problem with automatic parallelisation and Erlang. As
> Erlang DOES have side-effects, message passing basically, the order in which
> things are evaluated is significant. It is therefore not safe to
> automatically parallelise code. It is up to the programmer/designer to
> decide how the application should be made parallel.

In the Barklund spec, which you helped write, it states clearly that the
only order which is specified is that of expressions in a body. In an
example, (X=8) + (X=9) is used to illustrate how the evaluation order can
cause different run-time behavior(*), whereas the compiler accepts it, since
all possible orders are valid at compile-time. (Chapter 6.5)

(*) In this case, if X is unbound; then the exception will look different
depending on the evaluation order: {badmatch, 8} or {badmatch,9}

The new Erlang Reference Manual doesn't, as far as I can tell, address
the issue of evaluation order within patterns. Personally, I think the
description in the Specification is just fine.

Ulf W

More information about the erlang-questions mailing list