psylone
Elixir Getting Started: Scripted mode
Hi! Going through the elixir-lang.org getting started guides and have a question about Scripted mode section.
You can see this point in the guide:
When executed, both extensions compile and load their modules into memory, although only .ex files write their bytecode to disk in the format of .beam files.
And further:
And execute it as:
$ elixir math.exs
The file will be compiled in memory and executed, printing “3” as the result. No bytecode file will be created.
So, the question is here: one can do the same thing with *.ex extension and run it with:
elixir math.ex
And in this case I also see no compiled *.beam file.
Guess *.exs compilation will not write *.beam file to the disk if you do it with mix. Is it correct?
Thanks!
Marked As Solved
fuelen
Ah, yes. There is a button on the page to edit it on GitHub 
Also Liked
fuelen
Command elixir is used to run scripts.
Command elixirc is used to compile modules to *.beam files.
File extension is irrelevant for both commands. You may use math.my_custom_extension or even avoid it at all and name file as math.
psylone
Done.







