miclog

miclog

Speed vs F#

How does Elixir speed compare to F# for non-web applications - say, something like a chess game player.

Most Liked

AstonJ

AstonJ

I like to think of Elixir as the brain of an app - it excels at sending and receiving lots and lots and lots of messages, concurrently. When your app needs something that is computationally intensive, delegate to something that excels in that area; just like your brain tells vital organs what to do.

NobbZ

NobbZ

It depends. Erlang and elixir are not very good in doing only one thing at a time but shine in doing many things at the same time. So it totally depends on how you are able to parallelize the ai (which is the most compute intense part of chess games).

As a rule of thumb you do not choose erlang or any language on its hm VM for speed but for scalability and fault tolerance, which are both easy to achieve as long as one sticks to surrounding idioms.

Probably you want to stick with f# if you only want a single chess ai, but elixir when you want to have a server which gets connected from many clients and acts for all of them as the AI player or if you want to have a server which hosts chess games between humans.

peerreynders

peerreynders

How we program multicores - Joe Armstrong

Our goal is that applications run 0.75 x N times faster on an N-core computer.

(… provided the solution design/implementation can exploit concurrency to a reasonable degree)

So while F#/CLR will likely beat a single BEAM process for sequential code execution, ultimately any F# application will be hampered by the additional complexity needed for the explicit (i.e. manual) handling of synchronization of concurrent activities (not to mention that typically synchronization isn’t an easy problem to solve effectively in CLR languages - or the JVM for that matter).

Also: Erlang and Deep Learning by Garrett Smith

Currently there is seems to be a lot of momentum in the Python community regarding Deep/Machine Learning - but that probably has more to do with a fairly low barrier of entry to the language and environment rather than it being “the right tool for the job” - but for the time being the sheer volume of available libraries is going to keep it going for a while.

However over the past few years a growing number of Python users have been looking for alternatives because of Python’s performance ceiling. Some have chosen Clojure which also seems to make sense for AI applications as the AI pioneers have often used LISP. But Clojure is based on the JVM and therefore can be subject to stop-the-world garbage collection which can be inappropriate in some environments.

In the BEAM there is no stop-the-world garbage collection as each BEAM process has it’s own heap. Therefore Erlang/Elixir could be suitable for AI applications, provided by-and-large concurrent algorithms and strategies are employed.

Springer: Handbook of Neuroevolution Through Erlang (2013)

Where Next?

Popular in Questions Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New

We're in Beta

About us Mission Statement