Mr Joe Armstrong says that with Erlang we might have sequential code running N times faster with N cores. Does this apply to F# also? Or is the Erlang VM designed in that way? Does F# manage processes in the OS or language?
The MailboxProcessor
type in F# (see MSDN docs) implements essentially the same agent-based concurrency model as Erlang. The only difference is that Erlang is more suitable for distributed computing (across multiple computers), while F# uses the programming model mainly on a single machine (but multiple threads/cores).
In general, I think that claims about Erlang would also apply to F#.
Regarding the quote: I'm not quite sure what the is the author exactly trying to say (maybe there is some context missing?). It certainly doesn't mean that you can take usual (sequential) program and run it magically N times faster.
However, if you use the programming model of Erlang or F# agnet-based concurrency then you can get a speedup with every additional core. This means that you'll write the program as a large number of agents (instances of MailboxProcessor
in F#). Individual agents are written as sequential sub-programs, but you still need to think about programming differently.
Technical aspects: Erlang doesn't use physical OS threads and neither does F#, so the behavior should be very roughly similar. This means that you can create a large number of agents (which is the point of the programming model). Agents in F# are based on asynchronous workflows, that make this possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With