Hi,
I am primarily a Java developer, although I started my career doing Assembler (RTOS, VM, compiler, ++) back in the 80s.
We (a friend is helping out) have managed to put Erlang into OpenWRT clone (Ionic) and into a fairly small device[1] with MIPS24K, 16MB Flash and 64MB RAM plus "stuff" like a Arduino Leonardo compatible controller.
So far so good, simple apps has succeeded to run. But we have more ambitious plans;
1. REST API for serving data.
2. A block programming environment, using a browser and the above REST API (exists)
3. Interfacing with GPIO, I2C, SPI and Serial. I think "ALE" is the solution available, otherwise we develop those ourselves.
Now, I am faced (negatively) by a couple of things, and would like to hear of opinion on the matter;
a. "packaging" seems to be an "untold" chapter in Erlang. Rebar has a "generate" command, but not only is it incredibly difficult to make it do the right thing, it seems (or probably I am not able to tame it) that too much is placed into the rel/myapp directory (such as stdlib...) and at the same time it keep referencing the deps/ folder in the dev environment. Is there any better tool for managing "releases"?
b. For the REST API, we need a super tiny web server. Something that I can do in 10kB in Java. Yaws, Mochiweb, WebMachine and Cowboy are quite large, probably because they support more of the HTTP protocol than I need. Are there any other ones? Are there more efficient ways, such as leverage the uhttpd and perhaps go via microBus[2] to reach the Erlang environment?
c. Finally, a conceptual Erlang question; The block programming environment (currently written in Java) is event-driven 100%. A "block" has outputs, which can be "wired" to inputs on other blocks. I intend to run each block as an Erlang process. But processes are said to "crash", and I am in principle fine with that. BUT how does one handle the many Pid references held in other processes when such crash happens? Using gen_event's named events doesn't make sense to me for this...
Cheers
Niclas