Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between .app and .app.src files in Erlang?

Tags:

erlang

I found these description in the Erlang doc and learnyousomeerlang.com, but not sure which one is the "Application Resource File". When should I use .app and .app.src?

7.3 Application Resource File http://www.erlang.org/doc/design_principles/applications.html

The Application Resource File http://learnyousomeerlang.com/building-otp-applications

like image 821
redfrontedr Avatar asked Jun 18 '15 12:06

redfrontedr


People also ask

What is an Erlang application?

Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging.

How do I stop Erlang application?

Well if you're in the shell of the node you want to turn down, even if it's not receiving input, you can still press Ctrl-g (which takes you to JCL mode). Once there you can use the command q to quit the Erlang shell. This is similar in effect to erlang:halt(0).


2 Answers

The .app file (in ebin/) is the file necessary by the Erlang VM to load OTP applications. It must contain fields such as the dependencies of the application, the modules it contains, the version, and so on.

Particularly, the list of modules for the application is tedious to maintain, but there's other stuff that can be dynamically added. People write .app.src files (in src/) with the static content filled in so that their build tool of choice (rebar, rebar3, erlang.mk, and so on) can fill in the dynamic parts with what they want, such as the modules found on disk.

This allows for a more streamlined dev process with a lot less stuff to juggle and maintain by hand.

like image 184
I GIVE TERRIBLE ADVICE Avatar answered Oct 19 '22 01:10

I GIVE TERRIBLE ADVICE


My understanding is that the OTP application should have the application.app file in the ebin directory together with the compiled beam-files.

Keeping an application.app.src file (which would be identical to the one in the ebin directory) in the src directory is optional but can be useful to have the build process generate the application.app file.

like image 25
jpw Avatar answered Oct 19 '22 00:10

jpw