20

If so, what is the storage and memory footprint?

EDIT

I had done some research about this, but failed to find useful information. The site http://www.erlang-embedded.com/ doesn't help at all. The blog article http://www.1011ltd.com/web/blog/post/embedded_erlang was a little helpful, but It would be nice to hear answers from people with more experience.

EDIT 2

The hardware that I intend to use for Erlang has 32Mb of FLASH storage for the system and 512Mb of RAM. It is dual core with 400Mhz per core. It runs Linux version 2.6.18.

EDIT 3

The motivation behind my interest in Erlang would be to solve gracefully concurrency problems. On the project that I work we have some complex middleware software that is not robust, it's hard to understand and hard to extend. Of course, you can write great concurrent software in C, but Erlang just seems like a better tool for this problem domain.

ivarec
  • 2,542
  • 2
  • 34
  • 57
  • 1
    All Erlang/OTP applications except the wx application can be cross compiled.http://www.erlang.org/doc/installation_guide/INSTALL-CROSS.html – Amir Naghizadeh Jan 31 '13 at 05:21
  • 3
    This question is 1) far too vague and; 2) shows no prior research. –  Jan 31 '13 at 05:34
  • There is not a similar question in SO. Please, reconsider reopening. – ivarec Jan 31 '13 at 13:13
  • 1
    There are no similar questions on SO because this is not the kind of question that SO is intended for. – Dennis Jan 31 '13 at 13:34
  • @Dennis I see your point. Let's close a few questions, then: http://stackoverflow.com/questions/1082751/what-are-the-available-interactive-languages-that-run-in-tiny-memory, http://stackoverflow.com/questions/2714557/dynamic-languages-for-embedded-devices, http://stackoverflow.com/questions/6727310/best-scripting-language-for-cross-compiling-to-arm/6727426#6727426, http://stackoverflow.com/questions/5267066/python-lightweight-server-for-embedded-devices – ivarec Jan 31 '13 at 14:10
  • I like this question, but I agree with close-voters that it's not a good fit for SO. I've asked [here](http://meta.programmers.stackexchange.com/q/7870/89959) whether Programmers.SE might be a better fit. – Kyle Strand Feb 10 '16 at 17:18
  • @haole Also, yes, those should be closed. Note that *closing* a question does not *delete* the content, and since those questions are old they are unlikely to get new answers anyway. – Kyle Strand Feb 10 '16 at 17:21
  • Another possible place for your question would be the new Software Recommendations site. – Kyle Strand Feb 10 '16 at 17:21

3 Answers3

5

What is embedded for you?

In my world it's a system with less than 1MB Flash and typically ~64kB Ram.
In my world exists C and sometimes also C++ compilers.
But nobody heard ever for an erlang compiler for such a system (and nobody missed them).

But if embedded is for you WindowsCE or a linux running on a non PC basis hardware with > 64MB Ram and 1GB Flash,
then there should be no problem with erlang.

jeb
  • 78,592
  • 17
  • 171
  • 225
  • I've edited the question to add more information about my platform. Basically, 32Mb of disk space and 512Mb of RAM. Dual core. – ivarec Jan 31 '13 at 13:13
  • 6
    +1: The original reason Erlang was created — to drive Ericsson's telecom switches — is arguably an embedded system. – Warren Young Jan 31 '13 at 22:56
  • 1
    @Warren That directly contradicts the answer's (unsupported) assertions about the lack of Erlang on such systems. Not sure why it warrants a +1. – Kyle Strand Feb 10 '16 at 16:25
  • 2
    @KyleStrand You're talking only about the first part of the answer. The point here is that "embedded" isn't necessarily restricted to such small systems. As for the supportability of the statement, the Erlang runtime alone clocks in at 2-3 MB, so the standard version indeed won't run on such a system. Further, the 64 kB RAM limit implies an 8 or 16 bit processor, but all supported platforms are 32 or 64 bits. See the build requirements here: http://erlang.org/erldoc → System Documentation → Installation Guide → Building. – Warren Young Feb 10 '16 at 17:28
  • @WarrenYoung Man, I'm glad I left that comment, then, because your comment, with the specific runtime requirements of Erlang, is more useful than any of the existing answers! – Kyle Strand Feb 10 '16 at 17:56
5

I would echo the sentiment that the question is vague. But, ...

Not trying to troll, but I think the answer is either "Yes!!" or "No!!" depending on your assumptions regarding hardware and what problems your are trying to solve that aren't easily solved by something more standard like C (i.e., why aren't you using something like C, there must be a reason... reducing code-size, need hot-upgrade, {erlang_value_prop, n}, etc.).

Under a certain set of criteria, the answer seems to be "yes". Evidence includes:

  • EMBEDDED ERLANG? ABSOLUTELY (http://www.1011ltd.com/web/blog/post/embedded_erlang)
  • Its embedded use in ATM switches and other telecom equipment
  • There is (or was) an embedded-Erlang group on Google
  • I think Ulf Wiger has an Embedded Erlang slide-deck as part of his work with Erlang Solutions
  • etc
Jr0
  • 2,131
  • 13
  • 23
  • I will look for the Google group. I'm thinking of using Erlang to solve complex concurrency problems in a middleware written in C. It's hard to understand, hard to write and definitely not robust. But as I don't know how to program in it, I'm looking for show stoppers before I start anything. – ivarec Jan 31 '13 at 23:45
4

No,

  1. Many embedded systems don't have Erlang compilers, while all have C compilers and most have C++.
  2. Erlang lacks the low level access required by an embedded system.

Its certainly possible to get Erlang on a cluster of Raspberry Pis, but this isn't an embedded device.

Mikhail
  • 7,749
  • 11
  • 62
  • 136
  • 3
    1. I guess that the Erlang interpreter is written in C. What about cross-compiling it? 2. What about the FFI to C functions? It's impossible to live without C but that's no reason to use some more specific tool to do a job. – ivarec Jan 31 '13 at 05:18
  • 2
    @haole When you say embedded are you talking about a 4 core ARM or are you talking about a system with 200k of ram that has some efficient A/D converters. – Mikhail Jan 31 '13 at 05:20
  • 4
    -1: What does lack of compilers have to do with it? Plenty of embedded systems run an interpreter of some kind. And as for lack of low-level access, that's just wrong. You can write [a port driver](http://www.erlang.org/doc/tutorial/c_portdriver.html) or [compile in a BIF](http://www.trapexit.org/Adding_my_own_BIF) to get low-level access. – Warren Young Jan 31 '13 at 22:54
  • 3
    @WarrenYoung A lack of compilers is important because it may not be possible to build a working copy of Erlang on some systems, without first building a working copy of a second compiler. This is quite difficult. You may even need to build an OS. When I say `no` it is in response to the `practical` qualifier. – Mikhail Feb 01 '13 at 03:40
  • 4
    @Mikhail: Erlang is written in plain ANSI C. The continuous integration build system at Ericcson tests it on [pretty much everything](http://www.erlang.org/doc/installation_guide/INSTALL.html#id64305) as far as desktop and server platforms go, and as for traditional embedded CPUs, it's known to not only work on ARM, [the HiPE feature works, too](http://www.erlang.org/doc/installation_guide/INSTALL.html#id72090). Granted, there's more to 32-bit+ embedded than ARM, but I'd be surprised if it doesn't work on your CPU of choice, too. Obviously it doesn't work on 8-bitters. – Warren Young Feb 01 '13 at 03:51
  • 1
    -1. Ad1: Erlang is written in C/C++. Many platforms have Erlang distribution available. See Erlang Solutions website, they have ready to use packages for Raspberry Pi. Myself, I used Erlang on Beagleboard. Ad2: In general: write logic in high-level (Erlang), use NIFs/drivers to get low-level access. – kgadek May 18 '13 at 17:12
  • @kgadek When this was asked, we had assumed that author was talking about a machine with very little ram and perhaps a 8 bit processor. The Raspberry Pi and Beagleboard are not embed devices, they are wonderful for prototypes and university projects: at minimum their power-consumption and high latency IO puts them outside the embedded range. – Mikhail May 19 '13 at 03:18