cess11 5 days ago

Multi-core support and clustering was early requirements, hence the OS-like structures organised around the process implementation where the VM starts a scheduler as part of it booting.

Could you be more explicit about what you think has become more complex?

1
simoncion 5 days ago

> Multi-core support... was early requirements...

Erlang's first release was in 1986. Experimental SMP support was added to the Erlang VM in OTP R11B in mid 2006[0]. That's twenty years.

If you were to go back to the time of R11B's release and asked the folks who were aware of it "Has SMP support been added early in the life of the Erlang project?", I expect you would be hard-pressed to find anyone who would answer that question with a "yes". Twenty years after a software project's first release is a pretty damn long time.

If we want to be maximally charitable to you, then we can knock that date back to when the master's thesis work was started (and abandoned) in 1998. That's still more than a decade after the initial release.

It is my understanding that SMP support was a substantial change to the VM, and has gotten more complex as it has been made to perform better and better on larger systems and workloads.

> ...clustering was early requirements...

You are apparently unaware that the way operators who used Erlang handled multi-processor machines was to run multiple independent instances of the Erlang VM and -if desired- use local-machine clustering for intra-instance communications. SMP support is not the same as UP support with local-machine clustering of otherwise-independent program instances.

> Could you be more explicit about what you think has become more complex?

A great many things. The ones that immediately come to mind are SMP, HiPE [1], BeamAsm, dirty schedulers, multi time warp, and Unicode support. You may argue that surely some of the additional complications that have been added since 1986 are not much complication. I would counter that surely some of the optimizations that have been made since 1986 have not been much optimization.

[0] <https://erlang.org/euc/08/euc_smp.pdf>

[1] Unless I'm confused about HiPE... and the native code it produces was already a thing that the Erlang VM could consume. If that's the case, than the obvious complexity of HiPE is all outside Erlang. But the caveats on section 4.1 and 4.2 and acknowledgements in section 6 of [2] make me fairly confident that HiPE was not using already-existing functionality in the Erlang VM.

[2] <https://user.it.uu.se/~kostis/Papers/erlang03.pdf>

cess11 3 days ago

Right, I should have been more clear, perhaps.

2006 is the year multicore CPU:s were broadly introduced, it's the year of Core Duo and Athlon 64 X2. Before then clustering of cores looked different. Releasing support for such CPU:s pretty much as soon as they were available rather than a few years later probably says something about the required effort.

One might make a comparison with OCaml.

Edit: A friend of mine mentioned that Björn Gustafsson recently did a talk on optimising the move-instruction at a Code BEAM event. With a bit of luck it was recorded and will be published sometime soon, should be some interesting information in there.

simoncion 3 days ago

> Releasing support for such CPU:s pretty much as soon as they were available rather than a few years later probably says something about the required effort.

I doubt it. You should read the PDF in footnote zero from my previous comment. I'll copy the link here for your convenience. <https://erlang.org/euc/08/euc_smp.pdf>

cess11 3 days ago

"The history of support for SMP (Symmetrical Multi Processor) in Erlang started around 1997-1998"

"The SMP work was restarted at 2005"

"The first release of a stable runtime system with support for SMP came in OTP R11B in May 2006."

The Duo launched in July the same year. Pentium D was released in May 2005, as was Athlon 64 X2.

simoncion 2 hours ago

> The Duo launched in July the same year. Pentium D was released in May 2005, as was Athlon 64 X2.

Multi-socket machines predate these processors by at least ten years. Windows NT 4.0 (first released in 1996) had multiprocessor support, as did Linux 2.0 (also released in 1996).

If you don't want to bother verifying this information, gut-check it. Ask yourself: "Why on earth would the Masters work on adding SMP to Erlang have started in 1997 if there weren't already working computers that could have benefited from SMP? And would it have made any sense to do this work if those sorts of computers hadn't already been around for a while?"