architecture,elixir,acronym,beam,lightweight-processes , What does BEAM stand for in iex for the Elixir programming language?

What does BEAM stand for in iex for the Elixir programming language?


Tag: architecture,elixir,acronym,beam,lightweight-processes

I'm sort of curious as to what the B. E. A. and M. stand for.

I recall seeing an explanation of the acronym BEAM, but I have not managed to find it again.

It comes up in error codes:

➜  gentoo  iex
Erlang/OTP 17 [erts-6.4.1] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]

Interactive Elixir (1.0.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> import Math

08:05:02.839 [error] Loading of /var/opt/proj/elx/ubuntu/Elixir.Math.beam failed: :badfile

** (CompileError) iex:1: module Math is not loaded and could not be found

08:05:02.846 [error] beam/beam_load.c(1104): Error loading module 'Elixir.Math':
  non-ascii garbage '78705400' instead of chunk type id

    (elixir) src/elixir_exp.erl:123: :elixir_exp.expand/2

So, it looks like there's some sort of problem with a .beam file, probably due to my use of vi.


The following explains what the BEAM virtual machine is, but not what the letters stand for: What kind of virtual machine is BEAM (the Erlang VM)?

And it seems difficult to find out much about the etymology quick or to the point on Erlang central.

Supposedly BEAM is the secret sauce of Erlang and Elixir both: Technically, why are processes in Erlang more efficient than OS threads?

Anything particularly interesting about this question?

Are there any ways I can make it more to the point or more specific?


It stands for "Bogdan/Björn's Erlang Abstract Machine" - it is just the name of the VM, much like JVM (Java Virtual Machine).

Almost everyone uses "the new BEAM", where BEAM stands for Bogdan/Björn's Erlang Abstract Machine. This is the virtual machine supported in the commercial release.

The name probably finds its routes from the Warren Abstract Machine - an abstract instruction set for Prolog which you can read about at:

The WAM influenced JAM (Joe Abstract Machine - named after Joe Armstrong) which was the precursor to BEAM.

You can read more in the "the development of Erlang" article on the Erlang website.


Output tabular data with IO.ANSI

I would like to render a 2-dimensional list to a nice tabular output, using an ANSI escape sequences to control the formatting. So given this data: data = [ [ 100, 20, 30 ], [ 20, 10, 20 ], [ 50, 400, 20 ] ] I would like to output...

Importing test code in elixir unit test

I'm writing tests of some Elixir code that interacts with SSH. In my tests, I'd like to start an SSH server that I can run my code against. I'd prefer to store this code in it's own file in the test directory, and have it imported by various different tests....

MVC Web application architectural concern

I have inherited an MVC application designed along the above project structure. the application uses the Unity framework for dependency injection, and the user interactions go upstream to the database in the following order View -> Controller -> ViewModels -> Repository Services -> ORM -> Database The infrastructure components...

What does BEAM stand for in iex for the Elixir programming language?

I'm sort of curious as to what the B. E. A. and M. stand for. I recall seeing an explanation of the acronym BEAM, but I have not managed to find it again. It comes up in error codes: ➜ gentoo iex Erlang/OTP 17 [erts-6.4.1] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]...

Why Rem operator in Elixir returns negative numbers?

I am trying a simple operation rem(-1, 25) I expect that to be the reminder of integer division and return 24 (the same e.g. as in Ruby) but it returns -1. Am I doing something wrong? Is the behavior broken on elixir?...

Subtypes of an interface only compatible with a subtype of another interface

I've been scratching my head for a long time on a problem and I still don't know what would be the best solution. Since the application domain is very technical, I'll illustrate my problem with a simple example. Suppose I have the following interfaces: public interface Animal { public void...

How to Log something in Controller when Phoenix Server is running?

Well, the question is pretty clear. I'm trying to print some debug information from one of my Controllers in my Phoenix App when the Server is running. defmodule PhoenixApp.TopicController do use PhoenixApp.Web, :controller alias PhoenixApp.Topic plug :action def index(conn, _params) do # ... log "this text" # ... render(conn, "index.html")...

Segregating the read-only and read-write in Spring/J2EE Apps

We using Spring, Spring-Data and JPA in our project. For production servers, we would like to setup database cluster such that all read queries are directed to one server and all write queries are directed to another server. This obviously will require some changes in the way the DAOs are...

How to delete a Phoenix Session?

I'm going through the Phoenix Guide on Sessions. It explains it very well how I can bind data to a session using put_session and fetch the value later using get_session but it doesn't tell how I can delete a User's session. From the guide: defmodule HelloPhoenix.PageController do use Phoenix.Controller def...

Horribly redundant Phoenix controller

I'm doing my first Phoenix application, and trying to do new/2 controller. The code I wrote is def new(conn, %{"fbid" => fbid, "latitude" => lat, "longitude" => lng, "content" => content}) do {fbid, _} = Integer.parse(fbid); {lat, _} = Float.parse(lat); {lng, _} = Float.parse(lng); chats = %Chat{:fbid => fbid, :latitude...

Java generic class that contains an instance of implementation of generic interface

I am developing an independent, self contained component, that needs domain specific parts to function properly. The part of the idea is to create a generic interface, that will settle the usage of interface's implementation in another part of this component (in my example in class B). I have written...

How to rewrite Erlang combinations algorithm in Elixir?

I've been tinkering with Elixir for the last few weeks. I just came across this succinct combinations algorithm in Erlang, which I tried rewriting in Elixir but got stuck. Erlang version: comb(0,_) -> [[]]; comb(_,[]) -> []; comb(N,[H|T]) -> [[H|L] || L <- comb(N-1,T)]++comb(N,T). Elixir version I came up with...

“Cannot begin test transaction because we are already inside one”

I followed this tutorial and my simple test always fail with this error 1) test /index returns a list of contacts (WorldNote.ChatsControllerTest) test/controllers/chats_controller_test.exs:16 ** (RuntimeError) cannot begin test transaction because we are already inside one stacktrace: (ecto) lib/ecto/adapters/sql.ex:321: anonymous fn/6 in Ecto.Adapters.SQL.start_test_transaction/3 (ecto) lib/ecto/adapters/sql.ex:615: Ecto.Adapters.SQL.pool_transaction/4 (ecto) lib/ecto/adapters/sql.ex:314: Ecto.Adapters.SQL.start_test_transaction/3...

Getting a sibling process in Elixir

I have an Elixir/Erlang process tree: parent (Supervisor) ├── child1 (GenServer) └── child2 (GenServer) child1 (a DB client) has information that child2 needs to use. What's a good way to pass a reference from the Supervisor process to child2 so that child2 will always have a valid reference to child1?...

What's the recommended way to load an object graph from Data Access Layer?

From a relatively old software architecture book: In other situations, the same conceptual Get-Orders query might generate different data—for example, a collection of Order objects plus order items information. What should you do? Should you expose two slightly different GetOrders methods out of your DAL? And what if, depending on...

Data flow of MVC application architecture

Attempting to validate the approach for data flow in an MVC application that i am cleaning up and streamlining, (after a bit of refactoring) things currently looks like the diagram below (Data flow indicated by arrows). and some parts are written to access the the repository services jumping over layers....

With the MESI protocol, a write hit also stalls the processor, right?

I'm doing a project that is to implement a dual-processor system with some kind of cache coherency (for which I chose MESI) in VHDL. I just want to confirm this one thing: a write-hit on a shared cache line should cause the cache controller to send invalidation messages on the...

Some doubts related this Swing MVC implementation. Opening a database connection should be a Controller task?

I am following a Java tutorial related to the implementation of the observer pattern (using Swing) and I have some doubts. My doubts are not related to the observer pattern but about the architecture of this tutorial application (that is based on something like an MVC logic) So it contains...

WCF service architecture query,architecture,wcfserviceclient
I have an application that consists of a web application, and mutliple windows services, only one windows service is installed depending on what version of the backend sofware is used. Currently, Data is saved by the web app in a database, then the relevant service is installed and this picks...

Optional POST parameters in Elixir Phoenix

I have a phoenix route that I want to POST some form data to, however there are about 4 fields of the form that are optional (the form is constructed by the end user and therefore these fields may not exist in the POST payload) In the Phoenix controller for...

Elixir: Pattern Match or Guard

I am curious when I should be using pattern matching vs guard clauses when defining functions. For example with pattern matching: defmodule Exponent do def power(value, 0), do: 1 def power(value, n), do: value*power(value, n-1) end vs guard clause: defmodule Exponent do def power(value, n) when n==0, do: 1 def...

Client-Server architecture: 100% Android (Android as a server) or J2EE+Android?

Context I am considering going into a client-server architecture with Java. The idea is that several Android tablets (let's say around 15) need to display a content from a server. Content can vary times to times (e.g. day display v/s night display). Furthermore, tablets will also display a Yes /...

mips converting to assembly

I was working with Writing MIPS assembly for the following statement: f = a - 20 + b + c - d using the following registers $1 a $2 b $3 c $4 d $5 f $6 g $7 i $8 j $9 A 10$ D my answer is this:...

In Elixir how do you initialize a struct with a map variable

I know its possible to create a struct via %User{ email: '[email protected]' }. But if I had a variable params = %{email: '[email protected]'} is there a way to create that struct using that variable for eg, %User{ params }. This gives an error, just wondering if you can explode it...

Where to format collections / objects

From front end architectural point of view, what is the most common way to store scripts that perform transformations on collections of objects/models? In what folder would you store it, and what would you name the file / function? Currently I have models, views, controllers, repositories, presenters, components and services....

Which OTP behavior should I use for an “endless” repetition of tasks?

I want to repeatedly run the same sequence of operations over and over again next to a Phoenix application (without crashing the whole web-app if something brakes in the worker of course) and don't really know wether I should use a GenServer, Elixir's Tasks, an Agent or something completely different...

os kern error : “ld: symbol(s) not found for architecture x86_64”

I have looked all over Stack Overflow and other websites about this famous error, and all of them are very specific, and in my case I cannot find a solution. I am making an ncurses application and when i try to compile it, it causes the following error: Undefined symbols...

C# Code design / Seperate classes for each TabControl

My main problem is that my tool grows and grows and I start loosing the focus on the different parts of my code. The main-Form got a docked tabControl at fullsize. I got 5 different tabs with for really different functions. So I can say my tool is splitted into...

Rails' before_filter equivalent in Phoenix

I've just started working on my first Phoenix app, and the issue is that I have some common lines of code in every action in my controller, that I would like to separate out. These lines fetch data from multiple Ecto Models and saves them to variables for use. In...

Sort List elements in Elixir Lang

I have a list of strings that I want to order in two ways. Alphabetically By string length ...

How to run Elixir application?

What is the correct way to run an Elixir application? I'm creating a simple project by: mix new app and after that I can do: mix run which basically compiles my app once. So when I add: IO.puts "running" in lib/app.ex I see "running" only for the first time, each...

NodeJS run code in X minutes architecture

I want to schedule some code to be run at a variable time. For example, after 60 minutes I want to send an HTTP request to an endpoint and update a database document, but I also want to be able to cancel that code from being ran if an action...

Micro Service cross service dependencies

Just to simplify my situation I currently have 3 micro services. Authentication Locations Inventory The authentication service authenticates the user and sends back a JWT access token and I use that across the other services. Its stateless and all works well. I setup locations among some other things in the...

Where can I put my Plugs and then use them from different controllers in my Phoenix app?

I'm creating my first Elixir-Phoenix app. I've written a few plugs that I want to use in multiple controllers, right now there is a lot of code duplication since the Plug code is being repeated in all of my controllers. My question is, is there a file where I can...

How to model data for in-memory processing

I have a lot of static data (i.e. read only data, which is not transactional) which gets updated only once in few days. I have to support searches on that data (api calls, not sql). So I am thinking I will just load it in Memory, and refresh the in-memory...

Elixir exrm release crashes on eredis start_link

I'm fairly new to Elixir and this is the first app that I'm attempting to release using exrm. My app interacts with a Redis database for consuming jobs from a queue (using exq), and also stores results of processed jobs in Redis using eredis. My app works perfectly when I...

How to asynchronously send data to a client via a different application path?

I am currently researching large scale application optimisation and scaling, and through my research I have gotten to grips with the standard ways of doing large scale with DNS Round Robin for splitting the load across load balancers, using load balancing to divide traffic across web-servers like Nginx, which again...

Difference between switch & bus architecture?

I was just going through a operating systems textbook but I got stuck at switch architecture . Please explain what it is and how it is different from bus architecture ?...

What is the number that shows up after you define an anonymous function in elixir?

When you define an anonymous function in elixir you get a result like this. #Function<6.90072148/1 in :erl_eval.expr/5> What I've noticed is that the number is based on the arity of the function. So a 1 arg function is always #Function<6.90072148/1 in :erl_eval.expr/5> A two arg function is always #Function<12.90072148/2 in...

How to stub (or prevent running) of a call to a worker in my ExUnit test?

I have a Phoenix app (which is just a restful api with no front end) and one of the controllers does some stuff which I want to test, but at the end of the controller it calls a dispatcher which sends a payload off to a worker (run under poolboy)...

Phoenix - controller with multiple render

Trying to create an app with Elixir + Phoenix, that would be able to handle both "browser" and "api" requests to handle its resources. Is it possible to do it without having to do something like that : scope "/", App do pipe_through :browser resources "/users", UserController end scope "/api",...

Should I create another model for admins? Or what's the best way to do it in Ruby on Rails?

I'm developing an app, which requires two types of users regular user and admin. Regular users have roles in the app, and an admin doesn't have any roles, he just should have an access to an admin panel. What's the best way to implement this task? ...

Why doesn't JavaScript get its own thread in common browsers?

Not enough that JavaScript isn't multithreaded, apparently JavaScript doesn't even get its own but shares a thread with a load of other stuff. Even in most modern browsers JavaScript is typically in the same queue as painting, updating styles, and handling user actions. Why is that? From my experience an...

Why the syntax for defining sigils in Elixir doesn't use “defsigil”?

I was reading the page about sigils in the Elixir tutorial. I expected the syntax for defining sigils uses "defsigil" just like "defstruct", "defprotocol", and so on. But it was not so. Why?

How Can We Clear the Screen in Iex on Windows

Please how can we clear the screen in Iex on Windows Documented method in Iex help does not work: clear/0 — clears the screen This StackOverflow Answer also does not work in Windows....

How does ETL (database to database) fit into SOA?

Lets imagine, that our application needs ETL (extract, transform, load) data from relation database to another relation database. Most simple (and most performance, IMHO) way is to make link between databases and write simple stored procedure. In this case we use minimal technologies and components, all features are "out of...

simple model when requesting collection and extended model when requesting resource - how

I have the following URI: /articles/:id, where article is a resource on web-service and have associated model/class. Now I need to return only partial data for each resource (to save bandwidth and make for speed) when collection is requested, but when a single item is requested from collection I need...

Libgdx: Objects creating other objects

I have kind of a general question about a simple game architecture. In my game I have these classes: Main class who's responsible for drawing and rendering. Ball object which has a few attributes and update() function that does certain things. The main class has an array of all exist...

Architecture for creating a JavaScript framework

Around one year ago we started a web system that over the time has grown quite a bit. From the beginning the goal was to build reusable code that would speed up the development of future projects, and it has. With every new project, the reusable code from the previous...