Erlang Newbie going hardcore

54 views
Skip to first unread message

Niclas Hedhman

unread,
Nov 19, 2014, 1:15:17 AM11/19/14
to erlang-...@googlegroups.com
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

Stuart Thackray

unread,
Nov 23, 2014, 1:46:28 PM11/23/14
to erlang-...@googlegroups.com
Hi Niclas,

  With regards to (a) I think rebar great packaging language/tool. (once you got hang of it).

  With regards to (b) I think look @ http://nitrogenproject.com/, I am not sure about your requirements, they have for example raspberry-pi release although based on some web machine, but gets as simple as inets, not sure about 10k size, but they do have a make slim which I am not sure would suffice to your needs.

  (c) I mean if you look for web and web based crashes nitrogen is good cause you just update simple_crash...erl to be what you want or do your own.

  I have used "ALE" and made modifications and still have pull request there to make speed improvements(speed related). But so far so good on my own project(s). Been a great library.

Regards,
Stuart
Reply all
Reply to author
Forward
0 new messages